/* ============================================================
   Ethical Clothing — Redesign chrome
   Top bar, sticky header, mega-nav overlay, footer, country modal.
   ============================================================ */

/* -------------------- top bar -------------------- */
.top-bar {
  background: var(--sage-deep);
  color: #e8e4d6;
  font-size: 12px;
  letter-spacing: 0.04em;
}
.top-bar-inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: var(--topbar-h);
  gap: var(--space-6);
}
.top-bar-inner > .top-bar-links {
  display: flex;
  gap: 22px;
  flex-wrap: wrap;
}
.top-bar a {
  opacity: 0.85;
  transition: opacity var(--transition-fast);
}
.top-bar a:hover {
  opacity: 1;
  text-decoration: underline;
  text-underline-offset: 4px;
}
/* EN | DE inline switcher — the current locale renders as a muted
   non-link, the other side as a normal top-bar link. Pipe separator
   is a subtle 40% divider to match Lyst-style utility switchers. */
.lang-switch {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.lang-switch .lang-cur {
  opacity: 0.55;
  cursor: default;
}
.lang-switch .lang-sep {
  opacity: 0.35;
}

@media (max-width: 720px) {
  .top-bar-inner > :first-child { display: none; }
  .top-bar-inner { justify-content: center; }
  /* One line on phones: language and region only; the other links
     are in the menu drawer. */
  .top-bar-links > a:not([data-open-country]) { display: none; }
}

/* -------------------- header -------------------- */
.header {
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
}
.header-row {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: var(--header-h);
  gap: var(--space-6);
}
.header-left  { justify-self: start; }
.header-right { justify-self: end;   display: flex; align-items: center; gap: var(--space-4); }

.logo {
  font-family: var(--font-display);
  font-size: 22px;
  letter-spacing: -0.02em;
  font-weight: 600;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
}
.logo-mark {
  width: 28px; height: 28px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 30%, var(--sage) 0%, var(--sage-deep) 70%);
  flex-shrink: 0;
}

.header-center {
  display: flex;
  align-items: center;
  gap: var(--space-7);
  height: 100%;
}
.nav-item {
  display: inline-flex;
  align-items: center;
  height: 100%;
  padding: 0 4px;
  font-size: 14px;
  font-weight: 500;
  letter-spacing: -0.005em;
  color: var(--ink);
  cursor: pointer;
  position: relative;
  transition: color var(--transition-fast);
}
.nav-item::after {
  content: '';
  position: absolute;
  left: 4px; right: 4px; bottom: -1px;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform var(--transition-fast);
}
.nav-item:hover,
.nav-item.open { color: var(--sage-deep); }
.nav-item.open::after,
.nav-item.is-current::after { transform: scaleX(1); }
/* The section this page is in (nav_scope): underlined, not hover-coloured. */
.nav-item.is-current:not(.open)::after { background: var(--sage); }

.search-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  border-radius: 999px;
  min-width: 260px;
  transition: border-color var(--transition-fast);
}
.search-pill:focus-within { border-color: var(--ink); }
.search-pill input {
  border: none;
  outline: none;
  background: transparent;
  font-size: 13px;
  width: 100%;
  color: var(--ink);
}
.search-pill input::placeholder { color: var(--ink-3); }

/* Search suggestions (nav.js initSearchSuggest), under any search form. */
.has-suggest { position: relative; }
.suggest {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 280px;
  z-index: 60;
  margin: 0;
  padding: 6px;
  list-style: none;
  text-align: left;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(31, 36, 25, 0.12);
  max-height: 60vh;
  overflow-y: auto;
}
.suggest a {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 9px 12px;
  border-radius: 8px;
  color: var(--ink);
  font-size: 14px;
}
.suggest [aria-selected="true"] a,
.suggest a:hover { background: var(--bg-alt); }
.suggest-kind { color: var(--ink-3); font-size: 12px; white-space: nowrap; }
/* The header pill sits at the right edge: open the list leftwards. */
.search-pill .suggest { left: auto; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px; height: 36px;
  color: var(--ink);
  border-radius: 50%;
  transition: background var(--transition-fast);
}
.icon-btn:hover { background: var(--bg-alt); }

