/* TACENZA. Store: the frame (matches tacenza/site chrome.css) and the store's own pages. Tokens come from base.css. */

/* The backdrop products stand on: soft and light in both themes, so dark garments still read. */
:root { --stage: var(--bg); }
@media (prefers-color-scheme: dark) { :root:not([data-theme='light']) { --stage: #3b3347; } }
:root[data-theme='dark'] { --stage: #3b3347; }

/* ---------- header and footer ---------- */
.site-header { position: sticky; top: 0; z-index: 50; background: color-mix(in srgb, var(--surface) 92%, transparent); border-bottom: 1px solid var(--line-soft); }
@supports (backdrop-filter: blur(1px)) {
  .site-header { background: color-mix(in srgb, var(--surface) 82%, transparent); backdrop-filter: saturate(1.4) blur(12px); }
}
.hdr { display: flex; align-items: center; gap: var(--s-6); height: var(--header-h); }
.brand { display: flex; align-items: center; gap: var(--s-3); flex: none; }
.brand-mark { display: inline-flex; color: var(--ink); padding: 6px 2px; border-radius: var(--r-sm); }
.wordmark { color: inherit; }
.wordmark-dot { fill: var(--accent); }
.brand-sep { width: 1px; height: 20px; background: var(--line); }
.brand-site { font-family: var(--didone); font-size: 1.1875rem; font-weight: 500; color: var(--ink); text-decoration: none; line-height: 1; padding: 4px 2px; border-radius: var(--r-sm); }
.brand-site:hover { color: var(--accent); }
.hdr-end { display: flex; align-items: center; gap: var(--s-2); margin-left: auto; }
.bagbtn { color: var(--ink) !important; }
.bagbtn svg { width: 20px !important; height: 20px !important; }
.bagcount {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
  border-radius: var(--r-pill); background: var(--accent); color: var(--accent-ink); font-size: var(--fs-xs); line-height: 1;
}

.site-footer { margin-top: var(--section-y); border-top: 1px solid var(--line-soft); background: var(--surface-2); padding-block: var(--s-8) var(--s-6); }
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s-6); }
.foot-brand { display: grid; gap: var(--s-3); max-width: 38ch; color: var(--ink); }
.foot-links { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); }
.foot-links a { color: var(--ink); text-decoration: none; font-size: var(--fs-md); }
.foot-links a:hover { color: var(--accent); text-decoration: underline; }
.foot-legal { margin-top: var(--s-6); }

/* ---------- home ---------- */
.hero { padding-block: clamp(40px, 7vw, 96px) clamp(28px, 4vw, 56px); display: grid; gap: var(--s-4); }
.display { font-size: var(--fs-5xl); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 260px), 1fr)); gap: var(--s-6); }
.card { display: grid; gap: var(--s-2); color: var(--ink); text-decoration: none; border-radius: var(--r-lg); }
.card-art {
  aspect-ratio: 4 / 5; display: grid; place-items: center; padding: var(--s-6);
  background: var(--stage); border-radius: var(--r-lg); overflow: hidden;
  transition: background-color var(--t) var(--ease);
}
.card-art .mock { width: 100%; height: 100%; transition: transform var(--t-slow) var(--ease); }
.card:hover .card-art .mock { transform: scale(1.03); }
.card:hover .card-title { color: var(--accent); }
.card-meta { display: flex; justify-content: space-between; align-items: baseline; gap: var(--s-3); margin-top: var(--s-2); }
.card-title { font-size: var(--fs-xl); }
.price { font-weight: 700; white-space: nowrap; }
.promises { margin-top: var(--section-y); }
.promises ul { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); gap: var(--s-6); border-top: 1px solid var(--line-soft); padding-top: var(--s-7); }
.promises li { display: grid; gap: var(--s-1); }

