/* ==========================================================================
   Common Goods — simple storefront styles
   Change the look by editing the tokens in :root below.
   ========================================================================== */

:root {
  --text: #111111;
  --muted: #6b6b6b;
  --bg: #ffffff;
  --bg-soft: #f6f6f4;
  --border: #e6e6e3;
  --accent: #111111;      /* buttons, links, focus */
  --accent-text: #ffffff;
  --sale: #b42318;
  --success: #1f7a4d;

  --font: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --radius: 4px;
  --container: 1200px;
  --header-h: 64px;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { margin: 0; font-family: var(--font); font-size: 1rem; line-height: 1.6; color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.2; font-weight: 600; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 4.5vw, 3.2rem); letter-spacing: -.02em; }
h2 { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }
h3 { font-size: 1rem; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.container { width: 100%; max-width: var(--container); margin-inline: auto; padding-inline: 24px; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0; margin: -1px; }
.skip-link { position: absolute; left: 16px; top: -60px; z-index: 100; background: var(--accent); color: var(--accent-text); padding: 8px 14px; }
.skip-link:focus { top: 8px; }
[hidden] { display: none !important; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border: 1px solid var(--accent); border-radius: var(--radius);
  background: var(--accent); color: var(--accent-text); font-weight: 500; font-size: .95rem;
  text-decoration: none; cursor: pointer; transition: opacity .15s, background-color .15s, color .15s;
}
.btn:hover { opacity: .85; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btn-outline { background: transparent; color: var(--accent); }
.btn-outline:hover { background: var(--accent); color: var(--accent-text); opacity: 1; }
.btn-block { width: 100%; }
.btn-sm { padding: 8px 14px; font-size: .88rem; }
.link-btn { background: none; border: 0; padding: 0; color: var(--muted); text-decoration: underline; text-underline-offset: 3px; cursor: pointer; font-size: .88rem; }
.link-btn:hover { color: var(--text); }

/* ---------- Announcement + header ---------- */
.announcement { background: var(--text); color: #fff; text-align: center; font-size: .82rem; padding: 7px 16px; letter-spacing: .02em; }
.site-header { position: sticky; top: 0; z-index: 40; background: var(--bg); border-bottom: 1px solid var(--border); }
.header-inner { height: var(--header-h); display: flex; align-items: center; gap: 32px; }
.brand { font-weight: 700; font-size: 1.15rem; letter-spacing: -.02em; text-decoration: none; white-space: nowrap; }
.nav { display: flex; gap: 24px; }
.nav a { text-decoration: none; color: var(--muted); font-size: .93rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--text); }
.header-actions { margin-left: auto; display: flex; align-items: center; gap: 4px; }
.icon-btn { position: relative; display: inline-grid; place-items: center; width: 40px; height: 40px; border: 0; background: none; border-radius: var(--radius); cursor: pointer; }
.icon-btn:hover { background: var(--bg-soft); }
.icon-btn svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.cart-count { position: absolute; top: 3px; right: 1px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 9px; background: var(--accent); color: var(--accent-text); font-size: .7rem; font-weight: 600; display: grid; place-items: center; }
.cart-count:empty, .cart-count[data-count="0"] { display: none; }
.nav-toggle { display: none; }

/* ---------- Hero ---------- */
.hero { display: grid; grid-template-columns: 1fr 1.25fr; min-height: 460px; border-bottom: 1px solid var(--border); }
.hero-copy { display: flex; flex-direction: column; justify-content: center; padding: 56px max(24px, calc((100vw - var(--container)) / 2 + 24px)); padding-right: 48px; }
.hero-copy p { color: var(--muted); max-width: 26rem; font-size: 1.08rem; }
.hero-copy .btn { align-self: flex-start; margin-top: 8px; }
.hero-img { width: 100%; height: 100%; object-fit: cover; }
.eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin-bottom: 12px; }

/* ---------- Shop toolbar + grid ---------- */
.section { padding: 56px 0; }
.section-head { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 24px; flex-wrap: wrap; }
.section-head h2 { margin: 0; }
.toolbar { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; justify-content: space-between; margin-bottom: 28px; }
.filters { display: flex; gap: 8px; flex-wrap: wrap; }
.chip { padding: 7px 14px; border: 1px solid var(--border); border-radius: 999px; background: var(--bg); font-size: .88rem; cursor: pointer; }
.chip:hover { border-color: var(--text); }
.chip[aria-pressed="true"] { background: var(--text); border-color: var(--text); color: #fff; }
.toolbar-right { display: flex; gap: 8px; }
.input, .select { padding: 9px 12px; border: 1px solid var(--border); border-radius: var(--radius); background: var(--bg); font-size: .92rem; }
.input:focus, .select:focus { outline: none; border-color: var(--text); }
.search { width: 200px; }

.product-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 36px 20px; }
.product-card { position: relative; }
.product-card a { text-decoration: none; }
.product-card a:hover h3 { text-decoration: underline; text-underline-offset: 3px; }
.product-card .media-wrap { position: relative; margin-bottom: 12px; } /* the hover button is placed inside the image area */
.product-card .media { position: relative; display: block; aspect-ratio: 1 / 1; background: var(--bg-soft); overflow: hidden; border-radius: var(--radius); }
.product-card .media img { width: 100%; height: 100%; object-fit: cover; transition: transform .4s ease; }
.product-card:hover .media img { transform: scale(1.03); }
.product-card h3 { font-weight: 500; font-size: .95rem; margin: 0 0 2px; }
.product-card .price { color: var(--muted); font-size: .93rem; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--bg); padding: 3px 8px; font-size: .72rem; font-weight: 600; text-transform: uppercase; letter-spacing: .06em; border-radius: 2px; }
.badge-out { color: var(--muted); }
.badge-low { color: var(--sale); }
.quick-add { position: absolute; left: 10px; right: 10px; bottom: 10px; opacity: 0; transform: translateY(6px); transition: opacity .2s, transform .2s; }
.product-card:hover .quick-add, .quick-add:focus-visible { opacity: 1; transform: none; }
.empty-state { grid-column: 1 / -1; text-align: center; color: var(--muted); padding: 48px 0; }

