@import url("https://fonts.googleapis.com/css2?family=Fraunces:opsz,wght@9..144,500;9..144,600&family=Karla:wght@400;500;600;700&display=swap");

/* Store theme — shared by builder pages and the app pages.
   One warm, light look for every shopper: a shop should not change colour
   with the visitor's system setting. */
:root {
  --ground: #fbf8f3;
  --surface: #ffffff;
  --sunk: #f3efe6;
  --ink: #1f2a21;
  --muted: #5f6b60;
  --line: #e6e0d4;
  --accent: #1f5d3a;
  --accent-ink: #fdfbf6;
  --accent-soft: #e6efe7;
  --highlight: #b5751a;
  --highlight-soft: #f7ecd9;
  --radius: 14px;
  --radius-sm: 9px;
  --display: "Fraunces", Georgia, "Times New Roman", serif;
  --font: "Karla", "Segoe UI", system-ui, -apple-system, sans-serif;
  --shadow: 0 1px 2px rgba(31, 42, 33, 0.05), 0 8px 24px -16px rgba(31, 42, 33, 0.28);
  color-scheme: light;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--ground); color: var(--ink); font: 16px/1.6 var(--font); -webkit-font-smoothing: antialiased; }
a { color: inherit; }
img { max-width: 100%; display: block; }
h1, h2, h3 { font-family: var(--display); font-weight: 600; letter-spacing: -0.015em; text-wrap: balance; }
.island { display: contents; }

/* ── Frame ─────────────────────────────────────────────────────────────── */
.shell { min-height: 100vh; display: flex; flex-direction: column; }
.shell > * { padding-inline: max(20px, calc((100% - 1240px) / 2)); }

.promo { background: var(--accent); color: var(--accent-ink); font-size: 14px; padding-block: 9px; text-align: center; }
.promo span { display: inline-block; max-width: 80ch; }

.site-header {
  position: sticky; top: 0; z-index: 20;
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 28px;
  padding-block: 14px; background: color-mix(in srgb, var(--ground) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px); border-bottom: 1px solid var(--line);
}
.brand { font-family: var(--display); font-weight: 600; font-size: 23px; text-decoration: none; letter-spacing: -0.02em; }
.site-nav { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 4px; flex: 1; }
.nav-group { display: contents; }
.site-nav a, .nav-more summary {
  text-decoration: none; color: var(--muted); font-size: 14.5px; font-weight: 500;
  padding: 7px 12px; border-radius: 999px; white-space: nowrap;
}
.site-nav a:hover, .nav-more summary:hover { color: var(--ink); background: var(--sunk); }
.site-nav a.nav-all { color: var(--ink); font-weight: 700; }
.nav-more { position: relative; }
.nav-more summary { list-style: none; cursor: pointer; }
.nav-more summary::-webkit-details-marker { display: none; }
.nav-more summary::after { content: " ▾"; }
.nav-menu {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 30; min-width: 210px;
  display: grid; gap: 2px; padding: 8px; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow);
}
.nav-menu a { display: flex; justify-content: space-between; gap: 14px; }
.nav-menu .count { color: var(--muted); font-size: 12.5px; }

.site-actions { display: flex; align-items: center; gap: 6px; }
.account-link, .cart-link { text-decoration: none; color: var(--muted); font-size: 14.5px; font-weight: 500; padding: 7px 12px; border-radius: 999px; }
.account-link:hover, .cart-link:hover { color: var(--ink); background: var(--sunk); }
.cart-link { display: inline-flex; align-items: center; gap: 7px; background: var(--accent); color: var(--accent-ink); }
.cart-link:hover { background: var(--accent); color: var(--accent-ink); filter: brightness(1.08); }
.cart-count:not(:empty) { background: var(--accent-ink); color: var(--accent); border-radius: 999px; font-size: 12px; font-weight: 700; padding: 1px 7px; }

.site-main { flex: 1; padding-block: 32px 72px; display: flex; flex-direction: column; gap: 56px; }
.site-footer { border-top: 1px solid var(--line); background: var(--sunk); padding-block: 40px 28px; }
.footer-groups { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 28px; }
.footer-groups h2 { font-size: 15px; margin: 0 0 12px; font-family: var(--font); font-weight: 700; letter-spacing: 0.02em; }
.footer-groups div { display: grid; gap: 8px; align-content: start; }
.footer-groups a { color: var(--muted); text-decoration: none; font-size: 14.5px; }
.footer-groups a:hover { color: var(--ink); }
.footer-legal { color: var(--muted); font-size: 13.5px; margin: 32px 0 0; }

/* ── Home ──────────────────────────────────────────────────────────────── */
.hero {
  background: linear-gradient(135deg, var(--accent-soft), var(--highlight-soft));
  border: 1px solid var(--line); border-radius: calc(var(--radius) * 1.6);
  padding: clamp(28px, 6vw, 68px); margin-top: 8px;
}
.hero-text { max-width: 46ch; display: grid; gap: 14px; justify-items: start; }
.hero h1, .page-title { margin: 0; font-size: clamp(30px, 5.2vw, 50px); line-height: 1.08; }
.hero p { margin: 0; color: var(--muted); font-size: 17px; }

.categories h2, .preview-head h2 { margin: 0; font-size: clamp(21px, 2.6vw, 27px); }
.categories { display: grid; gap: 16px; }
.category-tiles { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(165px, 1fr)); gap: 14px; }
.category-tiles a {
  display: grid; gap: 4px; padding: 18px; text-decoration: none; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); transition: border-color 0.15s, transform 0.15s;
}
.category-tiles a:hover { border-color: var(--accent); transform: translateY(-2px); }
.tile-name { font-family: var(--display); font-size: 18px; font-weight: 600; }
.tile-count { color: var(--muted); font-size: 13.5px; }

