/* Kedai eDIDIK - gaya kedai
   Idea reka bentuk: alat tulis sekolah. Dakwat biru tua di atas kertas putih, garisan buku latihan,
   dan pen merah cikgu yang hanya digunakan untuk menanda (gred, tanda betul, kiraan troli). */

@font-face { font-family: "Besley"; src: url("../fonts/besley.woff2") format("woff2"); font-weight: 400 900; font-display: swap; }
@font-face { font-family: "Atkinson Next"; src: url("../fonts/atkinson-next.woff2") format("woff2"); font-weight: 200 800; font-display: swap; }
@font-face { font-family: "Caveat"; src: url("../fonts/caveat.woff2") format("woff2"); font-weight: 400 700; font-display: swap; }

:root {
  --paper: #ffffff;
  --sheet: #eef3fa;
  --ink: #14213d;
  --ink-soft: #46546f;
  --rule: #bfd1ec;
  --rule-faint: #dce7f6;
  --pen: #d7263d;
  --pen-blue: #1f3fae;
  --hi: #ffe45c;
  --ok: #17633f;
  --ok-bg: #e4f3ea;
  --warn: #8a4b00;
  --warn-bg: #fff1d6;
  --err: #b3261e;
  --focus: #1f6feb;
  --display: "Besley", Georgia, "Times New Roman", serif;
  --body: "Atkinson Next", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --hand: "Caveat", "Segoe Print", cursive;
  --gutter: clamp(1rem, 4vw, 2rem);
  --radius: 6px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 1.0625rem/1.55 var(--body);
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--ink); text-underline-offset: 0.18em; text-decoration-thickness: 1.5px; }
a:hover { text-decoration-thickness: 2.5px; }
h1, h2, h3, p, ul, ol, dl, dd, figure, table { margin: 0; }
h1, h2 { font-family: var(--display); line-height: 1.1; letter-spacing: -0.012em; text-wrap: balance; }
h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3rem); font-weight: 800; margin-bottom: 1rem; }
h2 { font-size: clamp(1.375rem, 1.1rem + 1vw, 1.75rem); font-weight: 700; margin-bottom: 0.75rem; }
h3 { font-size: 1.125rem; font-weight: 700; line-height: 1.3; }
p + p { margin-top: 0.75rem; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 2px; border-radius: 2px; }
[hidden] { display: none !important; }

.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: -999px; top: 0; background: var(--hi); color: var(--ink); padding: 0.6rem 1rem; font-weight: 700; z-index: 10; }
.skip:focus { left: 0; }

.wrap { max-width: 74rem; margin-inline: auto; padding-inline: var(--gutter); }
.wrap.narrow { max-width: 42rem; }
.wrap.narrow-wide { max-width: 58rem; }
.section { padding-block: clamp(2rem, 5vw, 3.5rem); }
.section-sheet { background: var(--sheet); }
.lead { font-size: 1.1875rem; color: var(--ink-soft); max-width: 38em; }
.hint { color: var(--ink-soft); font-size: 0.9375rem; }
.optional { color: var(--ink-soft); font-weight: 400; }
.empty { background: var(--sheet); border-radius: 8px; padding: 1.5rem; margin-bottom: 1.25rem; }
.crumbs { font-size: 0.9375rem; color: var(--ink-soft); margin-bottom: 0.75rem; display: flex; gap: 0.5rem; flex-wrap: wrap; }
.crumbs a { color: var(--ink-soft); }

