/* =========================================================================
   Maplewa​re Goods — storefront styles
   Palette: warm cream, ink, and a maple/amber accent.
   ========================================================================= */

:root {
  --bg:        #fbf7f1;
  --surface:   #ffffff;
  --surface-2: #f4ece1;
  --ink:       #2a2420;
  --ink-soft:  #524a42;
  --muted:     #857a6d;
  --line:      #e7dccd;
  --maple:     #b5652f;
  --maple-dk:  #97501f;
  --maple-sf:  #f2e3d3;
  --ok:        #4a7c59;

  --serif: "Fraunces", Georgia, "Times New Roman", serif;
  --sans:  "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;

  --wrap: 1200px;
  --radius: 6px;
  --shadow-sm: 0 1px 2px rgba(42,36,32,.06), 0 2px 8px rgba(42,36,32,.05);
  --shadow-md: 0 8px 30px rgba(42,36,32,.12);
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 0 0 .4em;
  color: var(--ink);
}
h1 { font-size: clamp(2.4rem, 5vw, 3.9rem); }
h2 { font-size: clamp(1.8rem, 3.4vw, 2.6rem); }
h3 { font-size: 1.25rem; }

p { margin: 0 0 1rem; }

.wrap { width: 100%; max-width: var(--wrap); margin: 0 auto; padding: 0 24px; }

.eyebrow {
  font-family: var(--sans);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--maple);
  margin: 0 0 .9rem;
}

.muted { color: var(--muted); }
.center { text-align: center; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  font-family: var(--sans); font-size: .9rem; font-weight: 600;
  letter-spacing: .02em;
  padding: .85rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: transform .12s ease, background .2s ease, color .2s ease, border-color .2s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--maple); color: #fff; }
.btn-primary:hover { background: var(--maple-dk); }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: var(--bg); }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--surface-2); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; }

