/* TinkerTaps Shop — design system extended from the landing page.
   Tokens, fonts, and component language mirror index.html. */
:root {
  --forest: #1C4A1E;
  --forest-md: #2A6B2D;
  --forest-lt: #3D8B41;
  --leaf: #5CAF5F;
  --lime: #8DC63F;
  --wood: #C8874A;
  --wood-dk: #8B5C2A;
  --wood-lt: #E8B06A;
  --wood-pale: #F5DFB8;
  --gold: #F0B800;
  --gold-dk: #C89000;
  --cream: #FEFAF2;
  --white: #FFFFFF;
  --ink: #1A2A1C;
  --smoke: #6B7B6C;
  --copper: #C45C28;
  --radius: 22px;
  --radius-sm: 14px;
  --shadow: 0 10px 30px rgba(28, 74, 30, 0.10);
  --shadow-lg: 0 18px 50px rgba(28, 74, 30, 0.16);
  --maxw: 1160px;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Outfit", system-ui, sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-weight: 400;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3, .serif { font-family: "Cormorant Garamond", Georgia, serif; }
h1, h2, h3 { color: var(--forest); line-height: 1.1; margin: 0 0 .4em; font-weight: 600; }
em { font-style: italic; color: var(--forest-lt); }
a { color: var(--forest-md); text-decoration: none; }
img { max-width: 100%; display: block; }
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* --- Header (matches landing #nav) --- */
.tt-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(254, 250, 242, 0.92);
  backdrop-filter: saturate(1.4) blur(10px);
  border-bottom: 1px solid rgba(28, 74, 30, 0.08);
}
.tt-header .bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; height: 62px;
}
.tt-brand { display: flex; align-items: center; gap: 10px; font-family: "Fredoka One", cursive; color: var(--forest); font-size: 20px; }
.tt-brand .mark { width: 32px; height: 32px; border-radius: 8px; background: var(--forest); color: var(--gold); font-family: Georgia, serif; font-weight: 700; display: grid; place-items: center; }
.tt-nav-links { display: flex; align-items: center; gap: 18px; }
.tt-nav-links a { color: var(--forest); font-weight: 500; font-size: 15px; }
.cart-btn {
  position: relative; border: 0; background: var(--forest); color: var(--cream);
  border-radius: 999px; padding: 9px 16px; font: inherit; font-weight: 600; cursor: pointer;
  min-height: 44px; display: inline-flex; align-items: center; gap: 8px;
}
.cart-btn .count {
  background: var(--gold); color: var(--forest); border-radius: 999px;
  min-width: 20px; height: 20px; padding: 0 6px; font-size: 12px; font-weight: 700;
  display: inline-grid; place-items: center;
}

/* --- Buttons --- */
.btn-primary, .btn-gold, .btn-outline {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: 999px; padding: 14px 26px; font: inherit; font-weight: 600;
  cursor: pointer; border: 2px solid transparent; min-height: 48px; text-align: center;
  transition: transform .12s ease, box-shadow .12s ease;
}
.btn-primary { background: var(--forest); color: var(--cream); }
.btn-gold { background: var(--gold); color: var(--forest); }
.btn-outline { background: transparent; color: var(--forest); border-color: var(--forest); }
.btn-primary:hover, .btn-gold:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn-primary:disabled, .btn-gold:disabled { opacity: .5; cursor: not-allowed; transform: none; }
.btn-block { width: 100%; }

.section-label {
  display: inline-block; font-family: "Fredoka One", cursive; font-size: 13px;
  letter-spacing: .06em; text-transform: uppercase; color: var(--wood-dk);
  background: var(--wood-pale); border-radius: 999px; padding: 6px 14px; margin-bottom: 14px;
}

/* --- Hero --- */
.shop-hero { padding: 46px 0 20px; }
.shop-hero .inner { display: grid; grid-template-columns: 1.05fr .95fr; gap: 34px; align-items: center; }
.shop-hero h1 { font-size: clamp(38px, 6vw, 62px); }
.shop-hero p.lead { font-size: 19px; color: var(--smoke); max-width: 34ch; }
.shop-hero .art { border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow-lg); background: var(--wood-pale); aspect-ratio: 4/3; }
.shop-hero .art img { width: 100%; height: 100%; object-fit: cover; }
.hero-ctas { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }

/* --- Sticky filter bar --- */
.filter-bar {
  position: sticky; top: 62px; z-index: 40;
  background: rgba(254, 250, 242, 0.95);
  backdrop-filter: saturate(1.3) blur(8px);
  border-bottom: 1px solid rgba(28, 74, 30, 0.08);
}
.filter-scroll {
  display: flex; gap: 8px; overflow-x: auto; padding: 12px 20px;
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
}
.filter-scroll::-webkit-scrollbar { display: none; }
.filter-pill {
  flex: 0 0 auto; border: 2px solid rgba(28, 74, 30, 0.18); background: var(--white);
  color: var(--forest); border-radius: 999px; padding: 9px 16px; font: inherit;
  font-weight: 600; font-size: 14px; cursor: pointer; min-height: 42px; white-space: nowrap;
  transition: background .12s ease, color .12s ease, border-color .12s ease;
}
.filter-pill.active { background: var(--forest); color: var(--cream); border-color: var(--forest); }
.filter-pill.filter-custom { border-color: var(--gold-dk); color: var(--wood-dk); }
.filter-pill.filter-custom.active { background: var(--gold); color: var(--forest); border-color: var(--gold); }

/* --- Product grid --- */
.type-group { padding: 26px 0; }
.type-group h2 { font-size: 30px; }
.product-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 480px) { .product-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 768px) { .product-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 1024px) { .product-grid { grid-template-columns: repeat(4, 1fr); } }

.shop-card {
  background: var(--white); border-radius: var(--radius); overflow: hidden;
  box-shadow: var(--shadow); border: 1px solid rgba(28,74,30,.06);
  display: flex; flex-direction: column; transition: transform .14s ease, box-shadow .14s ease;
}
.shop-card:hover { transform: translateY(-4px); box-shadow: var(--shadow-lg); }
.shop-card .cover { aspect-ratio: 4/5; background: var(--wood-pale); overflow: hidden; }
.shop-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.shop-card .body { padding: 14px 16px 18px; display: flex; flex-direction: column; gap: 6px; flex: 1; }
.shop-card .tag { font-size: 12px; color: var(--wood-dk); font-weight: 600; text-transform: uppercase; letter-spacing: .04em; }
.shop-card h3 { font-size: 22px; margin: 0; }
.shop-card .price { font-weight: 700; color: var(--forest-md); margin-top: auto; }
.shop-card.featured { grid-column: 1 / -1; }
.badge-custom { display: inline-block; background: var(--gold); color: var(--forest); font-size: 11px; font-weight: 700; border-radius: 999px; padding: 3px 9px; text-transform: uppercase; letter-spacing: .04em; }