/* ---- Butang -------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.5rem;
  min-height: 3rem; padding: 0.65rem 1.3rem;
  background: var(--ink); color: #fff; border: 2px solid var(--ink); border-radius: var(--radius);
  font: 700 1rem/1.2 var(--body); text-decoration: none; cursor: pointer; text-align: center;
}
.btn:hover { background: #0a142c; border-color: #0a142c; }
.btn-ghost { background: transparent; color: var(--ink); }
.btn-ghost:hover { background: var(--sheet); border-color: var(--ink); }
.btn-small { min-height: 2.5rem; padding: 0.4rem 0.95rem; font-size: 0.9375rem; }
.btn-block { width: 100%; }
.btn-pay { font-family: var(--display); font-size: 1.125rem; letter-spacing: 0.005em; min-height: 3.25rem; }
.btn[disabled] { opacity: 0.6; cursor: progress; }
.link-btn { background: none; border: 0; padding: 0; font: inherit; font-size: 0.9375rem; color: var(--ink-soft); text-decoration: underline; cursor: pointer; }
.link-btn:hover { color: var(--err); }
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 1.5rem; }

/* ---- Jalur atas & kepala ---------------------------------------------------- */
.strip { background: var(--ink); color: #e6edf9; font-size: 0.875rem; }
.strip-in { display: flex; justify-content: space-between; align-items: center; gap: 1rem; padding-block: 0.4rem; }
.strip p { margin: 0; }
.lang-switch { display: flex; gap: 0.75rem; flex: none; }
.lang-switch a { color: #e6edf9; }
.lang-switch span { font-weight: 700; color: #fff; }
.testmode { background: var(--hi); color: var(--ink); text-align: center; font-size: 0.9375rem; font-weight: 700; padding: 0.35rem var(--gutter); }

.masthead { border-bottom: 2px solid var(--ink); background: var(--paper); }
.masthead-in { display: flex; align-items: center; gap: 1rem 2rem; flex-wrap: wrap; padding-block: 0.85rem; }
.brand { display: inline-flex; align-items: baseline; gap: 0.35rem; text-decoration: none; color: var(--ink); }
.brand img { height: 44px; width: auto; align-self: center; }
.brand-mark { font: 900 1.75rem/1 var(--display); letter-spacing: -0.02em; }
.brand-sub { font: 700 1.6rem/1 var(--hand); color: var(--pen); transform: rotate(-5deg) translateY(-0.1rem); display: inline-block; }
.nav { display: flex; gap: 0.25rem 1.5rem; flex-wrap: wrap; margin-left: auto; }
.nav a { font-weight: 600; text-decoration: none; padding: 0.35rem 0; border-bottom: 2px solid transparent; }
.nav a:hover { border-bottom-color: var(--ink); }
.cart-link {
  display: inline-flex; align-items: center; gap: 0.45rem; text-decoration: none; font-weight: 700;
  border: 2px solid var(--ink); border-radius: var(--radius); padding: 0.4rem 0.8rem; min-height: 2.75rem;
}
.cart-link:hover { background: var(--sheet); }
.cart-count { background: var(--pen); color: #fff; border-radius: 99px; min-width: 1.5rem; height: 1.5rem; padding: 0 0.4rem; display: inline-grid; place-items: center; font-size: 0.875rem; }

/* ---- Mesej --------------------------------------------------------------------- */
.flash { margin: 1rem 0 0; padding: 0.75rem 1rem; border-radius: var(--radius); border-left: 6px solid var(--ink); background: var(--sheet); font-weight: 600; }
.flash-ok { border-color: var(--ok); background: var(--ok-bg); color: #0d3d27; }
.flash-error { border-color: var(--err); background: #fdecea; color: #7a1712; }
.section .flash { margin: 0 0 1.25rem; }
.notice { border-left: 6px solid var(--ink); background: var(--sheet); border-radius: 0 8px 8px 0; padding: 1.1rem 1.25rem; margin: 1.25rem 0 1.75rem; }
.notice h2 { font-size: 1.375rem; margin-bottom: 0.35rem; }
.notice .btn { margin-top: 0.75rem; }
.notice-ok { border-color: var(--ok); background: var(--ok-bg); }
.notice-warn { border-color: #c77700; background: var(--warn-bg); }

/* ---- Hero: halaman buku latihan ---------------------------------------------------- */
.hero {
  --line: 2.5rem;
  position: relative;
  border-bottom: 2px solid var(--ink);
  background: repeating-linear-gradient(to bottom, transparent 0, transparent calc(var(--line) - 1px), var(--rule-faint) calc(var(--line) - 1px), var(--rule-faint) var(--line));
}
.hero::before { /* garisan jidar merah */
  content: ""; position: absolute; top: 0; bottom: 0; width: 2px; background: #f3aab3;
  left: max(calc(var(--gutter) * 0.5), calc((100vw - 74rem) / 2 + var(--gutter) * 0.5));
}
.hero-in { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: clamp(2rem, 5vw, 4rem); align-items: center; padding-block: calc(var(--line) * 1.5); }
.hero-copy { padding-left: calc(var(--gutter) * 0.75); }
.hero-in > .hero-copy:only-child { grid-column: 1 / -1; max-width: 46rem; }
.hero h1 { font-size: clamp(2.25rem, 1.2rem + 3.6vw, 3.5rem); font-weight: 900; line-height: 1.04; margin-bottom: 1.25rem; }
.hero .lead { color: var(--ink); background: var(--paper); box-shadow: 0 0 0 0.35rem var(--paper); max-width: 31em; }

.hero-card { background: var(--paper); border: 2px solid var(--ink); border-radius: 10px; box-shadow: 0 0 0 5px var(--paper), 0 0 0 7px var(--ink); overflow: hidden; max-width: 28rem; justify-self: end; width: 100%; }
.hero-photo { display: block; background: var(--sheet); border-bottom: 2px solid var(--ink); }
.hero-photo img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }
.hero-card .report { border: 0; border-radius: 0; }
.hero-card-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; padding: 0.9rem 1.25rem; border-top: 2px solid var(--ink); background: var(--sheet); }
.hero-card-foot > span { display: grid; }
.hero-card-name { font: 700 1.0625rem/1.3 var(--display); text-decoration: none; }
.hero-card-foot .price { font: 800 1.375rem/1.2 var(--display); }

/* ---- Kad laporan ---------------------------------------------------------------------- */
.report { position: relative; background: var(--paper); border: 2px solid var(--ink); border-radius: 8px; padding: 1.1rem 1.25rem 1.1rem 3.25rem; margin-top: 1.75rem; }
.report::before { content: ""; position: absolute; top: 0; bottom: 0; left: 2.4rem; width: 2px; background: #f3aab3; }
.report-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 0.5rem; }
.report-title { font: 800 1.25rem/1.2 var(--display); margin: 0; }
.report-unit { font-size: 0.875rem; color: var(--ink-soft); margin: 0; }
.pen { font: 600 1.5rem/1 var(--hand); color: var(--pen-blue); }
.report-unit .pen { font-size: 1.25rem; }
.report-rows > div { display: flex; justify-content: space-between; align-items: center; gap: 1rem; min-height: 2.75rem; border-bottom: 1px solid var(--rule); padding: 0.25rem 0; }
.report-rows dt { font-size: 0.9375rem; color: var(--ink-soft); flex: none; }
.report-rows dd { display: flex; align-items: center; gap: 0.6rem; text-align: right; }
.report-checks-title { font-size: 0.9375rem; font-weight: 700; margin: 0.85rem 0 0.2rem; }
.report-checks { list-style: none; padding: 0; }
.report-checks li { position: relative; padding: 0.3rem 0; border-bottom: 1px solid var(--rule); font-size: 0.9375rem; line-height: 1.4; }
.report-checks li:last-child { border-bottom: 0; }
.tick { position: absolute; left: -2.55rem; top: 0.25rem; width: 1.5rem; height: 1.5rem; fill: none; stroke: var(--pen); stroke-width: 2.6; stroke-linecap: round; stroke-linejoin: round; }

.grade-mark { position: relative; display: inline-grid; place-items: center; width: 2.75rem; height: 2.75rem; flex: none; }
.grade-mark svg { position: absolute; inset: 0; width: 100%; height: 100%; fill: none; stroke: var(--pen); stroke-width: 3; stroke-linecap: round; overflow: visible; }
.grade-mark b { font: 700 1.9rem/1 var(--hand); color: var(--pen); transform: translateY(-0.05rem); }

/* Satu-satunya animasi: pen merah menanda kad laporan di halaman utama. */
@media (prefers-reduced-motion: no-preference) {
  .hero-card .grade-mark path, .hero-card .tick path { stroke-dasharray: 1; stroke-dashoffset: 1; animation: pen-stroke 0.55s ease-out forwards; }
  .hero-card .grade-mark path { animation-delay: 0.35s; animation-duration: 0.7s; }
  .hero-card .report-checks li:nth-child(1) .tick path { animation-delay: 1.05s; }
  .hero-card .report-checks li:nth-child(2) .tick path { animation-delay: 1.25s; }
  .hero-card .report-checks li:nth-child(3) .tick path { animation-delay: 1.45s; }
  .hero-card .report-checks li:nth-child(4) .tick path { animation-delay: 1.65s; }
  .hero-card .report-checks li:nth-child(5) .tick path { animation-delay: 1.85s; }
  .hero-card .report-checks li:nth-child(n+6) .tick path { animation-delay: 2.05s; }
}
@keyframes pen-stroke { to { stroke-dashoffset: 0; } }

/* ---- Grid produk ------------------------------------------------------------------------ */
.section-head { display: flex; justify-content: space-between; align-items: baseline; gap: 1rem; flex-wrap: wrap; border-bottom: 2px solid var(--ink); padding-bottom: 0.6rem; margin-bottom: 1.75rem; }
.section-head h2 { margin: 0; }
.section-head a { font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(15.5rem, 1fr)); gap: 2.25rem 1.75rem; }
.tile { position: relative; display: flex; flex-direction: column; }
.tile-media { display: block; background: var(--sheet); border-radius: 8px; overflow: hidden; }
.tile-media img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.tile:hover .tile-media { box-shadow: 0 0 0 2px var(--ink); }
.tile-grade { position: absolute; top: 0.6rem; right: 0.6rem; background: var(--paper); border-radius: 50%; width: 3rem; height: 3rem; }
.tile-body { padding-top: 0.8rem; display: grid; gap: 0.2rem; }
.tile-name { font: 700 1.125rem/1.25 var(--display); letter-spacing: -0.005em; }
.tile-name a { text-decoration: none; }
.tile-name a::after { content: ""; position: absolute; inset: 0; }
.tile-name a:hover { text-decoration: underline; }
.tile-summary { color: var(--ink-soft); font-size: 0.9375rem; line-height: 1.4; margin: 0; }
.tile-meta { font-size: 0.875rem; color: var(--ink-soft); margin: 0; }
.tile-price { margin: 0.25rem 0 0; }
.price { font-family: var(--display); font-weight: 800; font-variant-numeric: lining-nums; }
.tile-price .price { font-size: 1.375rem; }
.price-old { font-family: var(--display); color: var(--ink-soft); font-size: 0.9375rem; margin-left: 0.3rem; }
.tile-stock { font-size: 0.875rem; font-weight: 700; margin: 0; }
.tile-stock.is-low { color: var(--warn); }
.tile.is-soldout .tile-media img { filter: grayscale(1); opacity: 0.55; }
.tile.is-soldout .price { color: var(--ink-soft); }
.tag { background: var(--hi); color: var(--ink); font-family: var(--display); font-weight: 700; padding: 0.1em 0.5em; border-radius: 2px; font-size: 0.9375rem; }

/* ---- Langkah pesanan ------------------------------------------------------------------- */
.steps { list-style: none; padding: 0; margin-top: 1.5rem; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 2rem; counter-reset: step; }
.steps li { counter-increment: step; border-top: 2px solid var(--ink); padding-top: 0.9rem; }
.steps li::before { content: counter(step); display: block; font: 900 2.25rem/1 var(--display); margin-bottom: 0.4rem; }
.steps p { color: var(--ink-soft); margin-top: 0.3rem; }

/* ---- Penapis --------------------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 1rem; justify-content: space-between; align-items: center; margin: 0.5rem 0 2rem; }
.chips { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.chips a { padding: 0.35rem 0.95rem; border: 1.5px solid var(--ink); border-radius: 99px; text-decoration: none; font-weight: 600; font-size: 0.9375rem; }
.chips a:hover { background: var(--sheet); }
.chips a[aria-current] { background: var(--ink); color: #fff; }
.filter-form { display: flex; gap: 0.5rem; flex-wrap: wrap; }
.filter-form input[type="search"] { width: 15rem; }
.filter-form select { width: auto; }

/* ---- Borang ------------------------------------------------------------------------------ */
.field { margin-bottom: 1rem; }
.field label, .cart-qty label { display: block; font-weight: 600; margin-bottom: 0.3rem; }
input[type="text"], input[type="email"], input[type="tel"], input[type="number"], input[type="search"], input[type="password"], select, textarea {
  width: 100%; min-height: 3rem; padding: 0.55rem 0.75rem;
  font: inherit; color: var(--ink); background: var(--paper);
  border: 1.5px solid #7d8cab; border-radius: var(--radius);
}
textarea { min-height: 4.5rem; resize: vertical; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: 3px solid var(--focus); outline-offset: 1px; border-color: var(--ink); }
[aria-invalid="true"] { border-color: var(--err) !important; border-width: 2px !important; }
.error-text { color: var(--err); font-size: 0.9375rem; font-weight: 600; margin-top: 0.3rem; }
.field .hint { margin-top: 0.3rem; }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 0 1rem; }
.field-row-3 { grid-template-columns: 8rem 1fr 1fr; }
input[type="radio"], input[type="checkbox"] { width: 1.25rem; height: 1.25rem; accent-color: var(--ink); margin: 0.15rem 0 0; flex: none; }
.panel { border: 1.5px solid var(--rule); border-radius: 8px; padding: 1.25rem 1.5rem; margin: 0 0 1.5rem; background: var(--paper); min-width: 0; }
.panel > h2 { font-size: 1.25rem; }
fieldset.panel > legend { font: 700 1.25rem/1.2 var(--display); padding: 0 0.5rem; margin-left: -0.5rem; }
.panel > .btn { margin-top: 0.25rem; }
.choices { display: grid; grid-template-columns: 1fr 1fr; gap: 0.75rem; margin-bottom: 1.25rem; }
.choice { display: flex; gap: 0.75rem; align-items: flex-start; border: 1.5px solid #7d8cab; border-radius: var(--radius); padding: 0.8rem 1rem; cursor: pointer; }
.choice:has(input:checked) { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); background: var(--sheet); }
.choice small { display: block; color: var(--ink-soft); font-size: 0.9375rem; }
.pickup-info { background: var(--sheet); border-radius: var(--radius); padding: 0.9rem 1rem; margin-bottom: 1.25rem; }
.check { display: flex; gap: 0.6rem; align-items: flex-start; margin: 1.1rem 0 0.4rem; font-size: 0.9375rem; cursor: pointer; }

/* ---- Troli & checkout ---------------------------------------------------------------------- */
.cart, .checkout { display: grid; grid-template-columns: minmax(0, 1fr) 22rem; gap: 2rem; align-items: start; margin-top: 1.5rem; }
.cart-line { display: grid; grid-template-columns: 6rem minmax(0, 1fr) auto 7rem; gap: 1rem; align-items: center; padding: 1rem 0; border-bottom: 1px solid var(--rule); }
.cart-line:first-of-type { border-top: 2px solid var(--ink); }
.cart-thumb img { width: 6rem; height: 4.5rem; object-fit: cover; border-radius: var(--radius); background: var(--sheet); }
.cart-name { font: 700 1.0625rem/1.3 var(--display); text-decoration: none; }
.cart-name:hover { text-decoration: underline; }
.cart-unit { color: var(--ink-soft); font-size: 0.9375rem; margin: 0.1rem 0 0.25rem; }
.cart-qty label { font-size: 0.875rem; color: var(--ink-soft); font-weight: 400; margin-bottom: 0.15rem; }
.cart-qty input { width: 4.75rem; }
.cart-line-total { font: 700 1.0625rem/1.3 var(--display); text-align: right; }
.cart-update { margin-top: 1rem; }
.summary { background: var(--sheet); border-radius: 8px; padding: 1.4rem 1.5rem; position: sticky; top: 1rem; }
.summary h2 { font-size: 1.25rem; }
.summary .hint { margin: 0.6rem 0 1rem; }
.summary .btn-block + .hint { margin-bottom: 0; }
.summary-back { margin-top: 0.9rem; font-size: 0.9375rem; text-align: center; }
.lines { width: 100%; border-collapse: collapse; }
.lines td { padding: 0.45rem 0; vertical-align: top; }
.lines tbody td { border-bottom: 1px solid var(--rule); }
.lines .num { text-align: right; white-space: nowrap; padding-left: 1rem; font-family: var(--display); font-weight: 600; }
.lines .times { color: var(--ink-soft); white-space: nowrap; }
.lines .total td { font-weight: 700; font-size: 1.1875rem; border-top: 2px solid var(--ink); padding-top: 0.7rem; }

/* ---- Halaman produk -------------------------------------------------------------------------- */
.product { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 0.9fr); gap: clamp(1.5rem, 4vw, 3.5rem); align-items: start; }
.gallery { position: sticky; top: 1rem; }
.gallery-main { background: var(--sheet); border-radius: 8px; overflow: hidden; }
.gallery-main img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
.gallery-thumbs { list-style: none; padding: 0; display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 0.75rem; }
.gallery-thumbs button { padding: 0; border: 2px solid transparent; border-radius: var(--radius); background: var(--sheet); cursor: pointer; overflow: hidden; }
.gallery-thumbs button[aria-current] { border-color: var(--ink); }
.gallery-thumbs img { width: 5rem; height: 3.75rem; object-fit: cover; }
.buy h1 { font-size: clamp(1.75rem, 1.2rem + 2vw, 2.5rem); margin-bottom: 0.5rem; }
.buy-price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 0.4rem 0.75rem; margin-top: 1.1rem; }
.buy-price .price { font-size: 2.25rem; line-height: 1; }
.stock-note { font-weight: 700; margin-top: 0.5rem; color: var(--ok); }
.stock-note.is-low { color: var(--warn); }
.stock-note.is-out { color: var(--err); }
.buy-form { display: flex; align-items: flex-end; gap: 0.75rem; margin-top: 1rem; }
.buy-form .field { margin: 0; }
.field-qty input { width: 5rem; }
.buy-form .btn { flex: 1; max-width: 18rem; }
.assurances { list-style: none; padding: 0; margin-top: 1.5rem; border-top: 1px solid var(--rule); font-size: 0.9375rem; }
.assurances li { padding: 0.55rem 0; border-bottom: 1px solid var(--rule); }
.product-more { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 3.5rem); margin-top: 3rem; padding-top: 2rem; border-top: 2px solid var(--ink); }
.product-more > :only-child { grid-column: 1 / -1; max-width: 44rem; }
.specs { width: 100%; border-collapse: collapse; }
.specs th, .specs td { text-align: left; padding: 0.55rem 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.specs th { width: 42%; color: var(--ink-soft); font-weight: 600; padding-right: 1rem; }
.prose p, .prose li { max-width: 68ch; }
.prose h2 { margin-top: 2rem; }
.prose h1 + h2, .prose h2:first-child { margin-top: 0; }
.prose ul { padding-left: 1.25rem; margin: 0.75rem 0; }
.prose li + li { margin-top: 0.3rem; }
.prose p + p { margin-top: 0.9rem; }

/* ---- Halaman pesanan --------------------------------------------------------------------------- */
.order-no { letter-spacing: 0.02em; }
.status-steps { list-style: none; padding: 0; margin: 2rem 0; display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); }
.status-steps li { position: relative; padding-top: 1.9rem; padding-right: 0.5rem; color: var(--ink-soft); font-size: 0.9375rem; }
.status-steps li::before { content: ""; position: absolute; top: 0.55rem; left: 0; right: 0; height: 2px; background: var(--rule); }
.status-steps li::after { content: ""; position: absolute; top: 0; left: 0; width: 1.25rem; height: 1.25rem; border-radius: 50%; background: var(--paper); border: 2px solid var(--rule); }
.status-steps li:last-child::before { display: none; }
.status-steps .is-done { color: var(--ink); }
.status-steps .is-done::before { background: var(--ink); }
.status-steps .is-done::after { background: var(--ink); border-color: var(--ink); }
.status-steps .is-current { color: var(--ink); }
.status-steps .is-current::after { background: var(--pen); border-color: var(--pen); box-shadow: 0 0 0 4px #fbd5da; }
.step-name { display: block; font-weight: 700; }
.step-time { display: block; font-size: 0.8125rem; }
.order-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; }
.order-cols .panel { margin-bottom: 1.5rem; }
.pairs > div { display: flex; justify-content: space-between; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--rule); }
.pairs dt { color: var(--ink-soft); }
.pairs dd { font-weight: 700; }

