/* Layerborn storefront. Product-first, plain, no decoration. Tokens in tokens.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--color-bg); color: var(--color-text); font-family: var(--font-body); font-size: var(--text-base); line-height: 1.5; -webkit-font-smoothing: antialiased; min-height: 100dvh; display: flex; flex-direction: column; }
main { flex: 1 0 auto; }
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { text-decoration-thickness: 2px; }
h1, h2, h3, h4 { font-weight: 600; line-height: 1.2; letter-spacing: -0.01em; margin: 0 0 var(--s-3); text-wrap: balance; }
h1 { font-size: var(--text-3xl); } h2 { font-size: var(--text-2xl); } h3 { font-size: var(--text-lg); } h4 { font-size: var(--text-base); }
p { margin: 0 0 var(--s-3); max-width: 62ch; }
.muted { color: var(--color-muted); }
.small { font-size: var(--text-sm); }
.mono { font-family: var(--font-mono); font-size: 0.9em; }
.num { font-variant-numeric: tabular-nums; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--color-text); outline-offset: 2px; }
.skip-link { position: absolute; left: var(--s-4); top: -60px; background: var(--color-accent); color: var(--color-onAccent); padding: var(--s-2) var(--s-4); z-index: 100; }
.skip-link:focus { top: var(--s-4); }
.container { width: 100%; max-width: var(--max-w); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: var(--s-12); border-top: 1px solid var(--color-border); }
.section:first-of-type { border-top: 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s-4); margin-bottom: var(--s-6); flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.section-head .count { color: var(--color-muted); font-size: var(--text-sm); margin-left: var(--s-2); font-weight: 400; }

/* buttons & controls */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--s-2); min-height: var(--control-h); padding: 0 var(--s-4); border-radius: var(--radius); border: 1px solid transparent; font: inherit; font-weight: 500; cursor: pointer; text-decoration: none; white-space: nowrap; transition: background-color var(--dur-quick), border-color var(--dur-quick), color var(--dur-quick); }
.btn:hover { text-decoration: none; }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.5; cursor: not-allowed; }
.btn--primary { background: var(--color-accent); color: var(--color-onAccent); border-color: var(--color-accent); }
.btn--primary:hover { background: color-mix(in srgb, var(--color-accent) 85%, var(--color-bg)); }
.btn--secondary { background: transparent; border-color: var(--color-border-strong); color: var(--color-text); }
.btn--secondary:hover { background: var(--color-surface2); }
.btn--quiet { background: transparent; color: var(--color-text); padding-inline: var(--s-3); }
.btn--quiet:hover { background: var(--color-surface2); }
.btn--block { width: 100%; }
.btn--sm { min-height: 34px; padding-inline: var(--s-3); font-size: var(--text-sm); }
.spinner { width: 14px; height: 14px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin 0.8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.input, .select { min-height: var(--control-h); padding: 0 var(--s-3); border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface); color: var(--color-text); font: inherit; width: 100%; }
.input:focus, .select:focus { border-color: var(--color-text); outline: none; }
.field { display: flex; flex-direction: column; gap: var(--s-1); }
.field label { font-size: var(--text-sm); font-weight: 500; }
.qty { display: inline-flex; border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; }
.qty button { width: 40px; height: 40px; border: 0; background: var(--color-surface); font: inherit; font-size: var(--text-lg); cursor: pointer; color: var(--color-text); }
.qty button:hover { background: var(--color-surface2); }
.qty input { width: 48px; text-align: center; border: 0; border-inline: 1px solid var(--color-border); font: inherit; background: var(--color-surface); color: var(--color-text); -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* header */
.site-header { position: sticky; top: 0; z-index: 50; background: var(--color-bg); border-bottom: 1px solid var(--color-border); }
.site-header .row { display: flex; align-items: center; gap: var(--s-6); min-height: 60px; }
.brand { font-family: var(--font-wordmark); font-weight: 700; font-size: 1.3rem; letter-spacing: -0.02em; text-decoration: none; display: inline-flex; align-items: center; gap: 10px; }
.brand .mark { width: 24px; height: 26px; }
.nav { display: flex; gap: var(--s-1); }
.nav a { text-decoration: none; padding: var(--s-2) var(--s-3); border-radius: var(--radius); font-size: var(--text-sm); font-weight: 500; }
.nav a:hover { background: var(--color-surface2); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }
.search { margin-left: auto; width: min(320px, 100%); display: flex; }
.search .input { min-height: 38px; }
.cart-btn { position: relative; }
.cart-btn .count { position: absolute; top: 0; right: 0; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--color-text); color: var(--color-bg); font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; }
.cart-btn .count[hidden] { display: none; }
.menu-btn { display: none; }
@media (max-width: 860px) {
  .site-header .row { gap: var(--s-3); }
  .nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--color-bg); border-bottom: 1px solid var(--color-border); flex-direction: column; padding: var(--s-2) var(--gutter) var(--s-3); }
  .nav.is-open { display: flex; }
  .nav a { padding: var(--s-3) var(--s-2); }
  .menu-btn { display: inline-flex; }
  .search { order: 10; width: 100%; margin: 0 0 var(--s-3); }
  .site-header .row { flex-wrap: wrap; }
  .cart-btn { margin-left: auto; }
}

