/* ===== COLLEX v2 chrome: nav + footer pieces the kit does not cover =====
   Loaded after /kit.css. Kit variables only (--chrome, --surface, --line, --text, ...). */

:root { --nav-h: 64px; }
@media (max-width: 900px) { :root { --nav-h: 56px; } }

/* hidden must win over the display rules below */
.nav [hidden], .footer [hidden] { display: none !important; }

/* ---- bar ---- */
.nav { position: sticky; top: 0; z-index: 100; height: var(--nav-h); }
.nav__bar { height: var(--nav-h); }
.nav__item { position: relative; display: flex; align-items: center; }
.nav__link { min-height: 44px; }
.nav__link:hover, .nav__link[aria-expanded="true"] { color: var(--strong); }
.nav__link[aria-expanded="true"] svg { transform: rotate(180deg); }
.nav__link svg { transition: transform 150ms ease; }
.nav__auth { display: flex; align-items: center; }
.nav__chip { position: relative; }
.nav__account { min-height: 44px; }
.nav__account[aria-current="page"], .nav__cart[aria-current="page"] { color: var(--strong); background: var(--surface); }
.cart-badge[data-empty] { display: none; }

/* ---- EN | TH market switch (scripts/market-toggle.js) ---- */
.nav .market-toggle {
  display: inline-flex; align-items: center; gap: 2px; height: 40px; padding: 1px;
  border: 1px solid var(--line); border-radius: 999px; margin-right: 8px;
}
.nav .market-toggle__btn {
  position: relative; min-width: 44px; height: 36px; padding: 0 10px; border: 0; border-radius: 999px;
  background: transparent; color: var(--muted); opacity: 1; cursor: pointer;
  font: 600 12px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
/* 44px tap target without making the pill taller than the bar allows */
.nav .market-toggle__btn::before { content: ""; position: absolute; inset: -4px 0; }
.nav .market-toggle__btn:hover { color: var(--strong); }
.nav .market-toggle__btn[aria-pressed="true"] { background: var(--text); color: #0E0E12; }
/* Phones: the switch moves from the bar into the top of the phone menu, so the bar keeps the logo at full height. */
@media (max-width: 900px) {
  .nav__actions .market-toggle { display: none; }
  .nav__panel-inner .market-toggle { display: flex; width: 100%; height: 44px; margin: 0 0 8px; }
  .nav__panel-inner .market-toggle__btn { flex: 1; height: 40px; }
}
@media (min-width: 901px) { .nav__panel-inner .market-toggle { display: none; } }

/* ---- dropdowns (Shop, Tools, account) ---- */
.nav__menu {
  position: absolute; top: calc(100% - 6px); left: 0; z-index: 110;
  min-width: 240px; padding: 8px;
  background: var(--surface); border: 1px solid var(--line-strong); border-radius: 12px;
  box-shadow: var(--float);
  display: flex; flex-direction: column; gap: 2px;
}
.nav__menu--account { top: calc(100% + 6px); left: auto; right: 0; }
.nav__menu a {
  display: flex; align-items: center; gap: 8px; min-height: 44px; padding: 0 12px; border-radius: 8px;
  font-size: 14px; font-weight: 500; color: var(--text);
}
.nav__menu a:hover { background: var(--surface-2); color: var(--strong); }
.nav__menu a[aria-current="page"] { color: var(--strong); box-shadow: inset 2px 0 0 var(--red); }
.nav__menu-signout { border-top: 1px solid var(--line); border-radius: 0 0 8px 8px; margin-top: 4px; color: var(--muted); }
.nav__soon {
  font-family: var(--mono); font-size: 11px; font-weight: 600; letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); border: 1px solid var(--line-strong); border-radius: 999px; padding: 1px 8px;
}

/* ---- mega menu (nav.js enhanceMenus) ---- */
.nav__menu--rich { min-width: 360px; }
.nav__menu--mega { min-width: 640px; }
.nav__mega { display: grid; gap: 8px; }
.nav__menu--mega .nav__mega { grid-template-columns: minmax(0, 1fr) 220px; gap: 12px; }
.nav__mega-links { display: flex; flex-direction: column; gap: 2px; }
.nav__menu .nav__mega-item { align-items: flex-start; padding: 8px 12px; min-height: 44px; }
.nav__mega-icon {
  flex: none; width: 36px; height: 36px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; color: var(--text);
}
.nav__mega-icon svg { width: 18px; height: 18px; }
.nav__mega-text { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.nav__mega-title { display: flex; align-items: center; gap: 8px; color: var(--strong); font-weight: 600; }
.nav__mega-desc { font-size: 13px; line-height: 1.4; color: var(--muted); font-weight: 400; }
.nav__menu .nav__mega-promo {
  position: relative; display: flex; flex-direction: column; padding: 0; overflow: hidden;
  border: 1px solid var(--line); border-radius: 8px; background: var(--bg);
}
.nav__mega-promo img { width: 100%; height: 180px; object-fit: cover; object-position: center 26%; }
.nav__mega-promo-body { display: flex; flex-direction: column; gap: 6px; padding: 12px; }
.nav__mega-promo-title { font-family: var(--display); font-weight: 600; font-size: 15px; line-height: 1.25; color: var(--strong); }
.nav__mega-promo-cta { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text); }
.nav__mega-promo-cta svg { width: 14px; height: 14px; }

/* ---- phone menu ---- */
.nav__menu-btn .nav__ico-close { display: none; }
.nav__menu-btn[aria-expanded="true"] .nav__ico-open { display: none; }
.nav__menu-btn[aria-expanded="true"] .nav__ico-close { display: block; }
.nav__panel {
  position: fixed; top: var(--nav-h); left: 0; right: 0; bottom: 0; z-index: 99;
  overflow-y: auto; overscroll-behavior: contain;
  background: var(--chrome); border-top: 1px solid var(--line);
}
.nav__panel-inner { display: flex; flex-direction: column; padding-top: 12px; padding-bottom: 32px; }
.nav__panel-inner .t-label { padding: 20px 0 6px; }
.nav__panel-inner a {
  display: flex; align-items: center; gap: 8px; min-height: 44px;
  font-size: 16px; font-weight: 500; color: var(--text);
}
.nav__panel-inner a[aria-current="page"] { color: var(--strong); box-shadow: inset 2px 0 0 var(--red); padding-left: 12px; }
html.nav-open, html.nav-open body { overflow: hidden; }
@media (min-width: 901px) { .nav__panel { display: none !important; } }

/* ---- phone bar: Sign in and cart stay visible beside the logo ---- */
@media (max-width: 900px) {
  .nav__actions { gap: 4px; }
  .nav__account { padding: 0 12px 0 10px; gap: 6px; font-size: 13px; }
  .nav__account svg { width: 16px; height: 16px; }
  .nav__account--icon { width: 44px; padding: 0; border: 0; }
}

/* ---- footer ----
   The element also carries the legacy `site-footer` class (the sweep finds it by that name),
   so neutralise the legacy block's padding, margin and red hairline here. */
.footer, .footer.site-footer { border-top: 1px solid var(--line); background: var(--chrome); padding: 0; margin-top: 0; position: static; }
.footer.site-footer::before { content: none; }
.footer__grid { padding-top: 64px; padding-bottom: 40px; }
.footer__col { display: flex; flex-direction: column; gap: 12px; }
.footer__col--brand { gap: 12px; }
.footer__logo { height: 20px; width: auto; align-self: flex-start; }
.footer__base { padding-bottom: 40px; }
.footer__base-row {
  border-top: 1px solid var(--line); padding-top: 24px;
  display: flex; justify-content: space-between; gap: 24px; flex-wrap: wrap;
}
.footer__copy { color: var(--text); }
.footer__legal { max-width: 640px; }
.footer__col a:hover { text-decoration: underline; text-underline-offset: 3px; }
@media (max-width: 900px) {
  .footer__grid { padding-top: 48px; padding-bottom: 32px; }
  .footer__logo { height: 18px; }
  .footer__base { padding-bottom: 32px; }
  .footer__base-row { flex-direction: column; gap: 10px; padding-top: 20px; }
  .footer__legal { font-size: 12px; }
}

@media (prefers-reduced-motion: reduce) { .nav__link svg { transition: none; } }
