/* Shop storefront: Good Tree hero, featured showcases, product cards, tilt, reveals, category views.
   Builds on css/good-tree.css tokens; category navigation lives in css/shop-nav.css. */

/* ---------- Good Tree hero ---------- */
.gt-hero{max-width:1360px;margin-inline:auto;padding:52px 44px 88px;display:grid;grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr);gap:80px;align-items:center}
.gt-hero-copy{min-width:0;max-width:540px}
.gt-hero-logo{display:block;width:clamp(190px,18vw,260px);height:auto;margin:0 0 38px -6px}
.shop .gt-hero h1{margin:0;max-width:560px;font-size:clamp(58px,6.2vw,96px);line-height:.92;letter-spacing:-.045em}
.gt-hero-lede{margin-top:28px!important;max-width:440px;font-size:15px;line-height:1.85;color:var(--muted)}
.shop .gt-hero .shop-button{margin-top:36px}
.gt-hero-media{min-width:0;margin:0}
.gt-hero-media .spot-tilt{box-shadow:0 46px 90px -48px rgba(23,40,28,.62),0 2px 6px rgba(23,40,28,.08)}
.gt-hero-media figcaption{display:flex;justify-content:space-between;gap:16px;margin-top:18px;font-size:10px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--muted)}
.gt-hero-media figcaption a{color:var(--ink);letter-spacing:.06em}
.gt-hero-media figcaption a:hover{text-decoration:underline;text-underline-offset:4px}
/* The logo's lettering is charcoal, so dark mode sets it on a cream plate. */
html[data-theme="dark"] .gt-hero-logo{background:#f5f0e6;padding:14px 18px;border-radius:3px}

/* ---------- Featured showcases (Heaven's Tribe + Good Tree hoodie) ---------- */
.showcase{padding:110px 44px 120px;scroll-margin-top:20px}
.showcase-inner{max-width:1272px;margin-inline:auto}
.showcase-head{display:flex;align-items:end;justify-content:space-between;gap:50px;margin-bottom:72px;padding-bottom:32px;border-bottom:1px solid var(--line)}
.shop .showcase-head h2{margin-top:16px;font-size:clamp(64px,8.4vw,132px);line-height:.86;letter-spacing:-.05em}
.showcase-head>p{max-width:380px;font-size:14px;line-height:1.8;color:var(--muted)}
.showcase--tribe{--ink:#f5f0e6;--muted:#cdd5c8;--line:rgba(245,240,230,.2);background:var(--forest-deep);color:var(--ink)}
.showcase--hoodie{background:var(--cream)}

.spot{--sp:0;display:grid;grid-template-columns:minmax(0,1.08fr) minmax(0,.92fr);gap:88px;align-items:center}
.spot--reverse{grid-template-columns:minmax(0,.92fr) minmax(0,1.08fr)}
.spot--reverse .spot-stage{order:2}
.spot-stage{position:relative;min-width:0;transform:translate3d(0,calc(var(--sp) * -28px),0) scale(calc(1 - (var(--sp) * var(--sp)) * .05));will-change:transform}
.spot-tilt{aspect-ratio:1/1;background:#e8e0d3;box-shadow:0 30px 60px -34px rgba(23,40,28,.55),0 2px 6px rgba(23,40,28,.08)}
.showcase--tribe .spot-tilt{box-shadow:0 40px 80px -40px rgba(0,0,0,.75),0 2px 6px rgba(0,0,0,.2)}
.spot-tilt img,.catalog-image img{display:block;width:100%;height:100%;object-fit:contain;-webkit-user-drag:none;user-select:none}
.spot-hint{margin-top:16px!important;text-align:center;font-size:9px;font-weight:600;letter-spacing:.16em;text-transform:uppercase;color:var(--muted)}
.spot-copy{min-width:0;max-width:440px;transform:translate3d(0,calc(var(--sp) * 14px),0)}
.shop .spot-copy h3{font-size:clamp(34px,3.2vw,46px);line-height:1.02;letter-spacing:-.03em}
.spot-price{margin-top:14px!important;font-size:13px;color:var(--muted)}
.spot-description{margin-top:18px!important;font-size:14px;line-height:1.8;color:var(--muted)}
.spot-options{margin:30px 0 0;padding:0;border:0;min-width:0}
.spot-options legend{font-size:9px;font-weight:600;letter-spacing:.12em;text-transform:uppercase;padding:0}
.spot .swatch-row{gap:14px;margin-top:12px}
.spot .color-swatch{width:40px;height:40px;flex-basis:40px}
.spot .spot-views{margin-top:22px}
.spot .selected-color{margin-top:18px!important;font-size:11px}
.spot .catalog-cta{max-width:320px;margin-top:26px}
.showcase--tribe .color-swatch{box-shadow:inset 0 0 0 1px rgba(245,240,230,.35)}
.showcase--tribe .color-swatch[aria-pressed="true"]::after{border-color:#f5f0e6}
.showcase--tribe .color-swatch:focus-visible{outline-color:#f5f0e6}
.showcase--tribe .catalog-cta{background:#f5f0e6;color:var(--forest-deep)!important}
.showcase--tribe .catalog-cta:hover{background:#d8ded3}
.showcase--tribe .selected-color strong{color:#f5f0e6}

/* ---------- Front / back / folded view toggle ---------- */
.view-toggle{display:inline-flex;gap:0;border:1px solid var(--line);background:var(--paper)}
.view-toggle button{min-width:68px;min-height:40px;padding:8px 14px;border:0;background:transparent;color:var(--ink);font:600 10px/1 Inter,Arial,sans-serif;letter-spacing:.08em;text-transform:uppercase;cursor:pointer;transition:background .2s ease,color .2s ease}
.view-toggle button+button{border-left:1px solid var(--line)}
.view-toggle button[aria-pressed="true"]{background:var(--forest);color:#fff}
.view-toggle button:hover:not([aria-pressed="true"]){background:rgba(36,59,42,.07)}
.view-toggle button:focus-visible{outline:3px solid #9b633c;outline-offset:2px;position:relative;z-index:1}
html[data-theme="dark"] .view-toggle button[aria-pressed="true"]{background:#f1eddf;color:#17281c}
html[data-theme="dark"] .showcase--hoodie .catalog-cta,html[data-theme="dark"] .category-section .catalog-cta{background:#f5f0e6;color:var(--forest-deep)!important}
html[data-theme="dark"] .spot .color-swatch[aria-pressed="true"]::after{border-color:#f5f0e6}

/* The site-wide button hover (styles.css) paints every button solid blue with !important,
   which hides swatch colors. Keep shop swatches and toggles on-brand while hovered. */
@media (hover:hover){
  html body.shop-page .shop .color-swatch:not(:disabled):not([aria-disabled="true"]):hover{background:linear-gradient(90deg,var(--swatch-a) 0 50%,var(--swatch-b) 50% 100%)!important;border-color:transparent!important;color:inherit!important;box-shadow:inset 0 0 0 1px rgba(20,30,22,.18),0 0 0 3px rgba(36,59,42,.14)!important}
  html body.shop-page .shop .view-toggle button:not(:disabled):not([aria-disabled="true"]):hover{background:rgba(36,59,42,.08)!important;color:var(--ink)!important;border-color:var(--line)!important}
  html body.shop-page .shop .view-toggle button[aria-pressed="true"]:not(:disabled):not([aria-disabled="true"]):hover{background:var(--forest)!important;color:#fff!important}
  html[data-theme="dark"] body.shop-page .shop .view-toggle button[aria-pressed="true"]:not(:disabled):not([aria-disabled="true"]):hover{background:#f1eddf!important;color:#17281c!important}
}

/* ---------- Product cards: eight shared rows via CSS subgrid ----------
   media · collection label · title · price · description · colors · selected color · button.
   Every card renders all eight (empty rows collapse to zero height), so each row lines up
   across a row of cards and the buttons share one baseline. */
/* Subgrid rows inherit the parent's row gap, so the grid has none and cards carry their own spacing. */
.shop .product-grid{align-items:stretch;row-gap:0}
.shop .catalog-card{display:grid;grid-template-rows:subgrid;grid-row:span 8;row-gap:0;min-width:0;align-content:start;margin-bottom:48px}
.catalog-media{position:relative;min-width:0}
.catalog-image{display:block;width:100%;aspect-ratio:1/1;overflow:hidden;background:#eeeae2}
.catalog-media .view-toggle{position:absolute;left:10px;bottom:10px;z-index:2;background:rgba(251,248,241,.94);box-shadow:0 6px 18px -10px rgba(23,40,28,.45)}
.catalog-media .view-toggle button{min-width:0;min-height:34px;padding:7px 11px;font-size:9px}
.shop .catalog-collection{margin-top:18px;font-size:9px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--olive)}
.shop .catalog-title{margin-top:18px;font-family:Inter,Arial,sans-serif;font-size:14px;line-height:1.45;font-weight:600;align-self:start}
.shop .catalog-collection:not(:empty)~.catalog-title{margin-top:6px}
.shop .catalog-price{margin-top:5px;font-size:12px;color:var(--muted);align-self:start}
.shop .catalog-description{margin-top:12px!important;font-size:11px;line-height:1.7;color:var(--muted);align-self:start}
.shop .catalog-collection:empty,.shop .catalog-description:empty{margin:0!important}
.shop .catalog-card .catalog-colors{margin:20px 0 0;align-self:start}
.shop .catalog-card .selected-color{margin-top:13px!important;align-self:start}
.shop .catalog-card .catalog-cta{margin-top:20px;align-self:end}
@supports not (grid-template-rows:subgrid){
  .shop .catalog-card{display:flex;flex-direction:column}
  .shop .catalog-card .catalog-cta{margin-top:auto}
  .shop .catalog-card .selected-color{margin-bottom:20px}
}

/* ---------- Tilt surfaces ---------- */
.tilt{--rx:0deg;--ry:0deg;--gx:50%;--gy:50%;position:relative;overflow:hidden;transform:perspective(1100px) rotateX(var(--rx)) rotateY(var(--ry));transition:transform .7s cubic-bezier(.2,.8,.2,1),box-shadow .5s ease;touch-action:pan-y;user-select:none;-webkit-tap-highlight-color:transparent}
.tilt.is-tilting{transition:transform .12s linear,box-shadow .3s ease}
.tilt.is-dragging{cursor:grabbing}
.tilt::after{content:"";position:absolute;inset:0;pointer-events:none;background:radial-gradient(circle at var(--gx) var(--gy),rgba(255,255,255,.28),rgba(255,255,255,0) 55%);opacity:0;transition:opacity .4s ease;mix-blend-mode:soft-light}
.tilt.is-tilting::after{opacity:1}
.spot-tilt.is-tilting{box-shadow:0 44px 80px -36px rgba(23,40,28,.6),0 2px 6px rgba(23,40,28,.08)}
body.shop-motion .tilt{cursor:grab}
body:not(.shop-motion) .tilt{transform:none;cursor:auto}

/* ---------- Image swaps ---------- */
.spot-tilt img,.catalog-image img{transition:opacity .16s ease,transform .3s ease}
img.is-swapping{opacity:0;transform:scale(.985)}
.is-loading::before{content:"";position:absolute;z-index:2;top:14px;right:14px;width:16px;height:16px;border:2px solid rgba(36,59,42,.25);border-top-color:var(--forest);border-radius:50%;animation:shop-spin .8s linear infinite}
@keyframes shop-spin{to{transform:rotate(360deg)}}

/* ---------- Entrance reveals (only when JS + motion are available) ---------- */
body.shop-motion [data-reveal]{opacity:0;transform:translate3d(0,28px,0);transition:opacity .8s cubic-bezier(.2,.7,.2,1) var(--reveal-delay,0ms),transform .9s cubic-bezier(.2,.7,.2,1) var(--reveal-delay,0ms)}
body.shop-motion [data-reveal].is-in{opacity:1;transform:none}
@media (prefers-reduced-motion:no-preference){html:has(body.shop-page){scroll-behavior:smooth}}

/* ---------- Category view ---------- */
.category-intro{max-width:1360px;margin-inline:auto;padding:70px 44px 10px}
.shop .category-intro h1{margin:18px 0 0;font-size:clamp(64px,7vw,104px);line-height:.9}
.category-intro h1:focus{outline:none}
.category-lede{max-width:520px;margin-top:22px!important;font-size:15px;line-height:1.8;color:var(--muted)}
.category-count{margin-top:16px!important;font-size:10px;font-weight:600;letter-spacing:.14em;text-transform:uppercase;color:var(--olive)}
.shop[data-category]:not([data-category="all"]) .showcase{padding-top:72px;padding-bottom:96px}
/* Compact category identifier above a featured showcase (Hats, Hoodies). */
.shop[data-showcase="true"] .category-intro{display:flex;flex-wrap:wrap;align-items:baseline;gap:6px 22px;padding-top:30px;padding-bottom:30px}
.shop[data-showcase="true"] .category-intro .shop-eyebrow{flex-basis:100%}
.shop.shop[data-showcase="true"] .category-intro h1{margin:2px 0 0;font-family:Inter,Arial,sans-serif;font-size:20px;font-weight:600;line-height:1.2;letter-spacing:.01em}
.shop[data-showcase="true"] .category-lede{flex:1 1 320px;margin-top:0!important;max-width:560px;font-size:13px;line-height:1.6}
.shop[data-showcase="true"] .category-count{margin-top:0!important}
.shop[data-showcase="true"] .showcase{padding-top:64px}
.category-section{padding-top:84px}

/* Category grids size to their product count; a single product gets an editorial two-column card. */
@media(min-width:1051px){.category-section .product-grid[data-count="3"]{grid-template-columns:repeat(3,minmax(0,1fr));gap:40px 32px}.category-section .product-grid[data-count="2"]{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(min-width:761px){
  .category-section .product-grid[data-count="1"]{grid-template-columns:minmax(0,1fr)}
  .shop .category-section .product-grid[data-count="1"] .catalog-card{grid-row:auto;grid-template-rows:1fr repeat(7,auto) 1fr;grid-template-columns:minmax(0,1.05fr) minmax(0,.95fr);column-gap:64px;max-width:1120px}
  .category-section .product-grid[data-count="1"] .catalog-media{grid-column:1;grid-row:1 / -1}
  .category-section .product-grid[data-count="1"] .catalog-card>:nth-child(2){grid-column:2;grid-row:2}
  .category-section .product-grid[data-count="1"] .catalog-card>:nth-child(3){grid-column:2;grid-row:3}
  .category-section .product-grid[data-count="1"] .catalog-card>:nth-child(4){grid-column:2;grid-row:4}
  .category-section .product-grid[data-count="1"] .catalog-card>:nth-child(5){grid-column:2;grid-row:5}
  .category-section .product-grid[data-count="1"] .catalog-card>:nth-child(6){grid-column:2;grid-row:6}
  .category-section .product-grid[data-count="1"] .catalog-card>:nth-child(7){grid-column:2;grid-row:7}
  .category-section .product-grid[data-count="1"] .catalog-card>:nth-child(8){grid-column:2;grid-row:8;justify-self:start;width:100%;max-width:340px}
  .shop .category-section .product-grid[data-count="1"] .catalog-title{font-family:'Cormorant Garamond',Georgia,serif;font-size:clamp(40px,3.6vw,54px);font-weight:500;line-height:1;letter-spacing:-.035em}
  .shop .category-section .product-grid[data-count="1"] .catalog-price{font-size:14px;margin-top:12px}
  .category-section .product-grid[data-count="1"] .color-swatch{width:40px;height:40px;flex-basis:40px}
}

/* ---------- Six-collection strip above the shop footer ---------- */
.shop .collection-index{padding-top:64px;padding-bottom:36px}

/* ---------- Responsive ---------- */
@media(max-width:1050px){
  .gt-hero{gap:44px;padding-bottom:72px}
  .spot,.spot--reverse{gap:52px}
  .showcase-head{margin-bottom:56px}
}
@media(max-width:760px){
  .gt-hero{grid-template-columns:1fr;gap:40px;padding:40px 22px 60px}
  .gt-hero-logo{width:180px;margin-bottom:28px}
  .shop .gt-hero h1{font-size:clamp(50px,14vw,68px)}
  .gt-hero-media figcaption{flex-direction:column;gap:8px}
  .showcase{padding:72px 22px 80px}
  .showcase-head{display:block;margin-bottom:40px;padding-bottom:24px}
  .showcase-head>p{margin-top:18px}
  .shop .showcase-head h2{font-size:clamp(54px,16vw,80px)}
  .spot,.spot--reverse{grid-template-columns:1fr;gap:28px}
  .spot--reverse .spot-stage{order:0}
  .spot-stage{transform:none}
  .spot-copy{max-width:none;transform:none}
  .spot .catalog-cta{max-width:none}
  .spot .view-toggle{display:flex;width:100%}
  .spot .view-toggle button{flex:1;min-height:44px}
  .category-intro{padding:48px 22px 0}
  .shop .category-intro h1{font-size:clamp(56px,17vw,76px)}
  .category-section{padding-top:64px}
  .shop .collection-index{padding:48px 22px 24px}
}
@media(max-width:520px){
  .gt-hero,.showcase,.category-intro{width:100vw;max-width:100vw}
  .catalog-media .view-toggle{left:8px;right:8px;bottom:8px;display:flex}
  .catalog-media .view-toggle button{flex:1;min-height:40px}
}

/* ---------- Reduced motion: everything static, instant swaps ---------- */
@media (prefers-reduced-motion:reduce){
  .spot-stage,.spot-copy,.tilt{transform:none!important}
  .tilt::after{display:none}
  [data-reveal]{opacity:1!important;transform:none!important}
  .is-loading::before{animation:none}
}
