/* Shared storefront design system — same tokens/components as the homepage,
   plus styles for category, product, cart, and checkout pages. Linked by every
   inner page so the look matches index.html exactly. */
:root {
  --bg: #faf9f6;
  --surface: #ffffff;
  --ink: #1a1a1a;
  --ink-soft: #6b6b6b;
  --line: #e7e5df;
  --accent: #2f3a2f;
  --accent-ink: #ffffff;
  --sale: #9a3b28;
  --radius: 14px;
  --max: 1200px;
  --pad: clamp(20px, 5vw, 64px);
  --font: 'Inter', system-ui, -apple-system, sans-serif;
  --display: 'Fraunces', Georgia, serif;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body { font-family: var(--font); color: var(--ink); background: var(--bg); line-height: 1.5; -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }

.wrap { max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.wrap.iframe-full-width { max-width: none; padding-inline: 0; }
.wrap.iframe-full-width .breadcrumb,
.wrap.iframe-full-width .page-head { max-width: var(--max); margin-inline: auto; padding-inline: var(--pad); }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 8px; z-index: 200; }
.skip-link:focus { left: 12px; }

/* ---------- Announcement + header ---------- */
.announce { background: var(--accent); color: var(--accent-ink); text-align: center; font-size: 0.82rem; letter-spacing: 0.04em; padding: 9px 16px; }
.site-header { position: sticky; top: 0; z-index: 100; background: rgba(250, 249, 246, 0.85); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.nav { display: flex; align-items: center; justify-content: space-between; gap: 24px; height: 68px; }
.brand { font-family: var(--display); font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; white-space: nowrap; }
.brand span { color: var(--ink-soft); font-weight: 500; }
.nav-links { display: flex; gap: 28px; list-style: none; font-size: 0.92rem; font-weight: 500; }
.nav-links a, .nav-menu-toggle { color: var(--ink-soft); transition: color 0.15s; }
.nav-links a:hover, .nav-menu-toggle:hover { color: var(--ink); }
.nav-dropdown { position: relative; }
.nav-dropdown::after { content: ""; position: absolute; top: 100%; left: 50%; transform: translateX(-50%); width: min(var(--max), calc(100vw - (var(--pad) * 2))); height: 22px; }
.nav-menu-toggle { border: 0; background: transparent; font: inherit; font-weight: 500; cursor: pointer; display: inline-flex; align-items: center; gap: 6px; padding: 0; }
.nav-menu-toggle::after { content: ""; width: 6px; height: 6px; border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg) translateY(-2px); }
.nav-menu-panel { position: absolute; top: calc(100% + 18px); left: 50%; transform: translateX(-50%) translateY(6px); width: min(var(--max), calc(100vw - (var(--pad) * 2))); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: 0 24px 70px rgba(26,26,26,0.13); padding: 22px; opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 0.16s ease, transform 0.16s ease, visibility 0.16s ease; }
.nav-dropdown:hover .nav-menu-panel, .nav-dropdown:focus-within .nav-menu-panel, .nav-dropdown.is-open .nav-menu-panel { opacity: 1; visibility: visible; pointer-events: auto; transform: translateX(-50%) translateY(0); }
.nav-menu-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px 18px; list-style: none; max-height: min(62vh, 520px); overflow: auto; }
.nav-menu-grid a { display: block; padding: 8px 10px; border-radius: 9px; color: var(--ink-soft); line-height: 1.25; }
.nav-menu-grid a:hover { background: var(--bg); color: var(--ink); }
.nav-menu-empty { color: var(--ink-soft); padding: 8px 10px; }
.nav-actions { display: flex; align-items: center; gap: 18px; }
.icon-btn { background: none; border: none; cursor: pointer; color: var(--ink); display: inline-flex; align-items: center; gap: 6px; font-size: 0.9rem; font-family: inherit; text-decoration: none; position: relative; }
.cart-count { background: var(--accent); color: #fff; font-size: 0.7rem; font-weight: 600; min-width: 18px; height: 18px; border-radius: 999px; display: inline-grid; place-items: center; padding: 0 5px; }
.menu-toggle { display: none; }

/* ---------- Buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 14px 28px; border-radius: 999px; font-weight: 600; font-size: 0.95rem; font-family: inherit; cursor: pointer; border: 1px solid transparent; transition: transform 0.12s ease, background 0.15s, color 0.15s; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--accent); color: var(--accent-ink); }
.btn-primary:hover { background: #212a21; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #fff; }
.btn-block { width: 100%; }

/* ---------- Breadcrumb + page head ---------- */
.breadcrumb { font-size: 0.85rem; color: var(--ink-soft); padding-top: 28px; display: flex; gap: 8px; flex-wrap: wrap; }
.breadcrumb a:hover { color: var(--ink); }
.breadcrumb span { color: var(--line); }
.page-head { padding-block: 24px 8px; }
.page-head h1 { font-family: var(--display); font-weight: 600; font-size: clamp(1.8rem, 3.5vw, 2.8rem); letter-spacing: -0.02em; }
.page-head p { color: var(--ink-soft); margin-top: 8px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 20px; margin-bottom: 28px; flex-wrap: wrap; }
.section-head h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.5rem, 3vw, 2.1rem); letter-spacing: -0.02em; }
.link-arrow { font-weight: 600; font-size: 0.92rem; color: var(--accent); }
.link-arrow:hover { text-decoration: underline; }
.muted { color: var(--ink-soft); }

