/* ================== BASE NAVBAR ================== */
body.navbar-offset {
  padding-top: 80px;
}

.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 1000;
  background: #ffffff;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  transition: box-shadow 0.2s ease;
}

.navbar.navbar--solid {
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
}

/* ================== BOTTOM NAV (MOBILE) ================== */
.bottom-nav {
  display: none;
  position: fixed;
  left: 12px;
  right: 12px;
  bottom: calc(14px + env(safe-area-inset-bottom));
  height: 72px;
  background: #ffffff;
  border-radius: 22px;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.12);
  padding: 8px 14px calc(8px + env(safe-area-inset-bottom));
  align-items: center;
  justify-content: space-between;
  z-index: 120;
}

.bottom-nav__item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  text-decoration: none;
  color: #6b7280;
  font-size: 11px;
  font-weight: 600;
  text-align: center;
}

.bottom-nav__item i {
  width: 20px;
  height: 20px;
}

.bottom-nav__item--center {
  position: relative;
  color: #4b5563;
}

.bottom-nav__fab {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: #5b236e;
  color: #ffffff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 10px 20px rgba(91, 35, 110, 0.35);
  transform: translateY(-22px);
}

.bottom-nav__fab i {
  width: 22px;
  height: 22px;
}

.bottom-nav__label {
  margin-top: -14px;
}

/* ================== CONTAINER ================== */
.navbar-container {
  width: 100%;
  max-width: 1400px;
  margin: 0 auto;
  padding: 0.75rem clamp(1.5rem, 4vw, 3rem);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

/* ================== LOGO ================== */
.navbar-logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  text-decoration: none;
  z-index: 101;
}

.icone-header {
  height: 48px;
  width: auto;
  display: block;
  transition: transform 0.25s ease;
}

.navbar-logo:hover .icone-header {
  transform: scale(1.2);
}

.logo-text {
  font-size: 1.5rem;
  font-weight: 700;
  color: #5b236e;
  letter-spacing: -0.02em;
}

/* ================== STORES ZONE (CENTER) ================== */
.navbar-stores {
  display: none; /* Masqué par défaut, affiché uniquement sur la HOME */
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  margin: 0 auto;
}

body.landing-body .navbar-stores {
  display: flex; /* Affiché uniquement sur la page d'accueil */
}

.navbar-stores-text {
  font-size: 0.75rem;
  font-weight: 600;
  color: #6b7280;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.navbar-stores-badges {
  display: flex;
  gap: 0.5rem;
  align-items: center;
}

.navbar-store-badge {
  display: block;
  transition: transform 0.2s ease, opacity 0.2s ease;
  opacity: 0.9;
}

.navbar-store-badge:hover {
  transform: translateY(-1px);
  opacity: 1;
}

.navbar-store-badge img {
  height: 32px;
  width: auto;
  display: block;
}

/* ================== ACTIONS ZONE ================== */
.navbar-actions {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  margin-left: auto;
  min-width: 0;
  flex-shrink: 1;
}

/* ================== BOUTONS ================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.5rem;
  font-size: 1rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 0.5rem;
  border: none;
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.btn i {
  width: 18px;
  height: 18px;
}

/* Bouton Nouvelle Annonce */
.btn-new-ad {
  background: #5b236e;
  color: #ffffff;
  font-weight: 600;
  box-shadow: 0 2px 8px rgba(91, 35, 110, 0.25);
  flex-shrink: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.btn-new-ad:hover {
  background: #5b236e;
  box-shadow: 0 2px 8px rgba(91, 35, 110, 0.25);
  transform: none;
}

/* Boutons auth (non connecté) */
.btn-login {
  background: transparent;
  color: #333;
  border: 1px solid #ddd;
}

.btn-login:hover {
  background: #f5f5f5;
}

[data-theme="dark"] .btn-login,
body.dark-mode .btn-login {
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.25);
}

[data-theme="dark"] .btn-login:hover,
body.dark-mode .btn-login:hover {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.4);
}

