/* Struktur bersama: reset, aksesibilitas, kartu, dialog, keranjang. Warna/font/bentuk diatur tiap versi. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 16px; }
html.is-locked { overflow: hidden; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--font-body); -webkit-font-smoothing: antialiased; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }

.ic { width: 1.25em; height: 1.25em; flex: none; }
.shopee-mark { width: 20px; height: 20px; flex: none; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip-link { position: absolute; left: 12px; top: -60px; z-index: 50; padding: 10px 16px; background: var(--ink); color: var(--bg); border-radius: 8px; font-weight: 600; text-decoration: none; }
.skip-link:focus { top: 12px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-height: 52px; padding: 0 22px; text-decoration: none; font-weight: 600; }

/* Kartu */
.card { display: flex; flex-direction: column; width: 100%; height: 100%; padding: 0; border: 0; background: none; text-align: left; }
.card-media { position: relative; display: block; overflow: hidden; aspect-ratio: 1; }
.card-media img { width: 100%; height: 100%; object-fit: cover; }
.card-body, .card-name, .card-meta, .card-price { display: block; }
.card-tag { position: absolute; left: 10px; top: 10px; }
.cat-nav ul { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: thin; }
.cat-nav a { display: inline-flex; align-items: center; min-height: 44px; white-space: nowrap; text-decoration: none; }
.cat-group { scroll-margin-top: 24px; }

.size-btn { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 64px; border: 0; background: none; text-align: left; }
.size-g, .size-text { display: flex; flex-direction: column; }
.size-text { flex: 1; }
.size-arrow { display: grid; place-items: center; }
.care-step { display: flex; gap: 14px; }
.care-text { display: flex; flex-direction: column; gap: 2px; }

/* Dialog: bottom sheet di mobile, panel dua kolom di layar lebar */
.sheet { width: 100%; max-width: 480px; max-height: 92dvh; margin: auto auto 0; padding: 0; border: 0; background: var(--surface); color: var(--ink); overflow: hidden; }
.sheet::backdrop { background: rgb(20 24 20 / .55); }
.sheet-panel { position: relative; max-height: 92dvh; overflow-y: auto; overscroll-behavior: contain; padding-bottom: env(safe-area-inset-bottom); }
.sheet-close { position: absolute; top: 12px; right: 12px; z-index: 2; display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--surface); color: var(--ink); box-shadow: 0 2px 10px rgb(0 0 0 / .16); }
.sheet-img { width: 100%; aspect-ratio: 1; max-height: 44dvh; object-fit: cover; }
.sheet-body { display: grid; gap: 12px; padding: 20px 20px 24px; }
.sheet-desc { font-size: 15px; }
.sheet-meta, .sheet-note { color: var(--muted); font-size: 14px; }
.sheet-note { font-size: 13px; }
.sheet-points { display: grid; gap: 8px; font-size: 15px; }
.sheet-points li { display: flex; gap: 10px; align-items: flex-start; }
.sheet-points .ic { margin-top: 2px; color: var(--accent); }
.sheet-label { font-size: 13px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--muted); margin-bottom: 6px; }
.sheet-variants { margin: 0; padding: 0; border: 0; min-width: 0; }
.variant-list { display: grid; gap: 8px; }
.variant { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 48px; padding: 10px 14px; border: 1.5px solid var(--line); border-radius: 12px; font-size: 15px; cursor: pointer; }
.variant span:last-child { font-weight: 600; white-space: nowrap; }
.variant input { position: absolute; opacity: 0; pointer-events: none; }
.variant:has(input:checked) { border-color: var(--accent); box-shadow: inset 0 0 0 1px var(--accent); }
.variant:has(input:focus-visible) { outline: 3px solid var(--focus); outline-offset: 2px; }
.sheet-qty { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.sheet-qty .sheet-label { margin: 0; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; }
.qty button { display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: none; font-size: 20px; line-height: 1; }
.qty button:disabled { opacity: .35; cursor: default; }
.qty output { min-width: 28px; text-align: center; font-weight: 700; }
.sheet-buy { width: 100%; margin-top: 4px; border: 0; }
.sheet-ask { display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; font-size: 15px; font-weight: 500; }

/* Bar keranjang mengambang */
html.has-cart body { padding-bottom: calc(88px + env(safe-area-inset-bottom)); }
.cart-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 20; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); pointer-events: none; }
.cart-bar[hidden] { display: none; }
.cart-open { pointer-events: auto; display: flex; align-items: center; gap: 12px; width: min(100%, 480px); min-height: 60px; margin: 0 auto; padding: 8px 16px 8px 8px; border: 0; border-radius: 16px; background: var(--ink); color: #fff; text-align: left; box-shadow: 0 8px 28px rgb(0 0 0 / .22); }
.cart-count { display: grid; place-items: center; flex: none; min-width: 44px; height: 44px; padding: 0 6px; border-radius: 12px; background: rgb(255 255 255 / .14); font-weight: 800; }
.cart-text { display: flex; flex-direction: column; flex: 1; min-width: 0; line-height: 1.3; }
.cart-title { font-weight: 700; }
.cart-sum { font-size: 14px; opacity: .8; }
.cart-go { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; }
.cart-bar.is-bump .cart-open { animation: bump .35s ease; }
@keyframes bump { 40% { transform: scale(1.04); } }
.cart-sheet .sheet-panel { display: block; }
.cart-sheet .sheet-body { padding-top: 24px; }
.cart-sheet .sheet-title { padding-right: 52px; }
.cart-lines { display: grid; }
.cart-line { display: flex; align-items: center; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-line img { width: 56px; height: 56px; flex: none; border-radius: 10px; object-fit: cover; }
.cart-line-info { display: flex; flex-direction: column; flex: 1; min-width: 0; font-size: 15px; line-height: 1.35; }
.cart-line-name { font-weight: 600; }
.cart-line-price { color: var(--muted); font-size: 14px; }
.cart-line .qty button { width: 40px; height: 44px; }
.cart-total { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; font-size: 16px; }
.cart-total strong { font-size: 20px; }
.cart-send { width: 100%; }
.cart-clear { min-height: 44px; border: 0; background: none; color: var(--muted); font-size: 14px; text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 760px) {
  .sheet.cart-sheet { max-width: 520px; }
  .sheet { max-width: 860px; margin: auto; }
  .sheet-panel { display: grid; grid-template-columns: 1fr 1fr; }
  .sheet-media { position: sticky; top: 0; align-self: start; }
  .sheet-img { max-height: none; }
  .sheet-body { padding: 28px; align-content: start; }
}
