/* ------------------------------------------------------------------
   Header, left rail, drawer, footer, toast, search
   ------------------------------------------------------------------ */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--header-h);
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
  padding: 0 32px;
  color: var(--ink);
  background: color-mix(in srgb, var(--ivory) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(27, 24, 22, .06);
  transition: background .6s var(--ease-out), color .6s var(--ease-out), border-color .6s;
}
body.is-home .site-header {
  background: transparent; color: var(--ivory); border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none;
}
body.is-home .site-header .icon-btn:hover { background: rgba(245, 240, 232, .1); }

.header-nav { display: flex; align-items: center; gap: 30px; }
.header-nav a, .header-nav button {
  font-size: 11px; letter-spacing: .22em; text-transform: uppercase; font-weight: 400; position: relative; padding: 6px 0;
}
.header-nav a::after, .header-nav button::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: 0; height: 1px; background: currentColor;
  transition: right .5s var(--ease-out);
}
.header-nav a:hover::after, .header-nav a.active::after, .header-nav button:hover::after { right: 0; }
.header-nav .menu-toggle { display: none; }

.brand {
  display: grid; justify-items: center; gap: 2px; text-align: center;
}
.brand .wordmark {
  font-family: var(--font-display); font-size: 26px; letter-spacing: .28em; text-transform: uppercase; font-weight: 500; line-height: 1;
}
.brand .wordmark span { font-weight: 300; }
.brand .tagline { font-size: 9px; letter-spacing: .32em; text-transform: uppercase; opacity: .7; }

.header-actions { display: flex; justify-content: flex-end; align-items: center; gap: 6px; }

/* Mega menu */
.mega {
  position: fixed; top: var(--header-h); left: 0; right: 0; z-index: 59;
  background: var(--paper); color: var(--ink); border-bottom: 1px solid var(--line);
  transform: translateY(-8px); opacity: 0; pointer-events: none;
  transition: opacity .4s var(--ease-out), transform .4s var(--ease-out);
  box-shadow: var(--shadow-soft);
}
.mega.open { transform: none; opacity: 1; pointer-events: auto; }
.mega-inner { display: grid; grid-template-columns: 1.2fr 2fr 1fr; gap: 48px; padding: 40px 0 48px; }
.mega h4 { font-family: var(--font-body); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: var(--mute); font-weight: 400; margin-bottom: 16px; }
.mega-cats { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 32px; }
.mega-cats a { display: flex; align-items: baseline; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line-2); font-family: var(--font-display); font-size: 22px; transition: color .3s, padding-left .4s var(--ease-out); }
.mega-cats a span { font-family: var(--font-body); font-size: 11px; letter-spacing: .12em; color: var(--mute); }
.mega-cats a:hover { color: var(--berry); padding-left: 6px; }
.mega-feature { display: grid; gap: 14px; align-content: start; padding: 24px; background: var(--berry-soft); border-radius: var(--radius-lg); }
.mega-feature h3 { font-size: 26px; }
.mega-feature p { font-size: 14px; color: var(--ink-2); }
.mega-links a { display: block; padding: 8px 0; font-size: 13px; color: var(--ink-2); transition: color .3s; }
.mega-links a:hover { color: var(--berry); }

/* Mobile nav sheet */
.mobile-sheet {
  position: fixed; inset: 0; z-index: 80; background: var(--paper); color: var(--ink); padding: 24px;
  transform: translateX(-100%); transition: transform .5s var(--ease-out); overflow: auto;
}
.mobile-sheet.open { transform: none; }
.mobile-sheet .top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; }
.mobile-sheet a.big { display: block; font-family: var(--font-display); font-size: 30px; padding: 12px 0; border-bottom: 1px solid var(--line-2); }
.mobile-sheet a.small-link { display: block; padding: 10px 0; font-size: 12px; letter-spacing: .18em; text-transform: uppercase; }