/* intro */
.intro { padding-block: var(--s-12) var(--s-8); }
.intro h1 { max-width: 24ch; margin-bottom: var(--s-3); }
.intro p { font-size: var(--text-lg); color: var(--color-muted); max-width: 56ch; }
.intro .actions { display: flex; gap: var(--s-3); flex-wrap: wrap; margin-top: var(--s-4); }

/* product grid & card */
.grid { display: grid; gap: var(--s-6) var(--s-4); grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (max-width: 1024px) { .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 680px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--s-6) var(--s-3); } }
.card { position: relative; display: flex; flex-direction: column; gap: var(--s-2); }
.card .media { aspect-ratio: 1; background: var(--color-surface2); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; }
.card .media img { width: 100%; height: 100%; object-fit: cover; }
.card .media .placeholder { font-size: var(--text-xs); color: var(--color-muted); }
.card:hover .media { border-color: var(--color-border-strong); }
.card .title { font-weight: 500; font-size: var(--text-sm); margin: 0; line-height: 1.35; }
.card .title a { text-decoration: none; }
.card .title a::after { content: ""; position: absolute; inset: 0; }
.card .title a:hover { text-decoration: underline; }
.card .sub { font-size: var(--text-xs); color: var(--color-muted); margin: 0; }
.card .price-row { display: flex; align-items: baseline; gap: var(--s-2); font-size: var(--text-sm); }
.price { font-weight: 600; font-variant-numeric: tabular-nums; }
.price--sale { color: var(--color-brand); }
.price--was { color: var(--color-muted); text-decoration: line-through; font-weight: 400; }
.flag { position: absolute; top: var(--s-2); left: var(--s-2); z-index: 2; background: var(--color-bg); border: 1px solid var(--color-border); color: var(--color-text); font-size: var(--text-xs); font-weight: 500; padding: 2px 8px; border-radius: var(--radius); }
.flag--sale { color: var(--color-brand); border-color: var(--color-brand); }
.card .quick { position: relative; z-index: 2; align-self: flex-start; }

/* skeleton & states */
.skeleton { background: var(--color-surface2); border-radius: var(--radius); animation: pulse 1.2s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: 0.55; } }
@media (prefers-reduced-motion: reduce) { .skeleton { animation: none; } }
.skeleton-card .media { aspect-ratio: 1; }
.skeleton-card .lines { display: grid; gap: var(--s-2); margin-top: var(--s-2); }
.skeleton-card .lines .skeleton { height: 12px; }
.skeleton-card .lines .skeleton:last-child { width: 35%; }
.state { border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--s-6); max-width: 56ch; }
.state h3 { margin-bottom: var(--s-2); }
.state--error { border-color: var(--color-danger); }
.alert { padding: var(--s-3) var(--s-4); border-radius: var(--radius); border: 1px solid var(--color-border); font-size: var(--text-sm); background: var(--color-surface2); }
.alert--error { border-color: var(--color-danger); color: var(--color-danger); background: transparent; }
.alert[hidden] { display: none; }

/* category list & info */
.cat-list { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--color-border); }
.cat-list li { border-bottom: 1px solid var(--color-border); }
.cat-list a { display: grid; grid-template-columns: 1fr auto; gap: var(--s-4); align-items: center; padding: var(--s-4) 0; text-decoration: none; }
.cat-list a:hover h3 { text-decoration: underline; }
.cat-list h3 { margin: 0 0 2px; font-size: var(--text-base); }
.cat-list p { margin: 0; font-size: var(--text-sm); color: var(--color-muted); }
.cat-list .arrow { color: var(--color-muted); font-size: var(--text-sm); white-space: nowrap; }
.info-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--s-8); }
@media (max-width: 760px) { .info-grid { grid-template-columns: 1fr; gap: var(--s-6); } }
.info-grid h3 { font-size: var(--text-base); margin-bottom: var(--s-2); }
.info-grid p { font-size: var(--text-sm); color: var(--color-muted); margin: 0; }
.panel { border: 1px solid var(--color-border); border-radius: var(--radius); padding: var(--s-6); }
.panel h2 { font-size: var(--text-xl); }
.two-col { display: grid; grid-template-columns: minmax(0, 3fr) minmax(0, 2fr); gap: var(--s-12); align-items: start; }
@media (max-width: 760px) { .two-col { grid-template-columns: 1fr; gap: var(--s-8); } }
.page-head { padding-block: var(--s-8) var(--s-6); }
.page-head p { color: var(--color-muted); }
.breadcrumb { font-size: var(--text-sm); color: var(--color-muted); padding-top: var(--s-6); margin-bottom: var(--s-6); display: flex; gap: var(--s-2); flex-wrap: wrap; }
.breadcrumb a { text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }

/* shop toolbar */
.toolbar { display: flex; gap: var(--s-3); align-items: center; flex-wrap: wrap; margin-bottom: var(--s-6); }
.chips { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.chip { min-height: 34px; padding: 0 var(--s-3); border-radius: var(--radius); border: 1px solid var(--color-border); background: var(--color-surface); font: inherit; font-size: var(--text-sm); cursor: pointer; color: var(--color-text); }
.chip:hover { border-color: var(--color-border-strong); }
.chip[aria-pressed="true"] { background: var(--color-accent); color: var(--color-onAccent); border-color: var(--color-accent); }
.toolbar .spacer { flex: 1; }
.toolbar .select { width: auto; }
.result-count { font-size: var(--text-sm); color: var(--color-muted); margin-bottom: var(--s-4); }

/* product page */
.pdp { display: grid; grid-template-columns: minmax(0, 11fr) minmax(0, 9fr); gap: var(--s-12); align-items: start; }
@media (max-width: 900px) { .pdp { grid-template-columns: 1fr; gap: var(--s-8); } }
.gallery .main { aspect-ratio: 1; background: var(--color-surface2); border: 1px solid var(--color-border); border-radius: var(--radius); overflow: hidden; display: grid; place-items: center; }
.gallery .main img { width: 100%; height: 100%; object-fit: contain; }
.thumbs { display: flex; gap: var(--s-2); margin-top: var(--s-3); flex-wrap: wrap; }
.thumbs button { width: 60px; height: 60px; padding: 0; border: 1px solid var(--color-border); border-radius: var(--radius); background: var(--color-surface2); overflow: hidden; cursor: pointer; }
.thumbs button[aria-pressed="true"] { border-color: var(--color-border-strong); }
.thumbs img { width: 100%; height: 100%; object-fit: cover; }
.buybox { position: sticky; top: 76px; }
@media (max-width: 900px) { .buybox { position: static; } }
.buybox h1 { font-size: var(--text-2xl); margin-bottom: var(--s-1); }
.buybox .subtitle { color: var(--color-muted); margin-bottom: var(--s-4); }
.buybox .price-row { display: flex; align-items: baseline; gap: var(--s-3); margin-bottom: var(--s-4); font-size: var(--text-xl); }
.stock { font-size: var(--text-sm); color: var(--color-muted); }
.stock--low { color: var(--color-warning); }
.stock--out { color: var(--color-danger); }
.options { display: grid; gap: var(--s-4); margin-bottom: var(--s-4); }
.option-values { display: flex; gap: var(--s-2); flex-wrap: wrap; }
.buy-row { display: flex; gap: var(--s-3); flex-wrap: wrap; align-items: center; margin-bottom: var(--s-3); }
.buy-row .btn { flex: 1; }
.notes { display: grid; gap: var(--s-2); font-size: var(--text-sm); color: var(--color-muted); padding-top: var(--s-4); margin-top: var(--s-4); border-top: 1px solid var(--color-border); }
.prose { max-width: 64ch; }
.prose h2 { font-size: var(--text-xl); margin-top: var(--s-8); }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose img { border-radius: var(--radius); }
.accordion details { border-top: 1px solid var(--color-border); }
.accordion details:last-child { border-bottom: 1px solid var(--color-border); }
.accordion summary { cursor: pointer; padding: var(--s-3) 0; font-weight: 500; list-style: none; display: flex; justify-content: space-between; }
.accordion summary::-webkit-details-marker { display: none; }
.accordion summary::after { content: "+"; color: var(--color-muted); }
.accordion details[open] summary::after { content: "–"; }
.accordion .content { padding-bottom: var(--s-4); font-size: var(--text-sm); }

/* cart */
.drawer-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / 0.35); z-index: 60; opacity: 0; transition: opacity var(--dur-base) var(--ease-out); }
.drawer-backdrop[hidden] { display: none; }
.drawer-backdrop.is-open { opacity: 1; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; width: min(400px, 100%); background: var(--color-surface); z-index: 61; display: flex; flex-direction: column; transform: translateX(100%); transition: transform var(--dur-slow) var(--ease-out); box-shadow: var(--shadow-overlay); border-left: 1px solid var(--color-border); }
.drawer[hidden] { display: none; }
.drawer.is-open { transform: none; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: var(--s-3) var(--s-4) var(--s-3) var(--s-6); border-bottom: 1px solid var(--color-border); }
.drawer-head h2 { margin: 0; font-size: var(--text-lg); }
.drawer-body { flex: 1; overflow: auto; padding: var(--s-2) var(--s-6); }
.drawer-foot { padding: var(--s-4) var(--s-6) var(--s-6); border-top: 1px solid var(--color-border); display: grid; gap: var(--s-3); }
.cart-line { display: grid; grid-template-columns: 64px 1fr auto; gap: var(--s-3); padding: var(--s-4) 0; border-bottom: 1px solid var(--color-border); align-items: start; }
.cart-line:last-child { border-bottom: 0; }
.cart-line .thumb { width: 64px; height: 64px; background: var(--color-surface2); border-radius: var(--radius); overflow: hidden; border: 1px solid var(--color-border); display: block; }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line .name { font-weight: 500; margin: 0 0 2px; font-size: var(--text-sm); }
.cart-line .name a { text-decoration: none; }
.cart-line .name a:hover { text-decoration: underline; }
.cart-line .variant { font-size: var(--text-xs); color: var(--color-muted); }
.cart-line .controls { display: flex; align-items: center; gap: var(--s-3); margin-top: var(--s-2); }
.cart-line .qty button, .cart-line .qty input { height: 30px; width: 30px; font-size: var(--text-base); }
.cart-line .qty input { width: 38px; font-size: var(--text-sm); }
.cart-line .remove { background: none; border: 0; color: var(--color-muted); font: inherit; font-size: var(--text-xs); cursor: pointer; text-decoration: underline; padding: 0; }
.cart-line .remove:hover { color: var(--color-text); }
.cart-line .amount { text-align: right; font-size: var(--text-sm); }
.summary-row { display: flex; justify-content: space-between; font-size: var(--text-sm); }
.summary-row--total { font-size: var(--text-base); font-weight: 600; }
.cart-page { display: grid; grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr); gap: var(--s-12); align-items: start; }
@media (max-width: 900px) { .cart-page { grid-template-columns: 1fr; gap: var(--s-8); } }