/* ---------- Announcement bar ---------- */
.announce {
  background: var(--ink); color: #f3ece2;
  font-size: .78rem; letter-spacing: .05em; text-align: center;
  padding: .55rem 12px;
}
.announce strong { color: #fff; font-weight: 600; }

/* ---------- Header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  background: rgba(251,247,241,.9);
  backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.header-inner {
  display: flex; align-items: center; gap: 1.5rem;
  min-height: 68px;
}
.brand {
  font-family: var(--serif); font-size: 1.4rem; font-weight: 600;
  letter-spacing: -0.02em; white-space: nowrap;
}
.brand .leaf { color: var(--maple); }
.nav { display: flex; gap: 1.75rem; margin-left: auto; }
.nav a {
  font-size: .92rem; font-weight: 500; color: var(--ink-soft);
  padding: .3rem 0; position: relative;
}
.nav a::after {
  content: ""; position: absolute; left: 0; bottom: -2px; height: 2px; width: 0;
  background: var(--maple); transition: width .2s ease;
}
.nav a:hover, .nav a.active { color: var(--ink); }
.nav a:hover::after, .nav a.active::after { width: 100%; }

.header-actions { display: flex; align-items: center; gap: .35rem; margin-left: 1rem; }
.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 42px; height: 42px; border-radius: 999px; border: none;
  background: transparent; color: var(--ink); cursor: pointer;
  position: relative; transition: background .2s ease;
}
.icon-btn:hover { background: var(--surface-2); }
.icon-btn svg { width: 21px; height: 21px; }
.cart-count {
  position: absolute; top: 4px; right: 3px;
  min-width: 18px; height: 18px; padding: 0 5px;
  background: var(--maple); color: #fff;
  font-family: var(--sans); font-size: .68rem; font-weight: 700;
  line-height: 18px; text-align: center; border-radius: 999px;
  transform: scale(0); transition: transform .18s ease;
}
.cart-count.show { transform: scale(1); }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero {
  position: relative; min-height: 78vh; display: flex; align-items: flex-end;
  color: #fff; overflow: hidden;
}
.hero::before {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(20,16,12,.15) 0%, rgba(20,16,12,.35) 45%, rgba(20,16,12,.78) 100%);
  z-index: 1;
}
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero .wrap { position: relative; z-index: 2; padding-bottom: 4.5rem; padding-top: 4rem; }
.hero .eyebrow { color: #e9c9a8; }
.hero h1 { color: #fff; max-width: 12ch; }
.hero p { color: #f0e8dd; max-width: 46ch; font-size: 1.1rem; }
.hero-cta { display: flex; gap: .8rem; flex-wrap: wrap; margin-top: 1.6rem; }

/* ---------- Section scaffolding ---------- */
.section { padding: 5rem 0; }
.section-sm { padding: 3.5rem 0; }
.section-head { max-width: 620px; margin-bottom: 2.6rem; }
.section-head.center { margin-left: auto; margin-right: auto; }
.section-head p { color: var(--muted); font-size: 1.05rem; margin: 0; }
.head-row { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; margin-bottom: 2.4rem; flex-wrap: wrap; }
.head-row h2 { margin: 0; }
.link-arrow { font-weight: 600; color: var(--maple); font-size: .95rem; }
.link-arrow:hover { color: var(--maple-dk); }

/* ---------- Value props ---------- */
.values { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.values-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.value { text-align: center; padding: .5rem; }
.value svg { width: 30px; height: 30px; color: var(--maple); margin-bottom: .6rem; }
.value h3 { font-family: var(--sans); font-size: .98rem; font-weight: 600; margin: 0 0 .25rem; }
.value p { font-size: .88rem; color: var(--muted); margin: 0; }

/* ---------- Category tiles ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.25rem; }
.cat-tile {
  position: relative; display: block; border-radius: var(--radius); overflow: hidden;
  aspect-ratio: 3/4; box-shadow: var(--shadow-sm);
}
.cat-tile img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.cat-tile::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(0,0,0,0) 40%, rgba(20,16,12,.72) 100%);
}
.cat-tile:hover img { transform: scale(1.05); }
.cat-cap { position: absolute; left: 0; right: 0; bottom: 0; z-index: 2; padding: 1.2rem; color: #fff; }
.cat-cap h3 { color: #fff; margin: 0 0 .1rem; font-size: 1.2rem; }
.cat-cap span { font-size: .82rem; color: #eadfd2; }

/* ---------- Product grid & cards ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.6rem 1.4rem; }
.card { position: relative; }
.card-media {
  position: relative; display: block; border-radius: var(--radius);
  overflow: hidden; background: var(--surface-2); aspect-ratio: 4/5;
}
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform .5s ease; }
.card:hover .card-media img { transform: scale(1.04); }
.card-badge {
  position: absolute; top: 12px; left: 12px; z-index: 2;
  background: #fff; color: var(--ink);
  font-size: .68rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: .3rem .6rem; border-radius: 999px; box-shadow: var(--shadow-sm);
}
.card-quick {
  position: absolute; left: 12px; right: 12px; bottom: 12px; z-index: 2;
  opacity: 0; transform: translateY(8px); transition: opacity .2s ease, transform .2s ease;
}
.card:hover .card-quick { opacity: 1; transform: translateY(0); }
.card-body { padding: .85rem .1rem 0; }
.card-cat { font-size: .72rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); }
.card-title { font-family: var(--serif); font-size: 1.12rem; margin: .15rem 0 .1rem; }
.card-title a:hover { color: var(--maple); }
.card-price { font-weight: 600; font-size: 1rem; }
@media (hover: none) { .card-quick { opacity: 1; transform: none; } }

/* ---------- Story band ---------- */
.story { display: grid; grid-template-columns: 1fr 1fr; align-items: center; gap: 0; }
.story-media { min-height: 460px; }
.story-media img { width: 100%; height: 100%; object-fit: cover; }
.story-copy { padding: 4rem clamp(1.5rem, 5vw, 5rem); }
.story-copy blockquote {
  font-family: var(--serif); font-size: 1.5rem; line-height: 1.4; margin: 0 0 1rem; color: var(--ink);
}

/* ---------- Newsletter ---------- */
.newsletter { background: var(--ink); color: #f3ece2; text-align: center; }
.newsletter h2 { color: #fff; }
.newsletter p { color: #cabcae; max-width: 44ch; margin: 0 auto 1.6rem; }
.subscribe { display: flex; gap: .6rem; max-width: 440px; margin: 0 auto; }
.subscribe input {
  flex: 1; padding: .85rem 1.1rem; border-radius: 999px; border: 1px solid #4a4038;
  background: #332c26; color: #fff; font-family: var(--sans); font-size: .95rem;
}
.subscribe input::placeholder { color: #9c8f81; }
.subscribe input:focus { outline: none; border-color: var(--maple); }
.form-note { font-size: .8rem; color: #9c8f81; margin-top: .9rem; }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface-2); border-top: 1px solid var(--line); padding: 3.5rem 0 1.5rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: 2rem; }
.footer-grid h4 { font-family: var(--sans); font-size: .78rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin: 0 0 1rem; }
.footer-brand .brand { font-size: 1.5rem; }
.footer-brand p { color: var(--muted); font-size: .9rem; max-width: 32ch; margin-top: .8rem; }
.footer-links { list-style: none; padding: 0; margin: 0; display: flex; flex-direction: column; gap: .6rem; }
.footer-links a { font-size: .92rem; color: var(--ink-soft); }
.footer-links a:hover { color: var(--maple); }
.footer-bottom {
  display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  margin-top: 2.8rem; padding-top: 1.4rem; border-top: 1px solid var(--line);
  font-size: .82rem; color: var(--muted);
}
.pay { display: flex; gap: .5rem; align-items: center; }
.pay span {
  font-size: .62rem; font-weight: 700; letter-spacing: .04em; color: var(--ink-soft);
  border: 1px solid var(--line); background: #fff; border-radius: 4px; padding: .25rem .45rem;
}

/* ---------- Page header (interior pages) ---------- */
.page-head { padding: 3.2rem 0 1rem; }
.crumbs { font-size: .82rem; color: var(--muted); margin-bottom: .6rem; }
.crumbs a:hover { color: var(--maple); }

/* ---------- Shop toolbar ---------- */
.shop-layout { padding-top: 1rem; }
.filters { display: flex; flex-wrap: wrap; gap: .5rem; align-items: center; margin-bottom: 2rem; }
.chip {
  font-size: .86rem; font-weight: 500; padding: .5rem 1rem; border-radius: 999px;
  border: 1px solid var(--line); background: #fff; color: var(--ink-soft); cursor: pointer;
  transition: all .15s ease;
}
.chip:hover { border-color: var(--ink); color: var(--ink); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #fff; }
.result-count { margin-left: auto; font-size: .86rem; color: var(--muted); }

/* ---------- Product detail ---------- */
.pdp { display: grid; grid-template-columns: 1.1fr 1fr; gap: 3rem; align-items: start; padding-top: 1rem; }
.pdp-media { border-radius: var(--radius); overflow: hidden; background: var(--surface-2); position: sticky; top: 90px; }
.pdp-media img { width: 100%; aspect-ratio: 4/5; object-fit: cover; }
.pdp-info .card-cat { display: inline-block; margin-bottom: .4rem; }
.pdp-info h1 { font-size: clamp(2rem, 4vw, 2.8rem); margin-bottom: .3rem; }
.pdp-price { font-size: 1.5rem; font-weight: 600; margin: .2rem 0 1.2rem; }
.pdp-lede { font-size: 1.08rem; color: var(--ink-soft); }
.pdp-buy { display: flex; gap: .8rem; align-items: center; margin: 1.6rem 0; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.qty button { width: 40px; height: 44px; border: none; background: none; font-size: 1.2rem; cursor: pointer; color: var(--ink); }
.qty button:hover { color: var(--maple); }
.qty span { width: 34px; text-align: center; font-weight: 600; }
.pdp-details { border-top: 1px solid var(--line); margin-top: 1.6rem; padding-top: 1.4rem; }
.pdp-details h3 { font-family: var(--sans); font-size: .8rem; letter-spacing: .12em; text-transform: uppercase; color: var(--muted); margin-bottom: .8rem; }
.pdp-details ul { margin: 0; padding-left: 1.1rem; color: var(--ink-soft); }
.pdp-details li { margin-bottom: .4rem; }
.ship-line { display: flex; gap: .5rem; align-items: center; font-size: .9rem; color: var(--ink-soft); margin-top: 1.2rem; }
.ship-line svg { width: 18px; height: 18px; color: var(--maple); }

/* ---------- Cart drawer ---------- */
.overlay {
  position: fixed; inset: 0; background: rgba(20,16,12,.4); z-index: 90;
  opacity: 0; visibility: hidden; transition: opacity .25s ease, visibility .25s ease;
}
.overlay.open { opacity: 1; visibility: visible; }
.drawer {
  position: fixed; top: 0; right: 0; height: 100%; width: 400px; max-width: 90vw; z-index: 100;
  background: var(--bg); box-shadow: var(--shadow-md);
  transform: translateX(100%); transition: transform .3s cubic-bezier(.4,0,.2,1);
  display: flex; flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 1.3rem 1.4rem; border-bottom: 1px solid var(--line); }
.drawer-head h3 { margin: 0; font-size: 1.15rem; }
.drawer-close { background: none; border: none; cursor: pointer; font-size: 1.5rem; line-height: 1; color: var(--muted); }
.drawer-close:hover { color: var(--ink); }
.drawer-body { flex: 1; overflow-y: auto; padding: 1.1rem 1.4rem; }
.drawer-foot { border-top: 1px solid var(--line); padding: 1.2rem 1.4rem; background: var(--surface-2); }
.drawer-empty { text-align: center; color: var(--muted); padding: 3rem 1rem; }

/* line items (shared by drawer + cart page) */
.line { display: grid; grid-template-columns: 68px 1fr auto; gap: .9rem; padding: .9rem 0; border-bottom: 1px solid var(--line); }
.line-thumb { border-radius: 4px; overflow: hidden; background: var(--surface-2); aspect-ratio: 1; }
.line-thumb img { width: 100%; height: 100%; object-fit: cover; }
.line-name { font-family: var(--serif); font-size: 1rem; margin: 0 0 .1rem; }
.line-meta { font-size: .82rem; color: var(--muted); }
.line-controls { display: flex; align-items: center; gap: .6rem; margin-top: .5rem; }
.qty-sm { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: #fff; }
.qty-sm button { width: 28px; height: 30px; border: none; background: none; cursor: pointer; font-size: 1rem; color: var(--ink); }
.qty-sm span { width: 26px; text-align: center; font-size: .85rem; font-weight: 600; }
.line-remove { background: none; border: none; color: var(--muted); font-size: .8rem; cursor: pointer; text-decoration: underline; }
.line-remove:hover { color: var(--maple); }
.line-price { font-weight: 600; text-align: right; white-space: nowrap; }

.subtotal-row { display: flex; justify-content: space-between; font-size: 1.05rem; margin-bottom: .3rem; }
.subtotal-row strong { font-weight: 700; }
.ship-note { font-size: .82rem; color: var(--muted); margin-bottom: 1rem; }

/* ---------- Cart page ---------- */
.cart-page { display: grid; grid-template-columns: 1.7fr 1fr; gap: 2.5rem; align-items: start; padding-top: 1rem; }
.cart-lines .line { grid-template-columns: 96px 1fr auto; }
.summary { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.6rem; position: sticky; top: 90px; }
.summary h3 { font-size: 1.2rem; margin-bottom: 1rem; }
.summary-row { display: flex; justify-content: space-between; padding: .5rem 0; font-size: .95rem; color: var(--ink-soft); }
.summary-total { display: flex; justify-content: space-between; padding: .9rem 0 .2rem; border-top: 1px solid var(--line); margin-top: .5rem; font-size: 1.2rem; font-weight: 700; color: var(--ink); }
.empty-state { text-align: center; padding: 4rem 1rem; }
.empty-state svg { width: 48px; height: 48px; color: var(--line); margin-bottom: 1rem; }

/* ---------- Forms (contact / checkout) ---------- */
.form-grid { display: grid; gap: 1.1rem; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { display: flex; flex-direction: column; gap: .4rem; }
.field label { font-size: .82rem; font-weight: 600; color: var(--ink-soft); }
.field input, .field textarea, .field select {
  padding: .8rem 1rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; font-family: var(--sans); font-size: .95rem; color: var(--ink);
}
.field input:focus, .field textarea:focus, .field select:focus { outline: none; border-color: var(--maple); box-shadow: 0 0 0 3px var(--maple-sf); }
.field textarea { resize: vertical; min-height: 130px; }

.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 3rem; align-items: start; }
.contact-aside { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.8rem; }
.contact-aside dt { font-size: .78rem; letter-spacing: .1em; text-transform: uppercase; color: var(--muted); margin-top: 1.1rem; }
.contact-aside dd { margin: .2rem 0 0; font-size: .98rem; }
.contact-aside dl { margin: 0; }

/* ---------- About ---------- */
.prose { max-width: 680px; margin: 0 auto; }
.prose h2 { margin-top: 2.2rem; }
.prose p { font-size: 1.08rem; color: var(--ink-soft); }
.about-hero { aspect-ratio: 21/9; border-radius: var(--radius); overflow: hidden; margin-bottom: 2.5rem; }
.about-hero img { width: 100%; height: 100%; object-fit: cover; }
.stats { display: grid; grid-template-columns: repeat(3,1fr); gap: 1.5rem; text-align: center; margin: 3rem 0; }
.stat .num { font-family: var(--serif); font-size: 2.4rem; color: var(--maple); line-height: 1; }
.stat .lbl { font-size: .88rem; color: var(--muted); margin-top: .4rem; }

/* ---------- Toast ---------- */
.toast {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: .8rem 1.3rem; border-radius: 999px;
  font-size: .9rem; box-shadow: var(--shadow-md); z-index: 120;
  opacity: 0; visibility: hidden; transition: all .25s ease;
}
.toast.show { opacity: 1; visibility: visible; transform: translateX(-50%) translateY(0); }

/* ---------- Confirmation ---------- */
.confirm { text-align: center; max-width: 520px; margin: 0 auto; padding: 3rem 0; }
.confirm .tick { width: 64px; height: 64px; border-radius: 999px; background: var(--maple-sf); color: var(--maple); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 1.2rem; }
.confirm .tick svg { width: 30px; height: 30px; }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .values-grid, .cat-grid { grid-template-columns: repeat(2, 1fr); gap: 1.5rem; }
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .story { grid-template-columns: 1fr; }
  .story-media { min-height: 320px; }
  .pdp { grid-template-columns: 1fr; gap: 1.8rem; }
  .pdp-media { position: static; }
  .cart-page { grid-template-columns: 1fr; }
  .two-col { grid-template-columns: 1fr; gap: 2rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem 1.5rem; }
}
@media (max-width: 720px) {
  .nav, .header-actions .btn { display: none; }
  .nav-toggle { display: inline-flex; }
  .nav.open {
    display: flex; flex-direction: column; gap: 0;
    position: absolute; top: 100%; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); padding: .5rem 24px 1rem;
  }
  .nav.open a { padding: .8rem 0; border-bottom: 1px solid var(--line); }
  .nav.open a::after { display: none; }
  .header-inner { position: relative; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 1.4rem 1rem; }
  .section { padding: 3.5rem 0; }
  .stats, .form-row { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .subscribe { flex-direction: column; }
  .subscribe .btn { width: 100%; }
  .hero { min-height: 70vh; }
}
@media (max-width: 460px) {
  .product-grid, .cat-grid { grid-template-columns: 1fr 1fr; }
  .footer-grid { grid-template-columns: 1fr; }
}
