/* ============================================================
   WAFRICASTORE NAVIGATION CORE - Styles unifiés de navigation
   Ce fichier centralise TOUS les styles de navigation, header,
   menu mobile, barres secondaires, recherche, popups, etc.
   ============================================================ */

/* ===== RESET & BASE ===== */
html, body {
  font-family: 'Poppins', sans-serif;
  overflow-x: hidden;
}

html {
  -webkit-text-size-adjust: 100%;
  touch-action: manipulation;
}

body {
  touch-action: manipulation;
}

*, *::before, *::after {
  box-sizing: border-box;
}

input, select, textarea, button, a,
.hamburger-btn, .header-cart-icon, .header-profile-btn {
  touch-action: manipulation;
}

img, svg, video, canvas, iframe {
  max-width: 100%;
}

iframe {
  border: 0;
  display: block;
}

@media (max-width: 768px) {
  input, select, textarea {
    font-size: 16px !important;
  }
}

/* ===== ANNOUNCEMENT BAR ===== */
#top-announcement-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 36px;
  background-color: #da6f0d;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

#top-announcement-bar .announcement-text {
  color: white;
  font-size: 0.85rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  white-space: nowrap;
  animation: marqueeSlide 12s linear infinite;
  letter-spacing: 0.03em;
}

@keyframes marqueeSlide {
  0%   { transform: translateX(60%); opacity: 0; }
  8%   { opacity: 1; }
  45%  { transform: translateX(0%); }
  55%  { transform: translateX(0%); }
  92%  { opacity: 1; }
  100% { transform: translateX(-60%); opacity: 0; }
}

@media (max-width: 480px) {
  #top-announcement-bar .announcement-text { font-size: 0.78rem; }
}

/* Header top offset when announcement bar is present */
body.has-announcement header,
body.has-announcement-bar header {
  top: 36px !important;
}

/* ===== HEADER ===== */
header .max-w-7xl {
  width: 100% !important;
  max-width: 1280px !important;
}

header .h-16 {
  min-width: 0 !important;
  gap: clamp(0.35rem, 1vw, 0.9rem) !important;
}

header .h-16 > a:first-child,
#homeLink {
  min-width: 0 !important;
  flex: 0 1 auto !important;
}

header .h-16 > a:first-child span,
#homeLink span {
  min-width: 0 !important;
  overflow: hidden !important;
  text-overflow: ellipsis !important;
  white-space: nowrap !important;
  letter-spacing: 0 !important;
}

header .h-16 > .flex.items-center:last-child {
  flex: 0 0 auto !important;
  min-width: 0 !important;
  gap: clamp(0.35rem, 0.8vw, 0.75rem) !important;
}

header .h-16 > .flex.items-center {
  min-width: 0 !important;
  gap: clamp(0.35rem, 0.8vw, 0.75rem) !important;
}

/* ===== HERO SPACER ===== */
#hero-spacer {
  height: calc(36px + 7rem);
}

#hero-spacer.with-category-nav {
  height: calc(36px + 10rem);
}

@media (max-width: 639px) {
  #hero-spacer { height: calc(36px + 7rem); }
  #hero-spacer.with-category-nav { height: calc(36px + 10rem); }
}

/* No announcement bar variant */
body:not(.has-announcement):not(.has-announcement-bar) #hero-spacer {
  height: 4rem;
}

/* ===== DESKTOP NAVIGATION ===== */
.desktop-nav {
  display: none;
  min-width: 0 !important;
  flex: 1 1 auto !important;
  justify-content: center !important;
}

.desktop-nav-list {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
  min-width: 0 !important;
  flex-wrap: nowrap !important;
  gap: clamp(0.1rem, 0.45vw, 0.45rem) !important;
}

