/* ========================================
   NOUVEAU HEADER - CSS COMPLET
======================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: 'Libre Baskerville', serif;
  line-height: 1.6;
}

/* TOPBAR */
.topbar {
  background-color: #F5EFC1;
  color: #000;
  padding: 8px 20px;
  text-align: center;
  font-size: 14px;
}

.topbar a {
  color: #000;
  text-decoration: underline;
}

/* HEADER PRINCIPAL */
.main-header {
  background: #fff;
  position: sticky;
  top: 0;
  z-index: 1000;
  border-bottom: 1px solid #e0e0e0;
}

.header-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 20px;
}

/* LIGNE 1: Top header */
.header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 80px;
}

/* ZONES GAUCHE/DROITE */
.header-left,
.header-right {
  display: flex;
  align-items: center;
  gap: 20px;
  flex: 1;
}

.header-right {
  justify-content: flex-end;
}

/* CENTRE - LOGO */
.header-center {
  flex: 0 0 auto;
}

.logo {
  font-size: 24px;
  font-weight: bold;
  color: #000;
  text-decoration: none;
  text-align: center;
  line-height: 1.2;
}

.logo span {
  font-size: 12px;
  font-weight: normal;
  display: block;
}

/* BOUTONS HEADER */
.hamburger-btn,
.search-btn,
.account-btn {
  background: none;
  border: none;
  font-size: 18px;
  color: #000;
  cursor: pointer;
  padding: 10px;
  transition: opacity 0.3s ease;
}

.hamburger-btn:hover,
.search-btn:hover,
.account-btn:hover {
  opacity: 0.7;
}

/* Masquer le hamburger sur desktop uniquement */
@media (min-width: 769px) {
  .hamburger-btn {
    display: none;
  }
}

/* PANIER */
.cart-btn {
  color: #000;
  text-decoration: none;
  position: relative;
  padding: 10px;
  transition: opacity 0.3s ease;
}

.cart-btn:hover {
  opacity: 0.7;
}

.cart-count {
  position: absolute;
  top: 2px;
  right: 2px;
  background: #000;
  color: #fff;
  border-radius: 50%;
  width: 18px;
  height: 18px;
  font-size: 11px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: bold;
}

/* NAVIGATION PRINCIPALE */
.main-navigation {
  position: relative;
  border-top: 1px solid #f0f0f0;
}

.nav-menu {
  display: flex;
  justify-content: center;
  list-style: none;
  margin: 0;
  padding: 20px 0;
}

.nav-item {
  margin: 0 30px;
}

.nav-link {
  color: #000;
  text-decoration: none;
  font-size: 14px;
  text-transform: uppercase;
  font-weight: 400;
  letter-spacing: 1px;
  padding: 10px 15px;
  transition: color 0.3s ease;
  display: block;
}

.nav-link:hover {
  color: #666;
}

/* MEGA DROPDOWN */
.mega-dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  right: 0;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0,0,0,0.1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.3s ease;
  z-index: 999;
  pointer-events: none; /* Évite les interactions quand fermé */
}

/* Ouverture du dropdown avec la classe .active (contrôlé par JS) */
.mega-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  pointer-events: auto; /* Réactive les interactions */
}

.mega-content {
  max-width: 1200px;
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 40px;
}

.mega-column h4 {
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 20px;
  color: #000;
  font-weight: bold;
}

.mega-column a {
  display: block;
  color: #666;
  text-decoration: none;
  margin-bottom: 10px;
  font-size: 14px;
  transition: color 0.3s ease;
}

.mega-column a:hover {
  color: #000;
}

/* SEARCH OVERLAY - CACHÉE PAR DÉFAUT - FIX AFFICHAGE INTEMPESTIF */
.search-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.8);
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  display: none; /* 🚨 FIX: Masquer complètement par défaut */
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.search-overlay.active {
  opacity: 1;
  visibility: visible;
  display: block; /* 🚨 FIX: Réafficher quand actif */
}

.search-content {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  width: 90%;
  max-width: 600px;
  padding: 40px;
  text-align: center;
}

.search-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
}

