/* Everyday Supply — storefront theme
   Self-contained: system fonts only, no external assets. */

:root {
  --bg: #f6f4ef;
  --surface: #fffefb;
  --tile: #f3f1ec;          /* matches the product photography backdrop */
  --sand: #ebe5d9;
  --sand-deep: #e1d9ca;
  --ink: #1d1b18;
  --ink-soft: #3a3631;
  --muted: #69645b;
  --line: #e2ddd2;
  --line-strong: #cfc8ba;
  --accent: #9c4426;        /* sale price / small highlights */
  --accent-soft: #f4e4da;
  --focus: #1d1b18;

  --radius-sm: 10px;
  --radius: 16px;
  --radius-lg: 24px;
  --radius-xl: 32px;
  --shadow-sm: 0 1px 2px rgb(40 32 20 / 6%);
  --shadow: 0 12px 40px -16px rgb(40 32 20 / 22%);
  --shadow-lg: 0 30px 80px -24px rgb(30 24 14 / 35%);

  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --gutter: clamp(16px, 4vw, 40px);
  --header-h: 72px;
  --ease: cubic-bezier(.2, .7, .2, 1);

  color-scheme: light;
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

html.is-locked { overflow: hidden; }

body {
  margin: 0;
  min-width: 320px;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font);
  font-size: 1rem;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, p { margin: 0; }

[hidden] { display: none !important; }

.sprite { position: absolute; width: 0; height: 0; overflow: hidden; }

.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 3px;
  border-radius: 8px;
}

.container {
  width: 100%;
  max-width: 1280px;
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  top: 12px; left: 12px;
  z-index: 100;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-weight: 600;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .2s var(--ease);
}
.skip-link:focus-visible { transform: none; outline-color: var(--ink); }

.eyebrow {
  font-size: .8125rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--muted);
}

/* ---------- Buttons ---------- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 12px 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 600;
  font-size: .9375rem;
  line-height: 1.2;
  text-decoration: none;
  text-align: center;
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.button svg { width: 18px; height: 18px; flex: none; }
.button--primary { background: var(--ink); color: var(--surface); }
.button--primary:hover { background: #34302a; }
.button--secondary { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.button--secondary:hover { border-color: var(--ink); }
.button--block { width: 100%; }
.button:active { transform: translateY(1px); }
.button[disabled] { opacity: .45; cursor: not-allowed; }

.icon-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 44px;
  padding: 0 10px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  transition: background-color .2s var(--ease);
}
.icon-button svg { width: 22px; height: 22px; }
.icon-button:hover { background: rgb(29 27 24 / 6%); }

.link-button {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  text-align: left;
  text-decoration: none;
}
.link-button:hover { text-decoration: underline; text-underline-offset: 3px; }

/* ---------- Header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgb(246 244 239 / 88%);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 1 auto;
  min-width: 0;
  min-height: 44px;
  text-decoration: none;
  color: var(--ink);
}
.brand-mark { flex: none; width: 30px; height: 30px; color: var(--ink); }
.brand-name {
  overflow: hidden;
  font-weight: 700;
  font-size: 1.125rem;
  letter-spacing: -.02em;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.primary-nav { display: none; }
.nav-list { display: flex; align-items: center; gap: 4px; }
.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  padding: 0 12px;
  border-radius: 999px;
  font-size: .9375rem;
  font-weight: 550;
  color: var(--ink-soft);
  text-decoration: none;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.nav-list a:hover { background: rgb(29 27 24 / 5%); color: var(--ink); }
.nav-list a[aria-current="true"] { color: var(--ink); background: var(--sand); }

.header-actions {
  display: flex;
  flex: none;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.search {
  position: relative;
  display: flex;
  align-items: center;
}
.search-icon {
  position: absolute;
  left: 14px;
  width: 18px; height: 18px;
  color: var(--muted);
  pointer-events: none;
}
.search-input {
  width: 100%;
  min-height: 44px;
  padding: 10px 14px 10px 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  font-size: 1rem;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  -webkit-appearance: none;
  appearance: none;
}
.search-input::placeholder { color: #8a847a; }
.search-input:hover { border-color: var(--line-strong); }
.search-input:focus-visible {
  outline: none;
  border-color: var(--ink);
  box-shadow: 0 0 0 3px rgb(29 27 24 / 12%);
  border-radius: 999px;
}
.search--header { display: none; }
.search--header .search-input { font-size: .9375rem; }

.bag-button { gap: 8px; padding: 0 8px 0 10px; }
.bag-label { display: none; font-weight: 600; font-size: .9375rem; }
.bag-count {
  display: inline-grid;
  place-items: center;
  min-width: 24px;
  height: 24px;
  padding: 0 7px;
  border-radius: 999px;
  background: var(--sand);
  font-size: .8125rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  transition: background-color .2s var(--ease), color .2s var(--ease);
}
.bag-count.has-items { background: var(--ink); color: var(--surface); }
.bag-count.is-bumped { animation: bump .45s var(--ease); }
@keyframes bump {
  0% { transform: scale(1); }
  40% { transform: scale(1.25); }
  100% { transform: scale(1); }
}

.mobile-menu {
  border-top: 1px solid var(--line);
  background: var(--bg);
}
.mobile-menu-inner { display: grid; gap: 16px; padding-block: 16px 24px; }
.mobile-nav-list { display: grid; gap: 2px; }
.mobile-nav-list a {
  display: flex;
  align-items: center;
  min-height: 48px;
  padding: 0 12px;
  border-radius: var(--radius-sm);
  font-size: 1.0625rem;
  font-weight: 600;
  text-decoration: none;
}
.mobile-nav-list a:hover { background: rgb(29 27 24 / 5%); }
.mobile-nav-list a[aria-current="true"] { background: var(--sand); }
.mobile-nav-list .nav-count { margin-left: auto; color: var(--muted); font-weight: 500; font-size: .875rem; }

@media (min-width: 560px) {
  .bag-label { display: inline; }
}

@media (min-width: 1080px) {
  .primary-nav { display: block; }
  .search--header { display: flex; width: 220px; }
  .menu-toggle { display: none; }
  .mobile-menu { display: none !important; }
}

@media (min-width: 1240px) {
  .search--header { width: 280px; }
}

/* ---------- Hero ---------- */