.desktop-nav-link {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  min-height: 40px !important;
  padding: 0.5rem clamp(0.45rem, 0.7vw, 0.85rem) !important;
  text-decoration: none;
  color: #001830;
  font-weight: 500;
  font-size: clamp(0.78rem, 0.8vw, 0.9rem) !important;
  font-family: 'Poppins', sans-serif;
  border-radius: 0.5rem;
  white-space: nowrap !important;
  letter-spacing: 0 !important;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.desktop-nav-link:hover {
  background-color: #fff5ee;
  color: #da6f0d;
}

.desktop-nav-link.active {
  color: #da6f0d;
}

.desktop-nav-link i {
  font-size: 0.95rem;
  flex-shrink: 0 !important;
}

.desktop-nav-link .fa-chevron-down {
  font-size: 0.65rem;
  margin-left: 0.2rem;
  transition: transform 0.2s ease;
}

/* Dropdown in desktop nav */
.desktop-nav-list .has-dropdown,
.desktop-has-dropdown {
  position: relative;
}

.desktop-nav-list .has-dropdown > .dropdown-menu,
.desktop-dropdown-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  background-color: white;
  list-style: none;
  margin: 0;
  padding: 0.5rem 0;
  box-shadow: 0 4px 16px rgba(0,0,0,0.12);
  border-radius: 0.5rem;
  min-width: 180px;
  z-index: 100;
}

.desktop-nav-list .has-dropdown:hover > .dropdown-menu,
.desktop-has-dropdown:hover .desktop-dropdown-menu {
  display: block;
}

.desktop-nav-list .has-dropdown:hover > .desktop-nav-link .fa-chevron-down,
.desktop-has-dropdown:hover > .desktop-nav-link .fa-chevron-down {
  transform: rotate(180deg);
}

.desktop-nav-list .dropdown-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 1rem;
  text-decoration: none;
  color: #001830;
  font-size: 0.88rem;
  font-weight: 500;
  font-family: 'Poppins', sans-serif;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.desktop-nav-list .dropdown-item:hover,
.desktop-dropdown-menu a:hover {
  background-color: #fff5ee;
  color: #da6f0d;
}

.desktop-nav-list .dropdown-item i {
  font-size: 0.9rem;
  width: 18px;
  text-align: center;
}

.desktop-dropdown-menu li {
  border-bottom: none;
}

.desktop-dropdown-menu a {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.5rem 1rem;
  text-decoration: none;
  color: #001830;
  font-size: 0.85rem;
  font-weight: 500;
  transition: background-color 0.2s ease, color 0.2s ease;
}

@media (min-width: 1024px) {
  .desktop-nav {
    display: flex !important;
  }
}

/* ===== DESKTOP SEARCH ===== */
.desktop-search-wrap {
  display: none;
  min-width: 0 !important;
  flex: 0 1 360px !important;
  max-width: min(360px, 30vw) !important;
}

.desktop-search-box {
  display: flex;
  align-items: center;
  min-width: 0 !important;
  background: #f3f4f6;
  border: 1px solid #e5e7eb;
  border-radius: 0.5rem;
  padding: 0.25rem 0.5rem;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.desktop-search-box:focus-within {
  border-color: #da6f0d;
  box-shadow: 0 0 0 3px rgba(218,111,13,0.15);
}

.desktop-search-icon {
  color: #9ca3af;
  font-size: 0.9rem;
  margin-right: 0.5rem;
}

.desktop-search-input {
  flex: 1;
  min-width: 0 !important;
  border: none;
  background: transparent;
  font-size: 0.9rem;
  font-family: 'Poppins', sans-serif;
  color: #1f2937;
  outline: none;
}

.desktop-search-input::placeholder {
  color: #9ca3af;
}

.desktop-img-search-btn,
.desktop-filter-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: 36px !important;
  min-width: 36px !important;
  height: 36px !important;
  padding: 0 !important;
  background: none;
  border: none;
  color: #9ca3af;
  cursor: pointer;
  border-radius: 0.25rem;
  line-height: 1 !important;
  transition: color 0.2s ease, background 0.2s ease;
}

