/* MSC Mobile — corrections d'affichage téléphone (CPA91, thème Hummingbird).
   Chargé en dernier, uniquement des règles sous 768 px : la version ordinateur n'est pas touchée. */
@media (max-width: 767.98px) {

  /* ---------- Bandeau devis / téléphones : bande compacte sous l'en-tête, plus de bloc qui recouvre la page ---------- */
  .header-bottom__row > .msc-topinfo {
    position: static !important;
    order: 99;
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
    display: flex !important;
    flex-wrap: nowrap;
    align-items: center;
    justify-content: center;
    gap: 5px;
    padding: 6px 0 8px !important;
    margin: 0 !important;
    z-index: auto !important;
    max-height: 60px;
    overflow: hidden;
    transition: max-height .25s ease, padding .25s ease, opacity .2s ease;
  }
  body.msc-scrolled .header-bottom__row > .msc-topinfo {
    max-height: 0;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    opacity: 0;
  }
  .msc-topinfo__logo-space,
  .msc-topinfo__pickup-box,
  .msc-topinfo__devis-texte { display: none !important; }

  .msc-topinfo__left {
    flex: 0 0 auto !important;
    min-width: 0 !important;
    width: auto !important;
    display: flex !important;
  }
  .msc-topinfo__devis-box {
    padding: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    width: auto !important;
    transform: none !important;
  }
  .msc-topinfo__devis-btn {
    font-size: 12px !important;
    line-height: 1 !important;
    padding: 9px 11px !important;
    border-radius: 18px !important;
    letter-spacing: 0 !important;
  }
  .msc-topinfo__right {
    flex: 0 1 auto !important;
    min-width: 0 !important;
    width: auto !important;
    gap: 0 !important;
  }
  .msc-topinfo__contact-row {
    flex-wrap: nowrap !important;
    justify-content: center !important;
    gap: 5px !important;
  }
  .msc-topinfo .msc-topinfo__phone-btn {
    font-size: 12px !important;
    line-height: 1 !important;
    padding: 9px 9px !important;
    gap: 4px !important;
    background: #fff !important;
    color: #0f2d54 !important;
  }
  .msc-topinfo__phone-btn i { color: #c8202e; }
  .msc-topinfo__whatsapp-btn {
    width: 31px !important;
    height: 31px !important;
  }
  /* Petits écrans (< 400 px) : « Fixe » / « Mobile » au lieu des numéros complets */
  .msc-phone-short { display: none; }

  /* Icônes compte / panier : restent alignées sur la ligne du logo (elles étaient centrées sur la hauteur totale) */
  .header-bottom__row > .d-md-none {
    top: 16px !important;
    bottom: auto !important;
    transform: none !important;
  }
}
@media (max-width: 399.98px) {
  .msc-topinfo__phone-btn.msc-has-short .msc-phone-full { display: none; }
  .msc-topinfo__phone-btn.msc-has-short .msc-phone-short { display: inline; }
}

@media (max-width: 767.98px) {
  /* ---------- Textes : tailles adaptées au téléphone ---------- */
  html { -webkit-text-size-adjust: 100%; }
  h1, .h1 { font-size: 1.6rem !important; line-height: 1.2 !important; }
  h2, .h2 { font-size: 1.35rem !important; line-height: 1.25 !important; }
  h3, .h3 { font-size: 1.15rem !important; line-height: 1.3 !important; }
  h4, .h4 { font-size: 1.05rem !important; }

  /* Bloc texte d'accueil : les paragraphes étaient des titres H3 en 20 px gras */
  .ps-customtext h3, .ps-customtext h4 {
    font-size: 1rem !important;
    font-weight: 400 !important;
    line-height: 1.55 !important;
    margin-bottom: .8rem !important;
  }
  .ps-customtext h2 { font-size: 1.3rem !important; }
  .ps-customtext h1 { font-size: 1.6rem !important; }
  .ps-customtext .container, .ps-customtext { padding-left: 16px !important; padding-right: 16px !important; }

  /* Textes de catégorie et de fiche produit */
  .category-description, .product__description, .product-description, #description, .cms-content, .page-cms {
    font-size: .95rem !important;
    line-height: 1.55 !important;
    overflow-wrap: anywhere;
  }
  .category-description img, .product__description img, #description img, .cms-content img { max-width: 100% !important; height: auto !important; }
  table { max-width: 100%; }
  .product__description table, #description table, .cms-content table { display: block; overflow-x: auto; }

  /* Titres de page (catégorie, recherche) : marge sous l'en-tête */
  .page-title, #js-product-list-header, .block-category h1 { margin-top: .5rem !important; word-break: break-word; }

  /* Miniatures produits : 2 par ligne, textes lisibles */
  .product-miniature__title, .product-miniature .product-title { font-size: .9rem !important; line-height: 1.3 !important; }
  .product-miniature__prices, .product-miniature .product-price-and-shipping { font-size: .85rem !important; }

  /* Bouton flottant de discussion : plus petit et plus bas, ne masque plus les prix */
  #whatsapp-button {
    left: auto !important;
    right: 12px !important;
    bottom: 14px !important;
    width: 48px !important;
    height: 48px !important;
  }
}

