﻿/* =====================================================
   HEADER â€” ISOLATED & CLEAN
===================================================== */

#main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 90px;
  background: #ffffff;
  z-index: 9999;
  border-bottom: 1px solid #e5e7eb;
}

#main-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

/* ================= NAV ================= */

#main-header nav ul {
  display: flex;
  list-style: none;
  /* gap: 28px; */
}

#main-header nav a {
  text-decoration: none;
  font-weight: 600;
  color: #111827;
}

/* ================= DROPDOWN ================= */

#main-header li.has-dropdown {
  position: relative;
}

/* ================= MEGA MENU ================= */

#main-header .mega-menu {
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, 95vw);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  display: grid;
  grid-template-columns: 220px 1fr;
  /* Reduced from 260px */
  opacity: 0;
  visibility: hidden;
  z-index: 9999;
}

/* OPEN ON HOVER (DESKTOP) */
@media (hover: hover) {
  #main-header li.has-dropdown:hover>.mega-menu {
    opacity: 1;
    visibility: visible;
  }
}

/* ================= LEFT COLUMN ================= */

#main-header .mega-left {
  background: #f9fafb;
  border-right: 1px solid #e5e7eb;
}

#main-header .category-list {
  list-style: none;
  padding: 12px 0;
  margin: 0;
}

#main-header .category-item {
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 600;
  color: #1f2937;
}

#main-header .category-item:hover,
#main-header .category-item.active {
  background: #ffffff;
  color: #1e40af;
}

/* ================= RIGHT COLUMN ================= */

#main-header .mega-right {
  padding: 20px;
}

#main-header .product-panel {
  display: none;
}

#main-header .product-panel.active {
  display: block;
}

#main-header .product-panel a {
  display: block;
  padding: 6px 0;
  color: #374151;
  text-decoration: none;
}

#main-header .product-panel a:hover {
  color: #2563eb;
}



/* =====================================================
   ðŸ”¥ FORCE MEGA MENU 2 COLONNES (FINAL FIX)
===================================================== */

#main-header .mega-menu-2col {
  display: grid !important;
  grid-template-columns: 260px 1fr !important;
  gap: 0 !important;
}

/* KILL old grid behavior */
#main-header .mega-menu-2col>* {
  min-width: 0;
}

/* LEFT */
#main-header .mega-menu-2col .mega-left {
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
}

/* RIGHT */
#main-header .mega-menu-2col .mega-right {
  padding: 20px;
}

/* STOP nav styles leaking into mega menu */
#main-header .mega-menu ul {
  display: block !important;
}

/* ================================
   MEGA MENU â€“ PRODUCT CARDS (FIX)
================================ */

/* GRID */
#main-header .products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}

/* CARD */
#main-header .mega-product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: #111;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  transition: transform .25s ease, box-shadow .25s ease;
  height: 220px;
  /* ðŸ”¹ FIXE LA HAUTEUR DE LA CARD */
}

#main-header .mega-product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.15);
}

/* IMAGE CONTAINER */
#main-header .mega-product-img {
  height: 130px;
  /* ðŸ”¹ HAUTEUR MAX IMAGE */
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* IMAGE */
#main-header .mega-product-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  /* ðŸ”¹ PAS DE CROP */
}

/* NAME */
#main-header .mega-product-name {
  padding: 10px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* ================================
   CLICKABLE CATEGORIES (MEGA MENU)
================================ */

#main-header .category-item {
  padding: 0;
  /* padding dÃ©placÃ© sur le lien */
}

#main-header .category-link {
  display: block;
  padding: 12px 18px;
  text-decoration: none;
  color: inherit;
}

/* Hover / Active (reprend le style existant) */
#main-header .category-item:hover .category-link,
#main-header .category-item.active .category-link {
  background: #ffffff;
  color: #1e40af;
}

/* ================================
   MEGA MENU â€“ HEIGHT & SCROLL
================================ */

#main-header .mega-menu {
  max-height: calc(100vh - 120px);
  /* hauteur Ã©cran - header */
}

#main-header .mega-left {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

#main-header .mega-right {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

