/* ============================================================
   THE BAG COMPANY — Variation 3 "The Natural"
   Palette C · forest green on cool white · Spectral + Instrument Sans
   Feel: sustainable, considered, outdoors-adjacent. Restraint + warmth.
   ============================================================ */

:root {
  --bg:        #FAFAF7;   /* cool white, whisper of warmth */
  --ink:       #1C1C1C;   /* primary text */
  --accent:    #2D5A3D;   /* deep forest green */
  --accent-dk: #21452E;
  --surface:   #F0EDE8;   /* secondary surface */
  --detail:    #9A9590;   /* warm grey: captions, labels, meta */
  --hair:      rgba(28,28,28,.12);
  --hair-soft: rgba(28,28,28,.07);
  --dark:      #16201A;   /* dark contrast section (footer/newsletter) */
  --dark-ink:  #EAEDE8;

  --serif: "Spectral", Georgia, "Times New Roman", serif;
  --sans:  "Instrument Sans", ui-sans-serif, system-ui, sans-serif;

  --maxw: 1280px;
  --gutter: clamp(20px, 5vw, 80px);
  --sec: clamp(64px, 11vw, 156px);   /* section padding top/bottom */
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0; background: var(--bg); color: var(--ink);
  font-family: var(--sans); font-size: 16px; line-height: 1.65;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
  letter-spacing: -0.005em;
}
img { display: block; max-width: 100%; }
a { color: inherit; }

/* ---- layout helpers ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gutter); }
.wrap-wide { max-width: 1600px; margin: 0 auto; padding-inline: var(--gutter); }
.sec { padding-block: var(--sec); }
.muted { color: var(--detail); }
.surface { background: var(--surface); }

/* ---- type ---- */
h1, h2, h3 { font-family: var(--serif); font-weight: 400; margin: 0; letter-spacing: -0.02em; line-height: 1.02; }
.display {
  font-family: var(--serif); font-weight: 300;
  font-size: clamp(54px, 9.5vw, 132px); line-height: 0.96; letter-spacing: -0.03em;
}
.h-xl { font-size: clamp(34px, 5.2vw, 68px); line-height: 1.04; letter-spacing: -0.025em; }
.h-lg { font-size: clamp(28px, 3.6vw, 46px); line-height: 1.08; letter-spacing: -0.02em; }
.h-md { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.18; letter-spacing: -0.015em; }
.lead { font-size: clamp(18px, 1.7vw, 22px); line-height: 1.6; }
.label {
  font-family: var(--sans); font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em; color: var(--detail);
}
.italic { font-style: italic; }
.serif-it { font-family: var(--serif); font-style: italic; font-weight: 300; }

