/* ===============================
   TOP BANNER
   =============================== */

.inaris-top-banner {
  background-color: #0A472E;
  color: #F6EAD7;
  font-size: 16px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.inaris-top-banner p {
  margin: 0;
  line-height: 40px;
}

/* ===============================
   HEADER DESKTOP
   =============================== */

.inaris-header {
  background: #fff;
  margin-bottom: 10px;
  padding: 15px 30px;
  box-shadow: 0 2px 5px rgba(0,0,0,0.05);
  position: relative;
  z-index: 100;
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  position: relative;
  gap: 20px;
}

/* Desktop : masquer burger + nav mobile */
@media (min-width: 769px) {
  .menu-toggle,
  .mobile-nav {
    display: none !important;
  }
}

/* ===============================
   LOGO
   =============================== */

.logo img {
  display: block;
  height: 60px;
  margin-bottom: 3px;
}

/* Mobile logo */
@media (max-width: 768px) {
  .logo img {
    margin-top: 50px;
  }
}

/* ===============================
   MAIN NAV (DESKTOP)
   =============================== */

.main-nav {
  flex-grow: 1;
  text-align: center;
  top: 2px;
  position: relative;
  z-index: 200;
}
.main-nav ul {
  display: flex;
  justify-content: center;
  gap: 40px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.main-nav a {
  color: #0A472E;
  font-weight: bold;
  text-decoration: none;
}

/* ===============================
   DROPDOWN DESKTOP
   =============================== */

.has-dropdown {
  position: relative;
}
.dropdown {
  display: none;
  position: absolute;
  top: 100%;
  left: 0;
  background: #fff;
  text-align: left;
  padding: 20px 28px;
  box-shadow: 0 6px 20px rgba(0,0,0,0.08);
  border-radius: 6px;
  gap: 28px;
  flex-wrap: wrap;
  z-index: 1000 !important;
}
.dropdown-chien { width: 550px; }
.dropdown-chat  { width: 550px; }
.dropdown-nacs  { width: 300px; }

.has-dropdown:hover .dropdown {
  display: flex;
}

.dropdown-column {
  flex: 1 1 220px;
  max-width: 250px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.dropdown-column h4 {
  color: #8C9A44;
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 6px;
  border-bottom: 1px solid #8C9A44;
  padding-bottom: 4px;
}
.dropdown-column a {
  color: #0A472E;
  font-size: 13.5px;
  line-height: 1.4;
  padding: 3px 2px;
  text-decoration: none;
  transition: color .2s;
}
.dropdown-column a:hover {
  color: #8C9A44;
}
.dropdown-subgrid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 4px 16px;
  padding-top: 4px;
}

/* ===============================
   BUNNY NATURE DROPDOWN
   =============================== */

.dropdown-bunny {
  width: 550px;
}

/* Ligne pleine largeur sous les colonnes */
.dropdown-wide {
  flex: 0 0 100%;
  display: flex;
  flex-wrap: wrap;
  gap: 6px 10px;
  padding-top: 2px;
  margin-top: 2px;
}

/* Liens "pills" */
.dropdown-wide a {
  display: inline-block;
  padding: 6px 10px;
  border: 1px solid #8C9A44;
  border-radius: 999px;
  font-size: 13.5px;
  line-height: 1.2;
  color: #0A472E;
  text-decoration: none;
  transition: color .2s, border-color .2s, background .2s;
}
.dropdown-wide a:hover {
  color: #8C9A44;
  border-color: #8C9A44;
  background: #fafafa;
}

/* ===============================
   ICONES DESKTOP (search / compte / panier)
   =============================== */

.icons {
  display: flex;
  gap: 12px;
  align-items: center;
}

.icon-btn {
  position: relative;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid rgba(10, 71, 46, 0.18);
  background: #F6F9F4;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  box-shadow: 0 1px 3px rgba(0,0,0,0.04);
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    box-shadow 0.2s ease,
    transform 0.2s ease;
}

/* variantes légères */
.search-btn {
  background: #F3FAF8;
}
.account-btn {
  background: #F8F4F2;
}
.cart-btn {
  background: #FDFBF2;
  border-color: rgba(168, 179, 36, 0.35);
}

/* icônes */
.icon-btn img {
  width: 20px;
  height: 20px;
  display: block;
  opacity: 0.9;
  transition: filter 0.2s ease, opacity 0.2s ease, transform 0.2s ease;
}

/* hover commun */
.icon-btn:hover {
  background: #0A472E;
  border-color: #0A472E;
  box-shadow: 0 4px 12px rgba(0,0,0,0.12);
  transform: translateY(-1px);
}
.icon-btn:hover img {
  filter: brightness(0) invert(1);
  opacity: 1;
}

/* ===============================
   SEARCH POPUP (FIX)
   =============================== */

/* IMPORTANT : on force fermé par défaut, pour éviter qu'une surcharge l'affiche */
#search-popup.search-popup {
  display: none !important;
  position: fixed;
  inset: 0;
  background: rgba(10,71,46,0.8);
  justify-content: center;
  align-items: center;
  z-index: 99999; /* au-dessus du header */
}

/* Visible uniquement quand le JS ajoute .is-open */
#search-popup.search-popup.is-open {
  display: flex !important;
}