/* Custom scrollbar (Chrome / Edge / Safari) */
#main-header .mega-left::-webkit-scrollbar,
#main-header .mega-right::-webkit-scrollbar {
  width: 6px;
}

#main-header .mega-left::-webkit-scrollbar-thumb,
#main-header .mega-right::-webkit-scrollbar-thumb {
  background: #c7d2fe;
  border-radius: 4px;
}

#main-header .mega-left::-webkit-scrollbar-track,
#main-header .mega-right::-webkit-scrollbar-track {
  background: transparent;
}





.header-inner {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-center {
  flex: 1;
  display: flex;
  justify-content: center;
}



/* --- base: mobile simple (par dÃ©faut) --- */
.mobile-categories {
  display: none;
}

.mobile-categories ul {
  list-style: none;
  padding: 0;
  margin: 8px 0 0;
}

.mobile-categories li a {
  display: block;
  padding: 8px 0;
  color: #111827;
  text-decoration: none;
  font-weight: 500;
}

.mobile-categories li a:hover {
  color: #2563eb;
}


/* --- mobile <= 900px --- */




/* Lien principal Produits : texte + bouton chevron */
#main-header .menu-link {
  display: flex;
  align-items: center;
  gap: 4px;
}

/* Texte */
#main-header .menu-link-label {
  flex: 1;
}

/* Bouton chevron */
#main-header .menu-link-toggle {
  background: none;
  border: none;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
}

/* Sur mobile, agrandir un peu la zone de clic du chevron */




/* Le conteneur interne du lien + chevron + dropdown reste vertical */
#main-header li.has-dropdown {
  position: static;
  /* pas de positionnement bizarre sur mobile */
}

/* Liste mobile */
.has-dropdown .mobile-categories {
  display: none;
  padding-top: 8px;
}

.has-dropdown.open .mobile-categories {
  display: block;
}

.mobile-categories ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.mobile-categories li a {
  display: block;
  padding: 8px 0;
  color: #111827;
  text-decoration: none;
  font-weight: 500;
}


#main-header .menu-link {
  display: flex;
  align-items: center;
  gap: 4px;
}

#main-header .menu-link-label {
  flex: 1;
}

#main-header .menu-link-toggle {
  background: none;
  border: none;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: inherit;
}

/* --- desktop >= 901px --- */
@media (min-width: 901px) {

  #main-header .mega-menu {
    display: grid;
    opacity: 0;
    visibility: hidden;
  }

  .mobile-categories {
    display: none !important;
  }

  @media (hover: hover) {
    #main-header li.has-dropdown:hover>.mega-menu {
      opacity: 1;
      visibility: visible;
    }
  }
}






/* =====================================================
   HEADER â€” ISOLATED & CLEAN
===================================================== */

#main-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 90px;
  background: #ffffff;
  z-index: 9999;
  border-bottom: 1px solid #e5e7eb;
}

#main-header .header-inner {
  max-width: 1200px;
  margin: 0 auto;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 16px;
}

/* ================= BASE NAV (DESKTOP) ================= */
#main-header nav ul {
  display: flex;
  list-style: none;
  align-items: center;
  margin: 0;
  padding: 0;
  gap: 28px;
}

#main-header nav a {
  text-decoration: none;
  font-weight: 600;
  color: #111827;
  display: block;
  padding: 8px 0;
}

#main-header li.has-dropdown {
  position: relative;
}

/* ================= PRODUITS LINK FIX ================= */
#main-header .menu-link {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0;
}

#main-header .menu-link-label {
  flex: 1;
}

#main-header .menu-link-toggle {
  background: none;
  border: none;
  padding: 4px 8px;
  cursor: pointer;
  color: inherit;
  display: flex;
  align-items: center;
}

/* ================= MEGA MENU (DESKTOP ONLY) ================= */
#main-header .mega-menu {
  position: absolute;
  top: calc(100% - 4px);
  /* FIX: NO GAP */
  left: 50%;
  transform: translateX(-50%);
  width: min(1100px, 95vw);
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.15);
  display: grid;
  grid-template-columns: 220px 1fr;
  /* Reduced from 260px */
  opacity: 0;
  visibility: hidden;
  z-index: 9999;
  margin-top: 0;
}