/* Left rail --------------------------------------------------------- */
.left-rail {
  position: fixed; left: 32px; top: 50%; transform: translateY(-50%); z-index: 50;
  display: none; flex-direction: column; gap: 4px; color: var(--ivory);
}
body.is-home .left-rail { display: flex; }
.left-rail button {
  display: grid; grid-template-columns: 24px 1fr; align-items: center; gap: 14px;
  padding: 7px 0; text-align: left; opacity: .5; transition: opacity .4s, transform .5s var(--ease-out);
}
.left-rail button .idx { font-size: 10px; letter-spacing: .2em; font-family: var(--font-body); }
.left-rail button .name { font-family: var(--font-display); font-size: 19px; letter-spacing: .02em; white-space: nowrap; }
.left-rail button:hover { opacity: .9; }
.left-rail button.active { opacity: 1; transform: translateX(6px); }
.left-rail button.active .name { font-style: italic; }
.left-rail .rail-line { grid-column: 1 / -1; height: 1px; width: 24px; background: currentColor; opacity: .3; margin: 8px 0; }

/* Main ---------------------------------------------------------------- */
.site-main { min-height: 100vh; }
.page { padding-top: var(--header-h); animation: pageIn .7s var(--ease-out) both; }
.page.full-bleed { padding-top: 0; }
@keyframes pageIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }

.page-hero { padding: 72px 0 40px; display: grid; gap: 14px; }
.page-hero h1 { font-weight: 300; }
.page-hero .lead { max-width: 640px; }
.breadcrumbs { display: flex; gap: 10px; font-size: 11px; letter-spacing: .18em; text-transform: uppercase; color: var(--mute); }
.breadcrumbs a:hover { color: var(--ink); }
.breadcrumbs span { opacity: .5; }

/* Footer -------------------------------------------------------------- */
.site-footer { background: var(--ink); color: var(--ivory); padding: 80px 0 40px; }
body.is-home .site-footer { display: none; }
.footer-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1fr; gap: 48px; }
.footer-grid h4 { font-family: var(--font-body); font-size: 11px; letter-spacing: .22em; text-transform: uppercase; color: rgba(245, 240, 232, .6); margin-bottom: 18px; font-weight: 400; }
.footer-grid a { display: block; padding: 5px 0; font-size: 14px; color: rgba(245, 240, 232, .8); transition: color .3s; }
.footer-grid a:hover { color: var(--brass-2); }
.footer-brand .wordmark { font-family: var(--font-display); font-size: 30px; letter-spacing: .26em; text-transform: uppercase; }
.footer-brand p { font-size: 14px; color: rgba(245, 240, 232, .65); max-width: 380px; margin-top: 16px; }
.newsletter { display: flex; margin-top: 22px; max-width: 400px; border-bottom: 1px solid rgba(245, 240, 232, .35); }
.newsletter input { flex: 1; background: none; border: 0; color: var(--ivory); height: 44px; font-weight: 300; }
.newsletter input:focus { outline: none; }
.newsletter button { font-size: 11px; letter-spacing: .2em; text-transform: uppercase; color: var(--brass-2); }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px; margin-top: 64px; padding-top: 24px; border-top: 1px solid rgba(245, 240, 232, .12); font-size: 12px; color: rgba(245, 240, 232, .5); }

/* Drawer --------------------------------------------------------------- */
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(460px, 100%); z-index: 90;
  background: var(--paper); color: var(--ink); transform: translateX(100%);
  transition: transform .6s var(--ease-out); display: flex; flex-direction: column;
  box-shadow: -30px 0 80px -40px rgba(0, 0, 0, .4);
}
.drawer.open { transform: none; }
.drawer-scrim { position: fixed; inset: 0; z-index: 85; background: rgba(20, 16, 14, .45); backdrop-filter: blur(2px); animation: fadeIn .4s both; }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.drawer-head { display: flex; justify-content: space-between; align-items: center; padding: 24px 28px; border-bottom: 1px solid var(--line-2); }
.drawer-head h3 { font-size: 24px; }
.drawer-body { flex: 1; overflow: auto; padding: 8px 28px; }
.drawer-foot { padding: 20px 28px 28px; border-top: 1px solid var(--line-2); display: grid; gap: 12px; }
.drawer-empty { padding: 60px 0; text-align: center; display: grid; gap: 16px; justify-items: center; color: var(--mute); }