.desktop-img-search-btn:hover,
.desktop-filter-btn:hover {
  color: #da6f0d;
  background: rgba(218,111,13,0.1);
}

.desktop-filter-btn {
  margin-left: 0.25rem;
}

.currency-btn-wrapper {
  position: relative !important;
  flex: 0 0 auto !important;
}

.currency-badge {
  position: absolute;
  top: -10px;
  right: -10px;
  background: #da6f0d;
  color: white;
  font-size: 0.6rem;
  font-weight: 700;
  padding: 1px 5px;
  border-radius: 9999px;
  line-height: 1.4;
  letter-spacing: 0.5px;
  z-index: 2;
  white-space: nowrap;
  pointer-events: none;
}

.currency-badge.hidden {
  display: none;
}

@media (min-width: 1024px) {
  .desktop-search-wrap {
    display: block !important;
  }
}

@media (max-width: 1180px) and (min-width: 1024px) {
  .desktop-search-wrap {
    display: none !important;
  }

  header .h-16 > a:first-child span,
  #homeLink span {
    max-width: 13rem !important;
  }
}

/* ===== HEADER ICONS (cart, notifications, orders) ===== */
.header-cart-icon,
.header-orders-icon,
.header-notifications-icon,
.hamburger-btn {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  flex: 0 0 auto !important;
  width: 42px !important;
  min-width: 42px !important;
  height: 42px !important;
  padding: 0 !important;
  margin: 0;
  background: none;
  border: none;
  color: #001830;
  cursor: pointer;
  border-radius: 12px !important;
  line-height: 1 !important;
  text-decoration: none !important;
  transition: color 0.2s ease, background-color 0.2s ease;
  position: relative;
}

.header-cart-icon:hover,
.header-orders-icon:hover,
.header-notifications-icon:hover {
  color: #da6f0d;
}

.header-cart-icon i,
.header-orders-icon i,
.header-notifications-icon i {
  font-size: 1.5rem;
}

.header-icon-text {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* ===== CART BADGE ===== */
#cart-count-badge,
.cart-count-badge {
  position: absolute;
  top: -4px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  background-color: #da6f0d;
  border-radius: 9999px;
  border: 2px solid white;
  display: none;
  align-items: center;
  justify-content: center;
  color: white;
  font-size: 10px;
  font-weight: 700;
  font-family: 'Poppins', sans-serif;
  line-height: 1;
  padding: 0 3px;
  transform: translate(10%, -10%);
  pointer-events: none !important;
}

#cart-count-badge.show,
.cart-count-badge.show {
  display: flex;
}

/* ===== HAMBURGER BUTTON ===== */
.hamburger-btn {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: #001830;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.hamburger-btn:hover {
  color: #da6f0d;
}

@media (min-width: 1024px) {
  .hamburger-btn {
    display: none !important;
  }
}

@media (max-width: 1023px) {
  .desktop-nav,
  .desktop-search-wrap {
    display: none !important;
  }

  .hamburger-btn {
    display: inline-flex !important;
  }
}

/* ===== MOBILE MENU / SIDEBAR ===== */
.mobile-menu {
  position: fixed;
  top: 0;
  left: 0;
  width: min(86vw, 320px) !important;
  max-width: 320px !important;
  height: 100dvh !important;
  max-height: 100dvh !important;
  background-color: rgba(0,0,0,0.9);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  z-index: var(--wafrica-mobile-menu-z-index, 10030) !important;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: stretch !important;
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--wafrica-header-height, 4rem) + 0.75rem) !important;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-100%);
  transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease;
  overflow-y: auto !important;
  overscroll-behavior: contain !important;
}

body.has-announcement .mobile-menu,
body.has-announcement-bar .mobile-menu {
  padding-top: calc(env(safe-area-inset-top, 0px) + var(--wafrica-announcement-height, 36px) + var(--wafrica-header-height, 4rem) + 0.75rem) !important;
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
  transform: translateX(0);
}

