:root {
  color-scheme: light;
  --ink: #1f2320;
  --muted: #687064;
  --paper: #fbfaf4;
  --cream: #f3ead8;
  --moss: #44624a;
  --copper: #b45f36;
  --aqua: #227a82;
  --gold: #d9a441;
  --line: #d8d0c0;
  --shadow: 0 24px 70px rgba(45, 37, 24, .14);
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background:
    linear-gradient(120deg, rgba(68, 98, 74, .12), transparent 34%),
    radial-gradient(circle at 88% 10%, rgba(217, 164, 65, .18), transparent 30%),
    var(--paper);
  color: var(--ink);
  font: 16px/1.5 Georgia, "Times New Roman", serif;
}

button, input, textarea { font: inherit; }

button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  padding: 16px clamp(18px, 4vw, 54px);
  background: rgba(251, 250, 244, .88);
  border-bottom: 1px solid rgba(216, 208, 192, .82);
  backdrop-filter: blur(18px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  width: 42px;
  aspect-ratio: 1;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  border-radius: 50%;
  font-weight: 700;
}

.brand strong, .brand small { display: block; }
.brand small { color: var(--muted); font-size: .76rem; }

.top-nav { display: flex; gap: 20px; }
.top-nav a { color: var(--ink); text-decoration: none; font-weight: 700; }

.icon-button {
  display: inline-grid;
  position: relative;
  width: 44px;
  aspect-ratio: 1;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffef9;
  color: var(--ink);
  cursor: pointer;
}

.icon-button svg { width: 19px; height: 19px; }

.cart-toggle span {
  position: absolute;
  right: -7px;
  top: -7px;
  min-width: 22px;
  padding: 2px 6px;
  border-radius: 999px;
  background: var(--copper);
  color: white;
  font-size: .78rem;
  line-height: 1.2;
}

main { width: min(1220px, calc(100% - 34px)); margin: 0 auto; }

.screen { display: none; }
.screen[hidden] { display: none !important; }
.screen.active { display: block; }
.screen.active.checkout-section { display: grid; }

.storefront {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(340px, 1.05fr);
  gap: clamp(24px, 5vw, 64px);
  align-items: center;
  min-height: calc(100vh - 78px);
  padding: 44px 0 38px;
}

.store-copy h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(3rem, 8vw, 7rem);
  line-height: .88;
  letter-spacing: 0;
}

.store-copy p:not(.eyebrow) {
  max-width: 600px;
  color: var(--muted);
  font-size: 1.12rem;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--copper);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }

.primary-link, .secondary-link, .ghost-button, .checkout-button, .apple-pay-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 18px;
  border-radius: 8px;
  border: 1px solid transparent;
  text-decoration: none;
  font-weight: 700;
  cursor: pointer;
}

.primary-link, .checkout-button { background: var(--moss); color: white; }
.secondary-link, .ghost-button { background: #fffef9; color: var(--ink); border-color: var(--line); }

.hero-product {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.hero-product img { width: 100%; height: 100%; min-height: 520px; object-fit: cover; display: block; }

.feature-strip {
  position: absolute;
  inset: auto 18px 18px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

.feature-strip span {
  min-height: 54px;
  padding: 10px;
  background: rgba(31, 35, 32, .78);
  color: #fff;
  border: 1px solid rgba(255,255,255,.22);
  border-radius: 8px;
  font-size: .84rem;
}

.ad-band {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin: 18px 0 38px;
}

.ad-band article {
  padding: 18px;
  background: #fffef9;
  border: 1px solid var(--line);
  border-left: 5px solid var(--gold);
  border-radius: 8px;
}

.ad-band span { color: var(--aqua); font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.ad-band strong { display: block; margin: 6px 0; font-size: 1.2rem; }
.ad-band p { margin: 0; color: var(--muted); }

.home-highlights {
  padding: 34px 0 56px;
}

.home-highlights .section-heading h2 {
  max-width: 640px;
}

.highlight-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.highlight-tile {
  display: grid;
  grid-template-rows: 190px 1fr auto;
  overflow: hidden;
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 14px 36px rgba(45, 37, 24, .08);
}

.highlight-tile img {
  width: 100%;
  height: 190px;
  object-fit: cover;
  display: block;
  background: var(--cream);
}

.highlight-tile > div:not(.tile-footer) { padding: 16px; }
.highlight-tile span { color: var(--aqua); font-size: .78rem; font-weight: 700; text-transform: uppercase; }
.highlight-tile h3 { margin: 8px 0 6px; font-size: 1.2rem; line-height: 1.1; }
.highlight-tile p { margin: 0; color: var(--muted); }

.controls {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) minmax(190px, auto) auto;
  gap: 12px;
  align-items: center;
  margin-bottom: 14px;
}

.search-box, .sort-box {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 54px;
  padding: 0 16px;
  background: white;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.search-box svg { width: 20px; color: var(--muted); }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; }
.sort-box span { color: var(--muted); font-size: .82rem; font-weight: 700; text-transform: uppercase; }
.sort-box select { min-width: 150px; border: 0; outline: 0; background: transparent; color: var(--ink); cursor: pointer; }

.filter-row { display: flex; flex-wrap: wrap; gap: 8px; }
.type-filter { margin: 0 0 10px; }
.section-filter { margin: 0 0 34px; }

.chip {
  min-height: 40px;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fffef9;
  color: var(--ink);
  cursor: pointer;
}

.chip.active { background: var(--ink); color: white; border-color: var(--ink); }

.stock-filter { display: flex; align-items: center; gap: 8px; white-space: nowrap; }

.catalog-section, .service-band, .checkout-section { padding: 34px 0; }
.catalog-section { min-height: calc(100vh - 78px); }

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 18px;
}

h2 { margin: 0; font-size: clamp(1.8rem, 4vw, 3.6rem); line-height: .98; }

.section-heading > p { color: var(--muted); margin: 0; }

.catalog-groups { display: grid; gap: 34px; }
.group-title { margin: 0 0 14px; font-size: 1.4rem; }
.tile-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }

.product-tile {
  display: grid;
  grid-template-rows: 180px 1fr auto;
  overflow: hidden;
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 8px;
}

.product-tile img { width: 100%; height: 180px; object-fit: cover; display: block; background: var(--cream); }

.tile-body { padding: 16px; }
.tile-meta { display: flex; justify-content: space-between; gap: 10px; color: var(--muted); font-size: .86rem; }
.product-tile h3 { margin: 9px 0 6px; font-size: 1.22rem; line-height: 1.1; }
.product-tile p { margin: 0; color: var(--muted); }
.sponsored { color: var(--copper); font-weight: 700; }

.tile-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 16px 16px;
}