/* PERFECT HOVER: Produits â†’ Mega-menu without gap */
@media (hover: hover) and (min-width: 901px) {

  #main-header li.has-dropdown:hover>.mega-menu,
  #main-header .mega-menu:hover {
    opacity: 1;
    visibility: visible;
  }
}

/* Mega-menu internal styles (unchanged) */
#main-header .mega-left {
  background: #f9fafb;
  border-right: 1px solid #e5e7eb;
}

#main-header .category-list {
  list-style: none;
  padding: 12px 0;
  margin: 0;
}

#main-header .category-item {
  padding: 12px 18px;
  cursor: pointer;
  font-weight: 600;
  color: #1f2937;
}

#main-header .category-item:hover,
#main-header .category-item.active {
  background: #ffffff;
  color: #1e40af;
}

#main-header .mega-right {
  padding: 20px;
}

#main-header .product-panel {
  display: none;
}

#main-header .product-panel.active {
  display: block;
}

#main-header .products-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 18px;
}



#main-header .category-link {
  display: block;
  padding: 12px 18px;
  text-decoration: none;
  color: inherit;
}

/* Mega-menu scroll (desktop only) */
#main-header .mega-menu {
  max-height: calc(100vh - 120px);
}

#main-header .mega-left,
#main-header .mega-right {
  max-height: calc(100vh - 120px);
  overflow-y: auto;
}

/* ================= MOBILE ONLY (CLEAN & SINGLE BLOCK) ================= */


/* Desktop force 2-column mega-menu */
#main-header .mega-menu-2col {
  display: grid !important;
  grid-template-columns: 260px 1fr !important;
  gap: 0 !important;
}

#main-header .mega-menu-2col>* {
  min-width: 0;
}

#main-header .mega-menu-2col .mega-left {
  background: #f8fafc;
  border-right: 1px solid #e5e7eb;
}

#main-header .mega-menu-2col .mega-right {
  padding: 20px;
}

/* Mega product cards (unchanged) */
#main-header .mega-product-card {
  display: flex;
  flex-direction: column;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  text-decoration: none;
  color: #111;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
  height: 220px;
}

#main-header .mega-product-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 14px 32px rgba(0, 0, 0, 0.15);
}

#main-header .mega-product-img {
  height: 130px;
  background: #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#main-header .mega-product-img img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

#main-header .mega-product-name {
  padding: 10px 8px;
  font-size: 0.85rem;
  font-weight: 600;
  text-align: center;
  line-height: 1.3;
  flex-grow: 1;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Scrollbars */
#main-header .mega-left::-webkit-scrollbar,
#main-header .mega-right::-webkit-scrollbar {
  width: 6px;
}

#main-header .mega-left::-webkit-scrollbar-thumb,
#main-header .mega-right::-webkit-scrollbar-thumb {
  background: #c7d2fe;
  border-radius: 4px;
}

#main-header .mega-left::-webkit-scrollbar-track,
#main-header .mega-right::-webkit-scrollbar-track {
  background: transparent;
}

/* ================= MOBILE ONLY - CLEAN IMPLEMENTATION ================= */