.hero { padding-top: clamp(16px, 3vw, 32px); }

.hero-panel {
  display: grid;
  gap: clamp(24px, 4vw, 48px);
  align-items: center;
  padding: clamp(24px, 5vw, 64px);
  border-radius: var(--radius-xl);
  background:
    radial-gradient(120% 90% at 0% 0%, #f1ece2 0%, transparent 60%),
    var(--sand);
}

.hero-copy { display: grid; gap: 20px; max-width: 34rem; }
.hero-title {
  font-size: clamp(2.25rem, 7.2vw, 4.75rem);
  line-height: 1;
  font-weight: 700;
  letter-spacing: -.045em;
  text-wrap: balance;
}
.hero-lede {
  font-size: clamp(1rem, 1.6vw, 1.125rem);
  color: var(--ink-soft);
  max-width: 30rem;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; padding-top: 4px; }

.hero-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hero-tags a {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: .875rem;
  font-weight: 550;
  color: var(--ink-soft);
  text-decoration: none;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.hero-tags a:hover { border-color: var(--ink); background: rgb(255 255 255 / 40%); }

.feature-card {
  display: grid;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--tile);
  box-shadow: var(--shadow);
  text-decoration: none;
  color: var(--ink);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}
.feature-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); }
.feature-card:focus-visible { border-radius: var(--radius-lg); outline-offset: 4px; }
.feature-media { display: block; aspect-ratio: 1 / 1; overflow: hidden; }
.feature-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease);
}
.feature-card:hover .feature-media img { transform: scale(1.03); }

.feature-body {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: end;
  gap: 8px 16px;
  padding: 4px clamp(18px, 3vw, 28px) clamp(18px, 3vw, 26px);
}
.feature-text { display: grid; gap: 2px; min-width: 0; }
.feature-kicker { font-size: .8125rem; color: var(--muted); font-weight: 550; }
.feature-name { font-size: clamp(1.0625rem, 2vw, 1.25rem); font-weight: 650; letter-spacing: -.015em; line-height: 1.25; }
.feature-price { display: grid; justify-items: end; text-align: right; }
.feature-price .price-now { font-size: clamp(1.125rem, 2.2vw, 1.5rem); }
.feature-arrow {
  display: grid;
  place-items: center;
  width: 44px; height: 44px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  transition: transform .3s var(--ease);
}
.feature-arrow svg { width: 18px; height: 18px; }
.feature-card:hover .feature-arrow { transform: rotate(45deg); }