/* ---- buttons / links ---- */
.btn {
  display: inline-flex; align-items: center; gap: 10px; cursor: pointer;
  font-family: var(--sans); font-size: 14px; font-weight: 600; letter-spacing: .01em;
  padding: 15px 26px; border-radius: 2px; border: 1px solid var(--ink);
  background: transparent; color: var(--ink); text-decoration: none;
  transition: background .3s ease, color .3s ease, border-color .3s ease;
}
.btn:hover { background: var(--ink); color: var(--bg); }
.btn-fill { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn-fill:hover { background: var(--accent-dk); border-color: var(--accent-dk); color: #fff; }
.btn-block { width: 100%; justify-content: center; padding-block: 18px; font-size: 15px; }

.tlink {
  display: inline-flex; align-items: center; gap: 9px; text-decoration: none;
  font-weight: 600; font-size: 14px; letter-spacing: .01em; color: var(--ink);
  position: relative; padding-bottom: 4px;
}
.tlink::after { content: ""; position: absolute; left: 0; bottom: 0; height: 1.5px; width: 100%;
  background: currentColor; transform: scaleX(0); transform-origin: left; transition: transform .35s ease; }
.tlink:hover::after { transform: scaleX(1); }
.tlink .arr { transition: transform .3s ease; }
.tlink:hover .arr { transform: translateX(4px); }

/* ---- top nav ---- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100; height: 64px;
  display: flex; align-items: center; transition: background .35s ease, border-color .35s ease, color .35s ease;
  border-bottom: 1px solid transparent;
}
.nav .wrap-wide { display: flex; align-items: center; justify-content: space-between; width: 100%; }
.nav.scrolled { background: rgba(250,250,247,.86); backdrop-filter: blur(14px); border-bottom-color: var(--hair-soft); }
.nav.solid { background: var(--bg); border-bottom-color: var(--hair-soft); position: sticky; }
.brand { font-family: var(--serif); font-size: 21px; font-weight: 500; letter-spacing: -0.01em; text-decoration: none; color: inherit; display: flex; align-items: center; gap: 9px; }
.brand .mark { width: 22px; height: 22px; border: 1.5px solid currentColor; border-radius: 50%; position: relative; flex: none; }
.brand .mark::after { content:""; position:absolute; inset: 5px; border-radius: 50%; background: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 30px; }
.nav-links a { text-decoration: none; color: inherit; font-size: 13.5px; font-weight: 500; letter-spacing: .005em; position: relative; }
.nav-links a:not(.icon)::after { content:""; position:absolute; left:0; bottom:-5px; height:1.5px; width:100%; background: currentColor; transform: scaleX(0); transform-origin:left; transition: transform .3s ease; }
.nav-links a:not(.icon):hover::after { transform: scaleX(1); }
.nav-icons { display: flex; align-items: center; gap: 18px; }
.icon { display: inline-flex; align-items: center; }
.icon svg { width: 19px; height: 19px; }
.cart-wrap { position: relative; }
.cart-count {
  position: absolute; top: -8px; right: -9px; min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--accent); color: #fff; border-radius: 999px; font-family: var(--sans);
  font-size: 10px; font-weight: 700; display: none; align-items: center; justify-content: center; line-height: 1;
}
.cart-count.visible { display: flex; }
.cart-count.pulse { animation: cartpulse .5s ease; }
@keyframes cartpulse { 0%{transform:scale(.4)} 60%{transform:scale(1.25)} 100%{transform:scale(1)} }
.nav.over-hero { color: #fff; }
.nav.over-hero.scrolled { color: var(--ink); }

/* spacer for solid nav pages */
.nav-spacer { height: 64px; }

/* ---- reveal ---- */
.reveal { opacity: 0; transform: translateY(26px); transition: opacity .6s ease, transform .6s cubic-bezier(.22,.61,.36,1); }
.reveal.is-in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1 !important; transform: none !important; } }

/* ---- image slot baseline ---- */
image-slot { background: var(--surface); }