/* ================= MOBILE ONLY - FIXED DROPDOWN CONTENT ================= */
@media (max-width: 900px) {

  /* Kill ONLY desktop mega-menu, NOT mobile content */
  #main-header .mega-menu.mega-menu-2col,
  #main-header .mega-left,
  #main-header .mega-right,
  #main-header .product-panel,
  #main-header .products-grid,
  #main-header .mega-menu .category-list {
    display: none !important;
    visibility: hidden !important;
  }


  /* Mobile menu (hamburger - working correctly) */
  #main-header nav ul {
    position: fixed;
    top: 90px;
    right: -10px;
    background: #ffffff;
    flex-direction: column;
    width: 300px;
    max-height: calc(100vh - 90px);
    padding: 24px;
    display: none !important;
    align-items: stretch;
    overflow-y: auto;
    box-shadow: -8px 0 24px rgba(0, 0, 0, 0.15);
    z-index: 9998;
  }

  #main-header nav ul.active {
    display: flex !important;
  }

  #main-header nav ul>li {
    display: block;
    width: 100%;
    margin-bottom: 2px;
  }

  /* Mobile categories dropdown - CORRECTLY TARGETED */
  .mobile-categories {
    display: none !important;
  }

  .has-dropdown.open .mobile-categories {
    display: block !important;
    background: #f8fafc;
    margin: 2px 0 0 8px;
    padding: 12px;
    border-left: 3px solid #1e40af;
    border-radius: 0 6px 6px 0;
  }

  /* Mobile categories content - ULTRA-SPECIFIC OVERRIDE */
  .has-dropdown.open .mobile-categories ul {
    display: block !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
  }

  .has-dropdown.open .mobile-categories li {
    display: block !important;
    margin: 0 0 2px 0 !important;
  }

  .has-dropdown.open .mobile-categories a,
  .has-dropdown.open .mobile-categories li a {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    color: #374151 !important;
    background: transparent !important;
    padding: 12px 4px !important;
    text-decoration: none !important;
    font-weight: 500 !important;
    font-size: 15px !important;
    line-height: 1.4 !important;
    border-radius: 4px !important;
    position: static !important;
    overflow: visible !important;
  }

  .has-dropdown.open .mobile-categories li a:hover {
    background: rgba(29, 78, 216, 0.1) !important;
    color: #1e40af !important;
    padding-left: 12px !important;
  }

  /* Chevron */
  #main-header .menu-link {
    gap: 4px;
  }

  #main-header .menu-link-toggle {
    padding: 6px 8px;
  }

  .has-dropdown.open .chevron {
    transform: rotate(180deg);
    transition: transform 0.2s ease;
  }
}


/* FIX MOBILE â€“ RESTORE CATEGORIES VISIBILITY */
@media (max-width: 900px) {

  .has-dropdown.open .mobile-categories ul,
  .has-dropdown.open .mobile-categories li,
  .has-dropdown.open .mobile-categories a {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
  }
}

/* ðŸ”¥ FIX FINAL â€“ MOBILE PRODUITS DROPDOWN */
@media (max-width: 900px) {
  .has-dropdown.open {
    overflow: visible !important;
  }

  .has-dropdown.open .mobile-categories {
    max-height: none !important;
    overflow: visible !important;
  }
}

/* âœ… FIX DEFINITIF â€“ MOBILE PRODUITS */
@media (max-width: 900px) {
  .has-dropdown.open .mobile-categories ul {
    display: block !important;
    visibility: visible !important;
  }
}


/* ðŸ”¥ FIX FINAL â€“ MOBILE CATEGORIES HEIGHT */
@media (max-width: 900px) {

  .has-dropdown.open {
    height: auto !important;
    overflow: visible !important;
  }

  .has-dropdown.open .mobile-categories {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

  .has-dropdown.open .mobile-categories ul {
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

}

/* ðŸ”¥ FIX DÃ‰FINITIF â€“ FORCE AFFICHAGE CATEGORIES MOBILE */
@media (max-width: 900px) {

  #main-header .has-dropdown.open .mobile-categories,
  #main-header .has-dropdown.open .mobile-categories ul,
  #main-header .has-dropdown.open .mobile-categories li,
  #main-header .has-dropdown.open .mobile-categories a {
    display: block !important;
    visibility: visible !important;
    opacity: 1 !important;
    height: auto !important;
    max-height: none !important;
    overflow: visible !important;
  }

}

/* âœ… ORGANISATION PROPRE DU MENU MOBILE */
@media (max-width: 900px) {

  /* Le menu hamburger doit empiler les Ã©lÃ©ments */
  #main-header nav ul.active {
    display: flex !important;
    flex-direction: column !important;
  }

  /* Chaque item du menu prend toute la largeur */
  #main-header nav ul.active>li {
    position: relative !important;
    width: 100% !important;
  }

  /* Les catÃ©gories restent DANS le flux (pas en overlay) */
  .has-dropdown.open .mobile-categories {
    position: static !important;
    width: 100% !important;
    margin: 6px 0 12px 12px !important;
    padding: 8px 12px !important;
    background: #f8fafc;
    border-left: 3px solid #1e40af;
  }

  /* Les liens catÃ©gories bien alignÃ©s */
  .has-dropdown.open .mobile-categories li a {
    display: block !important;
    padding: 10px 6px !important;
  }

}