.mobile-menu ul {
  list-style-type: none;
  padding: 0;
  width: 100%;
  margin: 0 !important;
}

.mobile-menu li {
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-menu a {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  min-height: 48px !important;
  line-height: 1.35 !important;
  color: white;
  text-decoration: none;
  font-size: 1.1rem;
  font-weight: 500;
  padding: 1rem 1.5rem;
  text-align: left;
  transition: background-color 0.2s ease;
  width: 100%;
  box-sizing: border-box;
}

.mobile-menu a:hover {
  background-color: rgba(255,255,255,0.1);
}

.mobile-menu a.menu-active,
.mobile-menu a.menu-active i {
  color: #da6f0d !important;
}

.mobile-menu .has-dropdown {
  position: relative;
}

.mobile-menu .has-dropdown > a {
  justify-content: flex-start;
  cursor: pointer;
}

.mobile-menu .mobile-dropdown-arrow {
  font-size: 0.75rem;
  margin-left: auto;
  transition: transform 0.3s ease;
  display: inline-block;
}

.mobile-menu .has-dropdown.open > a .mobile-dropdown-arrow {
  transform: rotate(180deg);
}

.mobile-menu .has-dropdown > .dropdown-menu {
  display: none;
  background: rgba(255,255,255,0.05);
}

.mobile-menu .has-dropdown.open > .dropdown-menu {
  display: block;
}

.mobile-menu .has-dropdown > .dropdown-menu li {
  border-bottom: 1px solid rgba(255,255,255,0.05);
  padding: 0;
  margin: 0;
}

.mobile-menu .has-dropdown > .dropdown-menu li a {
  padding-left: 2.5rem !important;
  font-size: 1rem !important;
  padding-top: 0.75rem !important;
  padding-bottom: 0.75rem !important;
  display: block !important;
}

.mobile-menu .dropdown-menu a {
  min-height: 44px !important;
}

.mobile-menu-version {
  margin-top: auto !important;
  color: #9ca3af;
  font-size: 0.8rem;
  text-align: center;
  width: 100%;
  padding: 1rem;
  box-sizing: border-box;
}

/* Mobile currency selector inside menu */
.mobile-currency-selector {
  padding: 1rem 1.5rem;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mobile-currency-selector label {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: rgba(255,255,255,0.7);
  font-size: 0.85rem;
  margin-bottom: 0.5rem;
  font-family: 'Poppins', sans-serif;
}

.mobile-currency-selector label i {
  width: 18px;
  text-align: center;
}

.mobile-currency-select {
  width: 100%;
  padding: 0.5rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.1);
  color: white;
  font-size: 0.85rem;
  font-family: 'Poppins', sans-serif;
}

.mobile-currency-select option {
  background: #001830;
  color: white;
}

/* ===== SECONDARY NAV (Country selector) ===== */
.nav-secondary {
  position: fixed;
  top: calc(36px + 4rem);
  left: 0;
  right: 0;
  z-index: 55;
  background: #fff;
  border-bottom: 1px solid #e5e7eb;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  padding: 0.35rem 0;
}

.nav-secondary::-webkit-scrollbar {
  display: none;
}

.nav-secondary ul {
  display: flex;
  list-style: none;
  margin: 0;
  padding: 0 0.75rem;
  align-items: center;
  justify-content: center;
  min-width: max-content;
}

.nav-secondary li {
  margin: 0 0.25rem;
  flex-shrink: 0;
}

.nav-secondary a,
.nav-country-link {
  display: inline-block;
  padding: 0.35rem 0.75rem;
  color: #374151;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 9999px;
  transition: background-color 0.2s ease, color 0.2s ease;
  white-space: nowrap;
}

.nav-secondary a:hover,
.nav-country-link:hover {
  background-color: #f3f4f6;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.nav-secondary a.active,
.nav-country-link.active {
  background-color: #fff7ed;
  color: #da6f0d !important;
}

.nav-secondary .hamburger-menu-btn {
  background: none;
  border: none;
  color: #001830;
  cursor: pointer;
  padding: 0.25rem 0.5rem;
  margin-right: 0.25rem;
  font-size: 1.1rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav-secondary .hamburger-menu-btn:hover {
  color: #da6f0d;
}

/* No announcement bar variant */
body:not(.has-announcement):not(.has-announcement-bar) .nav-secondary {
  top: 4rem;
}

/* ===== CATEGORY NAV ===== */
#category-nav {
  position: fixed;
  top: calc(36px + 4rem + 2.5rem);
  left: 0;
  right: 0;
  z-index: 50;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

#category-nav.hidden {
  display: none;
}

#category-links {
  display: flex;
  overflow-x: auto;
  white-space: nowrap;
  -webkit-overflow-scrolling: touch;
  gap: 0.25rem;
  padding: 0.25rem 0;
}

#category-links::-webkit-scrollbar {
  display: none;
}