/* ---------- Listing layout ---------- */
.listing { display: grid; grid-template-columns: 232px 1fr; gap: 40px; padding-block: 8px 72px; align-items: start; }
.filters { position: sticky; top: 88px; }
.filters h3 { font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); margin-bottom: 14px; }
.filters ul { list-style: none; display: grid; gap: 4px; max-height: 60vh; overflow: auto; }
.filters a { display: block; padding: 7px 10px; border-radius: 8px; font-size: 0.92rem; color: var(--ink-soft); }
.filters a:hover { background: var(--surface); color: var(--ink); }
.filters a.active { background: var(--accent); color: #fff; }
.listing-main { min-width: 0; }
.toolbar { display: flex; justify-content: space-between; align-items: center; gap: 16px; margin-bottom: 20px; flex-wrap: wrap; }
.toolbar .count { font-size: 0.9rem; color: var(--ink-soft); }

/* ---------- Product grid + card (shared with homepage) ---------- */
.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; }
.product-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.product-card { background: transparent; }
.product-card a.pc-link { display: block; color: inherit; }
.product-media { position: relative; aspect-ratio: 1 / 1; border-radius: var(--radius); background: #fff; overflow: hidden; margin-bottom: 14px; }
.product-media img { position: absolute; top: 50%; left: 50%; width: auto; height: 100%; max-width: 100%; object-fit: contain; transform: translate(-50%, -50%); }
.product-media .ph { position: absolute; inset: 0; display: grid; place-items: center; color: rgba(0,0,0,0.18); font-family: var(--display); font-size: 1.5rem; padding: 12px; text-align: center; }
.tag { position: absolute; top: 12px; left: 12px; z-index: 2; background: var(--ink); color: #fff; font-size: 0.7rem; font-weight: 600; letter-spacing: 0.04em; text-transform: uppercase; padding: 5px 10px; border-radius: 999px; }
.tag.sale { background: var(--sale); }
.product-title { font-weight: 600; font-size: 0.98rem; }
.product-meta { display: flex; justify-content: space-between; align-items: baseline; margin-top: 4px; gap: 10px; }
.price { font-weight: 600; }
.price .was { color: var(--ink-soft); font-weight: 400; text-decoration: line-through; margin-left: 6px; font-size: 0.85rem; }
.stars { color: var(--ink-soft); font-size: 0.82rem; white-space: nowrap; }

/* ---------- Pagination ---------- */
.load-more { display: flex; justify-content: center; margin-top: 44px; }

/* ---------- Product detail ---------- */
.pdp { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: clamp(24px, 5vw, 64px); padding-block: 8px 64px; align-items: start; }
.gallery { position: sticky; top: 92px; }
.gallery .main { aspect-ratio: 1 / 1; border-radius: var(--radius); overflow: hidden; background: linear-gradient(160deg,#efece4,#e2ded3); }
.gallery .main img { width: 100%; height: 100%; object-fit: cover; }
.pdp-info h1 { font-family: var(--display); font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.5rem); line-height: 1.08; letter-spacing: -0.02em; margin-bottom: 12px; }
.pdp-price { font-size: 1.4rem; font-weight: 600; margin-bottom: 6px; }
.pdp-price .was { color: var(--ink-soft); font-weight: 400; text-decoration: line-through; margin-left: 8px; font-size: 1rem; }
.pdp-sub { color: var(--ink-soft); font-size: 0.9rem; margin-bottom: 24px; }
.pdp-desc { color: var(--ink-soft); margin: 20px 0 26px; max-width: 52ch; }
.option { margin-bottom: 18px; }
.option label { display: block; font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.06em; color: var(--ink-soft); margin-bottom: 8px; }
.option select, .qty input { font-family: inherit; font-size: 0.95rem; padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--ink); }
.option select { width: 100%; max-width: 320px; }
.color-option label strong { color: var(--ink); font-weight: 600; text-transform: none; letter-spacing: 0; }
.color-swatches { display: flex; flex-wrap: wrap; gap: 10px; max-width: 420px; }
.color-swatch {
  --swatch-primary: #d1d5db;
  --swatch-secondary: var(--swatch-primary);
  appearance: none;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 2px solid var(--surface);
  border-radius: 50%;
  background-color: var(--swatch-primary);
  background-image: none;
  box-shadow: 0 0 0 1px var(--line), inset 0 0 0 1px rgba(0, 0, 0, 0.18);
  cursor: pointer;
  position: relative;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.color-swatch.is-two-tone {
  background-image: linear-gradient(135deg, var(--swatch-primary) 0%, var(--swatch-primary) 48%, var(--swatch-secondary) 52%, var(--swatch-secondary) 100%);
}
.color-swatch:hover { transform: translateY(-1px); }
.color-swatch:focus-visible { outline: 3px solid color-mix(in srgb, var(--accent) 35%, transparent); outline-offset: 3px; }
.color-swatch.is-active { box-shadow: 0 0 0 2px var(--surface), 0 0 0 4px var(--accent), inset 0 0 0 1px rgba(0, 0, 0, 0.18); }
.pdp-actions { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; margin-top: 8px; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); overflow: hidden; }
.qty button { border: none; background: none; width: 40px; height: 46px; font-size: 1.1rem; cursor: pointer; color: var(--ink); }
.qty input { width: 48px; text-align: center; border: none; padding: 0; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.pdp-note { font-size: 0.82rem; color: var(--ink-soft); margin-top: 16px; }

/* ---------- Cart ---------- */
.cart-layout { display: grid; grid-template-columns: 1fr 360px; gap: 40px; padding-block: 8px 72px; align-items: start; }
.cart-lines { display: grid; gap: 4px; }
.cart-line { display: grid; grid-template-columns: 88px 1fr auto; gap: 18px; align-items: center; padding: 18px 0; border-bottom: 1px solid var(--line); }
.cart-line .thumb { width: 88px; height: 88px; border-radius: 10px; overflow: hidden; background: linear-gradient(160deg,#efece4,#e2ded3); }
.cart-line .thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-line .info h4 { font-size: 0.98rem; font-weight: 600; margin-bottom: 4px; }
.cart-line .info .variant { font-size: 0.85rem; color: var(--ink-soft); }
.cart-line .info .remove { font-size: 0.82rem; color: var(--ink-soft); background: none; border: none; cursor: pointer; padding: 0; margin-top: 8px; text-decoration: underline; }
.cart-line .line-end { text-align: right; display: grid; gap: 10px; justify-items: end; }
.summary { position: sticky; top: 92px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 26px; }
.summary h3 { font-family: var(--display); font-size: 1.3rem; margin-bottom: 18px; }
.summary .row { display: flex; justify-content: space-between; font-size: 0.95rem; padding: 8px 0; color: var(--ink-soft); }
.summary .row.total { color: var(--ink); font-weight: 600; font-size: 1.1rem; border-top: 1px solid var(--line); margin-top: 8px; padding-top: 16px; }
.summary .btn { margin-top: 18px; }
.summary .fine { font-size: 0.78rem; color: var(--ink-soft); margin-top: 12px; text-align: center; }
.storefront-iframe { width: 100%; min-height: 78vh; border: 0; background: var(--surface); display: block; }
.iframe-full-width .storefront-iframe { min-height: calc(100vh - 150px); }

/* ---------- Empty / status states ---------- */
.state { text-align: center; padding: 72px 20px; }
.state h2 { font-family: var(--display); font-size: 1.6rem; margin-bottom: 10px; }
.state p { color: var(--ink-soft); margin-bottom: 22px; }
.spinner { display: inline-block; width: 22px; height: 22px; border: 2px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Footer ---------- */
.site-footer { background: var(--surface); border-top: 1px solid var(--line); padding-block: 56px 28px; margin-top: 40px; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(3, 1fr); gap: 40px; margin-bottom: 40px; }
.footer-grid h4 { font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink-soft); margin-bottom: 16px; }
.footer-grid ul { list-style: none; display: grid; gap: 10px; }
.footer-grid a { color: var(--ink-soft); font-size: 0.92rem; }
.footer-grid a:hover { color: var(--ink); }
.footer-brand .brand { margin-bottom: 12px; display: inline-block; }
.footer-brand p { color: var(--ink-soft); font-size: 0.92rem; max-width: 34ch; }
.footer-bottom { display: flex; justify-content: space-between; align-items: center; gap: 16px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 0.85rem; color: var(--ink-soft); flex-wrap: wrap; }
.pay { display: flex; gap: 8px; }
.pay span { border: 1px solid var(--line); border-radius: 6px; padding: 3px 8px; font-size: 0.7rem; font-weight: 600; color: var(--ink-soft); }

/* ---------- Responsive ---------- */
@media (max-width: 960px) {
  .listing { grid-template-columns: 1fr; }
  .filters { position: static; }
  .filters ul { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: max-content; overflow-x: auto; max-height: none; }
  .pdp { grid-template-columns: 1fr; }
  .gallery { position: static; }
  .cart-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
  .product-grid, .product-grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
  .nav-menu-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 720px) {
  .product-grid, .product-grid.cols-3 { grid-template-columns: repeat(2, 1fr); }
  .nav-links { display: none; }
}
@media (max-width: 480px) {
  .cart-line { grid-template-columns: 64px 1fr; }
  .cart-line .thumb { width: 64px; height: 64px; }
  .cart-line .line-end { grid-column: 1 / -1; flex-direction: row; justify-items: stretch; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto; transition: none !important; } }