@media (max-width: 767.98px) {
  /* ---------- Listes de produits (catégories, recherche) : cartes plus compactes ---------- */
  .product-miniature__bottom { padding: .6rem .6rem .7rem !important; }
  .product-miniature__title { margin-bottom: .35rem !important; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
  .cpa91-price-ht-ttc.msc-split { display: flex; flex-direction: column; gap: 1px; line-height: 1.2; }
  .cpa91-price-ht-ttc.msc-split .msc-ttc { order: -1; font-size: 1.05rem; font-weight: 700; color: #0f2d54; }
  .cpa91-price-ht-ttc.msc-split .msc-ht { font-size: .75rem; color: #6b7280; }
  .cpa91-price-ht-ttc.msc-split .cpa91-price-ht-ttc__sep { display: none; }
  .product-miniature__actions .quantity-button { display: none !important; }
  .product-miniature__actions .product-miniature__form { display: block !important; }
  .product-miniature__actions .btn, .product-miniature__actions button[type="submit"] {
    width: 100% !important;
    min-height: 40px !important;
    padding: .45rem .5rem !important;
    font-size: .8rem !important;
    line-height: 1.15 !important;
    white-space: nowrap;
    gap: 4px;
  }
  .product-miniature__quickview-touch { transform: scale(.85); transform-origin: top right; }
  .products.row, .products { --bs-gutter-x: .75rem; }
}

/* ---------- Fiche produit (toutes tailles) : le bloc prix du thème, vide, n'affichait plus qu'un « HT » isolé ---------- */
.product__prices:has(.cpa91-price-ht-ttc) .product__prices-block { display: none !important; }

@media (max-width: 767.98px) {
  /* ---------- Fiche produit ---------- */
  .product__thumbnails:has(.product__thumbnail:only-child) { display: none !important; }
  .product__name { font-size: 1.35rem !important; }
  .product__prices .cpa91-price-ht-ttc.msc-split .msc-ttc { font-size: 1.6rem; }
  .product__prices .cpa91-price-ht-ttc.msc-split .msc-ht { font-size: .85rem; }
  .product__prices { margin: .5rem 0 .75rem !important; }

  /* Fil d'Ariane : plus petit, passe à la ligne au lieu d'être coupé */
  .breadcrumb { flex-wrap: wrap !important; font-size: .82rem !important; row-gap: 2px; }
  .breadcrumb .breadcrumb-item { white-space: normal !important; }
}

@media (max-width: 767.98px) {
  /* ---------- Menu mobile (Mega Menu) ---------- */
  .ets_mm_megamenu .close_menu {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px !important;
    min-height: 0 !important;
    height: auto !important;
  }
  .ets_mm_megamenu .close_menu .pull-left,
  .ets_mm_megamenu .close_menu .pull-right { float: none !important; display: flex; align-items: center; gap: 8px; font-size: 17px; }
  .ets_mm_megamenu .close_menu .pull-right { font-size: 0 !important; cursor: pointer; }
  .ets_mm_megamenu .close_menu .pull-right .mm_menus_back_icon { display: none !important; }
  .ets_mm_megamenu .close_menu .pull-right::after { content: "Fermer \2715"; font-size: 14px; font-weight: 600; opacity: .9; }
  .ets_mm_megamenu .mm_menus_li.mm_has_sub > .arrow {
    left: auto !important;
    right: 0 !important;
    width: 52px !important;
    top: 0 !important;
    bottom: 0 !important;
    height: auto !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
  }
  .ets_mm_megamenu .mm_menus_li > a { padding-right: 56px !important; padding-left: 18px !important; }
  .ets_mm_megamenu .mm_menus_li > a .mm_arrow { display: none !important; }
}

@media (max-width: 767.98px) {
  /* Titres des pages de résultats / catégories : un cran plus petits */
  body#search h1, body#category h1, body#manufacturer h1, body#prices-drop h1, body#new-products h1 {
    font-size: 1.3rem !important;
    line-height: 1.25 !important;
    margin-bottom: .6rem !important;
  }
}