.category-link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.85rem;
  color: #374151;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 500;
  border-radius: 9999px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: background-color 0.2s ease, color 0.2s ease;
}

.category-link:hover,
.category-link.active {
  background-color: #fff7ed;
  color: #da6f0d;
}

.category-link i {
  font-size: 0.75rem;
}

/* ===== CURRENCY CONVERTER POPUP ===== */
.currency-converter-popup {
  position: absolute;
  top: 100%;
  right: 0;
  margin-top: 0.5rem;
  width: 280px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 0.75rem;
  box-shadow: 0 10px 25px rgba(0,0,0,0.15);
  z-index: 10080 !important;
  max-width: calc(100vw - 1rem) !important;
  padding: 1rem;
}

.currency-converter-popup.hidden {
  display: none;
}

.currency-popup-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid #e5e7eb;
  min-width: 0 !important;
}

.currency-popup-title {
  font-weight: 600;
  color: #1f2937;
  font-size: 0.95rem;
  min-width: 0 !important;
  overflow-wrap: anywhere !important;
}

.currency-popup-close {
  background: none;
  border: none;
  font-size: 1.25rem;
  color: #9ca3af;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  flex-shrink: 0;
  margin-left: 0.5rem;
}

.currency-popup-close:hover {
  color: #1f2937;
}

.currency-popup-body {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.currency-popup-desc {
  font-size: 0.8rem;
  color: #6b7280;
  margin: 0;
}

.currency-input-group {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.currency-input-group label {
  font-size: 0.8rem;
  color: #6b7280;
  font-weight: 500;
  min-width: 0 !important;
}

.currency-input,
.currency-select {
  min-width: 0 !important;
  padding: 0.5rem;
  border: 1px solid #d1d5db;
  border-radius: 0.375rem;
  font-size: 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.currency-input:focus,
.currency-select:focus {
  border-color: #da6f0d;
  box-shadow: 0 0 0 3px rgba(218,111,13,0.15);
}

.currency-select {
  background: white;
  cursor: pointer;
}

.currency-convert-btn {
  padding: 0.6rem 1rem;
  background: #da6f0d;
  color: white;
  border: none;
  border-radius: 0.5rem;
  font-size: 0.9rem;
  font-weight: 600;
  font-family: 'Poppins', sans-serif;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.currency-convert-btn:hover {
  background: #b85d0a;
}

.currency-result-label {
  font-size: 0.85rem;
  color: #6b7280;
}

.currency-result-value {
  font-weight: 700;
  color: #da6f0d;
  font-size: 1rem;
}

@media (max-width: 1023px) {
  .currency-converter-popup:not(.hidden) {
    position: fixed !important;
    top: calc(4rem + 0.75rem) !important;
    left: 50% !important;
    right: auto !important;
    width: min(92vw, 360px) !important;
    max-height: calc(100dvh - 4rem - 1.5rem) !important;
    transform: translateX(-50%) !important;
    overflow: auto !important;
  }
}

/* ===== LOADING SCREEN ===== */
#loading-screen {
  position: fixed;
  inset: 0;
  background: #f1ece6;
  z-index: 10040;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: opacity 0.4s ease, visibility 0.4s ease;
}

#loading-screen[aria-hidden="true"] {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.loading-logo {
  width: 120px;
  height: 120px;
  background-image: url('https://i.postimg.cc/vBjDkrGd/logo-wafricastore.png');
  background-size: contain;
  background-repeat: no-repeat;
  background-position: center;
  animation: logoPulse 1.5s ease-in-out infinite;
}

@keyframes logoPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.2); }
}