/* mobile chrome */
.header-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
}
@media (max-width: 960px) {
  .header-row { grid-template-columns: 1fr auto; }
  .header-center { display: none; }
  .search-pill { display: none; }
  .header-toggle { display: inline-flex; }
  .header-right { gap: var(--space-2); }
}
.header-toggle { color: var(--ink); border-radius: 50%; }
.header-toggle:hover { background: var(--bg-alt); }

/* -------------------- mobile drawer -------------------- */
.mobile-nav {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  top: var(--mnav-top, calc(var(--header-h) + var(--topbar-h)));
  z-index: var(--z-header);
  background: var(--bg);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: var(--space-5) 16px var(--space-8);
  border-top: 1px solid var(--line);
}
.mobile-nav[hidden] { display: none; }
@media (min-width: 961px) { .mobile-nav { display: none !important; } }
body[data-mobile-nav="true"] { overflow: hidden; }

.mobile-search {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: var(--space-4);
}
.mobile-search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  padding: 0 14px;
  font-size: 16px;               /* no iOS zoom on focus */
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--line-2);
  border-radius: 999px;
}
.mobile-search input:focus { outline: none; border-color: var(--ink); }
.mobile-search .btn { height: 44px; }

.mnav-section,
.mnav-link { border-bottom: 1px solid var(--line); }
.mnav-section > summary,
.mnav-link {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 0;
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  cursor: pointer;
  list-style: none;
}
.mnav-section > summary::-webkit-details-marker { display: none; }
.mnav-section > summary::after {
  content: '+';
  font-weight: 400;
  color: var(--ink-3);
}
.mnav-section[open] > summary::after { content: '–'; }
.mnav-body { padding: 0 0 16px; }
.mnav-body .mega-col { padding: 4px 0 8px; }
.mnav-body .mega-col-title { margin: 8px 0 4px; }
.mnav-body .mega-col a { display: block; padding: 8px 0; font-size: 16px; }
.mnav-utility {
  display: flex;
  flex-direction: column;
  padding-top: var(--space-5);
}
.mnav-utility a { padding: 10px 0; color: var(--ink-2); font-size: 15px; }

/* -------------------- mega-nav -------------------- */
.mega {
  position: absolute;
  left: 0; right: 0;
  top: 100%;
  background: var(--bg);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
  max-height: 0;
  transition: max-height var(--transition-med);
  pointer-events: none;
}
.mega.open {
  max-height: 640px;
  pointer-events: auto;
}
.mega-panel { display: none; }
.mega-panel.active { display: block; }
.mega-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr) 1.4fr;
  gap: var(--space-8);
  padding-top: var(--space-7);
  padding-bottom: var(--space-8);
}
/* Materials panel has a fifth link column ("Popular collections"),
   so the feature block drops to a new row spanning the two leftmost
   columns, as a compact thumbnail + text strip so the panel stays short. */
/* Women / Men: four link columns; a picture only when the admin has one. */
.mega-panel[data-mega-key="women"] .mega-grid:not(.has-feature),
.mega-panel[data-mega-key="men"] .mega-grid:not(.has-feature) {
  grid-template-columns: repeat(4, 1fr);
}
.mega-panel[data-mega-key="brands"] .mega-grid {
  grid-template-columns: repeat(3, 1fr) 1.4fr;
}
.mega-panel[data-mega-key="materials"] .mega-grid {
  grid-template-columns: repeat(5, 1fr);
}
a.mega-feature { color: inherit; text-decoration: none; }
a.mega-feature:hover .mega-feature-title { text-decoration: underline; }
.mega-panel[data-mega-key="materials"] .mega-feature {
  grid-column: 1 / span 2;
  flex-direction: row;
  align-items: center;
  gap: var(--space-5);
}
.mega-panel[data-mega-key="materials"] .mega-feature-img {
  flex: none;
  width: 160px;
}
.mega-col-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-3);
  font-weight: 500;
  margin-bottom: var(--space-4);
}
.mega-col a {
  display: block;
  font-size: 14px;
  color: var(--ink);
  padding: 5px 0;
  transition: color var(--transition-fast), padding-left var(--transition-fast);
}
.mega-col a:hover {
  color: var(--sage-deep);
  padding-left: 4px;
}
.mega-col a.featured { color: var(--sage-deep); font-weight: 500; }