/* ---------- Promises ---------- */
.promises { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; border-top: 1px solid var(--border); padding-top: 40px; }
.promise h3 { margin-bottom: 4px; }
.promise p { color: var(--muted); font-size: .93rem; margin: 0; }

/* ---------- Product page ---------- */
.breadcrumbs { font-size: .85rem; color: var(--muted); padding: 20px 0 0; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--text); }
.product-layout { display: grid; grid-template-columns: 1fr 1fr; gap: 56px; padding: 24px 0 64px; align-items: start; }
.product-image { background: var(--bg-soft); border-radius: var(--radius); overflow: hidden; aspect-ratio: 1 / 1; max-width: 560px; }
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-info { position: sticky; top: calc(var(--header-h) + 24px); }
.product-info .price { font-size: 1.3rem; margin-bottom: 20px; }
.product-info .description { color: var(--muted); }
.stock-note { font-size: .88rem; margin: 0 0 16px; }
.stock-note.low { color: var(--sale); }
.stock-note.ok { color: var(--success); }
.buy-row { display: flex; gap: 12px; margin-bottom: 28px; }
.btn-grow { flex: 1; }
.deliver-to { margin: 16px 0 0; font-size: .9rem; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: var(--radius); }
.qty button { width: 38px; height: 44px; border: 0; background: none; cursor: pointer; font-size: 1.1rem; }
.qty button:hover { background: var(--bg-soft); }
.qty input { width: 40px; text-align: center; border: 0; background: none; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.qty.small button { width: 30px; height: 32px; }
.qty.small input { width: 30px; font-size: .9rem; }
.details-list { border-top: 1px solid var(--border); }
.details-list li { padding: 10px 0; border-bottom: 1px solid var(--border); font-size: .93rem; }

/* ---------- Cart drawer ---------- */
.drawer-backdrop { position: fixed; inset: 0; background: rgb(0 0 0 / 35%); z-index: 90; opacity: 0; visibility: hidden; transition: opacity .25s, visibility .25s; }
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 100; width: min(420px, 100%); background: var(--bg); display: flex; flex-direction: column; transform: translateX(100%); transition: transform .3s ease; visibility: hidden; }
.cart-open .drawer { transform: none; visibility: visible; }
.cart-open .drawer-backdrop { opacity: 1; visibility: visible; }
.cart-open { overflow: hidden; }
.drawer-head { display: flex; align-items: center; justify-content: space-between; padding: 0 20px; height: var(--header-h); border-bottom: 1px solid var(--border); }
.drawer-head h2 { font-size: 1.05rem; margin: 0; }
.drawer-body { flex: 1; overflow-y: auto; padding: 8px 20px; }
.drawer-foot { border-top: 1px solid var(--border); padding: 20px; }
.cart-line { display: grid; grid-template-columns: 72px 1fr auto; gap: 14px; padding: 16px 0; border-bottom: 1px solid var(--border); }
.cart-line:last-child { border-bottom: 0; }
.cart-line img { width: 72px; height: 90px; object-fit: cover; border-radius: var(--radius); background: var(--bg-soft); }
.cart-line h3 { font-weight: 500; font-size: .93rem; margin: 0 0 2px; }
.cart-line h3 a { text-decoration: none; }
.cart-line .unit { color: var(--muted); font-size: .85rem; margin-bottom: 8px; }
.cart-line .line-total { font-size: .93rem; text-align: right; }
.cart-line .line-actions { display: flex; align-items: center; gap: 12px; }
.cart-empty { text-align: center; color: var(--muted); padding: 48px 0; }
.totals { display: grid; gap: 6px; margin-bottom: 16px; font-size: .93rem; }
.totals div { display: flex; justify-content: space-between; }
.totals .grand { font-weight: 600; font-size: 1.05rem; padding-top: 8px; border-top: 1px solid var(--border); margin-top: 4px; }
.free-ship { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.free-ship .bar { height: 3px; background: var(--border); margin-top: 6px; border-radius: 2px; overflow: hidden; }
.free-ship .bar span { display: block; height: 100%; background: var(--text); transition: width .3s; }

/* ---------- Checkout ---------- */
.checkout-layout { display: grid; grid-template-columns: 1.2fr .8fr; gap: 56px; padding: 32px 0 72px; align-items: start; }
.checkout-form fieldset { border: 0; padding: 0; margin: 0 0 28px; }
.checkout-form legend { font-weight: 600; font-size: 1.05rem; margin-bottom: 14px; padding: 0; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { margin-bottom: 14px; }
.field label { display: block; font-size: .85rem; margin-bottom: 5px; }
.field .input, .field .select { width: 100%; padding: 11px 12px; font-size: 1rem; }
.field.invalid .input { border-color: var(--sale); }
.field-error { display: block; color: var(--sale); font-size: .82rem; margin-top: 4px; }
.field-error:empty { display: none; }
.notice { background: var(--bg-soft); border-left: 3px solid var(--text); padding: 12px 14px; font-size: .88rem; margin-bottom: 20px; }
.pay-methods { display: flex; flex-wrap: wrap; gap: 6px; list-style: none; padding: 0; margin: -8px 0 20px; }
.pay-methods li { border: 1px solid var(--border); border-radius: 4px; padding: 3px 8px; font-size: .75rem; font-weight: 600; color: var(--muted); }
.form-status { font-size: .93rem; margin: 12px 0 0; }
.form-status.error { color: var(--sale); }
.form-status.success { color: var(--success); }
.form-status:empty { display: none; }
.summary { background: var(--bg-soft); padding: 24px; border-radius: var(--radius); position: sticky; top: calc(var(--header-h) + 24px); }
.summary h2 { font-size: 1.05rem; }
.summary .cart-line { grid-template-columns: 56px 1fr auto; border-color: var(--border); }
.summary .cart-line img { width: 56px; height: 70px; }
.confirmation { max-width: 620px; margin: 0 auto; padding: 64px 0 96px; text-align: center; }
.confirmation .tick { width: 56px; height: 56px; border-radius: 50%; border: 1.5px solid var(--success); color: var(--success); display: grid; place-items: center; margin: 0 auto 20px; font-size: 1.5rem; }
.confirmation .summary { text-align: left; position: static; margin: 32px 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); margin-top: 24px; padding: 48px 0 28px; font-size: .9rem; }
.footer-grid { display: grid; grid-template-columns: 1.5fr 1fr 1fr 1.6fr; gap: 32px; }
.site-footer h4 { font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); font-weight: 500; margin-bottom: 12px; }
.site-footer ul { display: grid; gap: 8px; }
.site-footer a { text-decoration: none; color: var(--muted); }
.site-footer a:hover { color: var(--text); }
.newsletter-form { display: flex; gap: 8px; margin-top: 8px; }
.newsletter-form .input { flex: 1; min-width: 0; }
.footer-bottom { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 8px; margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .82rem; }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 24px; z-index: 200; transform: translate(-50%, calc(100% + 40px)); visibility: hidden; background: var(--text); color: #fff; padding: 11px 18px; border-radius: var(--radius); font-size: .92rem; transition: transform .3s ease, visibility .3s; max-width: calc(100% - 32px); }
.toast.show { transform: translate(-50%, 0); visibility: visible; }