@media (max-width: 419px) {
  .feature-body { grid-template-columns: 1fr auto; }
  .feature-arrow { display: none; }
}

@media (min-width: 860px) {
  .hero-panel { grid-template-columns: 1.05fr 1fr; }
}

/* ---------- Prices ---------- */

.price { display: inline-flex; flex-wrap: wrap; align-items: baseline; gap: 2px 8px; font-variant-numeric: tabular-nums; }
.price-now { font-weight: 700; letter-spacing: -.01em; color: var(--ink); }
.price-now.is-sale { color: var(--accent); }
.price-was { color: var(--muted); font-size: .875em; text-decoration: line-through; text-decoration-thickness: 1px; }
.price-from { font-size: .8125rem; color: var(--muted); font-weight: 550; }

/* ---------- Collection ---------- */

.collection { padding-block: clamp(48px, 8vw, 96px) clamp(56px, 8vw, 112px); }
.collection:focus { outline: none; }

.collection-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 12px 24px;
  margin-bottom: 24px;
}
.section-title {
  margin-top: 6px;
  font-size: clamp(2rem, 4.5vw, 3rem);
  line-height: 1.05;
  font-weight: 700;
  letter-spacing: -.04em;
}
.currency-note { font-size: .875rem; color: var(--muted); }

.toolbar {
  display: grid;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: clamp(20px, 3vw, 32px);
  border-bottom: 1px solid var(--line);
}
.filter-group { display: flex; flex-wrap: wrap; gap: 8px; }
.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: transparent;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--ink-soft);
  transition: background-color .2s var(--ease), border-color .2s var(--ease), color .2s var(--ease);
}
.pill:hover { border-color: var(--ink); color: var(--ink); }
.pill[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.pill-count { font-size: .8125rem; font-weight: 500; opacity: .7; font-variant-numeric: tabular-nums; }

.toolbar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 20px;
}
.results-count { font-size: .9375rem; color: var(--muted); }

.sort { display: flex; align-items: center; gap: 10px; }
.sort label { font-size: .9375rem; color: var(--muted); white-space: nowrap; }
.select-wrap { position: relative; }
.select-wrap::after {
  content: "";
  position: absolute;
  right: 16px;
  top: 50%;
  width: 8px; height: 8px;
  border-right: 1.8px solid var(--ink);
  border-bottom: 1.8px solid var(--ink);
  transform: translateY(-70%) rotate(45deg);
  pointer-events: none;
}
.select-wrap select {
  min-height: 44px;
  padding: 8px 40px 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  font-size: .9375rem;
  font-weight: 550;
  -webkit-appearance: none;
  appearance: none;
  cursor: pointer;
}
.select-wrap select:hover { border-color: var(--ink); }
.select-wrap select:focus-visible { border-radius: 999px; }

/* ---------- Product grid ---------- */

.product-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 44px) clamp(12px, 2.2vw, 28px);
}
@media (min-width: 720px) { .product-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1100px) { .product-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); } }

.card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
}
.card-media {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  margin-bottom: 10px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--tile);
}
.card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .6s var(--ease), opacity .4s var(--ease);
}
.card:hover .card-media img { transform: scale(1.035); }
.is-missing { position: relative; }
.is-missing img { opacity: 0; }
.is-missing::after {
  content: "Image unavailable";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: .8125rem;
  color: var(--muted);
}

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgb(255 254 251 / 92%);
  font-size: .75rem;
  font-weight: 650;
  color: var(--ink-soft);
}

