/* =================================================================
   BRAZZA-MARKET — HEADER UNIVERSEL (v2, SANS CONFLITS)
   Rôle de ce fichier :
   • Mode sombre (variables + transitions + ajustements des PAGES)
   • Accessoires du header (thème, avatar, hamburger legacy)
   • Compléments : recherche, dropdowns, menu mobile
   ❌ NE GÈRE PAS la géométrie du header (position, hauteurs, padding
     du body) → c'est header-pro.css qui en est la SEULE source.
================================================================= */

/* =================================================================
   1. VARIABLES DU MODE SOMBRE
================================================================= */
body.dark-mode {
  --bg-body: #1a1a2e;
  --bg-white: #16213e;
  --text-main: #eaeaea;
  --text-muted: #b8b8b8;
  --border: #2d2d44;
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 8px 32px rgba(0, 0, 0, 0.5);
}

/* =================================================================
   2. TRANSITIONS FLUIDES
================================================================= */
body,
header,
nav,
.menu li a,
.btn-nav,
.user-avatar-container,
.category-card,
.boutique-card,
.step-card,
.testimonial-card,
.search-box,
.search-field,
.search-btn,
.footer-col,
.footer-menu li a,
.footer-contact-list li,
.social-link,
.badge,
.hero,
.hero-title,
.hero-subtitle,
.section-title,
.section-subtitle,
.category-content h3,
.category-content p,
.boutique-info h3,
.boutique-info p,
.step-card h3,
.step-card p,
.cta-text h2,
.cta-text p,
.cta-feature,
.footer-desc,
.footer-col h3,
.copyright,
.credits,
.legal-links a {
  transition: background-color 0.4s ease, color 0.4s ease, border-color 0.4s ease, box-shadow 0.4s ease;
}

/* =================================================================
   3. AJUSTEMENTS MODE SOMBRE — COMPOSANTS DE PAGE (hors header)
   (la couleur du header est gérée par header-pro.css)
================================================================= */
body.dark-mode .menu li a {
  color: var(--text-main);
}

body.dark-mode .menu li a:hover {
  background: rgba(70, 149, 92, 0.2);
}

body.dark-mode .btn-outline {
  background: transparent;
  color: var(--primary);
}

body.dark-mode .category-card,
body.dark-mode .boutique-card,
body.dark-mode .step-card,
body.dark-mode .testimonial-card {
  background: var(--bg-white);
  border-color: var(--border);
}