/* ---- color blocks (placeholder imagery) ---- */
.block { position: relative; overflow: hidden; background: var(--surface); }
.block .tone { position:absolute; inset:0; }
.block .blabel { position: absolute; left: 16px; bottom: 14px; z-index: 2; }
.tone-sage   { background: linear-gradient(150deg, #cdd3c5, #aab39c); }
.tone-stone  { background: linear-gradient(150deg, #ddd8cf, #c3bcae); }
.tone-forest { background: linear-gradient(150deg, #3b5f47, #233d2c); }
.tone-clay   { background: linear-gradient(150deg, #d8c8b6, #b9a288); }
.tone-mist   { background: linear-gradient(150deg, #e4e6e0, #cfd2c8); }

/* ---- product card ---- */
.pcard { text-decoration: none; color: inherit; display: block; }
.pcard .media { position: relative; overflow: hidden; background: var(--surface); }
.pcard .media > * { transition: transform .5s cubic-bezier(.22,.61,.36,1); }
.pcard:hover .media > * { transform: scale(1.035); }
.pcard .pname { margin-top: 16px; font-family: var(--serif); font-size: 20px; font-weight: 400; letter-spacing: -0.01em; }
.pcard .pmeta { display: flex; align-items: baseline; justify-content: space-between; margin-top: 6px; }
.pcard .pprice { font-size: 14px; color: var(--ink); }
.pcard .swatches { display: flex; gap: 6px; margin-top: 11px; }
.pcard .sw { width: 13px; height: 13px; border-radius: 50%; border: 1px solid var(--hair); }

/* ---- footer ---- */
.foot { background: var(--dark); color: var(--dark-ink); }
.foot a { color: var(--dark-ink); text-decoration: none; opacity: .72; transition: opacity .2s ease; font-size: 14px; }
.foot a:hover { opacity: 1; }
.foot .label { color: rgba(234,237,232,.5); }
.foot-grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.2fr; gap: 40px; padding-block: 72px 40px; }
.foot-col { display: flex; flex-direction: column; gap: 13px; }
.foot-bottom { display: flex; justify-content: space-between; align-items: center; gap: 20px;
  border-top: 1px solid rgba(234,237,232,.14); padding-block: 22px; font-size: 12.5px; color: rgba(234,237,232,.55); flex-wrap: wrap; }
.foot-bottom a { font-size: 12.5px; }
.brand.on-dark .mark { border-color: var(--dark-ink); }

/* ---- newsletter band ---- */
.news { background: var(--dark); color: var(--dark-ink); }
.news-inner { display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.news form { display: flex; gap: 0; border: 1px solid rgba(234,237,232,.3); border-radius: 2px; overflow: hidden; min-width: min(420px, 92vw); }
.news input { flex: 1; background: transparent; border: none; color: var(--dark-ink); padding: 16px 18px; font-family: var(--sans); font-size: 15px; outline: none; }
.news input::placeholder { color: rgba(234,237,232,.45); }
.news button { background: var(--accent); color: #fff; border: none; padding: 0 26px; font-family: var(--sans); font-weight: 600; font-size: 14px; cursor: pointer; transition: background .25s ease; }
.news button:hover { background: var(--accent-dk); }

/* ---- accordion ---- */
.acc { border-top: 1px solid var(--hair); }
.acc-item { border-bottom: 1px solid var(--hair); }
.acc-head { width: 100%; background: none; border: none; cursor: pointer; text-align: left;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 20px 0; font-family: var(--sans); font-size: 16px; font-weight: 600; color: var(--ink); }
.acc-head .pm { position: relative; width: 16px; height: 16px; flex: none; }
.acc-head .pm::before, .acc-head .pm::after { content:""; position:absolute; background: var(--accent); transition: transform .3s ease; }
.acc-head .pm::before { left: 0; right: 0; top: 7px; height: 2px; }
.acc-head .pm::after  { top: 0; bottom: 0; left: 7px; width: 2px; }
.acc-item.open .pm::after { transform: scaleY(0); }
.acc-body { overflow: hidden; max-height: 0; transition: max-height .4s ease; }
.acc-body .inner { padding: 0 0 22px; color: #4a4a47; font-size: 15px; line-height: 1.7; max-width: 60ch; }

/* ---- marquee ---- */
.marquee { overflow: hidden; }
.marquee-track { display: flex; gap: 80px; width: max-content; animation: marq 38s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
@keyframes marq { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }

/* ---- swatch selector (PDP) ---- */
.swatch-row { display: flex; gap: 12px; }
.swatch { width: 30px; height: 30px; border-radius: 50%; cursor: pointer; position: relative; border: 1px solid var(--hair); padding: 0; background-clip: content-box; }
.swatch::after { content:""; position: absolute; inset: -5px; border-radius: 50%; border: 1.5px solid var(--accent); opacity: 0; transition: opacity .2s ease; }
.swatch[aria-pressed="true"]::after { opacity: 1; }

/* ---- filter bar ---- */
.filterbar { position: sticky; top: 64px; z-index: 50; background: rgba(250,250,247,.9); backdrop-filter: blur(12px); border-block: 1px solid var(--hair-soft); }
.filterbar .row { display: flex; align-items: center; gap: 10px; padding-block: 14px; flex-wrap: wrap; }
.chip { font-family: var(--sans); font-size: 13px; font-weight: 500; padding: 8px 15px; border: 1px solid var(--hair); border-radius: 999px; background: transparent; cursor: pointer; color: var(--ink); transition: all .2s ease; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.chip-x { display: inline-flex; align-items: center; gap: 7px; background: var(--surface); }

/* ---- utility grids ---- */
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: clamp(28px, 5vw, 80px); align-items: center; }

@media (max-width: 900px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
  .grid-2 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr 1fr; gap: 32px; }
  .nav-links .hide-sm { display: none; }
}
@media (max-width: 560px) {
  .grid-3 { grid-template-columns: 1fr; }
  .foot-grid { grid-template-columns: 1fr; }
}
