/* ═══════════════════════════════════════════════════════════════
   GRIDLY — E-Commerce Product Grid  (AAT-1)
   style.css — one shared stylesheet for all four pages.
   The whole point of this project is the PRODUCT GRID, so the
   catalogue is laid out with real CSS Grid:
     grid-template-columns: repeat(auto-fill, minmax(240px, 1fr))
   That single line gives a responsive multi-column layout with
   NO media queries — the columns re-flow to fit any screen.
   ═══════════════════════════════════════════════════════════════ */

/* ───────────────────────── 1. Design tokens ───────────────────────── */
:root {
  /* palette — warm modern retail */
  --ink: #1B1A17;            /* near-black text                */
  --paper: #FFFFFF;          /* page background                */
  --sand: #F6F3EE;           /* warm surface                   */
  --line: #E7E1D6;           /* hairlines                      */
  --muted: #6F6A60;          /* secondary text                 */
  --brand: #125B4A;          /* pine green primary             */
  --brand-soft: #E3EFEA;     /* primary tint                   */
  --accent: #F4653F;         /* coral — sale / CTA             */
  --gold: #E0A100;           /* stars / badges                 */
  --ok: #1F9254;

  /* type */
  --font-display: "Fraunces", Georgia, serif;
  --font-ui: "Manrope", "Segoe UI", Arial, sans-serif;
  --font-mono: "Space Mono", "Courier New", monospace;

  /* geometry */
  --radius: 16px;
  --radius-sm: 11px;
  --shadow: 0 10px 30px rgba(27, 26, 23, 0.08);
  --shadow-lift: 0 18px 44px rgba(27, 26, 23, 0.14);

  /* the grid gutter — one variable drives the whole layout */
  --gutter: 22px;
}

/* ───────────────────────── 2. Reset & base ───────────────────────── */
* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font-ui);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; }
input, select { font-family: inherit; }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 3px; border-radius: 4px; }

.container { width: min(1200px, 93%); margin-inline: auto; }

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.6em;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--brand);
}
.eyebrow::before { content: ""; width: 0.7em; height: 0.7em; background: var(--accent); border-radius: 2px; }

.section { padding: 88px 0; }
.section-head { max-width: 640px; margin-bottom: 40px; }
h1, h2, h3, .display { font-family: var(--font-display); font-weight: 600; letter-spacing: -0.01em; }
.section-head h2 { font-size: clamp(1.8rem, 3.6vw, 2.5rem); line-height: 1.12; margin-top: 12px; }
.section-head p { color: var(--muted); margin-top: 12px; font-size: 1.02rem; }

/* ───────────────────────── 3. Buttons ───────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5em;
  padding: 0.82em 1.6em;
  border-radius: var(--radius-sm);
  border: 1.5px solid transparent;
  font-weight: 700;
  font-size: 0.95rem;
  transition: transform 0.15s ease, background 0.15s ease, box-shadow 0.15s ease, color 0.15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--brand); color: #FFFFFF; box-shadow: 0 8px 20px rgba(18, 91, 74, 0.3); }
.btn-primary:hover { background: #0E4A3C; }
.btn-accent { background: var(--accent); color: #FFFFFF; box-shadow: 0 8px 20px rgba(244, 101, 63, 0.32); }
.btn-accent:hover { background: #E0532E; }
.btn-ghost { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover { background: var(--ink); color: #FFFFFF; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.45; cursor: not-allowed; box-shadow: none; }

/* ───────────────────────── 4. Navbar ───────────────────────── */
.navbar {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.9);
  backdrop-filter: blur(10px);
  border-bottom: 1.5px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 15px 0; }