/* ===== TOAST NOTIFICATIONS ===== */
#lp-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: #001830;
  color: white;
  padding: 0.75rem 1.5rem;
  border-radius: 9999px;
  font-size: 0.85rem;
  font-weight: 500;
  z-index: 10100;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
  white-space: nowrap;
  box-shadow: 0 8px 30px rgba(0,0,0,0.2);
  font-family: 'Poppins', sans-serif;
}

#lp-toast.show {
  opacity: 1;
  visibility: visible;
}

#lp-toast i {
  margin-right: 0.5rem;
  color: #4ade80;
}

#lp-toast.error i {
  color: #f87171;
}

/* ===== SEARCH SECTION (mobile) ===== */
.search-section-wrapper {
  position: relative;
  z-index: 45;
}

.search-section {
  padding: 0.75rem 1rem;
  background: white;
  border-bottom: 1px solid #e5e7eb;
}

.search-section.is-sticky {
  position: fixed;
  top: calc(36px + 4rem + 48px);
  left: 0;
  right: 0;
  z-index: 45;
  box-shadow: 0 2px 8px rgba(0,0,0,0.06);
}

@media (min-width: 1024px) {
  .search-section-wrapper {
    display: none;
  }
}

@media (max-width: 1023px) {
  header .h-16 > a:first-child,
  #homeLink {
    flex: 1 1 auto !important;
  }
}

/* ===== RESPONSIVE TWEAKS ===== */
@media (max-width: 480px) {
  header .max-w-7xl {
    padding-left: 0.75rem !important;
    padding-right: 0.75rem !important;
  }

  header .h-16 > a:first-child span,
  #homeLink span {
    max-width: min(42vw, 9.5rem) !important;
  }

  .desktop-img-search-btn,
  .desktop-filter-btn,
  .header-cart-icon,
  .header-orders-icon,
  .header-notifications-icon,
  .hamburger-btn,
  .header-account-icon,
  .header-profile-btn {
    width: 38px !important;
    min-width: 38px !important;
    height: 38px !important;
    border-radius: 10px !important;
  }

  #cart-count-badge {
    top: -3px !important;
    right: -3px !important;
  }
}

@media (max-width: 360px) {
  header .h-16 > a:first-child span,
  #homeLink span {
    display: none !important;
  }
}

/* ===== POPUP STANDARDIZATION ===== */
#newsletterPopup,
#countryPopup,
#categoriesPopup,
#imageSearchPopup,
#order-channel-modal,
.modal,
.modal-overlay,
.ticket-modal,
.transfer-modal,
.transaction-receipt-modal,
.avatar-cropper-modal,
.founder-modal,
#media-lightbox,
#img-zoom-overlay,
.wafrica-avatar-lightbox {
  align-items: center !important;
  justify-content: center !important;
  padding: 0.75rem !important;
}