.cart-line { display: grid; grid-template-columns: 84px 1fr auto; gap: 18px; padding: 18px 0; border-bottom: 1px solid var(--line-2); align-items: start; }
.cart-line .thumb { background: var(--ivory-2); border-radius: var(--radius); aspect-ratio: 3 / 4; display: grid; place-items: center; overflow: hidden; }
.cart-line .thumb svg { width: 70%; height: 90%; }
.cart-line .name { font-family: var(--font-display); font-size: 19px; }
.cart-line .meta { font-size: 12px; color: var(--mute); letter-spacing: .06em; margin-top: 2px; }
.cart-line .fitline { font-size: 11px; color: var(--berry); letter-spacing: .1em; text-transform: uppercase; margin-top: 6px; }
.cart-line .price { font-size: 15px; font-weight: 400; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: var(--radius); margin-top: 10px; }
.qty button { width: 30px; height: 30px; font-size: 16px; }
.qty span { min-width: 26px; text-align: center; font-size: 13px; }
.remove { font-size: 11px; letter-spacing: .12em; text-transform: uppercase; color: var(--mute); margin-top: 10px; display: inline-block; }
.remove:hover { color: var(--berry); }
.totals { display: grid; gap: 8px; font-size: 14px; }
.totals .row { justify-content: space-between; }
.totals .grand { font-size: 18px; font-weight: 400; border-top: 1px solid var(--line-2); padding-top: 10px; }

/* Toast ---------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 20px); z-index: 100;
  background: var(--ink); color: var(--ivory); padding: 14px 22px; border-radius: 3px; font-size: 13px; letter-spacing: .04em;
  opacity: 0; pointer-events: none; transition: opacity .4s, transform .4s var(--ease-out); max-width: calc(100vw - 32px);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* Search overlay ---------------------------------------------------------- */
.search-overlay { position: fixed; inset: 0; z-index: 95; background: rgba(251, 248, 243, .97); color: var(--ink); padding: 100px 24px 40px; overflow: auto; animation: fadeIn .3s both; }
.search-overlay .close { position: absolute; top: 20px; right: 28px; }
.search-box { max-width: 760px; margin: 0 auto; border-bottom: 1px solid var(--ink); display: flex; gap: 12px; align-items: center; }
.search-box input { flex: 1; background: none; border: 0; font-family: var(--font-display); font-size: clamp(28px, 4vw, 44px); height: 72px; font-weight: 300; }
.search-box input:focus { outline: none; }
.search-results { max-width: 760px; margin: 32px auto; display: grid; gap: 6px; }
.search-results a { display: grid; grid-template-columns: 56px 1fr auto; gap: 16px; align-items: center; padding: 10px 8px; border-radius: var(--radius); transition: background .3s; }
.search-results a:hover { background: var(--ivory-2); }
.search-results .thumb { width: 56px; height: 70px; background: var(--ivory-2); display: grid; place-items: center; overflow: hidden; border-radius: var(--radius); }
.search-results .thumb svg { width: 60%; height: 90%; }
.search-results .name { font-family: var(--font-display); font-size: 20px; }
.search-results .cat { font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: var(--mute); }

@media (max-width: 1100px) {
  .mega-inner { grid-template-columns: 1fr 1fr; }
  .mega-inner > :nth-child(3) { display: none; }
  .left-rail { left: 20px; }
}
@media (max-width: 900px) {
  :root { --header-h: 64px; }
  .site-header { padding: 0 16px; grid-template-columns: auto 1fr auto; }
  .header-nav a, .header-nav .shop-toggle { display: none; }
  .header-nav .menu-toggle { display: inline-flex; }
  .brand .wordmark { font-size: 19px; }
  .brand .tagline { display: none; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .footer-grid > :first-child { grid-column: 1 / -1; }
  body.is-home .left-rail { display: none; }
  .page-hero { padding: 40px 0 24px; }
}
