/* ============================================
   HEADER DESKTOP - STYLE 2 "PILULE"
   Design : Pilule blanche fixe sur fond transparent

   VARIABLES CSS PERSONNALISABLES (via Apparence > Headers > Customisation) :
   --header-pill-bg         : Couleur de fond de la pilule
   --header-pill-radius     : Border radius de la pilule
   --header-padding         : Padding interne de la pilule
   ============================================ */

/* Header fixe (pas de background, juste la pilule) */
.header-2 {
  position: fixed;
  top: 20px;
  left: 0;
  right: 0;
  z-index: 1000;
  pointer-events: none; /* Permet de cliquer à travers l'espace vide */
  overflow-x: hidden;
}

/* Container pour centrer la pilule */
.header-2-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 1.5rem 20px;
  pointer-events: none;
}

/* Pilule blanche */
.header-2-pill {
  background: var(--header-pill-bg, #ffffff);
  border-radius: var(--header-pill-radius, 50px);
  padding: var(--header-padding, 12px) calc(var(--header-padding, 12px) * 1.5);
  display: flex;
  align-items: center;
  gap: 3rem;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06), 0 4px 16px rgba(0, 0, 0, 0.1);
  border: 1px solid rgba(0, 0, 0, 0.05);
  pointer-events: auto; /* Réactive les événements sur la pilule */
  flex-wrap: wrap;
}

/* ============================================
   LOGO
   ============================================ */

.header-2-logo {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}

.header-2-logo a {
  display: inline-block;
  font-size: var(--text-xl);
  font-weight: 700;
  color: var(--bs-gray-darker);
  text-decoration: none;
  transition: color 0.3s ease;
}

.header-2-logo a:hover {
  color: var(--bs-primary);
}

.header-2-logo .custom-logo-link,
.header-2-logo .logo-link {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.header-2-logo .custom-logo {
  max-height: 40px;
  width: auto;
  height: auto;
  display: block;
}

/* ============================================
   MENU WORDPRESS (Navigation normale)
   ============================================ */

.header-2-nav {
  display: flex;
  align-items: center;
}

.header-2-menu-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.header-2-menu-list > li {
  position: relative;
}

.header-2-menu-list > li > a {
  color: var(--bs-gray-darker);
  font-weight: 500;
  font-size: var(--text-base);
  text-decoration: none;
  position: relative;
  transition: color 0.3s ease;
  display: inline-flex;
  align-items: center;
  height: 40px;
}

.header-2-menu-list > li > a:hover {
  color: var(--bs-primary);
}

/* Soulignement au survol */
.header-2-menu-list > li > a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--bs-primary);
  transition: width 0.3s ease;
}

.header-2-menu-list > li > a:hover::after {
  width: 100%;
}

/* Item actif */
.header-2-menu-list .current-menu-item > a,
.header-2-menu-list .current_page_item > a {
  color: var(--bs-primary);
}

.header-2-menu-list .current-menu-item > a::after,
.header-2-menu-list .current_page_item > a::after {
  width: 100%;
}

/* Sous-menus (dropdown) */
.header-2-menu-list .sub-menu {
  position: absolute;
  top: 100%;
  left: 0;
  background: white;
  border-radius: var(--radius-md);
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
  padding: 0.5rem 0;
  min-width: 200px;
  list-style: none;
  margin: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 1000;
}

.header-2-menu-list > li:hover > .sub-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.header-2-menu-list .sub-menu li {
  padding: 0;
}

.header-2-menu-list .sub-menu a {
  padding: 0.75rem 1.5rem;
  display: block;
  color: var(--bs-gray-darker);
  text-decoration: none;
  transition: background-color 0.2s ease;
}

.header-2-menu-list .sub-menu a:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--bs-primary);
}

/* ============================================
   ACTIONS (Boutons & Icônes)
   ============================================ */

.header-2-actions {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 1rem;
}

/* Boutons (Contact, CTA custom) */
.header-2-actions .btn {
  font-weight: 600;
  font-size: var(--text-sm);
  padding: 0.5rem 1.5rem;
  border-radius: 50px;
  transition: all 0.3s ease;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  line-height: 1.5;
  white-space: nowrap;
}

.header-2-actions .btn-primary {
  background-color: var(--bs-primary);
  color: white;
}

.header-2-actions .btn-primary:hover {
  background-color: #ffffff;
  border: 1px solid var(--bs-primary);
  color: var(--bs-primary) !important;
  transform: none;
  box-shadow: none;
}

/* Icônes (Panier, Mon compte, Recherche) */
.header-2-icon {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: transparent;
  border: none;
  color: var(--bs-primary);
  font-size: 1.25rem;
  cursor: pointer;
  transition: all 0.3s ease;
  text-decoration: none;
}

.header-2-icon svg {
  width: 24px;
  height: 24px;
  min-width: 24px;
  min-height: 24px;
  display: block;
  flex-shrink: 0;
}

.header-2-icon:hover {
  background-color: rgba(0, 0, 0, 0.05);
  color: var(--bs-primary-dark, var(--bs-primary));
}