.mega-feature {
  display: flex;
  flex-direction: column;
  gap: var(--space-4);
}
.mega-feature-img {
  aspect-ratio: 4/3;
  background: var(--sage-tint) center/cover;
  border-radius: var(--radius-lg);
}
.mega-feature .mega-feature-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 500;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
}
.mega-feature p {
  font-size: 13.5px;
  color: var(--ink-2);
  line-height: 1.5;
}

/* -------------------- footer -------------------- */
.footer {
  background: #1c2018;
  color: #c9c6b8;
  padding: var(--space-10) 0 var(--space-7);
  margin-top: var(--space-10);
}
.footer .logo { color: #f5f1ea; }
.footer .logo-mark { filter: brightness(1.3); }

.footer-grid {
  display: grid;
  grid-template-columns: 2fr repeat(4, 1fr);
  gap: var(--space-8);
  margin-bottom: var(--space-8);
}
.footer-col-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f5f1ea;
  font-weight: 500;
  margin-bottom: var(--space-4);
}
.footer-col a {
  display: block;
  font-size: 13.5px;
  color: #9a9788;
  padding: 4px 0;
  transition: color var(--transition-fast);
}
.footer-col a:hover { color: #f5f1ea; }

.footer-tagline {
  font-size: 13.5px;
  color: #9a9788;
  max-width: 34ch;
  line-height: 1.55;
  margin-top: var(--space-5);
}

.footer-social {
  list-style: none;
  display: flex;
  gap: var(--space-3);
  margin: var(--space-4) 0 0;
  padding: 0;
}
.footer-social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px; height: 32px;
  border: 1px solid #303029;
  border-radius: 999px;
  color: #9a9788;
  transition: color .18s ease, border-color .18s ease;
}
.footer-social a:hover { color: #f5f1ea; border-color: #7a7768; }

/* Popular pages: long link lists in newspaper columns, quieter than the main footer links. */
.footer-popular {
  display: grid;
  grid-template-columns: 3fr 1fr 1fr;
  gap: var(--space-8);
  padding: var(--space-7) 0;
  border-top: 1px solid #303029;
}
.footer-popular .footer-col-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #f5f1ea;
  font-weight: 500;
  margin-bottom: var(--space-4);
}
.footer-popular ul { list-style: none; margin: 0; padding: 0; column-gap: var(--space-6); }
.footer-popular > div:first-child ul { columns: 3; }
.footer-popular li { break-inside: avoid; }
.footer-popular a {
  display: block;
  font-size: 12.5px;
  line-height: 1.4;
  color: #7a7768;
  padding: 3px 0;
  transition: color var(--transition-fast);
}
.footer-popular a:hover { color: #f5f1ea; }
@media (max-width: 900px) {
  .footer-popular { grid-template-columns: minmax(0, 1fr); gap: var(--space-6); }
  .footer-popular ul { columns: 2; }
}

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: var(--space-6);
  border-top: 1px solid #303029;
  font-size: 12px;
  color: #7a7768;
  gap: var(--space-6);
}

@media (max-width: 960px) {
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: var(--space-7);
  }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  .footer-bottom { flex-direction: column; align-items: flex-start; }
}

/* -------------------- country / region modal -------------------- */
.country-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 36, 25, 0.6);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-5);
}
.country-backdrop.open { display: flex; }

.country-card {
  background: var(--bg);
  max-width: 520px;
  width: 100%;
  padding: var(--space-8);
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}
.country-close {
  position: absolute;
  top: var(--space-5);
  right: var(--space-5);
  width: 32px; height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--ink-3);
  border-radius: 50%;
  transition: background var(--transition-fast), color var(--transition-fast);
}
.country-close:hover { background: var(--bg-alt); color: var(--ink); }

.country-eyebrow {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--sage-deep);
  margin-bottom: var(--space-3);
}
.country-title {
  font-family: var(--font-display);
  font-size: 30px;
  font-weight: 500;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: var(--space-3);
}
.country-sub {
  color: var(--ink-2);
  margin-bottom: var(--space-7);
  font-size: 14.5px;
}
.country-options {
  display: grid;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
}
.country-opt {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  padding: var(--space-4);
  border: 1px solid var(--line);
  background: var(--surface);
  text-align: left;
  transition: border-color var(--transition-fast), background var(--transition-fast);
  cursor: pointer;
}
.country-opt:hover {
  border-color: var(--ink);
  background: var(--bg-alt);
}
.country-opt .flag {
  flex-shrink: 0;
  width: 56px; height: 38px;
  overflow: hidden;
  border-radius: 3px;
}
.country-opt-text { flex: 1; }
.country-opt-title {
  font-weight: 500;
  font-size: 15px;
}
.country-opt-meta {
  font-size: 12.5px;
  color: var(--ink-3);
  margin-top: 2px;
}
.country-rest {
  text-align: center;
  padding-top: var(--space-4);
  border-top: 1px solid var(--line);
  font-size: 13px;
  color: var(--ink-2);
}
.country-rest a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}
.country-rest a:hover { color: var(--sage); border-color: var(--sage); }