.search-content h2 {
  margin-bottom: 30px;
  font-size: 24px;
  color: #000;
}

.search-content input {
  width: 100%;
  padding: 15px;
  border: 1px solid #e0e0e0;
  font-size: 16px;
  outline: none;
}

.search-content input:focus {
  border-color: #000;
}

/* MOBILE MENU */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  background: #fff;
  z-index: 2000;
  transform: translateX(-100%);
  transition: transform 0.3s ease;
}

.mobile-menu.active {
  transform: translateX(0);
}

.mobile-menu-header {
  padding: 20px;
  border-bottom: 1px solid #f0f0f0;
}

.mobile-search {
  position: relative;
}

.mobile-search input {
  width: 100%;
  padding: 15px 50px 15px 15px;
  border: 1px solid #e0e0e0;
  font-size: 16px;
}

.mobile-menu-close {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
}

.mobile-nav-list {
  list-style: none;
  padding: 20px 0;
}

.mobile-nav-list li {
  border-bottom: 1px solid #f0f0f0;
}

.mobile-nav-list a {
  display: block;
  padding: 20px;
  color: #000;
  text-decoration: none;
  text-transform: uppercase;
  font-size: 16px;
  transition: background 0.3s ease;
}

.mobile-nav-list a:hover {
  background: #f8f8f8;
}

/* ACCOUNT OVERLAY - FIX AFFICHAGE INTEMPESTIF */
.account-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3000;
  opacity: 0;
  visibility: hidden;
  display: none; /* 🚨 FIX: Masquer complètement par défaut */
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.account-overlay.active {
  opacity: 1;
  visibility: visible;
  display: block; /* 🚨 FIX: Réafficher quand actif */
}

.account-modal {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  width: 90%;
  max-width: 500px;
  max-height: 90vh;
  overflow-y: auto;
  font-family: 'Libre Baskerville', serif;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
}

.account-modal-header {
  position: relative;
  padding: 30px 30px 20px;
  border-bottom: 1px solid #f0f0f0;
  text-align: center;
}

.account-modal-close {
  position: absolute;
  top: 15px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #666;
  transition: color 0.3s ease;
}

.account-modal-close:hover {
  color: #000;
}

.account-modal-title {
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 2px;
  color: #000;
  margin: 0;
  font-weight: 400;
}

.account-modal-subtitle {
  font-size: 24px;
  color: #000;
  margin: 15px 0 0;
  font-weight: 400;
  line-height: 1.3;
}

.account-modal-body {
  padding: 30px;
}

/* Boutons de connexion sociale */
.social-login-buttons {
  display: flex;
  flex-direction: column;
  gap: 15px;
  margin-bottom: 30px;
}

.social-login-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 12px 20px;
  border: 1px solid #e0e0e0;
  background: #fff;
  color: #000;
  text-decoration: none;
  font-size: 14px;
  transition: all 0.3s ease;
  cursor: pointer;
}

.social-login-btn:hover {
  background: #f8f8f8;
  border-color: #000;
}

.social-login-btn i {
  font-size: 16px;
}

/* Formulaire de connexion */
.account-form {
  margin-bottom: 30px;
}

.form-group {
  margin-bottom: 20px;
}

.form-group label {
  display: block;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: #000;
  margin-bottom: 8px;
}

.form-group input[type="email"],
.form-group input[type="password"],
.form-group input[type="text"] {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid #ccc;
  background: transparent;
  font-size: 14px;
  font-family: inherit;
  color: #000;
  outline: none;
  transition: border-color 0.3s ease;
}

.form-group input[type="email"]:focus,
.form-group input[type="password"]:focus,
.form-group input[type="text"]:focus {
  border-bottom-color: #000;
}

.form-group input[type="email"]::placeholder,
.form-group input[type="password"]::placeholder,
.form-group input[type="text"]::placeholder {
  color: #999;
}

.checkbox-group {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 20px;
}

.checkbox-group input[type="checkbox"] {
  margin-top: 3px;
}

.checkbox-group label {
  font-size: 12px;
  color: #666;
  line-height: 1.4;
  text-transform: none;
  letter-spacing: normal;
}