/* toast */
.toast { position: fixed; left: 50%; bottom: var(--s-6); transform: translate(-50%, 8px); z-index: 70; background: var(--color-text); color: var(--color-bg); padding: var(--s-3) var(--s-4); border-radius: var(--radius); font-size: var(--text-sm); display: flex; gap: var(--s-4); align-items: center; opacity: 0; transition: opacity var(--dur-base), transform var(--dur-base); pointer-events: none; max-width: calc(100% - 2 * var(--gutter)); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); pointer-events: auto; }
.toast a { color: inherit; font-weight: 500; }

/* footer */
.site-footer { border-top: 1px solid var(--color-border); margin-top: var(--s-16); font-size: var(--text-sm); }
.site-footer .top { display: grid; grid-template-columns: 2fr 1fr 1fr 1fr; gap: var(--s-8); padding-block: var(--s-8); }
@media (max-width: 760px) { .site-footer .top { grid-template-columns: 1fr 1fr; gap: var(--s-6); } .site-footer .top > div:first-child { grid-column: 1 / -1; } }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: var(--s-2); }
.site-footer h4 { margin-bottom: var(--s-3); }
.site-footer a { text-decoration: none; }
.site-footer a:hover { text-decoration: underline; }
.site-footer .bottom { display: flex; justify-content: space-between; gap: var(--s-4); flex-wrap: wrap; padding-block: var(--s-4); border-top: 1px solid var(--color-border); font-size: var(--text-xs); color: var(--color-muted); }
.pay { display: flex; gap: var(--s-2); flex-wrap: wrap; margin-top: var(--s-3); }
.pay span { border: 1px solid var(--color-border); border-radius: var(--radius); padding: 2px 8px; font-size: var(--text-xs); color: var(--color-muted); }

/* forms & status pages */
.form { display: grid; gap: var(--s-4); }
.form textarea.input { min-height: 140px; padding-block: var(--s-3); resize: vertical; }
.contact-list { list-style: none; padding: 0; margin: 0; display: grid; gap: var(--s-3); font-size: var(--text-sm); }
.contact-list strong { display: block; font-weight: 500; margin-bottom: 1px; }
.status-page { max-width: 56ch; padding-block: var(--s-16); }
.status-page .actions { display: flex; gap: var(--s-3); flex-wrap: wrap; }
.policy h2 { font-size: var(--text-xl); margin-top: var(--s-8); padding-top: var(--s-6); border-top: 1px solid var(--color-border); }
.policy h2:first-of-type { border-top: 0; margin-top: 0; padding-top: 0; }