body.dark-mode .search-box {
  background: var(--bg-white);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

body.dark-mode .search-field input {
  color: var(--text-main);
}

body.dark-mode .search-field input::placeholder {
  color: var(--text-muted);
}

body.dark-mode .search-divider {
  background: var(--border);
}

body.dark-mode .section-tag {
  background: rgba(70, 149, 92, 0.2);
}

body.dark-mode .hero {
  background: linear-gradient(135deg, rgba(10, 30, 20, 0.95) 0%, rgba(20, 60, 40, 0.9) 100%),
              url('https://images.unsplash.com/photo-1523482580672-f109ba8cb9be?w=1920&q=80');
}

body.dark-mode .cta-vendeur {
  background: linear-gradient(135deg, #0f2e1f 0%, #1a4a30 100%);
}

body.dark-mode .how-it-works {
  background: linear-gradient(135deg, #1a1a2e 0%, #16213e 100%);
}

body.dark-mode .categories-section,
body.dark-mode .featured-section {
  background: var(--bg-body);
}

body.dark-mode .footer-menu li a,
body.dark-mode .footer-contact-list li,
body.dark-mode .footer-desc,
body.dark-mode .copyright,
body.dark-mode .credits {
  color: rgba(255, 255, 255, 0.8);
}

/* =================================================================
   4. ACCESSOIRES DU HEADER (legacy — sans géométrie)
================================================================= */
/* Conteneur des actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* --- BOUTON THÈME (LUNE) --- */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: rgba(70, 149, 92, 0.1);
  border: 2px solid rgba(70, 149, 92, 0.3);
  cursor: pointer;
  transition: all 0.3s ease;
  color: var(--primary);
  font-size: 18px;
  position: relative;
  overflow: hidden;
}

.theme-toggle:hover {
  background: rgba(70, 149, 92, 0.2);
  transform: rotate(15deg) scale(1.1);
  border-color: var(--primary);
}

.theme-toggle.rotating i {
  animation: rotateIcon 0.5s ease;
}

@keyframes rotateIcon {
  0%   { transform: rotate(0deg) scale(1); }
  50%  { transform: rotate(180deg) scale(1.2); }
  100% { transform: rotate(360deg) scale(1); }
}

body.dark-mode .theme-toggle {
  background: rgba(255, 215, 0, 0.1);
  border-color: rgba(255, 215, 0, 0.5);
  color: #ffd700;
}

body.dark-mode .theme-toggle:hover {
  background: rgba(255, 215, 0, 0.2);
  border-color: #ffd700;
}

/* --- AVATAR UTILISATEUR --- */
.user-avatar-container {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 50px;
  background: rgba(70, 149, 92, 0.15);
  transition: var(--transition);
  text-decoration: none;
}

.user-avatar-container:hover {
  background: rgba(70, 149, 92, 0.2);
}

.user-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: linear-gradient(135deg, #46955c, #2d7a3e);
  color: white;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 14px;
  font-family: 'Poppins', sans-serif;
  box-shadow: 0 2px 8px rgba(70, 149, 92, 0.3);
}

.user-name {
  font-weight: 600;
  font-size: 14px;
  color: var(--text-main);
}

body.dark-mode .user-avatar-container {
  background: rgba(70, 149, 92, 0.25);
}

body.dark-mode .user-name {
  color: #ffffff;
}

/* --- HAMBURGER (legacy, sans position fixe forcée) --- */
.humburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 4px;
  background: transparent;
  padding: 8px 10px;
  position: relative;
  z-index: 1003;
}

.humburger span {
  width: 28px;
  height: 3px;
  background-color: #46955c;
  border-radius: 2px;
  transition: all 0.3s ease;
}

body.dark-mode .humburger span {
  background-color: #73dd91;
}

body.dark-mode .humburger:hover span {
  background-color: #73dd91;
}

/* Animation quand le menu est ouvert */
.menu-toggle:checked ~ .humburger span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}
.menu-toggle:checked ~ .humburger span:nth-child(2) {
  opacity: 0;
}
.menu-toggle:checked ~ .humburger span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* =================================================================
   5. MENU MOBILE — TOGGLE THÈME
================================================================= */
.mobile-menu .theme-toggle-mobile {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 15px 20px;
  color: white;
  border-radius: 10px;
  margin-top: 10px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
  transition: background 0.3s ease;
}

.mobile-menu .theme-toggle-mobile:hover {
  background: rgba(255, 255, 255, 0.2);
}

.mobile-menu .theme-toggle-mobile i {
  font-size: 20px;
}