.card-category { font-size: .8125rem; color: var(--muted); font-weight: 550; }
.card-title {
  font-size: clamp(.9375rem, 1.6vw, 1.0625rem);
  font-weight: 650;
  letter-spacing: -.012em;
  line-height: 1.3;
}
.card-link { text-decoration: none; }
.card-link::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  border-radius: var(--radius-lg);
}
.card-link:focus-visible { outline: none; }
.card-link:focus-visible::after { outline: 2px solid var(--focus); outline-offset: 4px; }
.card-link:hover { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 4px;
}
.card-foot .price { font-size: .9375rem; }
.card-add {
  position: relative;
  z-index: 2;
  flex: none;
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink);
  transition: background-color .2s var(--ease), color .2s var(--ease), border-color .2s var(--ease);
}
.card-add svg { width: 20px; height: 20px; }
.card-add:hover { background: var(--ink); border-color: var(--ink); color: var(--surface); }
.card-add.is-added { background: var(--ink); border-color: var(--ink); color: var(--surface); }

.card--skeleton .card-media,
.sk-line {
  background: linear-gradient(90deg, var(--tile) 0%, #ebe8e1 50%, var(--tile) 100%);
  background-size: 200% 100%;
  animation: shimmer 1.4s linear infinite;
}
.sk-line { display: block; height: 14px; border-radius: 6px; width: 70%; }
.sk-line--short { width: 35%; }
@keyframes shimmer { to { background-position: -200% 0; } }

.state-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: clamp(40px, 8vw, 72px) 20px;
  border: 1px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  text-align: center;
}
.state-title { font-size: 1.25rem; font-weight: 650; letter-spacing: -.015em; }
.state-text { color: var(--muted); max-width: 32rem; overflow-wrap: anywhere; }
.state-panel .button { margin-top: 8px; }

/* ---------- Footer ---------- */

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.footer-grid {
  display: grid;
  gap: 32px;
  padding-block: clamp(40px, 6vw, 64px) 32px;
}
@media (min-width: 720px) {
  .footer-grid { grid-template-columns: 2fr 1fr 1fr; }
}
.footer-brand { display: grid; gap: 10px; align-content: start; }
.footer-tagline { color: var(--muted); max-width: 22rem; }
.footer-heading {
  margin-bottom: 10px;
  font-size: .8125rem;
  font-weight: 650;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.footer-col ul { display: grid; gap: 2px; }
.footer-col a,
.footer-col .link-button {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: .9375rem;
  text-decoration: none;
}
.footer-col a:hover { text-decoration: underline; text-underline-offset: 3px; }

.footer-base {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-block: 20px 28px;
  border-top: 1px solid var(--line);
  font-size: .875rem;
  color: var(--muted);
}
.back-to-top {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 600;
  color: var(--ink);
  text-decoration: none;
}
.back-to-top:hover { text-decoration: underline; text-underline-offset: 3px; }

.noscript {
  margin: 24px var(--gutter);
  padding: 16px;
  border-radius: var(--radius);
  background: var(--accent-soft);
}

/* ---------- Dialogs ---------- */

.modal {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--ink);
  max-width: none;
  max-height: none;
  overflow: visible;
}
.modal::backdrop {
  background: rgb(29 24 18 / 42%);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
}
.modal[open] { animation: modal-in .28s var(--ease); }
.modal[open]::backdrop { animation: fade-in .28s var(--ease); }
@keyframes modal-in { from { opacity: 0; transform: translateY(12px) scale(.985); } }
@keyframes fade-in { from { opacity: 0; } }

.modal-panel {
  position: relative;
  width: min(100vw - 24px, 980px);
  max-height: calc(100vh - 24px);
  max-height: calc(100dvh - 24px);
  overflow: auto;
  overscroll-behavior: contain;
  border-radius: var(--radius-lg);
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.modal-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  background: rgb(255 254 251 / 88%);
}
.modal-close:hover { background: var(--surface); }

/* Product dialog */
.product-layout { display: grid; }
@media (min-width: 780px) {
  .product-layout { grid-template-columns: 1.05fr 1fr; }
}
.dialog-media {
  position: relative;
  aspect-ratio: 1 / 1;
  background: var(--tile);
  overflow: hidden;
}
.dialog-media img { width: 100%; height: 100%; object-fit: cover; }

.dialog-info {
  display: grid;
  align-content: start;
  gap: 16px;
  padding: clamp(22px, 4vw, 44px);
}
.dialog-category { font-size: .875rem; font-weight: 600; color: var(--muted); }
.dialog-title {
  margin-top: -8px;
  font-size: clamp(1.625rem, 3.4vw, 2.25rem);
  line-height: 1.1;
  font-weight: 700;
  letter-spacing: -.035em;
  padding-right: 40px;
}
.dialog-tagline { font-size: 1.0625rem; color: var(--ink-soft); }
.dialog-price .price { font-size: 1.375rem; }
.dialog-price .price-was { font-size: 1rem; }
.dialog-save {
  display: inline-block;
  margin-left: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: .8125rem;
  font-weight: 650;
  vertical-align: middle;
}
.dialog-desc { color: var(--ink-soft); }