/* ---- Kaki halaman ------------------------------------------------------------------------------ */
.footer { background: var(--ink); color: #d7e1f2; margin-top: clamp(2rem, 5vw, 4rem); font-size: 0.9375rem; }
.section-sheet + .footer, main > .section-sheet:last-child { margin-top: 0; }
main:has(> .section-sheet:last-child) + .footer { margin-top: 0; }
.footer a { color: #fff; }
.footer-in { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; padding-block: 2.5rem 2rem; }
.footer-about p { max-width: 32em; }
.footer-brand { font: 800 1.375rem/1.2 var(--display); color: #fff; }
.footer h2 { font: 700 1rem/1.3 var(--body); letter-spacing: 0; color: #fff; margin-bottom: 0.5rem; }
.footer ul { list-style: none; padding: 0; display: grid; gap: 0.35rem; }
.footer-base { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; border-top: 1px solid rgba(255, 255, 255, 0.22); padding-block: 1rem; font-size: 0.875rem; }
.footer-base p { margin: 0; }

/* ---- Skrin kecil ------------------------------------------------------------------------------- */
@media (max-width: 60rem) {
  .hero-in, .product, .cart, .checkout, .product-more { grid-template-columns: minmax(0, 1fr); }
  .hero-card { justify-self: start; }
  .summary, .gallery { position: static; }
  .nav { order: 3; width: 100%; margin-left: 0; flex-wrap: nowrap; overflow-x: auto; white-space: nowrap; gap: 1.5rem; padding-bottom: 0.15rem; }
  .cart-link { margin-left: auto; }
  .footer-in { grid-template-columns: 1fr 1fr; }
  .footer-about { grid-column: 1 / -1; }
}
@media (max-width: 40rem) {
  .hero { --line: 2.25rem; }
  .strip-in > p:first-child { font-size: 0.8125rem; }
  .hero-card-foot { flex-wrap: wrap; }
  .hero-card-foot .btn { width: 100%; }
  .field-row, .field-row-3, .choices, .order-cols, .steps { grid-template-columns: minmax(0, 1fr); }
  .field-row-3 .field:first-child { max-width: 9rem; }
  .steps { gap: 1.25rem; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1.5rem 1rem; }
  .tile-grade { width: 2.5rem; height: 2.5rem; top: 0.4rem; right: 0.4rem; }
  .tile-grade b { font-size: 1.6rem; }
  .tile-summary { display: none; }
  .cart-line { grid-template-columns: 4.5rem minmax(0, 1fr) auto; grid-template-areas: "thumb info info" "thumb qty total"; }
  .cart-thumb { grid-area: thumb; align-self: start; }
  .cart-thumb img { width: 4.5rem; height: 3.4rem; }
  .cart-info { grid-area: info; }
  .cart-qty { grid-area: qty; }
  .cart-line-total { grid-area: total; align-self: end; padding-bottom: 0.7rem; }
  .filter-form, .filter-form input[type="search"] { width: 100%; }
  .filter-form select { flex: 1; }
  .status-steps { grid-template-columns: 1fr; margin: 1.5rem 0; }
  .status-steps li { padding: 0 0 1.1rem 2rem; }
  .status-steps li::before { top: 0.6rem; bottom: -0.6rem; left: 0.56rem; right: auto; width: 2px; height: auto; }
  .panel { padding: 1rem 1.1rem; }
  .footer-in { grid-template-columns: 1fr; }
  .buy-form .btn { max-width: none; }
}
@media print {
  .strip, .testmode, .masthead, .footer, .btn { display: none !important; }
}