.btn-signup {
  background: #5b236e;
  color: #ffffff;
  font-weight: 600;
}

.btn-signup:hover {
  background: #481c57;
}

/* ================== LANDING NAV ANCHOR LINKS ================== */
.nav-anchor-link {
  color: rgba(255, 255, 255, 0.65);
  text-decoration: none;
  font-size: 0.875rem;
  font-weight: 500;
  padding: 0.375rem 0.75rem;
  border-radius: 8px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-anchor-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.06);
}

@media (max-width: 768px) {
  .nav-anchor-link {
    display: none;
  }
}

/* ================== LANG SELECTOR ================== */
.nav-lang-selector {
  position: relative;
}

.nav-lang-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.15);
  border-radius: 20px;
  cursor: pointer;
  font-size: 13px;
  font-weight: 700;
  font-family: inherit;
  transition: background 0.2s, border-color 0.2s;
}

.nav-lang-btn:hover {
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
}

.nav-lang-flag {
  display: block;
  border-radius: 2px;
}

.nav-lang-code {
  display: none;
}

.nav-lang-dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 6px);
  right: 0;
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,0.15);
  min-width: auto;
  padding: 6px 0;
  z-index: 1001;
}

.nav-lang-dropdown.active {
  display: block;
}

.nav-lang-option {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  padding: 8px 14px;
  border: none;
  background: none;
  cursor: pointer;
  font-size: 0;
  font-family: inherit;
}

.nav-lang-option img {
  border-radius: 2px;
}

.nav-lang-option:hover {
  background: none;
}

.nav-lang-option.active {
  background: none;
  opacity: 0.5;
}

/* ================== COMPTEUR ================== */
.navbar-counter {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 0.75rem;
  background: #f3e8f6;
  border-radius: 0.5rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.navbar-counter:hover {
  background: #e8d4ed;
  transform: translateY(-1px);
}

.navbar-counter i {
  width: 20px;
  height: 20px;
}
.navbar-counter i svg {
  stroke: url(#zapGradient) !important;
}

.counter-value {
  font-size: 0.95rem;
  font-weight: 700;
  color: #333;
}

/* Tooltip pour le compteur navbar */
.navbar-counter {
  position: relative;
  text-decoration: none;
}

.navbar-quota-tooltip {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-10px);
  background: #ffffff;
  border-radius: 12px;
  padding: 16px 20px;
  min-width: 240px;
  max-width: 300px;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15), 0 4px 12px rgba(0, 0, 0, 0.1);
  border: 1px solid #e5e7eb;
  z-index: 1001;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: all 0.3s ease;
}

/* Pont invisible pour garder le hover entre l'icône et la tooltip */
.navbar-quota-tooltip::before {
  content: '';
  position: absolute;
  top: -12px;
  left: 0;
  right: 0;
  height: 12px;
}

.navbar-counter:hover .navbar-quota-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: auto;
}

/* Flèche de la tooltip (vers le haut) */
.navbar-quota-tooltip-arrow {
  position: absolute;
  top: -8px;
  left: 50%;
  transform: translateX(-50%);
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #ffffff;
  filter: drop-shadow(0 -2px 2px rgba(0, 0, 0, 0.05));
}

.navbar-quota-tooltip-arrow::before {
  content: '';
  position: absolute;
  top: -1px;
  left: -10px;
  width: 0;
  height: 0;
  border-left: 10px solid transparent;
  border-right: 10px solid transparent;
  border-bottom: 10px solid #e5e7eb;
  z-index: -1;
}

/* Contenu de la tooltip */
.navbar-quota-tooltip-content {
  text-align: center;
}

.quota-tooltip-title {
  font-size: 1rem;
  font-weight: 700;
  color: #1f2937;
  margin: 0 0 8px 0;
}

.quota-tooltip-text {
  font-size: 0.875rem;
  color: #6b7280;
  line-height: 1.5;
  margin: 0;
}

