/**
 * Overrides spécifiques à l'intégration PrestaShop → WordPress.
 * Chargé en dernier par api.php pour passer devant theme.css / custom.css.
 *
 * Sans le JS PrestaShop (jQuery, core.js, theme.js), certains panneaux
 * normalement contrôlés par script (dropdowns, sidebar mobile, recherche)
 * restent ouverts ou apparaissent en double. On les masque ici et on
 * force la version desktop du header.
 */

/* === 1. Wrapper d'intégration : reset des box CSS héritées de WordPress === */
.integration-prestashop-header-wrapper,
.integration-prestashop-footer-wrapper {
  font-family: "Manrope", -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  overflow: hidden;
}

.integration-prestashop-header * ,
.integration-prestashop-footer * {
  box-sizing: border-box;
}

/* === 2. Masquer la version "mobile" du header sur desktop === */
/* (Le thème utilise des classes Bootstrap 3 — hidden-md-up — qui peuvent
   ne pas être appliquées correctement dans un contexte WP.) */
@media (min-width: 768px) {
  .integration-prestashop-header .hidden-md-up,
  .integration-prestashop-header .mobile,
  .integration-prestashop-header #_desktop_logo_responsive,
  .integration-prestashop-header #_mobile_user_info,
  .integration-prestashop-header #_mobile_cart,
  .integration-prestashop-header #menu-icon,
  .integration-prestashop-header #mobile_top_menu_wrapper {
    display: none !important;
  }
}

/* === 3. Masquer les dropdowns "ouverts par défaut" sans JS === */
/* Login panel, recherche déroulée, popover compte, panier déroulé… */
.integration-prestashop-header .user-info .popover,
.integration-prestashop-header .blockcart .popover,
.integration-prestashop-header .header-nav .popover,
.integration-prestashop-header .login-form,
.integration-prestashop-header .ets_mm_megamenu_content,
.integration-prestashop-header .search-widgets .auto-search,
.integration-prestashop-header .ui-autocomplete {
  display: none !important;
}

/* === 4. Forcer la nav du top-menu en horizontal === */
.integration-prestashop-header .top-menu,
.integration-prestashop-header .js-top-menu,
.integration-prestashop-header #top-menu {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem;
  padding: 0;
  margin: 0;
  list-style: none;
}

.integration-prestashop-header .top-menu li,
.integration-prestashop-header .top-menu .category {
  list-style: none;
  display: inline-block;
}

/* Cacher les sous-menus (depth >= 1) — ouverts par défaut sans JS */
.integration-prestashop-header .top-menu .sub-menu,
.integration-prestashop-header .top-menu .collapse,
.integration-prestashop-header .top-menu [data-depth="1"],
.integration-prestashop-header .top-menu [data-depth="2"],
.integration-prestashop-header .top-menu [data-depth="3"] {
  display: none !important;
}

/* …sauf au survol du parent */
.integration-prestashop-header .top-menu > li:hover .sub-menu,
.integration-prestashop-header .top-menu > li:hover [data-depth="1"] {
  display: block !important;
  position: absolute;
  background: #fff;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
  padding: 0.75rem 1rem;
  z-index: 9999;
}

/* === 5. Icônes Material Icons : éviter les ligatures texte brut === */
/* Si la font ne se charge pas, on cache le texte (.material-icons contient
   souvent "search", "close" etc. en ligature). */
.integration-prestashop-header .material-icons {
  font-family: "Material Icons", "Material Symbols Outlined", sans-serif;
  font-feature-settings: 'liga';
  -webkit-font-feature-settings: 'liga';
  -webkit-font-smoothing: antialiased;
}

/* Fallback : si la font ne charge pas, le texte de ligature reste visible.
   On le rend transparent pour éviter "search", "close", "clear" en clair. */
@supports not (font-feature-settings: 'liga') {
  .integration-prestashop-header .material-icons {
    color: transparent;
  }
}

/* === 6. Conteneur principal : padding + alignement === */
.integration-prestashop-header .header-top {
  padding: 0.5rem 1rem;
}

.integration-prestashop-header .header-top .container {
  max-width: 1200px;
  margin: 0 auto;
}

/* === 7. Footer : si présent inline, on simplifie === */
.integration-prestashop-footer .block-contact,
.integration-prestashop-footer .block_newsletter,
.integration-prestashop-footer .links {
  margin-bottom: 1rem;
}

/* === 8. Annule les animations LocomotiveScroll (opacity:0 par défaut) === */
/* Le thème emarket utilise LocomotiveScroll qui démarre les contenus à
   opacity:0 puis les anime au scroll. Sans le JS fonctionnel (ou avec un
   script chargé depuis un chemin erroné), le contenu reste invisible.
   On force la visibilité de tous les wrappers concernés. */
.integration-prestashop-header .ns-wrapper,
.integration-prestashop-footer .ns-wrapper,
.integration-prestashop-header [data-scroll],
.integration-prestashop-footer [data-scroll],
.integration-prestashop-header .animated-full,
.integration-prestashop-footer .animated-full,
.integration-prestashop-header .animated,
.integration-prestashop-footer .animated {
  opacity: 1 !important;
  transform: none !important;
  visibility: visible !important;
}

/* Icônes de réassurance (paiement, livraison, etc.) — souvent en opacity:0 */
.integration-prestashop-footer #reinsurance_footer img,
.integration-prestashop-footer #reinsurance_footer i,
.integration-prestashop-footer #reinsurance_footer .title,
.integration-prestashop-footer #reinsurance_footer a {
  opacity: 1 !important;
  visibility: visible !important;
}

/* Panneaux glissants du footer (block-layout-X) : forcés hors flux pour
   ne pas faire grandir la page ; sans JS, ils ne s'ouvrent pas mais ne
   doivent pas non plus pousser le footer. */
.integration-prestashop-footer [id^="block-layout-"],
.integration-prestashop-footer .panel-slide-right,
.integration-prestashop-footer .cart-layout {
  display: none !important;
}