/* =================================================================
   6. BARRE DE RECHERCHE (complément, cohérent avec header-pro)
================================================================= */
.header-search {
  display: flex;
  align-items: center;
  background: #f5f7fa;
  border: 1px solid #e0e0e0;
  border-radius: 50px;
  padding: 6px 14px;
  margin: 0 16px;
  flex: 1;
  max-width: 380px;
  transition: all 0.25s ease;
}
body.dark-mode .header-search { background: #1a1f2e; border-color: #2d3748; }
.header-search:focus-within {
  border-color: var(--primary, #46955c);
  background: white;
  box-shadow: 0 0 0 3px rgba(70, 149, 92, 0.15);
}
body.dark-mode .header-search:focus-within { background: #0f1419; }
.header-search .search-icon { color: #999; font-size: 14px; margin-right: 10px; }
body.dark-mode .header-search .search-icon { color: #73dd91; }
.header-search-input {
  flex: 1; border: none; outline: none; background: transparent;
  font-size: 14px; color: var(--text-main, #2d3436);
  font-family: inherit;
}
.header-search-input::placeholder { color: #999; }

/* =================================================================
   7. DROPDOWNS NAV (Catégories + Arrondissements)
================================================================= */
.nav-dropdown { position: relative; }
.nav-dropdown-trigger {
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: inherit;
  display: inline-flex; align-items: center; gap: 6px;
}
.nav-dropdown-trigger i { font-size: 10px; transition: transform 0.2s ease; }
.nav-dropdown.open .nav-dropdown-trigger i { transform: rotate(180deg); }

.nav-dropdown-menu {
  position: absolute; top: calc(100% + 8px); left: 0;
  min-width: 260px; max-height: 480px; overflow-y: auto;
  background: white; border-radius: 14px;
  box-shadow: 0 12px 32px rgba(0, 0, 0, 0.12);
  padding: 10px 0;
  opacity: 0; visibility: hidden; transform: translateY(-8px);
  transition: all 0.2s ease;
  z-index: 1000;
}
body.dark-mode .nav-dropdown-menu { background: #1a1f2e; box-shadow: 0 12px 32px rgba(0,0,0,0.4); }
.nav-dropdown.open .nav-dropdown-menu {
  opacity: 1; visibility: visible; transform: translateY(0);
}

.dropdown-item-main {
  font-weight: 600; background: rgba(70, 149, 92, 0.08);
  border-radius: 8px; margin: 4px 8px;
}
body.dark-mode .dropdown-item-main { background: rgba(115, 221, 145, 0.1); }

.dropdown-divider {
  height: 1px; background: rgba(0,0,0,0.08);
  margin: 6px 0;
}
body.dark-mode .dropdown-divider { background: rgba(255,255,255,0.1); }

.dropdown-label {
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.5px; color: #999; padding: 6px 18px 4px;
}

/* =================================================================
   8. MENU MOBILE — DROPDOWNS ACCORDÉON
================================================================= */
.mobile-dropdown { margin: 4px 0; }
.mobile-dropdown-trigger {
  width: 100%; background: rgba(255,255,255,0.08);
  border: none; color: white; padding: 14px 20px;
  display: flex; justify-content: space-between; align-items: center;
  font-size: 16px; font-weight: 500; cursor: pointer;
  border-radius: 10px; font-family: inherit;
}
.mobile-dropdown-trigger i.fa-chevron-down { transition: transform 0.2s ease; }
.mobile-dropdown.open .mobile-dropdown-trigger i.fa-chevron-down { transform: rotate(180deg); }
.mobile-dropdown-content {
  max-height: 0; overflow: hidden;
  transition: max-height 0.3s ease;
  padding-left: 12px;
}
.mobile-dropdown.open .mobile-dropdown-content { max-height: 600px; overflow-y: auto; }
.mobile-sub-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 16px; color: rgba(255,255,255,0.9);
  font-size: 14px; text-decoration: none;
  border-radius: 8px; transition: background 0.2s;
}
.mobile-sub-item:hover { background: rgba(255,255,255,0.12); }
.mobile-sub-label {
  font-size: 11px; color: rgba(255,255,255,0.6); text-transform: uppercase;
  letter-spacing: 0.5px; padding: 8px 16px 4px; font-weight: 700;
}
.mobile-user-info {
  padding: 12px 20px; color: rgba(255,255,255,0.85); font-size: 0.9rem;
  text-align: center; border-bottom: 1px solid rgba(255,255,255,0.1);
}
.mobile-user-info span { font-size: 0.75rem; color: #73dd91; }

/* =================================================================
   9. RESPONSIVE (sans toucher au padding du body)
================================================================= */
@media (max-width: 900px) {
  .nav-actions { gap: 10px; }
  .theme-toggle { width: 36px; height: 36px; font-size: 16px; }
  .user-avatar-container { padding: 5px 10px; }
  .user-name { display: none; }
  .humburger { display: flex; padding: 6px 8px; }
  .humburger span { width: 24px; height: 2.5px; }
  .header-search { display: none; }
}

@media (max-width: 480px) {
  .humburger span { width: 22px; height: 2px; }
}

@media (min-width: 901px) and (max-width: 1100px) {
  .header-search { max-width: 220px; }
}