.quota-tooltip-text strong {
  color: #5b236e;
  font-weight: 700;
}

.quota-tooltip-upgrade {
  display: inline-block;
  margin-top: 12px;
  padding: 8px 16px;
  background: linear-gradient(135deg, #5b236e 0%, var(--flipiq-purple, #5b236e) 100%);
  color: #ffffff;
  font-size: 0.8rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 8px;
  transition: all 0.2s ease;
}

.quota-tooltip-upgrade:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(91, 35, 110, 0.3);
}

/* Premium style pour la tooltip */
.navbar-counter[data-premium="1"] .navbar-quota-tooltip {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%);
  border-color: #f59e0b;
}

.navbar-counter[data-premium="1"] .navbar-quota-tooltip-arrow {
  border-bottom-color: #fde68a;
}

.navbar-counter[data-premium="1"] .navbar-quota-tooltip-arrow::before {
  border-bottom-color: #f59e0b;
}

/* ================== MENU UTILISATEUR ================== */
.user-menu {
  position: relative;
}

.user-avatar {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.35rem 0.5rem 0.35rem 0.35rem;
  background: transparent;
  border: none;
  border-radius: 2rem;
  cursor: pointer;
  transition: all 0.2s ease;
}

.user-avatar:hover {
  background: #f5f5f5;
}

.avatar-letter {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: linear-gradient(135deg, #ff6b35 0%, #ff8c42 100%);
  color: #ffffff;
  font-size: 1rem;
  font-weight: 700;
  border-radius: 50%;
  text-transform: uppercase;
}

.chevron-icon {
  width: 16px;
  height: 16px;
  color: #666;
  transition: transform 0.2s ease;
}

.user-avatar[aria-expanded="true"] .chevron-icon {
  transform: rotate(180deg);
}

/* ================== DROPDOWN MENU ================== */
.user-dropdown {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: 0;
  min-width: 200px;
  background: #ffffff;
  border-radius: 0.75rem;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.15);
  padding: 0.5rem;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-10px);
  transition: all 0.2s ease;
  z-index: 1000;
}

.user-dropdown.active {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

/* Ouvrir au survol (desktop) */
@media (hover: hover) and (min-width: 769px) {
  .user-menu:hover .user-dropdown {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
  }
}

.dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.75rem 1rem;
  color: #333;
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  border-radius: 0.5rem;
  transition: all 0.2s ease;
}

.dropdown-item:hover {
  background: #f5f5f5;
}

.dropdown-item i {
  width: 18px;
  height: 18px;
  color: #666;
}

.dropdown-item.logout {
  color: #dc2626;
}

.dropdown-item.logout i {
  color: #dc2626;
}

.dropdown-item.logout:hover {
  background: #fef2f2;
}

.dropdown-divider {
  margin: 0.5rem 0;
  border: none;
  border-top: 1px solid #e5e5e5;
}

/* ================== MOBILE MENU ================== */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px;
  z-index: 101;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2.5px;
  background: #333;
  border-radius: 2px;
  transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
  transform: rotate(45deg) translate(7px, 7px);
}

.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}

.menu-toggle.active span:nth-child(3) {
  transform: rotate(-45deg) translate(7px, -7px);
}

.menu-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 99;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.menu-overlay.active {
  display: block;
  opacity: 1;
}

/* ================== RESPONSIVE ================== */

/* Écrans moyens - Réduire la taille des éléments */
@media (max-width: 1100px) {
  .navbar-container {
    padding: 0.75rem clamp(1rem, 3vw, 2rem);
  }

  .navbar-actions {
    gap: 0.5rem;
  }

  .btn {
    padding: 0.55rem 1rem;
    font-size: 0.875rem;
  }

  .btn i {
    width: 16px;
    height: 16px;
  }

  .icone-header {
    height: 42px;
  }

  .navbar-counter {
    padding: 0.45rem 0.65rem;
    gap: 0.4rem;
  }

  .navbar-counter i {
    width: 18px;
    height: 18px;
  }

  .counter-value {
    font-size: 0.875rem;
  }

  .avatar-letter {
    width: 36px;
    height: 36px;
    font-size: 0.9rem;
  }
}