/* ===============================
   FIX FINAL â€“ MENU MOBILE PROPRE
================================ */
@media (max-width: 900px) {

  /* Le panneau du menu mobile */
  #main-header nav ul {
    position: fixed;
    top: 90px;
    right: 0;
    width: 280px;
    height: calc(100vh - 90px);
    background: #e0f2fe;
    /* bleu clair homogÃ¨ne */
    display: none;
    flex-direction: column;
    padding: 16px;
    overflow-y: auto;
    z-index: 9999;
  }

  #main-header nav ul.active {
    display: flex;
  }

  /* Chaque item du menu */
  #main-header nav ul>li {
    width: 100%;
    position: relative;
  }

  /* Dropdown mobile : reste DANS le menu */
  .has-dropdown .mobile-categories {
    display: none;
    position: static;
    width: 100%;
    margin-top: 8px;
    padding: 8px 0 8px 12px;
    background: #dbeafe;
    border-left: 3px solid #1e40af;
  }

  .has-dropdown.open .mobile-categories {
    display: block;
  }

  /* Liens catÃ©gories */
  .mobile-categories li a {
    display: block;
    padding: 8px 4px;
    font-size: 14px;
    color: #1f2937;
    text-decoration: none;
  }

  .mobile-categories li a:hover {
    color: #1e40af;
  }

}

/* âœ… FIX HAUTEUR MENU MOBILE (FINAL) */
@media (max-width: 900px) {

  /* Le panneau mobile doit pouvoir grandir */
  #main-header nav ul.active {
    height: auto !important;
    max-height: calc(100vh - 90px) !important;
    overflow-y: auto !important;
  }

  /* Chaque item reste dans le flux */
  #main-header nav ul.active>li {
    position: static !important;
  }

  /* Les catÃ©gories ne flottent plus */
  .has-dropdown.open .mobile-categories {
    position: relative !important;
    margin-bottom: 12px !important;
  }

}

/* ðŸ”¥ FIX FINAL ABSOLU â€“ CONTENEUR MENU MOBILE */
@media (max-width: 900px) {

  /* Le VRAI panneau mobile */
  #main-header nav {
    position: fixed !important;
    top: 90px !important;
    right: 0 !important;
    width: 280px !important;
    height: calc(100vh - 90px) !important;
    background: #e0f2fe !important;
    overflow-y: auto !important;
    z-index: 9999 !important;
  }

  /* Le ul doit juste empiler */
  #main-header nav ul {
    position: static !important;
    height: auto !important;
    max-height: none !important;
    background: transparent !important;
  }

  /* Les catÃ©gories restent dans le flux */
  .has-dropdown.open .mobile-categories {
    position: static !important;
    margin-bottom: 16px !important;
  }

}

/* ===============================
   FIX VISIBILITÃ‰ MENU MOBILE
================================ */
@media (max-width: 900px) {

  /* Par dÃ©faut : menu mobile cachÃ© */
  #main-header nav {
    display: none !important;
  }

  /* Menu ouvert */
  #main-header nav ul.active {
    display: flex;
  }

  /* Quand le ul est actif â†’ le nav apparaÃ®t */
  #main-header nav:has(ul.active) {
    display: block !important;
  }

}

/* ===============================
   STYLE MOBILE CATEGORIES
================================ */
@media (max-width: 900px) {

  .mobile-categories {
    background: linear-gradient(180deg,
        #f0f9ff 0%,
        #e0f2fe 100%) !important;

    border-left: 3px solid #2563eb;
    border-radius: 6px;
    padding: 10px 12px;
    margin: 8px 0 12px 12px;
    box-shadow: inset 0 0 0 1px rgba(37, 99, 235, 0.1);
  }

  .mobile-categories li a {
    font-size: 14px;
    color: #1f2937;
    padding: 8px 6px;
    border-radius: 4px;
  }

  .mobile-categories li a:hover {
    background: rgba(37, 99, 235, 0.08);
    color: #1e40af;
  }

}


/* ===============================
   SUPPRIMER LA LIGNE SOUS CONTACT
================================ */
@media (max-width: 900px) {

  /* Supprime toute bordure sur le dernier item */
  #main-header nav ul.active>li:last-child {
    border-bottom: none !important;
  }

  /* SÃ©curitÃ© : supprime aussi tout <hr> Ã©ventuel */
  #main-header nav ul.active hr {
    display: none !important;
  }

}