/* -------------------- toast -------------------- */
.ec-toast {
  position: fixed;
  bottom: 24px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: var(--bg);
  padding: 10px 18px;
  border-radius: 999px;
  font-size: 13px;
  z-index: var(--z-toast);
  box-shadow: 0 6px 20px rgba(0,0,0,0.18);
  opacity: 0;
  transition: opacity 250ms ease;
}
.ec-toast.show { opacity: 1; }

/* -------------------- form modal ("List your brand") -------------------- */
/* Same backdrop + card treatment as the country modal; taller content scrolls. */
.form-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(31, 36, 25, 0.6);
  display: none;
  align-items: flex-start;
  justify-content: center;
  z-index: var(--z-modal);
  padding: var(--space-5);
  overflow-y: auto;
}
.form-modal-backdrop.open { display: flex; }
.form-modal-card {
  background: var(--bg);
  max-width: 560px;
  width: 100%;
  margin: auto 0;
  padding: var(--space-8);
  position: relative;
  box-shadow: 0 24px 60px rgba(0,0,0,0.25);
}
.brand-submit-form { display: grid; gap: var(--space-4); }
.brand-submit-form .field { display: grid; gap: 6px; }
.brand-submit-form .field > span {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.brand-submit-form .field em { font-style: normal; text-transform: none; letter-spacing: 0; color: var(--ink-3); }
.brand-submit-form input,
.brand-submit-form textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--line-2);
  border-radius: var(--radius);
  padding: 8px 0;
  resize: vertical;
}
.brand-submit-form input:focus,
.brand-submit-form textarea:focus { outline: none; border-bottom-color: var(--sage-deep); }
.brand-submit-form .field.invalid input,
.brand-submit-form .field.invalid textarea { border-bottom-color: #a4442f; }
.brand-submit-form .hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.brand-submit-form .form-error { color: #a4442f; font-size: 14px; }
.form-submit {
  justify-self: start;
  margin-top: var(--space-3);
  padding: 12px 28px;
  background: var(--ink);
  color: var(--bg);
  font-size: 14px;
  letter-spacing: 0.04em;
  transition: background var(--transition-fast);
}
.form-submit:hover { background: var(--sage-deep); }
.form-submit[disabled] { opacity: 0.6; cursor: wait; }
.form-success-title { font-family: var(--font-display); font-size: 22px; font-weight: 500; margin-bottom: var(--space-3); }
.form-success p { color: var(--ink-2); }
@media (max-width: 720px) {
  .form-modal-card { padding: var(--space-7) var(--space-5); }
}

/* Phones: small text links get a larger, invisible tap area (at least
   ~40px tall) without changing the layout. */
@media (max-width: 720px) {
  .top-bar a, .plp-crumbs a, .pdp-crumbs a, .article-crumbs a, .chip a, .hero-popular a,
  .pdp-brand a, .pdp-attrs a, .brand-header-toggle, a[data-open-country], .btn-link, .footer-social a {
    position: relative;
  }
  .top-bar a::after, .plp-crumbs a::after, .pdp-crumbs a::after, .article-crumbs a::after, .chip a::after,
  .hero-popular a::after, .pdp-brand a::after, .pdp-attrs a::after, .brand-header-toggle::after,
  a[data-open-country]::after, .btn-link::after, .footer-social a::after {
    content: '';
    position: absolute;
    inset: -11px -6px;
  }
  .footer-col a { padding: 9px 0; }
  .footer-popular a { padding: 6px 0; }
  .chip a::after { inset: -14px -10px; }
}

/* Narrow phones (iPhone SE): keep the logo on one line. */
@media (max-width: 400px) {
  .logo { font-size: 19px; white-space: nowrap; gap: 8px; }
  .header-row { gap: var(--space-3); }
}