/* --- Product page --- */
.product { padding: 30px 0 60px; }
.product .cols { display: grid; grid-template-columns: 1.1fr 1fr; gap: 40px; }
.gallery { position: relative; }
.gallery .stage { aspect-ratio: 4/5; border-radius: var(--radius); overflow: hidden; background: var(--wood-pale); box-shadow: var(--shadow); }
.gallery .stage img { width: 100%; height: 100%; object-fit: cover; }
.gallery .thumbs { display: flex; gap: 10px; margin-top: 12px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; }
.gallery .thumbs img { width: 68px; height: 84px; object-fit: cover; border-radius: 10px; scroll-snap-align: start; cursor: pointer; border: 2px solid transparent; }
.gallery .thumbs img.active { border-color: var(--gold); }
.product h1 { font-size: clamp(30px, 5vw, 46px); }
.product .price-lg { font-size: 26px; font-weight: 700; color: var(--forest-md); }
.opt-group { margin: 18px 0; }
.opt-group .label { font-weight: 600; margin-bottom: 8px; display: block; }
.swatches { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { border: 2px solid rgba(28,74,30,.2); background: var(--white); border-radius: 999px; padding: 10px 16px; cursor: pointer; font: inherit; min-height: 44px; }
.swatch[aria-pressed="true"] { border-color: var(--forest); background: var(--forest); color: var(--cream); }
.swatch:disabled { opacity: .35; cursor: not-allowed; text-decoration: line-through; }
.qty { display: inline-flex; align-items: center; border: 2px solid rgba(28,74,30,.2); border-radius: 999px; overflow: hidden; }
.qty button { width: 44px; height: 44px; border: 0; background: transparent; font-size: 20px; cursor: pointer; color: var(--forest); }
.qty input { width: 46px; text-align: center; border: 0; font: inherit; background: transparent; }

/* --- Uploader --- */
.uploader { border: 2px dashed var(--wood); border-radius: var(--radius); background: var(--wood-pale); padding: 22px; text-align: center; }
.uploader.drag { background: #fff4dd; border-color: var(--gold-dk); }
.uploader h4 { font-family: "Fredoka One", cursive; color: var(--forest); margin: 0 0 6px; font-size: 18px; }
.uploader .hint { font-size: 14px; color: var(--wood-dk); }
.preview-wrap { margin-top: 16px; }
.preview-canvas { width: 100%; max-width: 420px; margin: 0 auto; border-radius: var(--radius-sm); background: var(--white); box-shadow: var(--shadow); display: block; }
.preview-controls { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; margin-top: 12px; }
.preview-controls button { min-height: 44px; min-width: 44px; border-radius: 999px; border: 2px solid var(--forest); background: #fff; color: var(--forest); font: inherit; cursor: pointer; padding: 0 14px; }
.reso-warn { color: var(--copper); font-size: 13px; margin-top: 8px; }
.caption-field { margin-top: 14px; text-align: left; }
.caption-field label { display: block; font-weight: 600; font-size: 14px; color: var(--forest); margin-bottom: 6px; }
.caption-field label span { color: var(--smoke); font-weight: 400; }
.caption-field input { width: 100%; box-sizing: border-box; border: 2px solid rgba(28,74,30,.2); border-radius: 12px; padding: 12px 14px; font: inherit; min-height: 48px; background: var(--white); }
.caption-field input:focus { outline: none; border-color: var(--forest); }
.frame-note { margin-top: 14px; font-size: 14px; color: var(--wood-dk); background: var(--wood-pale); border-radius: 12px; padding: 12px 14px; }
.frame-note strong { color: var(--forest); }
.privacy-note { font-size: 13px; color: var(--smoke); margin-top: 14px; line-height: 1.5; }

/* --- Cart drawer --- */
.drawer-scrim { position: fixed; inset: 0; background: rgba(26,42,28,.45); opacity: 0; pointer-events: none; transition: opacity .2s; z-index: 90; }
.drawer-scrim.open { opacity: 1; pointer-events: auto; }
.drawer { position: fixed; top: 0; right: 0; height: 100%; width: min(420px, 92vw); background: var(--cream); box-shadow: var(--shadow-lg); transform: translateX(100%); transition: transform .24s ease; z-index: 91; display: flex; flex-direction: column; }
.drawer.open { transform: none; }
.drawer header { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid rgba(28,74,30,.08); }
.drawer header h3 { margin: 0; }
.drawer .lines { flex: 1; overflow-y: auto; padding: 12px 20px; }
.drawer footer { padding: 18px 20px; border-top: 1px solid rgba(28,74,30,.08); }
.cart-line { display: grid; grid-template-columns: 62px 1fr auto; gap: 12px; padding: 12px 0; border-bottom: 1px solid rgba(28,74,30,.06); align-items: center; }
.cart-line img { width: 62px; height: 76px; object-fit: cover; border-radius: 10px; background: var(--wood-pale); }
.cart-line .meta { font-size: 14px; }
.cart-line .rm { border: 0; background: none; color: var(--copper); cursor: pointer; font-size: 13px; }
.subtotal { display: flex; justify-content: space-between; font-size: 18px; font-weight: 700; margin-bottom: 12px; }
.close-x { border: 0; background: none; font-size: 24px; cursor: pointer; color: var(--forest); line-height: 1; }

/* --- Sticky bottom bar (mobile) --- */
.sticky-cart { position: fixed; left: 0; right: 0; bottom: 0; z-index: 60; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: var(--forest); transform: translateY(120%); transition: transform .2s ease; }
.sticky-cart.show { transform: none; }
.sticky-cart button { width: 100%; border: 0; background: var(--gold); color: var(--forest); font: inherit; font-weight: 700; border-radius: 999px; min-height: 50px; cursor: pointer; }

/* --- Footer (matches landing) --- */
.tt-footer { background: var(--forest); color: #dfeede; margin-top: 40px; }
.tt-footer .wrap { padding: 40px 20px; display: flex; flex-wrap: wrap; gap: 30px; justify-content: space-between; }
.tt-footer a { color: #dfeede; opacity: .9; }
.tt-footer h4 { color: var(--gold); font-family: "Fredoka One", cursive; font-size: 15px; margin: 0 0 10px; }
.tt-footer ul { list-style: none; padding: 0; margin: 0; display: grid; gap: 7px; font-size: 14px; }
.tt-footer .fine { width: 100%; border-top: 1px solid rgba(255,255,255,.12); padding-top: 16px; font-size: 12px; opacity: .7; }

/* --- Reveal + misc --- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .5s ease, transform .5s ease; }
.reveal.in { opacity: 1; transform: none; }
.suggest-row { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; margin-top: 20px; }
@media (min-width: 768px) { .suggest-row { grid-template-columns: repeat(4, 1fr); } }
.empty { text-align: center; padding: 60px 20px; color: var(--smoke); }
.notice { background: #fff; border-left: 4px solid var(--gold); border-radius: 10px; padding: 12px 16px; margin: 12px 0; box-shadow: var(--shadow); }

@media (max-width: 760px) {
  .shop-hero .inner, .product .cols { grid-template-columns: 1fr; }
  .tt-nav-links a:not(.cart-btn) { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  * { scroll-behavior: auto; }
}