#newsletterPopup .popup-container,
#countryPopup .popup-container,
#categoriesPopup .popup-container,
#imageSearchPopup .isp-container,
#order-channel-modal .ocm-card,
.ticket-modal-content,
.transfer-dialog,
.transaction-receipt-dialog,
.avatar-cropper-dialog,
.founder-modal-content,
.modal-box {
  width: min(100%, 560px) !important;
  max-height: calc(100dvh - 2rem) !important;
  margin: auto !important;
  overflow: auto !important;
  overscroll-behavior: contain !important;
}

#categoriesPopup .popup-container {
  width: min(100%, 720px) !important;
  overflow: hidden !important;
}

#imageSearchPopup .isp-container {
  width: min(100%, 640px) !important;
}

#imageModal .modal-content {
  max-width: calc(100vw - 2rem) !important;
  max-height: calc(100dvh - 4rem) !important;
  object-fit: contain !important;
}

.transaction-receipt-modal {
  z-index: 10600 !important;
}

.transaction-receipt-dialog {
  width: min(100%, 560px) !important;
  height: min(760px, calc(100dvh - 2rem)) !important;
  overflow: hidden !important;
}

.transaction-receipt-frame {
  width: 100% !important;
  height: 100% !important;
  min-height: 0 !important;
  border: 0 !important;
}

@media (max-width: 640px) {
  #newsletterPopup,
  #countryPopup,
  #categoriesPopup,
  #imageSearchPopup,
  #order-channel-modal,
  .modal,
  .modal-overlay,
  .ticket-modal,
  .transfer-modal,
  .transaction-receipt-modal,
  .avatar-cropper-modal,
  .founder-modal,
  #media-lightbox,
  #img-zoom-overlay,
  .wafrica-avatar-lightbox {
    padding: 0.5rem !important;
  }

  #newsletterPopup .popup-container,
  #countryPopup .popup-container,
  #categoriesPopup .popup-container,
  #imageSearchPopup .isp-container,
  #order-channel-modal .ocm-card,
  .ticket-modal-content,
  .transfer-dialog,
  .transaction-receipt-dialog,
  .avatar-cropper-dialog,
  .founder-modal-content,
  .modal-box {
    max-height: calc(100dvh - 1rem) !important;
    border-radius: 14px !important;
  }

  .transaction-receipt-dialog {
    width: calc(100vw - 1rem) !important;
    height: calc(100dvh - 1rem) !important;
  }
}

/* ===== MAP CONTAINER ===== */
.map-container {
  width: min(100%, 1000px) !important;
  margin-left: auto !important;
  margin-right: auto !important;
}

.map-container iframe {
  width: 100% !important;
  height: clamp(260px, 40vw, 420px) !important;
}

/* ===== GLOBAL CONTAINER + SIDEBARS (layout latéral) ===== */
.global-container {
  display: flex;
  width: 100%;
  min-height: calc(100vh - 4rem);
  align-items: stretch;
}

.global-container .sidebar {
  width: 160px;
  min-height: 100%;
  display: none;
  background-color: #da6f0d;
  position: sticky;
  top: 0;
  overflow: hidden;
  z-index: 1;
}

.sidebar-image {
  width: 100%;
  height: auto;
  max-height: 600px;
  object-fit: contain;
}

.global-container .main-content {
  width: 100%;
  max-width: 1440px;
  margin: 0 auto;
  position: relative;
  z-index: 2;
}

@media (min-width: 1024px) {
  .global-container .sidebar {
    display: block;
  }
  .global-container .main-content {
    max-width: min(1440px, calc(100% - 320px));
  }
}

/* Pages sans global-container : .main-content centré normalement */
.main-content {
  max-width: 1440px;
  margin: 0 auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

@media (min-width: 640px) {
  .main-content {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }
}

@media (min-width: 1024px) {
  .main-content {
    padding-left: 2rem;
    padding-right: 2rem;
  }
}

/* Sidebar couleurs */
.sidebar.color-5 {
  background-color: #da6f0d;
}

.sidebar.left-sidebar::before,
.sidebar.right-sidebar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  opacity: 0.05;
  z-index: 0;
}