@media (max-width: 960px) {
  body.navbar-offset {
    padding-top: 70px;
  }

  .navbar-container {
    padding: 0.6rem clamp(1rem, 4vw, 1.5rem);
  }

  .menu-toggle {
    display: flex;
    min-width: 44px;
    min-height: 44px;
    align-items: center;
    justify-content: center;
  }

  .icone-header {
    height: 42px;
  }

  .logo-text {
    font-size: 1.25rem;
  }

  /* Masquer la section stores sur mobile/tablette */
  .navbar-stores {
    display: none !important;
  }

  .navbar-actions {
    position: fixed;
    top: 0;
    right: -100%;
    height: 100vh;
    width: 320px;
    max-width: 85vw;
    background: #ffffff;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: 90px 20px 20px;
    margin: 0;
    gap: 1rem;
    box-shadow: -4px 0 24px rgba(0, 0, 0, 0.2);
    transition: right 0.3s ease;
    overflow-y: auto;
  }

  .navbar-actions.active {
    right: 0;
  }

  .btn-new-ad,
  .btn-login,
  .btn-signup {
    width: 100%;
    justify-content: center;
    padding: 1rem 1.5rem;
    font-size: 1rem;
  }

  .navbar-counter {
    width: 100%;
    justify-content: center;
    padding: 1rem;
  }

  .user-menu {
    width: 100%;
  }

  .user-avatar {
    width: 100%;
    justify-content: center;
    padding: 1rem;
    border-radius: 0.5rem;
    background: #f5f5f5;
  }

  .user-dropdown {
    position: static;
    min-width: 100%;
    margin-top: 0.5rem;
    box-shadow: none;
    border: 1px solid #e5e5e5;
  }

  .user-dropdown.active {
    display: block;
  }

  .user-dropdown:not(.active) {
    display: none;
  }
}

@media (max-width: 720px) {
  .navbar-actions {
    width: 280px;
    padding: 80px 16px 16px;
  }

  .icone-header {
    height: 38px;
  }

  .logo-text {
    font-size: 1.1rem;
  }
}