/* ---------- product page ---------- */
.pdp { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); padding-top: var(--s-7); align-items: start; }
.pdp-art { position: sticky; top: calc(var(--header-h) + var(--s-5)); aspect-ratio: 1; display: grid; place-items: center; padding: clamp(16px, 4vw, 48px); background: var(--stage); border-radius: var(--r-xl); }
.pdp-art .mock { width: 100%; height: 100%; }
.pdp-info { --flow: var(--s-4); padding-block: var(--s-2); }
.pdp-info h1 { font-size: var(--fs-4xl); }
.pdp-price { font-size: var(--fs-xl); font-weight: 700; }
.buy { --flow: var(--s-5); }
.opt { border: 0; margin: 0; padding: 0; display: grid; gap: var(--s-2); min-width: 0; }
.opt legend { font-size: var(--fs-sm); font-weight: 700; padding: 0; margin-bottom: var(--s-2); }
.opt legend span { font-weight: 400; color: var(--muted); }
.opts { display: flex; flex-wrap: wrap; gap: var(--s-2); }
.sw-in, .chip-in { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.sw { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; cursor: pointer; border: 2px solid transparent; transition: border-color var(--t-fast) var(--ease); }
.sw svg { width: 30px; height: 30px; }
.sw circle { stroke: color-mix(in srgb, var(--ink) 22%, transparent); stroke-width: 1; }
.sw:hover { border-color: var(--line); }
.sw-in:checked + .sw { border-color: var(--accent); }
.sw-in:focus-visible + .sw, .chip-in:focus-visible + .chip { outline: 2px solid var(--accent); outline-offset: 2px; }
.sw-in:disabled + .sw { opacity: 0.35; cursor: not-allowed; }
.chip {
  display: inline-grid; place-items: center; min-width: 52px; min-height: var(--h-md); padding: 0 var(--s-3);
  border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); font-weight: 700; font-size: var(--fs-md); cursor: pointer;
  transition: border-color var(--t-fast) var(--ease), background-color var(--t-fast) var(--ease);
}
.chip:hover { border-color: color-mix(in srgb, var(--line) 55%, var(--ink)); }
.chip-in:checked + .chip { border-color: var(--accent); background: var(--accent-soft); color: var(--ink); box-shadow: inset 0 0 0 1px var(--accent); }
.chip-in:disabled + .chip { opacity: 0.4; text-decoration: line-through; cursor: not-allowed; }
.buyrow { display: flex; gap: var(--s-3); }
.buyrow .qty { width: 84px; flex: none; min-height: 48px; }
.buyrow .btn { flex: 1; }
.details { display: grid; gap: var(--s-2); padding: var(--s-5) 0 0; margin: var(--s-2) 0 0; border-top: 1px solid var(--line-soft); list-style: none; }
.details li { display: flex; gap: var(--s-2); align-items: flex-start; }
.details svg { width: 18px; height: 18px; color: var(--ok); flex: none; margin-top: 2px; }