.brand { font-family: var(--font-display); font-weight: 600; font-size: 1.4rem; display: inline-flex; align-items: center; gap: 0.5em; }
.brand-mark {
  width: 28px; height: 28px;
  border-radius: 8px;
  background: var(--brand);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2px;
  padding: 6px;
}
.brand-mark i { background: #FFFFFF; border-radius: 1.5px; display: block; }
.nav-links { display: flex; align-items: center; gap: 28px; list-style: none; }
.nav-links a { font-weight: 700; font-size: 0.93rem; color: var(--muted); padding: 6px 2px; border-bottom: 2px solid transparent; }
.nav-links a:hover { color: var(--ink); }
.nav-links a.active { color: var(--ink); border-bottom-color: var(--accent); }
.cart-link { position: relative; display: inline-flex; align-items: center; gap: 6px; }
.cart-badge {
  min-width: 21px; height: 21px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  font-weight: 700;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.burger { display: none; flex-direction: column; gap: 5px; background: none; border: 1.5px solid var(--line); border-radius: 8px; padding: 9px 10px; }
.burger span { width: 20px; height: 2px; background: var(--ink); border-radius: 2px; }

/* ───────────────────────── 5. Hero ───────────────────────── */
.hero { padding: 76px 0 84px; overflow: hidden; }
.hero-grid { display: grid; grid-template-columns: 1.02fr 0.98fr; gap: 54px; align-items: center; }
.hero h1 { font-size: clamp(2.3rem, 5vw, 3.5rem); line-height: 1.05; margin-top: 16px; }
.hero h1 em { font-style: italic; color: var(--brand); }
.hero-sub { color: var(--muted); font-size: 1.1rem; max-width: 470px; margin-top: 18px; }
.hero-actions { display: flex; gap: 14px; margin-top: 30px; flex-wrap: wrap; }
.hero-note { margin-top: 26px; font-family: var(--font-mono); font-size: 0.78rem; color: var(--muted); }
.hero-note b { color: var(--ink); }

/* the hero visual literally demonstrates the grid: 4 mini tiles */
.hero-tiles {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 16px;
}
.hero-tile {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius);
  border: 1.5px solid var(--line);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow);
  display: flex;
  align-items: flex-end;
  padding: 16px;
}
.hero-tile span { position: relative; font-family: var(--font-mono); font-size: 0.72rem; font-weight: 700; color: #FFFFFF; z-index: 1; }
.hero-tile::after { content: ""; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0,0,0,0.35), transparent 55%); }
.hero-tile:nth-child(1) { background: linear-gradient(135deg, #1F7A63, #125B4A); }
.hero-tile:nth-child(2) { background: linear-gradient(135deg, #F4915F, #F4653F); margin-top: 26px; }
.hero-tile:nth-child(3) { background: linear-gradient(135deg, #3A6EA5, #274C77); margin-top: -26px; }
.hero-tile:nth-child(4) { background: linear-gradient(135deg, #C9A227, #E0A100); }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }
.hero-tile:nth-child(1) { animation: floaty 6s ease-in-out infinite; }
.hero-tile:nth-child(4) { animation: floaty 6s ease-in-out infinite 1.5s; }
@media (prefers-reduced-motion: reduce) {
  .hero-tile { animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ───────────────────────── 6. THE PRODUCT GRID (signature) ─────────────────────────
   This is the whole assignment. auto-fill + minmax = a responsive
   multi-column layout that needs NO media queries. A density
   toggle just swaps the min track width via a CSS variable. */
.grid-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 26px;
}
.chips { display: flex; gap: 10px; flex-wrap: wrap; }
.chip {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-weight: 700;
  padding: 8px 15px;
  border-radius: 999px;
  border: 1.5px solid var(--line);
  background: var(--paper);
  color: var(--muted);
  transition: all 0.15s ease;
}
.chip:hover { border-color: var(--brand); color: var(--brand); }
.chip.active { background: var(--ink); border-color: var(--ink); color: #FFFFFF; }

.toolbar-right { display: flex; align-items: center; gap: 16px; }
.result-count { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); }
.density { display: inline-flex; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; }
.density button {
  padding: 7px 14px;
  border: none;
  background: transparent;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-weight: 700;
  color: var(--muted);
}
.density button:hover { background: var(--sand); }
.density button.active { background: var(--brand); color: #FFFFFF; }
.sort-select {
  padding: 8px 12px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--paper);
  font-size: 0.85rem;
  font-weight: 700;
  color: var(--ink);
}

/* ★ THE GRID ITSELF ★ */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-min, 240px), 1fr));
  gap: var(--gutter);
  align-items: stretch;
}
.product-grid.cozy { --card-min: 300px; }
.product-grid.dense { --card-min: 190px; }

/* the reusable product card */
.card {
  background: var(--paper);
  border: 1.5px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  transition: transform 0.18s ease, box-shadow 0.18s ease, border-color 0.18s ease;
}
.card:hover { transform: translateY(-5px); box-shadow: var(--shadow-lift); border-color: var(--brand); }

.card-media {
  position: relative;
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
  overflow: hidden;
}
/* product "photo" is a generated gradient + glyph, so no image files */
.card-media .glyph { font-size: 2.6rem; filter: drop-shadow(0 6px 10px rgba(0,0,0,0.18)); }
.badge {
  position: absolute;
  top: 12px; left: 12px;
  font-family: var(--font-mono);
  font-size: 0.66rem;
  font-weight: 700;
  padding: 4px 9px;
  border-radius: 999px;
  background: var(--accent);
  color: #FFFFFF;
  letter-spacing: 0.04em;
}
.badge.new { background: var(--brand); }
.badge.low { background: var(--ink); }
.wish {
  position: absolute;
  top: 10px; right: 10px;
  width: 32px; height: 32px;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.9);
  display: grid;
  place-items: center;
  font-size: 0.95rem;
  color: var(--muted);
  transition: transform 0.15s ease, color 0.15s ease;
}
.wish:hover { transform: scale(1.12); color: var(--accent); }
.wish.on { color: var(--accent); }

.card-body { padding: 15px 16px 16px; display: flex; flex-direction: column; gap: 5px; flex: 1; }
.card-cat { font-family: var(--font-mono); font-size: 0.68rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.card-name { font-family: var(--font-display); font-size: 1.06rem; line-height: 1.25; }
.card-rating { display: flex; align-items: center; gap: 5px; font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); }
.card-rating .stars { color: var(--gold); letter-spacing: 1px; }
.card-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; padding-top: 12px; }
.price-wrap { display: flex; align-items: baseline; gap: 7px; }
.price { font-family: var(--font-mono); font-weight: 700; font-size: 1.12rem; }
.price-was { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); text-decoration: line-through; }
.add-btn {
  background: var(--ink);
  color: #FFFFFF;
  border: none;
  border-radius: var(--radius-sm);
  width: 40px; height: 40px;
  font-size: 1.15rem;
  display: grid;
  place-items: center;
  transition: background 0.15s ease, transform 0.15s ease;
}
.add-btn:hover { background: var(--brand); }
.add-btn.added { background: var(--ok); }
.add-btn:active { transform: scale(0.92); }

/* skeleton shimmer while the grid "loads" */
.skeleton { pointer-events: none; }
.skeleton .card-media, .skeleton .sk-line {
  background: linear-gradient(90deg, #EEE9E0 25%, #F6F2EB 37%, #EEE9E0 63%);
  background-size: 400% 100%;
  animation: shimmer 1.4s ease infinite;
}
.skeleton .sk-line { height: 12px; border-radius: 6px; margin-top: 8px; }
.skeleton .sk-line.short { width: 55%; }
@keyframes shimmer { 0% { background-position: 100% 0; } 100% { background-position: -100% 0; } }

/* ───────────────────────── 7. Feature row / stats / CTA ───────────────────────── */
.mini-features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; margin-top: 8px; }
.mini-feature { display: flex; gap: 12px; align-items: flex-start; }
.mini-feature .mf-ic {
  width: 40px; height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: var(--brand-soft);
  color: var(--brand);
  display: grid;
  place-items: center;
  font-family: var(--font-mono);
  font-weight: 700;
}
.mini-feature h4 { font-family: var(--font-ui); font-size: 0.96rem; font-weight: 700; }
.mini-feature p { font-size: 0.85rem; color: var(--muted); }

.stat-strip { background: var(--brand); color: #FFFFFF; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); padding: 44px 0; }
.stat-item { padding: 6px 28px; border-left: 1px solid rgba(255,255,255,0.16); }
.stat-item:first-child { border-left: none; }
.stat-item b { display: block; font-family: var(--font-display); font-weight: 600; font-size: 2.1rem; color: #FFE9B8; line-height: 1.2; }
.stat-item span { font-size: 0.85rem; color: rgba(255,255,255,0.8); }

.cta-band {
  border: 1.5px solid var(--line);
  border-radius: 22px;
  background: var(--sand);
  padding: 52px 40px;
  text-align: center;
}
.cta-band h2 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.cta-band p { color: var(--muted); margin: 10px 0 24px; }

/* ───────────────────────── 8. Page head ───────────────────────── */
.page-head { padding: 56px 0 8px; }
.page-head h1 { font-size: clamp(2rem, 4vw, 2.7rem); margin-top: 12px; }
.page-head p { color: var(--muted); margin-top: 10px; max-width: 560px; }

/* ───────────────────────── 9. Cart page ───────────────────────── */
.cart-layout { display: grid; grid-template-columns: 1fr 350px; gap: 28px; align-items: start; padding: 34px 0 96px; }
.cart-list { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.cart-row {
  display: grid;
  grid-template-columns: 74px 1fr auto auto auto;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
  border-bottom: 1.5px solid var(--line);
}
.cart-row:last-child { border-bottom: none; }
.thumb { width: 70px; height: 70px; border-radius: 12px; display: grid; place-items: center; font-size: 1.6rem; border: 1.5px solid var(--line); }
.cart-item-name { font-family: var(--font-display); font-size: 1.02rem; }
.cart-item-cat { font-family: var(--font-mono); font-size: 0.72rem; color: var(--muted); }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; overflow: hidden; background: var(--paper); }
.qty button { width: 32px; height: 32px; border: none; background: transparent; font-size: 1rem; font-weight: 700; color: var(--ink); }
.qty button:hover { background: var(--brand-soft); color: var(--brand); }
.qty output { min-width: 30px; text-align: center; font-family: var(--font-mono); font-size: 0.9rem; font-weight: 700; }
.line-total { font-family: var(--font-mono); font-weight: 700; min-width: 76px; text-align: right; }
.remove-btn { width: 32px; height: 32px; border: 1.5px solid var(--line); border-radius: 8px; background: transparent; color: var(--muted); font-size: 0.95rem; }
.remove-btn:hover { border-color: var(--accent); color: var(--accent); background: #FDEEE9; }

.summary { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 26px 24px; position: sticky; top: 92px; }
.summary h3 { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand); padding-bottom: 12px; border-bottom: 1.5px solid var(--line); margin-bottom: 16px; }
.summary-line { display: flex; justify-content: space-between; font-size: 0.92rem; color: var(--muted); margin-bottom: 10px; }
.summary-line span:last-child { font-family: var(--font-mono); color: var(--ink); }
.summary-line.free span:last-child { color: var(--ok); font-weight: 700; }
.summary-total { display: flex; justify-content: space-between; align-items: baseline; border-top: 1.5px solid var(--line); padding-top: 14px; margin: 14px 0 20px; font-family: var(--font-display); font-size: 1.05rem; }
.summary-total span:last-child { font-family: var(--font-mono); font-size: 1.35rem; font-weight: 700; }
.summary-note { margin-top: 14px; font-size: 0.78rem; color: var(--muted); text-align: center; }

.empty-state { border: 1.5px solid var(--line); border-radius: 22px; background: var(--sand); text-align: center; padding: 76px 30px; margin: 34px 0 96px; }
.empty-mark { width: 68px; height: 68px; margin: 0 auto 20px; border-radius: 16px; background: var(--brand); display: grid; place-items: center; color: #FFFFFF; font-size: 1.5rem; }
.empty-state h2 { font-size: 1.6rem; }
.empty-state p { color: var(--muted); margin: 8px 0 24px; }

/* ───────────────────────── 10. Payment page ───────────────────────── */
.pay-layout { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: 28px; align-items: start; padding: 34px 0 96px; }
.pay-form { background: var(--paper); border: 1.5px solid var(--line); border-radius: var(--radius); padding: 30px 28px; }
.pay-form fieldset { border: none; margin-bottom: 26px; }
.pay-form legend { font-family: var(--font-mono); font-size: 0.78rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand); margin-bottom: 16px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { display: flex; flex-direction: column; }
.field.full { grid-column: 1 / -1; }
.field label { font-size: 0.85rem; font-weight: 700; margin-bottom: 6px; }
.field input {
  padding: 12px 14px;
  border: 1.5px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  background: #FCFAF6;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus { outline: none; border-color: var(--brand); box-shadow: 0 0 0 3px rgba(18, 91, 74, 0.14); }
.field input.mono { font-family: var(--font-mono); letter-spacing: 0.04em; }
.field input.invalid { border-color: var(--accent); background: #FDEEE9; }
.err { font-size: 0.76rem; color: var(--accent); margin-top: 5px; min-height: 1em; visibility: hidden; }
.err.show { visibility: visible; }
.accepted { font-family: var(--font-mono); font-size: 0.7rem; color: var(--muted); letter-spacing: 0.08em; margin-top: -6px; margin-bottom: 16px; }

.mini-item { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; font-size: 0.9rem; }
.mini-item .thumb { width: 46px; height: 46px; font-size: 1.1rem; border-radius: 10px; }
.mini-item .m-name { flex: 1; font-family: var(--font-display); font-size: 0.92rem; }
.mini-item .m-qty { font-family: var(--font-mono); font-size: 0.76rem; color: var(--muted); }
.mini-item .m-price { font-family: var(--font-mono); font-weight: 700; }

/* ───────────────────────── 11. Toast & modal ───────────────────────── */
.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 80px);
  background: var(--ink);
  color: #FFFFFF;
  padding: 12px 22px;
  border-radius: 12px;
  font-size: 0.9rem;
  font-weight: 700;
  box-shadow: var(--shadow-lift);
  opacity: 0;
  transition: transform 0.25s ease, opacity 0.25s ease;
  z-index: 90;
  pointer-events: none;
}
.toast.show { transform: translate(-50%, 0); opacity: 1; }

.modal-overlay { position: fixed; inset: 0; background: rgba(27, 26, 23, 0.6); backdrop-filter: blur(4px); display: none; align-items: center; justify-content: center; z-index: 100; padding: 20px; }
.modal-overlay.show { display: flex; }
.modal { background: var(--paper); border: 1.5px solid var(--line); border-radius: 22px; padding: 44px 38px; max-width: 430px; width: 100%; text-align: center; animation: pop 0.3s ease; }
@keyframes pop { from { transform: scale(0.85); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.check-mark { width: 72px; height: 72px; margin: 0 auto 20px; border-radius: 20px; background: var(--brand); color: #FFFFFF; font-size: 2rem; display: grid; place-items: center; box-shadow: 0 8px 22px rgba(18, 91, 74, 0.4); }
.modal h2 { font-size: 1.6rem; }
.modal .order-id { font-family: var(--font-mono); font-size: 0.85rem; background: var(--sand); border: 1.5px dashed var(--line); border-radius: 8px; display: inline-block; padding: 6px 14px; margin: 14px 0 8px; }
.modal p { color: var(--muted); font-size: 0.92rem; margin-bottom: 22px; }

/* ───────────────────────── 12. Footer ───────────────────────── */
.footer { border-top: 1.5px solid var(--line); background: var(--sand); padding: 56px 0 0; margin-top: 20px; }
.footer-grid { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; padding-bottom: 44px; }
.footer-blurb { color: var(--muted); font-size: 0.9rem; max-width: 320px; margin-top: 12px; }
.footer h4 { font-family: var(--font-mono); font-size: 0.72rem; letter-spacing: 0.16em; text-transform: uppercase; color: var(--brand); margin-bottom: 14px; }
.footer ul { list-style: none; }
.footer li { margin-bottom: 9px; }
.footer li a { font-size: 0.92rem; }
.footer li a:hover { color: var(--brand); }
.footer-bottom { border-top: 1.5px solid var(--line); padding: 18px 0; display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.74rem; color: var(--muted); }

/* ───────────────────────── 13. Responsive ─────────────────────────
   NOTE: the product grid needs NO breakpoints — auto-fill handles it.
   These rules are only for the surrounding page furniture. */
@media (max-width: 1020px) {
  .hero-grid { grid-template-columns: 1fr; gap: 44px; }
  .mini-features { grid-template-columns: repeat(2, 1fr); }
  .cart-layout, .pay-layout { grid-template-columns: 1fr; }
  .summary { position: static; }
}
@media (max-width: 820px) {
  .burger { display: flex; }
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--paper);
    border-bottom: 1.5px solid var(--line);
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 10px 4%;
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links li { width: 100%; }
  .nav-links a { display: block; padding: 13px 4px; width: 100%; }
  .stat-grid { grid-template-columns: repeat(2, 1fr); row-gap: 26px; }
  .stat-item:nth-child(3) { border-left: none; }
}
@media (max-width: 620px) {
  .section { padding: 60px 0; }
  .mini-features { grid-template-columns: 1fr; }
  .form-grid { grid-template-columns: 1fr; }
  .grid-toolbar { flex-direction: column; align-items: stretch; }
  .toolbar-right { justify-content: space-between; }
  .cart-row {
    grid-template-columns: 70px 1fr auto;
    grid-template-areas:
      "thumb name remove"
      "thumb qty  total";
    row-gap: 12px;
  }
  .thumb { grid-area: thumb; }
  .cart-item-info { grid-area: name; }
  .qty { grid-area: qty; justify-self: start; }
  .line-total { grid-area: total; }
  .remove-btn { grid-area: remove; justify-self: end; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .stat-item { padding: 6px 16px; }
  .stat-item b { font-size: 1.7rem; }
  /* on the smallest screens, force at least 2 columns so it still reads as a grid */
  .product-grid { --card-min: 150px; }
}