@media (max-width: 768px) {
  .navbar {
    display: none;
  }

  body.navbar-offset {
    padding-top: 0;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .bottom-nav {
    display: flex;
  }

  .bottom-nav__item {
    min-height: 44px;
    min-width: 44px;
  }
}

@media (max-width: 480px) {
  body.navbar-offset {
    padding-top: 0;
    padding-bottom: calc(96px + env(safe-area-inset-bottom));
  }

  .navbar-actions {
    width: 260px;
  }
}

/* ================== DARK MODE ================== */
[data-theme="dark"] body,
body.dark-mode {
  background-color: #111827 !important;
  color: #F9FAFB !important;
}

[data-theme="dark"] .navbar,
body.dark-mode .navbar {
  background: #1F2937;
  border-bottom-color: #374151;
}

[data-theme="dark"] .navbar-logo img.logo-light,
body.dark-mode .navbar-logo img.logo-light {
  display: none !important;
}

[data-theme="dark"] .navbar-logo img.logo-dark,
body.dark-mode .navbar-logo img.logo-dark {
  display: block !important;
  filter: brightness(2) saturate(0.6);
}

[data-theme="dark"] .btn-new-ad,
body.dark-mode .btn-new-ad {
  background: #5b236e !important;
  border-color: #5b236e !important;
  color: #fff !important;
}

[data-theme="dark"] .navbar-counter,
body.dark-mode .navbar-counter {
  background: #374151;
}

[data-theme="dark"] .navbar-counter:hover,
body.dark-mode .navbar-counter:hover {
  background: #4B5563;
}

[data-theme="dark"] .counter-value,
body.dark-mode .counter-value {
  color: #F9FAFB;
}

[data-theme="dark"] .navbar-counter i svg,
body.dark-mode .navbar-counter i svg {
  stroke: url(#zapGradient) !important;
}

[data-theme="dark"] .user-avatar:hover,
body.dark-mode .user-avatar:hover {
  background: #374151;
}

[data-theme="dark"] .chevron-icon,
body.dark-mode .chevron-icon {
  color: #9CA3AF;
}

[data-theme="dark"] .user-dropdown,
body.dark-mode .user-dropdown {
  background: #1F2937;
  border-color: #374151;
}

[data-theme="dark"] .dropdown-item,
body.dark-mode .dropdown-item {
  color: #F9FAFB;
}

[data-theme="dark"] .dropdown-item:hover,
body.dark-mode .dropdown-item:hover {
  background: #374151;
}

[data-theme="dark"] .dropdown-item.logout,
body.dark-mode .dropdown-item.logout {
  color: #ef4444;
}

[data-theme="dark"] .dropdown-item.logout i,
body.dark-mode .dropdown-item.logout i {
  color: #ef4444;
}

[data-theme="dark"] .dropdown-item.logout:hover,
body.dark-mode .dropdown-item.logout:hover {
  background: rgba(239, 68, 68, 0.1);
}

[data-theme="dark"] .dropdown-header,
body.dark-mode .dropdown-header {
  color: #F9FAFB;
}

[data-theme="dark"] .dropdown-divider,
body.dark-mode .dropdown-divider {
  border-color: #374151;
}

[data-theme="dark"] .nav-lang-dropdown,
body.dark-mode .nav-lang-dropdown {
  background: #1e293b;
  border: 1px solid #374151;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}

[data-theme="dark"] .nav-lang-option:hover,
body.dark-mode .nav-lang-option:hover {
  background: none;
}

[data-theme="dark"] .nav-lang-option.active,
body.dark-mode .nav-lang-option.active {
  background: none;
  opacity: 0.5;
}

[data-theme="dark"] .navbar-quota-tooltip,
body.dark-mode .navbar-quota-tooltip {
  background: #1F2937;
  border-color: #374151;
}

[data-theme="dark"] .navbar-quota-tooltip-arrow,
body.dark-mode .navbar-quota-tooltip-arrow {
  border-bottom-color: #1F2937;
}

[data-theme="dark"] .quota-tooltip-title,
body.dark-mode .quota-tooltip-title {
  color: #F9FAFB;
}

[data-theme="dark"] .quota-tooltip-text,
body.dark-mode .quota-tooltip-text {
  color: #9CA3AF;
}

/* Keep premium golden tooltip in dark mode */
[data-theme="dark"] .navbar-counter[data-premium="1"] .navbar-quota-tooltip,
body.dark-mode .navbar-counter[data-premium="1"] .navbar-quota-tooltip {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  border-color: #f59e0b !important;
}

[data-theme="dark"] .navbar-counter[data-premium="1"] .navbar-quota-tooltip-arrow,
body.dark-mode .navbar-counter[data-premium="1"] .navbar-quota-tooltip-arrow {
  border-bottom-color: #fde68a !important;
}

[data-theme="dark"] .navbar-counter[data-premium="1"] .navbar-quota-tooltip-arrow::before,
body.dark-mode .navbar-counter[data-premium="1"] .navbar-quota-tooltip-arrow::before {
  border-bottom-color: #f59e0b !important;
}

[data-theme="dark"] .navbar-counter[data-premium="1"] .quota-tooltip-title,
body.dark-mode .navbar-counter[data-premium="1"] .quota-tooltip-title {
  color: #92400e !important;
}

[data-theme="dark"] .navbar-counter[data-premium="1"] .quota-tooltip-text,
body.dark-mode .navbar-counter[data-premium="1"] .quota-tooltip-text {
  color: #78350f !important;
}