.options { border: 0; margin: 0; padding: 0; min-width: 0; }
.options legend { padding: 0; margin-bottom: 10px; font-size: .9375rem; font-weight: 650; }
.option-list { display: grid; gap: 8px; }
.option {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  min-height: 52px;
  padding: 12px 16px 12px 46px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  transition: border-color .2s var(--ease), background-color .2s var(--ease);
}
.option:hover { border-color: var(--ink); }
.option input {
  position: absolute;
  left: 16px;
  top: 50%;
  width: 18px;
  height: 18px;
  margin: 0;
  transform: translateY(-50%);
  accent-color: var(--ink);
}
.option:has(input:checked) { border-color: var(--ink); background: var(--tile); box-shadow: inset 0 0 0 1px var(--ink); }
@supports selector(:has(*)) {
  .option:has(input:focus-visible) { outline: 2px solid var(--focus); outline-offset: 3px; }
  .option input:focus-visible { outline: none; }
}
.option-name { font-weight: 600; }
.option-price { font-weight: 650; font-variant-numeric: tabular-nums; }

.option-error {
  margin-top: -6px;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--accent);
}

.purchase { display: grid; gap: 12px; padding-top: 4px; }
.purchase-row { display: flex; flex-wrap: wrap; gap: 12px; }
.purchase-row .button { flex: 1 1 180px; }

.qty {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  background: var(--surface);
}
.qty button {
  display: inline-grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: transparent;
}
.qty button svg { width: 18px; height: 18px; }
.qty button:hover:not([disabled]) { background: rgb(29 27 24 / 6%); }
.qty button[disabled],
.qty button[aria-disabled="true"] { opacity: .35; cursor: not-allowed; }
.qty button[aria-disabled="true"]:hover { background: transparent; }
.qty-value {
  min-width: 2ch;
  text-align: center;
  font-weight: 650;
  font-variant-numeric: tabular-nums;
}
.qty--lg { min-height: 48px; }
.qty--lg button { width: 46px; height: 46px; }

.added-note {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 10px;
  font-size: .9375rem;
  color: var(--ink-soft);
}
.added-note svg { width: 18px; height: 18px; color: var(--ink); }
.added-note .link-button { font-weight: 650; text-decoration: underline; text-underline-offset: 3px; min-height: 32px; }

/* Bag drawer */
.modal--drawer {
  margin: 0 0 0 auto;
  height: 100vh;
  height: 100dvh;
  max-height: none;
}
.modal--drawer[open] { animation: drawer-in .32s var(--ease); }
@keyframes drawer-in { from { transform: translateX(40px); opacity: 0; } }