/* =====================================
   FIX FINAL : SUPPRIMER LA LIGNE EN BAS
   (box-shadow du menu mobile)
===================================== */
@media (max-width: 900px) {

  #main-header nav ul.active {
    box-shadow: none !important;
    border-bottom: none !important;
  }

}

/* =========================================
   FIX DEFINITIF : MENU MOBILE PLEIN ECRAN
========================================= */
@media (max-width: 900px) {

  /* Le menu UL prend TOUT lâ€™Ã©cran */
  #main-header nav ul.active {
    top: 90px;
    height: calc(100vh - 90px) !important;
    max-height: calc(100vh - 90px) !important;
    overflow-y: auto !important;

    box-shadow: none !important;
    border: none !important;
  }

}

/* =================================
   MOBILE â€“ LIGNE BLEUE SOUS LE TEXTE
================================= */
/* =========================================
   MOBILE â€“ ALIGNEMENT TEXTE + FLÃˆCHE
========================================= */
@media (max-width: 900px) {

  /* Le lien Produits reste en flex */
  #main-header .menu-link {
    display: flex !important;
    align-items: center !important;
    width: 100%;
  }

  /* Le texte peut Ãªtre soulignÃ© */
  #main-header .menu-link-label {
    position: relative;
    display: inline-block;
  }

  /* Ligne bleue UNIQUEMENT sous le texte */
  #main-header .menu-link.active .menu-link-label::after {
    content: "";
    position: absolute;
    left: -15%;
    bottom: -6px;
    width: 130%;
    height: 2px;
    background: #1e40af;
    border-radius: 2px;
  }

}

/* =================================================
   MOBILE â€“ NEUTRALISER STYLE.CSS (DOUBLE LIGNE)
================================================= */
@media (max-width: 900px) {

  /* DÃ©sactiver COMPLETEMENT les 2 soulignements globaux */
  #main-header nav a,
  #main-header nav a:hover,
  #main-header nav a.active {
    border-bottom: none !important;
    background-image: none !important;
    border-image: none !important;
  }

}

/* =================================================
   MOBILE â€“ SOULIGNEMENT PRO (SOUS LE TEXTE SEULEMENT)
================================================= */
@media (max-width: 900px) {

  /* Liens mobiles */
  #main-header nav ul.active>li>a {
    position: relative;
    display: inline-block;
  }

  /* Cas spÃ©cial "Produits" (texte + flÃ¨che) */
  #main-header .menu-link {
    display: flex !important;
    align-items: center;
  }

  #main-header .menu-link-label {
    position: relative;
    display: inline-block;
  }

  /* Ligne bleue sous le texte actif */
  #main-header nav ul.active a.active::after,
  #main-header .menu-link.active .menu-link-label::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, #007BFF, #0056b3);
    border-radius: 2px;
  }

}

/* =================================================
   MOBILE â€“ FIX FINAL SOULIGNEMENT "PRODUITS"
================================================= */
@media (max-width: 900px) {

  /* Annuler underline sur le <a> Produits */
  #main-header .menu-link.active::after {
    content: none !important;
  }

  /* Soulignement UNIQUEMENT sur le texte */
  #main-header .menu-link-label::after {
    content: none;
  }

  #main-header .menu-link.active .menu-link-label::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: -6px;
    width: 29%;
    height: 2px;
    background: linear-gradient(90deg, #007BFF, #0056b3);
    border-radius: 2px;
  }

}

/* =================================================
   RESPONSIVE - TABLET & SMALL SCREENS
================================================= */