.preview { display: grid; gap: 18px; }
.preview-head { display: flex; align-items: baseline; justify-content: space-between; gap: 14px; }
.preview-head a { color: var(--accent); font-weight: 600; font-size: 14.5px; }

/* ── Products ──────────────────────────────────────────────────────────── */
.listing-head { display: grid; gap: 6px; }
.listing-head .note { margin: 0; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-block; text-decoration: none; font-size: 14px; font-weight: 600; padding: 8px 15px;
  border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--muted);
}
.chip:hover { color: var(--ink); border-color: var(--ink); }
.chip.is-active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.grid { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 20px; }
.card {
  display: flex; flex-direction: column; height: 100%; background: var(--surface);
  border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: border-color 0.15s, box-shadow 0.15s;
}
.card:hover { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); box-shadow: var(--shadow); }
.card-link { display: grid; gap: 6px; padding: 12px 14px 10px; text-decoration: none; flex: 1; align-content: start; }
.card-image { position: relative; display: block; aspect-ratio: 1; background: var(--sunk); border-radius: var(--radius-sm); overflow: hidden; margin: -12px -14px 8px; }
.card-image img { width: 100%; height: 100%; object-fit: cover; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--ink); color: var(--ground); font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; padding: 4px 9px; border-radius: 999px; }
.card-tag { color: var(--highlight); font-size: 12px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; }
.card-title { font-family: var(--display); font-size: 16.5px; font-weight: 600; line-height: 1.3; }
.card-price { color: var(--ink); font-weight: 700; font-variant-numeric: tabular-nums; }
.card-action { padding: 0 14px 14px; }
.card-action .button { width: 100%; padding: 9px 14px; font-size: 14.5px; }
.placeholder { display: block; width: 100%; height: 100%; background: repeating-linear-gradient(45deg, var(--line) 0 1px, transparent 1px 13px); }
.placeholder.large { aspect-ratio: 1; border-radius: var(--radius); }

.crumbs { font-size: 14px; color: var(--muted); }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.item { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr); gap: clamp(24px, 5vw, 56px); align-items: start; }
@media (max-width: 780px) { .item { grid-template-columns: 1fr; } }
.gallery { display: grid; gap: 12px; }
.gallery img { border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface); }
.summary { display: grid; gap: 14px; justify-items: start; position: sticky; top: 96px; }
.summary h1 { margin: 0; font-size: clamp(26px, 3.6vw, 38px); }
.price { font-size: 26px; font-weight: 700; margin: 0; font-variant-numeric: tabular-nums; }
.description { color: var(--muted); max-width: 60ch; margin: 0; }
.details { margin: 12px 0 0; display: grid; gap: 8px; width: 100%; }
.details div { display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px; border-top: 1px solid var(--line); padding-top: 8px; }
.details dt { color: var(--muted); }
.details dd { margin: 0; }

/* ── Controls ──────────────────────────────────────────────────────────── */
.button {
  font: inherit; font-weight: 600; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 11px 22px; cursor: pointer; transition: filter 0.15s, border-color 0.15s;
}
.button.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.button:hover:not(:disabled) { filter: brightness(1.06); border-color: color-mix(in srgb, var(--accent) 50%, var(--line)); }
.button:disabled { opacity: 0.55; cursor: default; }
.button:focus-visible, a:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.load-more { display: flex; flex-direction: column; align-items: center; gap: 8px; margin-top: 12px; }
.note { color: var(--muted); }

/* ── Cart, account, checkout ───────────────────────────────────────────── */
.cart { display: grid; gap: 14px; max-width: 780px; }
.cart-line { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 16px; align-items: center; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; }
.cart-line img, .cart-line .placeholder { width: 72px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); }
.qty { display: inline-flex; align-items: center; gap: 8px; }
.qty button { width: 34px; height: 34px; padding: 0; }
.cart-total { display: flex; justify-content: space-between; font-weight: 700; font-size: 19px; margin-top: 4px; }

.account { display: grid; gap: 32px; max-width: 680px; }
.account-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; flex-wrap: wrap; }
.account h2 { font-size: 20px; margin: 0 0 14px; }
.account h3 { font-size: 16px; margin: 8px 0 0; font-family: var(--font); }
.form { display: grid; gap: 12px; }
.form label { display: grid; gap: 5px; font-size: 14px; color: var(--muted); }
.form input { font: inherit; color: var(--ink); background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 10px 13px; }
.form input:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.form input[readonly] { opacity: 0.75; }
.form .button { justify-self: start; }
.addresses { list-style: none; margin: 0 0 16px; padding: 0; display: grid; gap: 10px; }
.addresses li { display: flex; justify-content: space-between; align-items: center; gap: 12px; border: 1px solid var(--line); border-radius: var(--radius); padding: 13px 15px; background: var(--surface); }
.addresses p { margin: 2px 0 0; color: var(--muted); }
.invoice-link { color: var(--accent); font-weight: 600; font-size: 13.5px; }
.choice { display: flex !important; align-items: center; gap: 10px; color: var(--ink) !important; border: 1px solid var(--line); border-radius: var(--radius-sm); padding: 11px 13px; background: var(--surface); }
.choice input { width: auto; }

@media (max-width: 620px) {
  .site-header { gap: 8px 14px; }
  .site-nav { order: 3; width: 100%; overflow-x: auto; flex-wrap: nowrap; padding-bottom: 2px; }
  .site-actions { margin-left: auto; }
  .summary { position: static; }
}