/* ---------- Simple pages ---------- */
.simple-page { max-width: 720px; padding: 56px 24px 80px; }
.simple-page h2 { font-size: 1.2rem; margin-top: 2rem; }
.simple-page p { color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; scroll-behavior: auto !important; }
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .product-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 800px) {
  .nav-toggle { display: inline-grid; }
  .nav { position: absolute; top: 100%; left: 0; right: 0; flex-direction: column; gap: 0; background: var(--bg); border-bottom: 1px solid var(--border); padding: 8px 24px 16px; display: none; }
  .nav.open { display: flex; }
  .nav a { padding: 10px 0; font-size: 1rem; }
  .hero { grid-template-columns: 1fr; }
  .hero-img { aspect-ratio: 16 / 10; height: auto; }
  .hero-copy { padding: 40px 24px; }
  .product-grid { grid-template-columns: repeat(2, 1fr); gap: 28px 14px; }
  .product-layout, .checkout-layout { grid-template-columns: 1fr; gap: 28px; }
  .product-info, .summary { position: static; }
  .checkout-layout .summary { order: -1; }
  .promises { grid-template-columns: 1fr; }
  .quick-add { display: none; }
}
@media (max-width: 520px) {
  .container { padding-inline: 16px; }
  .hero-copy { padding: 32px 16px; }
  .toolbar-right { width: 100%; }
  .search { flex: 1; width: auto; }
  .form-row, .footer-grid { grid-template-columns: 1fr; }
  .form-row { gap: 0; }
}