.search-popup-inner {
  background: #fff;
  padding: 30px;
  width: 90%;
  max-width: 700px;
  border-radius: 8px;
  position: relative;
}

.search-popup input[type="text"] {
  width: 100%;
  padding: 12px;
  margin: 25px 0 10px;
  font-size: 16px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

#search-close {
  position: absolute;
  top: -5px;
  right: -5px;
  font-size: 24px;
  background: none;
  border: none;
  cursor: pointer;
  color: #0A472E;
}

/* ===============================
   MOBILE (≤ 768px)
   =============================== */

@media (max-width: 768px) {

  .main-nav,
  .icons {
    display: none !important;
  }

  .menu-toggle {
    display: block !important;
    position: absolute;
    left: 4px;
    top: 5px;
    font-size: 28px;
    color: #0A472E;
    border: none;
    background: none;
    cursor: pointer;
    z-index: 10;
  }

  .inaris-header {
    min-height: 80px;
  }

  .header-inner {
    justify-content: center !important;
  }

  .logo {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
  }

  .mobile-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 80%;
    max-width: 300px;
    height: 100vh;
    background: #fff;
    overflow-y: auto;
    box-shadow: 2px 0 8px rgba(0,0,0,0.1);
    flex-direction: column;
    z-index: 9999;
  }
  .mobile-nav.show {
    display: flex;
  }

  #mobile-menu-close {
    position: absolute;
    top: 3px;
    right: 3px;
    margin: 0;
    font-size: 28px;
    border: none;
    background: none;
    cursor: pointer;
    color: #000;
    z-index: 10000;
  }

  /* Icônes mobile en haut */
  .mobile-icons {
    display: flex !important;
    justify-content: center;
    gap: 16px;
    margin-top: 120px;
    padding: 12px 0;
  }

  .mobile-icons .icon-btn {
    width: 46px;
    height: 46px;
    background: #F6F9F4;
    border-radius: 999px;
  }

  .mobile-icons .icon-btn img {
    width: 22px !important;
    height: 22px !important;
    margin: auto;
  }

  /* icône recherche mobile spécifique */
  #mobile-search-toggle img {
    content: url('https://shop.inaris.fr/wp-content/uploads/2020/08/loupe.svg') !important;
  }

  .mobile-nav ul {
    padding: 0 16px;
    margin: 0;
    list-style: none;
  }

  .mobile-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    font-size: 16px;
    font-weight: 600;
    color: #0A472E;
    border-bottom: 1px solid #eee;
    background: none !important;
    cursor: pointer;
  }

  .mobile-item a.mobile-link {
    display: block;
    width: 100%;
    color: inherit;
    text-decoration: none;
  }

  .submenu-toggle,
  .submenu-toggle:focus,
  .submenu-toggle:active {
    background: none !important;
    -webkit-tap-highlight-color: transparent;
    color: black;
  }

  .mobile-submenu,
  .submenu-group {
    background: none !important;
  }

  .mobile-submenu {
    display: none;
    padding-left: 16px;
    margin: 0 0 12px;
  }

  .mobile-submenu li a {
    display: block;
    padding: 6px 0;
    color: #000;
    font-weight: normal;
    text-decoration: none;
  }
}

/* Marge sous le header – seulement hors page d'accueil */
body:not(.home) .inaris-header {
  margin-bottom: 60px !important;
}