.drawer-panel {
  display: flex;
  flex-direction: column;
  width: min(100vw, 440px);
  height: 100%;
  background: var(--surface);
  box-shadow: var(--shadow-lg);
}
.drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 14px 14px 14px 24px;
  border-bottom: 1px solid var(--line);
}
.drawer-title { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.drawer-title:focus-visible { outline-offset: 4px; }
.drawer-count { color: var(--muted); font-weight: 500; font-size: 1rem; }
.drawer-body {
  flex: 1 1 auto;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 24px;
}
.drawer-foot {
  display: grid;
  gap: 12px;
  padding: 18px 24px 24px;
  border-top: 1px solid var(--line);
  background: var(--surface);
}
.drawer-foot:empty { display: none; }

.bag-lines { display: grid; }
.bag-line {
  display: grid;
  grid-template-columns: 80px minmax(0, 1fr);
  gap: 14px;
  padding-block: 16px;
  border-bottom: 1px solid var(--line);
}
.bag-line:last-child { border-bottom: 0; }
.bag-thumb {
  width: 80px;
  height: 80px;
  overflow: hidden;
  border-radius: 14px;
  background: var(--tile);
}
.bag-thumb img { width: 100%; height: 100%; object-fit: cover; }
.bag-line-main { display: grid; gap: 4px; min-width: 0; }
.bag-line-top { display: flex; justify-content: space-between; gap: 12px; }
.bag-line-name { font-weight: 650; line-height: 1.3; }
.bag-line-meta { font-size: .875rem; color: var(--muted); }
.bag-line-total { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bag-line-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: 6px;
}
.bag-line-actions .qty { min-height: 40px; }
.bag-line-actions .qty button { width: 40px; height: 40px; }
.remove-button {
  min-height: 40px;
  padding: 0 4px;
  border: 0;
  background: none;
  font-size: .875rem;
  font-weight: 600;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.remove-button:hover { color: var(--ink); }

.subtotal-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  font-size: 1.0625rem;
}
.subtotal-row strong { font-size: 1.25rem; font-variant-numeric: tabular-nums; }
.foot-note { font-size: .8125rem; color: var(--muted); }
.storage-note {
  margin-top: 8px;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  font-size: .8125rem;
  color: var(--ink-soft);
}

.bag-empty,
.checkout-panel {
  display: grid;
  justify-items: center;
  gap: 12px;
  padding: 56px 8px;
  text-align: center;
}
.bag-empty-icon {
  display: grid;
  place-items: center;
  width: 64px;
  height: 64px;
  border-radius: 999px;
  background: var(--tile);
}
.bag-empty-icon svg { width: 28px; height: 28px; color: var(--muted); }
.bag-empty h3,
.checkout-panel h3 { font-size: 1.25rem; font-weight: 700; letter-spacing: -.02em; }
.bag-empty p,
.checkout-panel p { color: var(--muted); max-width: 22rem; }
.checkout-panel { justify-items: stretch; text-align: left; padding-top: 32px; }
.checkout-panel .eyebrow { color: var(--accent); }
.checkout-panel h3:focus-visible { outline-offset: 4px; }
.checkout-panel .checkout-actions { display: grid; gap: 10px; margin-top: 12px; }

/* Info dialog */
.info-panel {
  display: grid;
  gap: 12px;
  width: min(100vw - 24px, 520px);
  padding: clamp(24px, 5vw, 36px);
}
.info-title { font-size: 1.5rem; font-weight: 700; letter-spacing: -.025em; padding-right: 40px; }
.info-content { display: grid; gap: 10px; color: var(--ink-soft); }
.info-panel > .button { justify-self: start; margin-top: 8px; }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: max(20px, env(safe-area-inset-bottom));
  z-index: 50;
  max-width: calc(100vw - 32px);
  padding: 12px 20px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--surface);
  font-size: .9375rem;
  font-weight: 600;
  box-shadow: var(--shadow);
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, 16px);
  transition: opacity .25s var(--ease), transform .25s var(--ease);
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

/* Small screens */
@media (max-width: 479px) {
  .header-inner { gap: 8px; }
  .brand-name { font-size: 1rem; }
  .brand-mark { width: 28px; height: 28px; }
  .pill { padding: 0 14px; }
  .sort label { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
  .card-media { border-radius: var(--radius); }
  .card-link::after { border-radius: var(--radius); }
  .card-foot { align-items: flex-end; }
  .card-foot .price { font-size: .875rem; flex-direction: column; gap: 0; }
  .modal-panel { width: calc(100vw - 16px); max-height: calc(100dvh - 16px); }
  .drawer-head { padding-left: 20px; }
  .drawer-body, .drawer-foot { padding-inline: 20px; }
  .bag-line { grid-template-columns: 64px minmax(0, 1fr); gap: 12px; }
  .bag-thumb { width: 64px; height: 64px; border-radius: 12px; }
}

@media (max-width: 359px) {
  .brand-name { font-size: .9375rem; letter-spacing: -.03em; }
  .header-actions { gap: 2px; }
  .bag-button { padding: 0 4px 0 6px; gap: 4px; }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
  .card:hover .card-media img,
  .feature-card:hover .feature-media img,
  .feature-card:hover,
  .feature-card:hover .feature-arrow { transform: none; }
}

@media (forced-colors: active) {
  .pill[aria-pressed="true"] { outline: 2px solid CanvasText; }
  .bag-count { border: 1px solid CanvasText; }
}