/* ---------- bag ---------- */
.bagpage { padding-top: var(--s-7); }
.bagpage h1 { font-size: var(--fs-4xl); margin-bottom: var(--s-6); }
.baggrid { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: var(--s-8); align-items: start; }
.lines { display: grid; gap: 0; }
.line { display: grid; grid-template-columns: 96px minmax(0, 1fr) auto auto; gap: var(--s-4); align-items: center; padding-block: var(--s-4); border-bottom: 1px solid var(--line-soft); }
.line:first-child { border-top: 1px solid var(--line-soft); }
.line-art { display: grid; place-items: center; width: 96px; aspect-ratio: 1; padding: 8px; background: var(--stage); border-radius: var(--r-md); }
.line-art .mock { width: 100%; height: 100%; }
.line-info { display: grid; gap: 2px; min-width: 0; }
.line-name { font-family: var(--didone); font-size: var(--fs-lg); color: var(--ink); text-decoration: none; }
.line-name:hover { color: var(--accent); text-decoration: underline; }
.line-qty { display: flex; align-items: center; gap: var(--s-2); }
.line-qty .t { width: 72px; }
.line-total { min-width: 72px; text-align: right; }
.summary { --flow: var(--s-4); position: sticky; top: calc(var(--header-h) + var(--s-5)); padding: var(--s-6); background: var(--surface-2); border-radius: var(--r-lg); }
.methods { display: grid; gap: var(--s-2); }
.method input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.method label { display: flex; justify-content: space-between; align-items: center; gap: var(--s-3); padding: var(--s-3); border: 1px solid var(--line); border-radius: var(--r-md); background: var(--surface); cursor: pointer; }
.method label > span:first-child { display: grid; }
.method input:checked + label { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.method input:focus-visible + label { outline: 2px solid var(--accent); outline-offset: 2px; }
.totals { margin: 0; display: grid; gap: var(--s-2); }
.totals > div { display: flex; justify-content: space-between; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 700; }
.totals .grand { padding-top: var(--s-3); border-top: 1px solid var(--line); font-size: var(--fs-lg); }
.totals .grand dt { color: var(--ink); font-weight: 700; }
.empty { display: grid; gap: var(--s-4); justify-items: start; padding-block: var(--s-6); }

/* ---------- simple pages ---------- */
.center-page { padding-block: clamp(48px, 10vw, 120px); }
.center-page h1 { font-size: var(--fs-4xl); }
.prose { --flow: var(--s-4); padding-top: var(--s-8); }
.prose h1 { font-size: var(--fs-4xl); }
.prose h2 { font-size: var(--fs-2xl); margin-top: var(--s-7); }
.prose p, .prose li { max-width: 68ch; }
.prose ul { padding-left: 1.2em; display: grid; gap: var(--s-2); }

@media (max-width: 900px) {
  .pdp { grid-template-columns: 1fr; padding-top: var(--s-4); }
  .pdp-art { position: static; }
  .baggrid { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 560px) {
  .bagbtn span:not(.bagcount) { display: none; }
  .line { grid-template-columns: 72px minmax(0, 1fr) auto; }
  .line-art { width: 72px; }
  .line-qty { grid-column: 2; }
  .line-total { grid-column: 3; grid-row: 1; align-self: start; }
  .brand-site { font-size: 1.0625rem; }
}

/* ---------- polish ---------- */
.facts { display: flex; flex-wrap: wrap; gap: var(--s-2) var(--s-5); margin: var(--s-2) 0 0; padding: 0; color: var(--muted); }
.facts li { display: inline-flex; align-items: center; gap: 6px; }
.facts svg { width: 16px; height: 16px; color: var(--ok); }

.more { margin-top: var(--section-y); }
.more h2 { font-size: var(--fs-2xl); margin-bottom: var(--s-5); }
.minis { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 220px), 1fr)); gap: var(--s-5); }
.mini { display: grid; gap: var(--s-3); color: var(--ink); text-decoration: none; }
.mini img { width: 100%; aspect-ratio: 1; object-fit: cover; border-radius: var(--r-lg); background: var(--stage); transition: transform var(--t-slow) var(--ease); }
.mini > span { display: grid; gap: 2px; }
.mini strong { font-family: var(--didone); font-weight: 500; font-size: var(--fs-lg); }
.mini:hover strong { color: var(--accent); }
.mini:hover img { transform: translateY(-2px); }

/* The bag count gives a small nod when something is added. */
@keyframes bump { 40% { transform: scale(1.3); } }
.bagcount.bump { animation: bump 360ms var(--ease); }

/* Loading lines in the bag, before prices arrive. */
@keyframes pulse { 50% { opacity: 0.45; } }
.skel .line-art, .skel-text { background: var(--stage); animation: pulse 1.2s ease-in-out infinite; }
.skel-text { display: block; height: 14px; width: 60%; border-radius: 6px; grid-column: 2 / -1; }

.method .when { display: block; }
.summary .secure { display: flex; align-items: center; gap: 6px; justify-content: center; }
.summary .secure svg { width: 14px; height: 14px; }
.pdp-art .mock, .card-art .mock { filter: drop-shadow(0 18px 24px hsl(var(--shadow-color) / 0.14)); }