/* Tablet - reduce header height and adjust spacing */
@media (max-width: 768px) {

  #main-header {
    height: 70px;
  }

  #main-header .header-inner {
    padding: 0 12px;
  }

  /* Adjust mobile menu position for smaller header */
  #main-header nav ul {
    top: 70px;
  }

  #main-header nav ul.active {
    top: 70px;
    height: calc(100vh - 70px) !important;
    max-height: calc(100vh - 70px) !important;
  }

  #main-header nav {
    top: 70px !important;
    height: calc(100vh - 70px) !important;
  }

  /* Reduce logo size on smaller screens */
  #main-header .logo img {
    max-height: 50px;
  }

  /* Smaller mega menu width on tablets */
  #main-header .mega-menu {
    width: min(900px, 95vw);
  }
}

/* Small Mobile - further optimizations */
@media (max-width: 480px) {

  #main-header {
    height: 60px;
  }

  #main-header .header-inner {
    padding: 0 8px;
    gap: 8px;
  }

  /* Adjust mobile menu for very small screens */
  #main-header nav ul {
    top: 60px;
    width: 100%;
    right: 0;
    padding: 16px 12px;
  }

  #main-header nav ul.active {
    top: 60px;
    height: calc(100vh - 60px) !important;
    max-height: calc(100vh - 60px) !important;
  }

  #main-header nav {
    top: 60px !important;
    height: calc(100vh - 60px) !important;
    width: 100% !important;
  }

  /* Smaller logo for very small screens */
  #main-header .logo img {
    max-height: 80px;
  }

  /* Reduce font sizes */
  #main-header nav a {
    font-size: 14px;
  }

  .mobile-categories li a {
    font-size: 13px !important;
  }

  /* Smaller hamburger icon */
  .hamburger-icon {
    width: 24px;
    height: 24px;
  }

  .hamburger-icon span {
    height: 2px;
  }
}

/* Extra Small Mobile - minimal design */
@media (max-width: 360px) {

  #main-header {
    height: 55px;
  }

  #main-header .header-inner {
    padding: 0 6px;
  }

  #main-header nav ul {
    top: 55px;
    padding: 12px 8px;
  }

  #main-header nav ul.active {
    top: 55px;
    height: calc(100vh - 55px) !important;
    max-height: calc(100vh - 55px) !important;
  }

  #main-header nav {
    top: 55px !important;
    height: calc(100vh - 55px) !important;
  }

  #main-header .logo img {
    max-height: 40px;
  }

  #main-header nav a {
    font-size: 13px;
  }

  .mobile-categories li a {
    font-size: 12px !important;
    padding: 6px 4px !important;
  }
}

/* Landscape phones - adjust menu layout */
@media (max-width: 900px) and (max-height: 500px) {

  #main-header {
    height: 50px;
  }

  #main-header nav ul.active {
    top: 50px;
    height: calc(100vh - 50px) !important;
    max-height: calc(100vh - 50px) !important;
    padding: 8px 12px;
  }

  #main-header nav {
    top: 50px !important;
    height: calc(100vh - 50px) !important;
  }

  #main-header .logo img {
    max-height: 40px;
  }

  /* Compact menu items in landscape */
  #main-header nav a {
    padding: 4px 0;
    font-size: 13px;
  }

  .mobile-categories {
    margin: 4px 0 8px 12px !important;
    padding: 6px 8px !important;
  }

  .mobile-categories li a {
    padding: 4px 4px !important;
    font-size: 12px !important;
  }
}

/* =====================================================
   REFINEMENT: ULTRA-THINNER MEGA MENU CATEGORIES
   ===================================================== */
#main-header .mega-menu,
#main-header .mega-menu-2col {
  grid-template-columns: 180px 1fr !important;
}

#main-header .category-list {
  padding: 4px 0 !important;
}

#main-header .category-item,
#main-header .category-link {
  padding: 3px 10px !important;
  font-weight: 500 !important;
  font-size: 15px !important;
  line-height: 1.2 !important;
}

#main-header .category-item:hover,
#main-header .category-item.active,
#main-header .category-item:hover .category-link,
#main-header .category-item.active .category-link {
  background: #f1f5f9 !important;
  font-weight: 700 !important;
  color: #1e40af !important;
}