.price { font-size: 1.15rem; font-weight: 700; }
.add-button { min-height: 40px; padding: 8px 12px; border: 0; border-radius: 8px; background: var(--aqua); color: white; font-weight: 700; cursor: pointer; }
.add-button:disabled { background: #c9c3b5; cursor: not-allowed; }

.service-band {
  display: grid;
  grid-template-columns: minmax(220px, .7fr) minmax(0, 1.3fr);
  gap: 24px;
  align-items: start;
}

.service-tiles { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.service-tiles .product-tile { grid-template-rows: 150px 1fr auto; }
.service-tiles .product-tile img { height: 150px; }

.checkout-section {
  display: grid;
  grid-template-columns: minmax(240px, .8fr) minmax(300px, 1.2fr);
  gap: 28px;
  align-items: start;
}

.screen:not(.active) { display: none; }
.screen.active.checkout-section { display: grid; }

.checkout-section > div > p:not(.eyebrow) { color: var(--muted); }
.checkout-form { display: grid; gap: 12px; }
.checkout-form label { display: grid; gap: 7px; font-weight: 700; }
.checkout-form input, .checkout-form textarea, .card-element {
  width: 100%;
  min-height: 48px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffef9;
}
.checkout-form textarea { min-height: 96px; resize: vertical; }

.payment-box {
  display: grid;
  gap: 12px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fffef9;
}
.payment-box p { margin: 4px 0 0; color: var(--muted); }
.apple-pay-button { background: #000; color: #fff; width: 100%; }
.wallet-slot { min-height: 42px; }
.checkout-button { width: 100%; border: 0; }

.cart-drawer {
  position: fixed;
  z-index: 35;
  top: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  width: min(430px, 100%);
  height: 100vh;
  padding: 18px;
  background: var(--paper);
  border-left: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: translateX(110%);
  transition: transform .22s ease;
}

.cart-drawer.open { transform: translateX(0); }
.cart-header { display: flex; justify-content: space-between; align-items: start; gap: 12px; }
.cart-header h2 { font-size: 2rem; }
.cart-items { flex: 1; overflow: auto; display: grid; gap: 10px; padding: 16px 0; }
.empty-cart { color: var(--muted); }

.cart-line {
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px;
  background: #fffef9;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.cart-line img { width: 64px; aspect-ratio: 1; object-fit: cover; border-radius: 6px; }
.cart-line h3 { margin: 0 0 5px; font-size: 1rem; }
.cart-line p { margin: 0; color: var(--muted); font-size: .9rem; }
.quantity { display: flex; align-items: center; gap: 7px; }
.quantity button { width: 30px; aspect-ratio: 1; border: 1px solid var(--line); border-radius: 6px; background: white; cursor: pointer; }

.cart-footer { display: grid; gap: 8px; border-top: 1px solid var(--line); padding-top: 14px; }
.cart-footer > div { display: flex; justify-content: space-between; }
.cart-footer .total { font-size: 1.2rem; }
.full { width: 100%; }
.scrim { position: fixed; inset: 0; z-index: 30; background: rgba(31,35,32,.32); opacity: 0; pointer-events: none; transition: opacity .2s ease; }
.scrim.open { opacity: 1; pointer-events: auto; }
.toast { position: fixed; left: 50%; bottom: 22px; z-index: 50; transform: translate(-50%, calc(100% + 40px)); opacity: 0; pointer-events: none; max-width: min(520px, calc(100% - 28px)); padding: 12px 16px; background: var(--ink); color: white; border-radius: 8px; transition: transform .2s ease, opacity .2s ease; }
.toast.show { transform: translate(-50%, 0); opacity: 1; }

@media (max-width: 920px) {
  .top-nav { display: none; }
  .storefront, .service-band, .checkout-section { grid-template-columns: 1fr; min-height: auto; }
  .hero-product, .hero-product img { min-height: 390px; }
  .controls { grid-template-columns: 1fr; }
  .ad-band, .service-tiles, .highlight-grid { grid-template-columns: 1fr; }
}

@media (max-width: 560px) {
  main { width: min(100% - 24px, 1220px); }
  .site-header { padding-inline: 12px; }
  .brand small { display: none; }
  .store-copy h1 { font-size: clamp(2.5rem, 17vw, 4.2rem); }
  .feature-strip { grid-template-columns: 1fr; }
  .section-heading { display: block; }
  .section-heading > p { margin-top: 8px; }
  .tile-grid { grid-template-columns: 1fr; }
}