/**
 * SWS Theme Modern - layout.css
 * Header (3 rows) + Footer
 */

/* ─── TOPBAR ─────────────────────────────────────────── */

.mnx-topbar {
  background: var(--color-surface-dark);
  color: rgba(255,255,255,0.75);
  font-size: 12px;
  height: var(--topbar-height, 36px);
  display: flex;
  align-items: center;
}

.mnx-topbar__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.mnx-topbar__left {
  color: rgba(255,255,255,0.75);
}

.mnx-topbar__right {
  display: flex;
  align-items: center;
  gap: 1rem;
  color: rgba(255,255,255,0.75);
}

.mnx-topbar__right a {
  color: rgba(255,255,255,0.75);
  transition: color 0.15s;
}

.mnx-topbar__right a:hover {
  color: #fff;
}

/* ─── MAIN HEADER ─────────────────────────────────────── */

.mnx-header__main {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  padding: 12px 0;
}

.mnx-header__main-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
}

/* Logo */
.mnx-logo {
  display: flex;
  align-items: center;
  gap: 4px;
  text-decoration: none;
  flex-shrink: 0;
}

.mnx-logo__wordmark {
  font-size: 22px;
  font-weight: 900;
  color: var(--color-text);
  letter-spacing: -0.03em;
  line-height: 1;
}

.mnx-logo__dot {
  color: var(--color-primary);
}

.mnx-logo img {
  max-height: 40px;
  width: auto;
  object-fit: contain;
}

/* Search */
.mnx-search {
  display: flex;
  border: 1.5px solid var(--color-border);
  border-radius: var(--radius);
  overflow: hidden;
  background: #fff;
  transition: border-color 0.15s;
}

.mnx-search:focus-within {
  border-color: var(--color-primary);
}

.mnx-search__category {
  border: none;
  background: var(--color-surface);
  border-right: 1px solid var(--color-border);
  padding: 0 12px;
  font-size: 13px;
  color: var(--color-text-muted);
  cursor: pointer;
  white-space: nowrap;
  outline: none;
}

.mnx-search__input {
  flex: 1;
  border: none;
  padding: 10px 14px;
  font-size: 14px;
  font-family: var(--font-family-base);
  color: var(--color-text);
  outline: none;
  background: transparent;
}

.mnx-search__input::placeholder {
  color: var(--color-text-muted);
}

.mnx-search__btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 0 22px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}

.mnx-search__btn:hover {
  background: var(--color-primary-dark);
}

/* Utility icons */
.mnx-header__utility {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-shrink: 0;
}

.mnx-header__utility-link {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 11px;
  color: var(--color-text);
  text-decoration: none;
  transition: color 0.15s;
}

.mnx-header__utility-link i {
  font-size: 18px;
}

.mnx-header__utility-link:hover {
  color: var(--color-primary);
}

.mnx-header__cart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--btn-radius);
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s;
}

.mnx-header__cart-btn:hover {
  background: var(--color-primary-dark);
  color: #fff;
}

.mnx-header__cart-btn i {
  font-size: 16px;
}

/* ─── NAVIGATION BAR ──────────────────────────────────── */

.mnx-header__nav {
  background: #fff;
  border-bottom: 1px solid var(--color-border);
  overflow: visible;
  position: relative;
  z-index: 1;
}

.mnx-header__nav-inner {
  display: flex;
  align-items: center;
  justify-content: center;
}

.mnx-nav {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  align-items: stretch;
  gap: 0;
}