/* Badge pour le compteur du panier */
.header-2-badge {
  position: absolute;
  top: -4px;
  right: -4px;
  background-color: var(--bs-primary);
  color: white;
  font-size: 0.65rem;
  font-weight: 700;
  padding: 0.2em 0.5em;
  border-radius: 50px;
  min-width: 18px;
  height: 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* ============================================
   BOUTON BURGER (Mobile)
   ============================================ */

.header-2-burger {
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--bs-gray-darker, #34333c);
  transition: color 0.3s ease;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.header-2-burger:hover {
  color: var(--bs-primary);
}

/* Focus states */
.header-2-burger:focus:not(:focus-visible) {
  outline: 0 !important;
  box-shadow: none !important;
}

.header-2-burger:focus-visible {
  outline: 2px solid var(--bs-primary);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ============================================
   RESPONSIVE
   ============================================ */

/* Tablette */
@media (max-width: 1200px) {
  .header-2-pill {
    gap: 2rem;
    padding: 0.75rem 1.5rem;
  }

  .header-2-menu-list {
    gap: 1.5rem;
  }

  .header-2-menu-list > li > a {
    font-size: var(--text-sm);
  }
}

/* Mobile */
@media (max-width: 991px) {
  .header-2 {
    top: 10px;
  }

  .header-2-container {
    padding: 0 1rem;
  }

  .header-2-pill {
    column-gap: 1rem;
    row-gap: 0;
    padding: 0.5rem 1rem;
    justify-content: space-between;
    flex-wrap: wrap;
  }

  .header-2-logo .custom-logo {
    max-height: 32px;
  }
}

/* Très petit mobile */
@media (max-width: 480px) {
  .header-2-pill {
    padding: 0.5rem 0.75rem;
  }
}

/* ============================================
   SPACING POUR LE CONTENU (fixed header)
   ============================================ */

/* Ajouter du padding-top au body pour compenser le header fixe */
body.has-header-2 {
  padding-top: 100px;
  overflow-x: hidden;
}

@media (max-width: 991px) {
  body.has-header-2 {
    padding-top: 80px;
    overflow-x: hidden;
  }
}

/* ============================================
   VARIANTE : Pilule avec backdrop-filter (effet glassmorphism)
   Décommenter pour un effet de transparence moderne
   ============================================ */

/*
.header-2-pill {
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
*/

/* ============================================
   ANIMATION AU SCROLL (Optionnel)
   Pilule plus compacte au scroll
   ============================================ */

.header-2.scrolled .header-2-pill {
  padding: 0.5rem 1.5rem;
  box-shadow: 0 8px 40px rgba(0, 0, 0, 0.25);
}

.header-2.scrolled .header-2-logo .custom-logo {
  max-height: 32px;
}

/* ============================================
   MODAL DE RECHERCHE
   ============================================ */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
}

.search-modal.is-open {
  pointer-events: auto;
  visibility: visible;
}

/* Overlay avec blur - animation séparée pour fluidité */
.search-modal-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0);
  backdrop-filter: blur(0px);
  -webkit-backdrop-filter: blur(0px);
  transition: background 0.2s ease, backdrop-filter 0.2s ease,
    -webkit-backdrop-filter 0.2s ease;
}

.search-modal.is-open .search-modal-overlay {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

/* Contenu du modal */
.search-modal-content {
  position: relative;
  z-index: 1;
  width: 90%;
  max-width: 700px;
  opacity: 0;
  transform: translateY(-30px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.search-modal.is-open .search-modal-content {
  opacity: 1;
  transform: translateY(0);
}

/* Formulaire de recherche */
.search-modal-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.search-modal-input-wrapper {
  position: relative;
  display: flex;
  align-items: center;
  background: #ffffff;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
  overflow: hidden;
}

.search-modal-icon {
  position: absolute;
  left: 1.5rem;
  width: 28px;
  height: 28px;
  color: var(--bs-gray-medium, #6c757d);
  pointer-events: none;
}

.search-modal-input {
  width: 100%;
  padding: 1.5rem 1.5rem 1.5rem 4rem;
  font-family: var(--font-body, sans-serif);
  font-size: 1.25rem;
  font-weight: 400;
  color: var(--bs-gray-darker, #333);
  background: transparent;
  border: none;
  outline: none;
}

.search-modal-input::placeholder {
  color: var(--bs-gray-medium, #6c757d);
}

.search-modal-input:focus {
  outline: none;
}

/* Bouton clear (croix) pour input search */
.search-modal-input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
  height: 20px;
  width: 20px;
  background: var(--bs-primary);
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='currentColor' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='18' y1='6' x2='6' y2='18'%3E%3C/line%3E%3Cline x1='6' y1='6' x2='18' y2='18'%3E%3C/line%3E%3C/svg%3E");
  mask-size: contain;
  -webkit-mask-size: contain;
  cursor: pointer;
}

/* Hint texte sous le champ */
.search-modal-hint {
  text-align: center;
  font-size: 0.875rem;
  color: rgba(255, 255, 255, 0.7);
}

/* Bouton fermer */
.search-modal-close {
  position: absolute;
  top: -60px;
  right: 0;
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.1);
  border: none;
  border-radius: 50%;
  color: #ffffff;
  cursor: pointer;
  transition: background-color 0.3s ease, transform 0.3s ease;
}

.search-modal-close:hover {
  background: rgba(255, 255, 255, 0.2);
  transform: rotate(90deg);
}

.search-modal-close svg {
  width: 24px;
  height: 24px;
}

/* Body lock quand modal ouverte */
body.search-modal-open {
  overflow: hidden;
}

/* Responsive */
@media (max-width: 767px) {
  .search-modal-content {
    width: 95%;
  }

  .search-modal-input {
    font-size: 1rem;
    padding: 1.25rem 1.25rem 1.25rem 3.5rem;
  }

  .search-modal-icon {
    left: 1rem;
    width: 24px;
    height: 24px;
  }

  .search-modal-close {
    top: -50px;
    width: 40px;
    height: 40px;
  }

  .search-modal-close svg {
    width: 20px;
    height: 20px;
  }
}