.checkbox-group label a {
  color: #666;
  text-decoration: underline;
}

.forgot-password {
  text-align: center;
  margin-bottom: 30px;
}

.forgot-password a {
  color: #000;
  text-decoration: underline;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.login-button {
  width: 100%;
  padding: 15px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
  margin-bottom: 30px;
}

.login-button:hover {
  background: #fff;
  color: #000;
}

.divider {
  text-align: center;
  margin: 30px 0;
  position: relative;
  color: #999;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.divider::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 0;
  right: 0;
  height: 1px;
  background: #e0e0e0;
  z-index: 1;
}

.divider span {
  background: #fff;
  padding: 0 20px;
  position: relative;
  z-index: 2;
}

/* Section création de compte */
.create-account-section {
  background: #f8f8f8;
  padding: 30px;
  margin: -30px -30px 0;
  text-align: center;
}

.create-account-section h3 {
  font-size: 16px;
  color: #000;
  margin-bottom: 15px;
  font-weight: 400;
}

.create-account-section p {
  font-size: 14px;
  color: #666;
  line-height: 1.6;
  margin-bottom: 25px;
}

.create-account-btn {
  display: inline-block;
  padding: 15px 30px;
  background: #fff;
  color: #000;
  border: 1px solid #000;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.3s ease;
  font-family: inherit;
}

.create-account-btn:hover {
  background: #000;
  color: #fff;
}

/* Styles pour utilisateur connecté */
.logged-in-content {
  text-align: center;
}

.logged-in-content p {
  font-size: 16px;
  margin-bottom: 30px;
  color: #000;
}

.account-links {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.account-link {
  display: block;
  padding: 15px 20px;
  border: 1px solid #e0e0e0;
  color: #000;
  text-decoration: none;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
  transition: all 0.3s ease;
  text-align: center;
}

.account-link:hover {
  background: #f8f8f8;
  border-color: #000;
}

.account-link.logout-link {
  background: #000;
  color: #fff;
  border-color: #000;
}

.account-link.logout-link:hover {
  background: #fff;
  color: #000;
}

/* Responsive modal */
@media (max-width: 768px) {
  .account-modal {
    width: 95%;
    max-width: none;
    max-height: 95vh;
  }
  
  .account-modal-header {
    padding: 20px 20px 15px;
  }
  
  .account-modal-body {
    padding: 20px;
  }
  
  .create-account-section {
    padding: 20px;
    margin: -20px -20px 0;
  }
  
  .account-modal-subtitle {
    font-size: 20px;
  }
}

/* RESPONSIVE */
@media (max-width: 768px) {
  .hamburger-btn {
    display: block;
  }
  
  .main-navigation {
    display: none;
  }
  
  .header-top {
    height: 60px;
  }
  
  .logo {
    font-size: 20px;
  }
  
  .mega-content {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
    padding: 20px;
  }
}

/* ========================================
   FOOTER - STYLES ORIGINAUX
======================================== */

.site-footer {
  background-color: #FFFFFF;
  font-family: 'Libre Baskerville', serif;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  border-top: 1px solid #e0e0e0;
}

.footer-top-section,
.footer-bottom-section,
.footer-final-row {
  width: 100vw;
  margin-left: calc(50% - 50vw);
}

/* Newsletter pleine largeur */
.footer-top-section.full-width-newsletter {
  width: 100vw !important;
  margin-left: calc(50% - 50vw) !important;
  padding: 80px 60px !important;
  background: #f5f5f5 !important;
}

.footer-top-section .stay-in-touch {
  max-width: 1400px;
  margin: 0 auto;
  text-align: center;
}

.footer-column.stay-in-touch h2 {
  text-align: center;
}

.footer-column.stay-in-touch p {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.footer-columns-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 60px;
  padding: 60px;
  background: #fff;
}

.footer-column h2 {
  font-size: 12px;
  text-transform: uppercase;
  margin-bottom: 25px;
  letter-spacing: 1.5px;
  color: #000;
}

.footer-column p {
  font-size: 14px;
  color: #000;
  line-height: 1.6;
  margin-bottom: 30px;
}

.footer-column ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-column ul li {
  margin-bottom: 10px;
}

.footer-column ul li a {
  font-size: 14px;
  color: #666;
  text-decoration: none;
  transition: color 0.3s ease;
}

.footer-column ul li a:hover {
  color: #000;
}

/* Newsletter form */
.newsletter-form {
  max-width: 400px;
  margin: 0 auto;
}

.email-input-wrapper {
  position: relative;
  margin-bottom: 15px;
}

.email-input-wrapper input[type="email"] {
  width: 100%;
  padding: 12px 0;
  border: none;
  border-bottom: 1px solid #ccc;
  background: transparent;
  font-size: 14px;
  outline: none;
  transition: border-color 0.3s;
  color: #000;
}

.email-input-wrapper input[type="email"]:focus {
  border-bottom-color: #000;
}

.email-label {
  position: absolute;
  left: 0;
  top: 12px;
  color: #999;
  font-size: 12px;
  text-transform: uppercase;
  pointer-events: none;
  transition: all 0.3s;
}

.email-input-wrapper input[type="email"]:focus + .email-label,
.email-input-wrapper input[type="email"]:not(:placeholder-shown) + .email-label {
  top: -10px;
  font-size: 10px;
}

.checkbox-wrapper {
  margin-bottom: 30px;
  font-size: 11px;
  color: #666;
  line-height: 1.4;
}

.checkbox-wrapper label a {
  color: #666;
  text-decoration: underline;
}

.subscribe-btn {
  width: 100%;
  padding: 15px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s;
  font-family: inherit;
}

.subscribe-btn:hover {
  background: #fff;
  color: #000;
}

/* Contact section */
.footer-column .contact-us {
  margin-top: 30px;
  padding: 15px 40px;
  background: #000;
  color: #fff;
  border: 1px solid #000;
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: 2px;
  cursor: pointer;
  transition: all 0.3s;
}

.footer-column .contact-us:hover {
  background: #fff;
  color: #000;
}

/* Réseaux sociaux */
.social-links {
  display: flex;
  gap: 15px;
  padding: 0;
  margin: 0;
}

.social-links li {
  list-style: none;
}

.social-links li a {
  font-size: 20px;
  color: #000;
  transition: opacity 0.3s ease;
}

.social-links li a:hover {
  opacity: 0.6;
}

/* Ligne finale */
.footer-final-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 40px 60px;
  border-top: 1px solid #ccc;
  background-color: #fff;
}

.language-selector {
  display: none !important;
}

.footer-link {
  font-size: 12px;
  text-transform: uppercase;
  color: #000;
  text-decoration: none;
  letter-spacing: 1.5px;
  transition: opacity 0.3s ease;
}

.footer-link:hover {
  opacity: 0.6;
}

/* Bouton flottant retour en haut */
.back-to-top-float {
  position: fixed;
  bottom: 40px;
  right: 40px;
  background: #000;
  border: none;
  border-radius: 50%;
  width: 50px;
  height: 50px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 20px;
  color: #fff;
  box-shadow: 0 2px 10px rgba(0,0,0,0.2);
  transition: all 0.3s ease;
  opacity: 0;
  visibility: hidden;
  z-index: 1000;
}

.back-to-top-float.show {
  opacity: 1;
  visibility: visible;
}

.back-to-top-float:hover {
  transform: translateY(-5px);
  box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

/* Footer Responsive */
@media (max-width: 1024px) {
  .footer-columns-grid {
    grid-template-columns: repeat(2, 1fr);
    padding: 40px;
    gap: 40px;
  }

  .footer-final-row {
    padding: 30px 40px;
  }
}

@media (max-width: 768px) {
  .footer-columns-grid {
    grid-template-columns: 1fr;
    padding: 30px;
    gap: 30px;
  }

  .footer-final-row {
    flex-direction: column;
    text-align: center;
    gap: 20px;
    padding: 20px 30px;
  }

  .back-to-top-float {
    bottom: 20px;
    right: 20px;
    width: 45px;
    height: 45px;
    font-size: 18px;
  }
}