.mnx-nav > li > a {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.mnx-nav > li > a:hover,
.mnx-nav > li.active > a {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

/* Nav items */
.mnx-nav__item {
  position: relative;
  list-style: none;
}

.mnx-nav__link {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 12px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  text-decoration: none;
  border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s;
  white-space: nowrap;
}

.mnx-nav__item:hover > .mnx-nav__link,
.mnx-nav__item.active > .mnx-nav__link {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.mnx-nav__caret {
  font-size: 10px;
  margin-left: 2px;
  transition: transform 0.15s;
}

.mnx-nav__item:hover > .mnx-nav__link .mnx-nav__caret {
  transform: rotate(180deg);
}

/* Dropdown */
.mnx-nav__dropdown {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 210px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-top: 2px solid var(--color-primary);
  box-shadow: var(--shadow-md);
  border-radius: 0 0 var(--radius) var(--radius);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  display: none;
  z-index: 300;
}

.mnx-nav__item--has-drop:hover > .mnx-nav__dropdown {
  display: block;
}

.mnx-nav__dropdown li a {
  display: block;
  padding: 9px 18px;
  font-size: 13px;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
  white-space: nowrap;
}

.mnx-nav__dropdown li a:hover,
.mnx-nav__dropdown li.active a {
  background: var(--color-surface);
  color: var(--color-primary);
  padding-left: 22px;
}

/* Legacy Bootstrap dropdown compat (fallback if old template used) */
.mnx-nav > li {
  position: relative;
}
.mnx-nav > li > .dropdown-menu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-top: 2px solid var(--color-primary);
  box-shadow: var(--shadow-md);
  list-style: none;
  margin: 0;
  padding: 6px 0;
  display: none;
  z-index: 300;
}
.mnx-nav > li:hover > .dropdown-menu,
.mnx-nav > li.open > .dropdown-menu {
  display: block;
}
.mnx-nav > li > .dropdown-menu a {
  display: block;
  padding: 9px 18px;
  font-size: 13px;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.1s, color 0.1s;
}
.mnx-nav > li > .dropdown-menu a:hover {
  background: var(--color-surface);
  color: var(--color-primary);
}

.mnx-nav__deals {
  font-size: 13px;
  font-weight: 700;
  color: var(--color-primary);
  text-decoration: none;
  white-space: nowrap;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 4px;
  transition: opacity 0.15s;
}

.mnx-nav__deals:hover {
  opacity: 0.75;
  color: var(--color-primary);
}

/* Sticky header wrapper */
.mnx-header-wrapper {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: #fff;
  overflow: visible;
}

/* Quand un modal Bootstrap est ouvert, le header ne doit plus créer de contexte d'empilement */
body.modal-open .mnx-header-wrapper {
  z-index: 0;
}

/* Breadcrumb items */
.mnx-breadcrumb a {
  color: var(--color-text-muted);
  text-decoration: none;
}
.mnx-breadcrumb a:hover {
  color: var(--color-primary);
}
.mnx-breadcrumb__sep {
  margin: 0 6px;
  color: var(--color-text-muted);
}
.mnx-breadcrumb__current {
  color: var(--color-text);
  font-weight: 500;
}

/* ─── PERKS BAR ───────────────────────────────────────── */

.mnx-perks {
  background: var(--color-surface-dark);
  color: #fff;
  padding: 14px 0;
}

.mnx-perks__inner {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  text-align: center;
}

.mnx-perks__item {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  font-size: 13px;
  font-weight: 500;
  color: rgba(255,255,255,0.88);
}

.mnx-perks__item i {
  color: var(--color-primary);
  font-size: 16px;
}

/* ─── FOOTER ──────────────────────────────────────────── */

.mnx-footer {
  background: var(--color-surface-dark);
  color: rgba(255,255,255,0.75);
  padding-top: 56px;
}

.mnx-footer__grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr 1.5fr;
  gap: 40px;
  padding-bottom: 40px;
  border-bottom: 1px solid rgba(255,255,255,0.1);
}

.mnx-footer__brand-wordmark {
  font-size: 22px;
  font-weight: 900;
  color: #fff;
  letter-spacing: -0.03em;
  display: flex;
  align-items: center;
  gap: 2px;
  text-decoration: none;
  margin-bottom: 12px;
}

.mnx-footer__brand-wordmark span {
  color: var(--color-primary);
}

.mnx-footer__brand-tagline {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 20px;
  line-height: 1.5;
}

.mnx-footer__social {
  display: flex;
  gap: 8px;
}

.mnx-footer__social a {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid rgba(255,255,255,0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  color: rgba(255,255,255,0.75);
  font-size: 13px;
  text-decoration: none;
  transition: border-color 0.15s, color 0.15s;
}

.mnx-footer__social a:hover {
  border-color: rgba(255,255,255,0.6);
  color: #fff;
}

.mnx-footer__col-title {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #fff;
  margin-bottom: 16px;
}

.mnx-footer__links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.mnx-footer__links a {
  font-size: 13px;
  color: rgba(255,255,255,0.65);
  text-decoration: none;
  transition: color 0.15s;
}

.mnx-footer__links a:hover {
  color: #fff;
}

/* Newsletter in footer */
.mnx-footer__newsletter-copy {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  margin-bottom: 12px;
  line-height: 1.5;
}

.mnx-footer__newsletter-form {
  display: flex;
  gap: 0;
}

.mnx-footer__newsletter-input {
  flex: 1;
  border: 1px solid rgba(255,255,255,0.2);
  background: rgba(255,255,255,0.07);
  color: #fff;
  padding: 9px 12px;
  font-size: 13px;
  font-family: var(--font-family-base);
  outline: none;
  border-radius: var(--radius) 0 0 var(--radius);
  min-width: 0;
}

.mnx-footer__newsletter-input::placeholder {
  color: rgba(255,255,255,0.35);
}

.mnx-footer__newsletter-btn {
  background: var(--color-primary);
  color: #fff;
  border: none;
  padding: 9px 16px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  cursor: pointer;
  border-radius: 0 var(--radius) var(--radius) 0;
  transition: background 0.15s;
  white-space: nowrap;
}

.mnx-footer__newsletter-btn:hover {
  background: var(--color-primary-dark);
}

/* Footer bottom bar */
.mnx-footer__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 0;
  font-size: 12px;
  color: rgba(255,255,255,0.4);
}

.mnx-footer__bar-payments {
  display: flex;
  gap: 6px;
  align-items: center;
  font-size: 12px;
}

/* To-top */
.sws-to-top {
  position: fixed;
  bottom: 24px;
  right: 24px;
  width: 40px;
  height: 40px;
  background: var(--color-text);
  color: #fff;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  z-index: 150;
  opacity: 0;
  transition: opacity 0.3s;
  text-decoration: none;
}

.sws-to-top.visible {
  opacity: 1;
}

/* ─── RESPONSIVE ──────────────────────────────────────── */

@media (min-width: 768px) {
  .mnx-header__main-inner {
    grid-template-columns: auto 1fr auto;
  }

  .mobile { display: none !important; }
  .desktop { display: block !important; }
}

@media (max-width: 767px) {
  .mnx-perks__inner {
    grid-template-columns: repeat(2, 1fr);
    text-align: left;
  }

  .mnx-footer__grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .mnx-header__utility-link span {
    display: none;
  }

  /* Le cœur favoris est enveloppé dans un span (icon-wrap + badge) : ne masquer
     que le libellé, pas l'icône. */
  .mnx-header__utility-link .mnx-wishlist-btn__icon-wrap,
  .mnx-header__utility-link .mnx-wishlist-btn__badge {
    display: inline-flex;
  }

  .mnx-search__category {
    display: none;
  }
}

/* ── Header responsive : burger + menu drill (≤1024px tablette/mobile) ── */
.mnx-burger { display: none; }
@media (max-width: 1024px) {
  /* La rangée catégories (niveau 2) est remplacée par le drill mobile. */
  .mnx-header-wrapper .mnx-header__nav { display: none; }

  .mnx-header__main-inner {
    grid-template-columns: auto 1fr auto;
    gap: 10px 14px;
  }

  /* Recherche pleine largeur sur la 2e ligne de la grille
     (.mnx-search-wrap = wrapper créé par le JS autocomplete autour du form) */
  .mnx-header__main-inner > .mnx-search,
  .mnx-header__main-inner > .mnx-search-wrap {
    grid-column: 1 / -1;
    grid-row: 2;
  }

  .mnx-burger {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 42px;
    height: 42px;
    padding: 9px;
    background: none;
    border: 0;
    cursor: pointer;
    flex-shrink: 0;
  }
  .mnx-burger span {
    display: block;
    height: 2px;
    width: 100%;
    border-radius: 2px;
    background: var(--color-text);
    transition: transform .25s, opacity .2s;
  }
  body.mnx-nav-open .mnx-burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
  body.mnx-nav-open .mnx-burger span:nth-child(2) { opacity: 0; }
  body.mnx-nav-open .mnx-burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

  /* Locale : dropdowns alignés à droite, dans l'écran. */
  .mnx-header__locale { gap: 6px; }
  .mnx-header__locale .mnx-lang__dropdown { right: 0; left: auto; }

  /* Barre d'actions compacte : éviter le débordement du bouton panier. */
  .mnx-header__utility { gap: 10px; }
  .mnx-cart-label { display: none; }            /* panier = icône + compteur seuls */
  .mnx-header__cart-btn { padding: 8px 12px; gap: 6px; }

  /* Overlay derrière le drill. */
  .mnx-drill-overlay {
    position: fixed;
    inset: 0;
    background: rgba(20,15,20,.45);
    z-index: 1290;
    opacity: 0;
    transition: opacity .25s;
  }
  body.mnx-nav-open .mnx-drill-overlay { opacity: 1; }
  body.mnx-nav-open { overflow: hidden; }
}

/* ── Language selector ────────────────────────────────── */
/* ── Language selector (topbar context) ──────────────── */
.mnx-topbar__right .mnx-lang {
  position: relative;
}

.mnx-topbar__right .mnx-lang__btn {
  display: flex;
  align-items: center;
  gap: 4px;
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  font-weight: 600;
  color: rgba(255,255,255,0.85);
  cursor: pointer;
  white-space: nowrap;
}

.mnx-topbar__right .mnx-lang__btn:hover {
  color: #fff;
}

.mnx-topbar__right .mnx-lang__caret {
  font-size: 9px;
  transition: transform 0.2s;
}

.mnx-topbar__right .mnx-lang__btn[aria-expanded="true"] .mnx-lang__caret {
  transform: rotate(180deg);
}

.mnx-topbar__right .mnx-lang__dropdown {
  display: none;
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  min-width: 90px;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 12px rgba(0,0,0,.15);
  list-style: none;
  margin: 0;
  padding: 4px 0;
  z-index: 110;
}

.mnx-topbar__right .mnx-lang__dropdown li {
  list-style: none;
}

.mnx-topbar__right .mnx-lang__dropdown--open {
  display: block;
}

.mnx-topbar__right .mnx-lang__option {
  display: block;
  padding: 7px 14px;
  font-size: 12px;
  font-weight: 600;
  color: var(--color-text);
  text-decoration: none;
  transition: background 0.12s;
}

.mnx-topbar__right .mnx-lang__option:hover {
  background: var(--color-surface);
  color: var(--color-primary);
}

/* ── Wishlist button ──────────────────────────────────── */
.mnx-wishlist-btn {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background: none;
  border: none;
  box-shadow: none;
  outline: none;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
  font-size: 11px;
  font-family: var(--font-family-base);
  color: var(--color-text);
  padding: 0;
  transition: color 0.15s;
  text-decoration: none;
}

.mnx-wishlist-btn:hover,
.mnx-wishlist-btn:focus {
  color: var(--color-primary);
  outline: none;
  box-shadow: none;
}

.mnx-wishlist-btn__icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mnx-wishlist-btn i {
  font-size: 18px;
}

.mnx-wishlist-btn__badge {
  position: absolute;
  top: -6px;
  right: -8px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
  background: var(--color-primary);
  color: #fff;
  border-radius: 999px;
}

/* ============================================================
 * Header 2 niveaux : rangée 1 = logo + recherche + utility
 * (langue/devise/favoris/connexion/panier), rangée 2 = catégories.
 * ============================================================ */
.mnx-header__main{overflow:visible}
.mnx-header__locale{display:flex;align-items:center;gap:10px;white-space:nowrap}
.mnx-header__locale a,.mnx-header__locale select,.mnx-header__locale .dropdown-toggle{
  font-size:13px;color:var(--color-text);text-decoration:none;
}

/* Sélecteurs langue/devise dans le header une-ligne (luxe) : la topbar a été
   retirée, les règles .mnx-lang* étaient scopées .mnx-topbar__right et ne
   s'appliquaient plus → dropdown jamais masqué. On les rescope ici (thème clair). */
.mnx-header__locale .mnx-lang{position:relative}
.mnx-header__locale .mnx-lang__btn{
  display:inline-flex;align-items:center;gap:5px;
  background:var(--color-surface,#f3e9de);
  border:1px solid var(--color-border,#e7dbcf);
  border-radius:var(--button-radius,8px);
  padding:5px 10px;font:inherit;font-size:13px;font-weight:600;
  color:var(--color-text);cursor:pointer;white-space:nowrap;line-height:1.2;
}
.mnx-header__locale .mnx-lang__btn:hover{color:var(--color-primary)}
.mnx-header__locale .mnx-lang__caret{font-size:9px;transition:transform .2s}
.mnx-header__locale .mnx-lang__btn[aria-expanded="true"] .mnx-lang__caret{transform:rotate(180deg)}
.mnx-header__locale .mnx-lang__dropdown{
  display:none;position:absolute;top:calc(100% + 6px);right:0;min-width:90px;
  background:#fff;border:1px solid var(--color-border);
  border-radius:var(--radius-sm,8px);box-shadow:0 6px 18px rgba(0,0,0,.15);
  list-style:none;margin:0;padding:4px 0;z-index:1200;
}
.mnx-header__locale .mnx-lang__dropdown li{list-style:none}
.mnx-header__locale .mnx-lang__dropdown--open{display:block}
.mnx-header__locale .mnx-lang__option{
  display:block;padding:7px 14px;font-size:13px;font-weight:600;
  color:var(--color-text);text-decoration:none;transition:background .12s;
}
.mnx-header__locale .mnx-lang__option:hover{background:var(--color-surface);color:var(--color-primary)}
