/* Toko STP: CSS tulisan tangan, ponsel dulu. Font sistem. */
:root {
    --red: #C8102E;
    --red-dark: #9E0B23;
    --text: #1F1F1F;
    --gray: #5F5F5F;
    --line: #E3E3E3;
    --bg: #F5F5F5;
    --white: #fff;
    --ok: #17703A;
    --low: #8A4B00;
    --radius: 10px;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
    margin: 0; background: var(--bg); color: var(--text);
    font: 16px/1.5 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Liberation Sans", sans-serif;
    min-height: 100vh; display: flex; flex-direction: column;
}
img, svg { max-width: 100%; }
img { height: auto; }
a { color: var(--red-dark); }
a:hover { color: var(--red); }
h1 { font-size: 1.5rem; line-height: 1.25; margin: .5rem 0 .75rem; }
h2 { font-size: 1.2rem; line-height: 1.3; margin: 0 0 .75rem; }
h3 { margin: 0; font-size: 1rem; }
p { margin: 0 0 .75rem; }
ul, ol { padding-left: 1.25rem; }
.wrap { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 16px; }
.muted { color: var(--gray); }
.lead { color: var(--gray); font-size: 1.05rem; }
.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: -999px; top: 0; background: var(--white); padding: 8px 12px; z-index: 100; }
.skip-link:focus { left: 8px; top: 8px; }
:focus-visible { outline: 3px solid #1A5FD0; outline-offset: 2px; }

/* Strip data contoh */
.demo-strip { background: #3A3A3A; color: #fff; font-size: .78rem; line-height: 1.35; text-align: center; padding: 6px 12px; }

/* Header */
.site-header { background: var(--white); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-row { display: grid; grid-template-columns: 1fr auto; grid-template-areas: "brand cart" "search search"; gap: 8px 12px; align-items: center; padding-top: 10px; padding-bottom: 8px; }
.brand { grid-area: brand; font-weight: 800; font-size: 1.3rem; letter-spacing: -.01em; color: var(--red); text-decoration: none; min-height: 44px; display: inline-flex; align-items: center; }
.brand:hover { color: var(--red-dark); }
.cart-link { grid-area: cart; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 10px; color: var(--text); text-decoration: none; font-weight: 600; border-radius: var(--radius); }
.cart-link:hover { background: var(--bg); color: var(--text); }
.cart-text { display: none; }
.badge { background: var(--red); color: #fff; border-radius: 999px; min-width: 22px; height: 22px; padding: 0 6px; font-size: .8rem; line-height: 22px; text-align: center; font-weight: 700; }
.badge-empty { background: #6B6B6B; }
.search { grid-area: search; display: flex; }
.search input, .hero-search input { flex: 1; min-width: 0; height: 46px; border: 1px solid #B5B5B5; border-right: 0; border-radius: var(--radius) 0 0 var(--radius); padding: 0 14px; font: inherit; background: var(--white); color: var(--text); }
.search button, .hero-search button { height: 46px; min-width: 72px; padding: 0 18px; border: 0; border-radius: 0 var(--radius) var(--radius) 0; background: var(--red); color: #fff; font: inherit; font-weight: 700; cursor: pointer; }
.search button:hover, .hero-search button:hover { background: var(--red-dark); }
.chips { border-top: 1px solid var(--line); background: var(--white); }
.chips-row { display: flex; gap: 8px; overflow-x: auto; padding-top: 8px; padding-bottom: 8px; scrollbar-width: thin; -webkit-overflow-scrolling: touch; }
.chips-row a { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--white); color: var(--text); text-decoration: none; font-size: .92rem; white-space: nowrap; }
.chips-row a:hover { border-color: var(--red); color: var(--red-dark); }
.chips-row a[aria-current] { background: var(--red); border-color: var(--red); color: #fff; }
.chips-row .chip-mesin { font-weight: 700; }

/* Isi */
.main { flex: 1; padding-top: 12px; padding-bottom: 40px; }
.block { margin-top: 28px; }
.alert { padding: 10px 14px; border-radius: var(--radius); margin: 0 0 12px; font-size: .95rem; }
.alert-ok { background: #E7F4EC; color: #0F5128; border: 1px solid #BFE0CC; }
.alert-info { background: #FFF6DD; color: #5C4200; border: 1px solid #F0DFA8; }
.alert-error { background: #FDECEE; color: #8A0B20; border: 1px solid #F2BCC4; }
.empty, .note-box { background: var(--white); border: 1px dashed #BDBDBD; border-radius: var(--radius); padding: 16px; margin: 12px 0; }
.note-box { border-style: solid; border-color: #F0DFA8; background: #FFF9E6; }
.breadcrumb ol { list-style: none; display: flex; flex-wrap: wrap; gap: 2px 0; margin: 0; padding: 0; font-size: .88rem; color: var(--gray); }
.breadcrumb li + li::before { content: "›"; padding: 0 8px; color: #8A8A8A; }
.breadcrumb a { color: var(--gray); display: inline-block; padding: 8px 0; }
.result-count { margin: 4px 0 12px; font-size: .92rem; }

/* Beranda */
.hero { background: var(--white); border: 1px solid var(--line); border-radius: 14px; padding: 22px 16px; margin-top: 4px; border-top: 4px solid var(--red); }
.hero h1 { font-size: 1.7rem; margin: 0; }
.hero-sub { color: var(--gray); margin: 6px 0 0; font-size: 1.05rem; }
.hero-search { display: flex; max-width: 640px; }
.page-search { margin: 8px 0 16px; }
.cat-grid { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.cat-grid a { display: flex; flex-direction: column; justify-content: center; gap: 2px; min-height: 76px; padding: 12px 14px; background: var(--white); border: 1px solid var(--line); border-left: 4px solid var(--red); border-radius: var(--radius); text-decoration: none; color: var(--text); height: 100%; }
.cat-grid a:hover { border-color: var(--red); box-shadow: 0 2px 8px rgba(0,0,0,.08); }
.cat-name { font-weight: 700; line-height: 1.3; }
.cat-count { color: var(--gray); font-size: .88rem; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 4px; }
.chip { display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; background: var(--white); border: 1px solid #C9C9C9; border-radius: 999px; color: var(--text); text-decoration: none; font-weight: 600; }
.chip:hover { border-color: var(--red); color: var(--red-dark); }
.chip-more { border-style: dashed; font-weight: 500; }

/* Kartu barang */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.card { position: relative; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; display: flex; flex-direction: column; }
.card:hover { border-color: #BDBDBD; box-shadow: 0 2px 10px rgba(0,0,0,.08); }
.card-img { aspect-ratio: 1 / 1; background: var(--white); border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: center; }
.card-img img, .card-img svg { width: 100%; height: 100%; object-fit: contain; display: block; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 2px; flex: 1; }
.card-title { font-size: .95rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.6em; }
.card-title a { color: var(--text); text-decoration: none; }
.card-title a::after { content: ""; position: absolute; inset: 0; }
.card-title a:focus-visible { outline: none; }
.card:has(.card-title a:focus-visible) { outline: 3px solid #1A5FD0; outline-offset: 2px; }
.sku { color: var(--gray); font-size: .8rem; margin: 0; }
.price { font-weight: 800; font-size: 1.05rem; margin: 4px 0 2px; color: var(--text); }
.stock { display: inline-block; font-size: .82rem; font-weight: 600; }
.stock-ok { color: var(--ok); }
.stock-low { color: var(--low); }
.stock-out { color: var(--gray); }
.card-out .card-img { opacity: .55; }
.card-out .price { color: var(--gray); }

/* Paginasi */
.pager { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 24px 0 8px; flex-wrap: wrap; }
.pager-nums { list-style: none; display: none; gap: 6px; padding: 0; margin: 0; }
.pager-btn, .pager-num { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 14px; border: 1px solid #C9C9C9; border-radius: var(--radius); background: var(--white); color: var(--text); text-decoration: none; font-weight: 600; }
a.pager-btn:hover, a.pager-num:hover { border-color: var(--red); color: var(--red-dark); }
.pager-btn.is-off { color: #8A8A8A; background: var(--bg); }
.pager-num.is-current { background: var(--red); border-color: var(--red); color: #fff; }
.pager-gap { display: inline-flex; min-height: 44px; align-items: center; padding: 0 4px; color: var(--gray); }

/* Halaman barang */
.product { display: grid; gap: 16px; margin-top: 4px; }
.gallery-main { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); aspect-ratio: 1 / 1; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.gallery-main img, .gallery-main svg { width: 100%; height: 100%; object-fit: contain; display: block; }
.thumbs { list-style: none; display: flex; gap: 8px; padding: 0; margin: 8px 0 0; overflow-x: auto; }
.thumbs a { display: block; width: 64px; height: 64px; background: var(--white); border: 2px solid var(--line); border-radius: 8px; overflow: hidden; }
.thumbs a[aria-current] { border-color: var(--red); }
.thumbs img { width: 100%; height: 100%; object-fit: contain; display: block; }
.buybox { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.buybox h1 { margin-top: 0; }
.price-big { font-size: 1.8rem; margin: 8px 0 4px; }
.add-form { display: grid; grid-template-columns: auto 88px; gap: 6px 10px; align-items: center; margin: 12px 0 8px; }
.add-form label { font-weight: 600; }
.add-form button { grid-column: 1 / -1; }
input[type=number] { height: 46px; border: 1px solid #B5B5B5; border-radius: 8px; padding: 0 10px; font: inherit; background: var(--white); color: var(--text); width: 100%; }
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 20px; border-radius: var(--radius); border: 2px solid transparent; font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; text-align: center; }
.btn-primary { background: var(--red); color: #fff; }
.btn-primary:hover { background: var(--red-dark); color: #fff; }
.btn-primary:disabled { background: #BDBDBD; color: #4A4A4A; cursor: not-allowed; }
.btn-outline { background: var(--white); color: var(--red-dark); border-color: var(--red); margin-top: 8px; width: 100%; }
.btn-outline:hover { background: #FDECEE; color: var(--red-dark); }
.btn-small { min-height: 44px; padding: 0 14px; background: var(--white); border-color: #8A8A8A; color: var(--text); }
.btn-block { width: 100%; }
.buybox > .btn-primary { width: 100%; }
.out-note { font-weight: 700; color: var(--gray); margin: 12px 0 8px; }
.facts { margin: 16px 0 0; border-top: 1px solid var(--line); }
.facts div { display: flex; flex-wrap: wrap; gap: 4px 12px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.facts dt { color: var(--gray); width: 150px; }
.facts dd { margin: 0; flex: 1; font-weight: 600; }
.desc { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.desc h2 { font-size: 1.1rem; }

/* Keranjang */
.cart-lines { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 10px; }
.cart-line { display: grid; grid-template-columns: 80px 1fr; gap: 6px 12px; background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.cart-thumb { width: 80px; height: 80px; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; background: var(--white); }
.cart-thumb img, .cart-thumb svg { width: 100%; height: 100%; object-fit: contain; display: block; }
.cart-name { font-weight: 700; color: var(--text); text-decoration: none; display: block; line-height: 1.3; }
.cart-name:hover { color: var(--red-dark); text-decoration: underline; }
.unit { color: var(--gray); font-size: .9rem; margin: 2px 0 8px; }
.cart-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.qty-form { display: flex; gap: 8px; align-items: center; }
.qty-form input { width: 72px; }
.btn-link { background: none; border: 0; padding: 0 6px; min-height: 44px; font: inherit; color: var(--red-dark); text-decoration: underline; cursor: pointer; }
.line-total { grid-column: 1 / -1; text-align: right; font-weight: 800; margin: 0; padding-top: 8px; border-top: 1px solid var(--line); }
.summary { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; }
.summary dl { margin: 0 0 8px; }
.summary dl div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.summary dt { color: var(--gray); }
.summary dd { margin: 0; font-weight: 700; }
.summary .price { font-size: 1.3rem; margin: 0; }
.back-link { display: block; text-align: center; margin-top: 12px; padding: 10px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; }
.prose { max-width: 720px; }
.prose h2 { margin-top: 1.25rem; }
.error-page { padding-top: 48px; }

/* Checkout dan halaman pesanan */
.form-card { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; }
.form-card h2 { font-size: 1.1rem; }
.field { margin: 0 0 14px; }
.field label, .field-label { display: block; font-weight: 700; margin: 0 0 4px; }
.field input[type=text], .field input[type=tel], .field input[type=email], .field input[type=search], .field textarea { display: block; width: 100%; min-height: 48px; border: 1px solid #8A8A8A; border-radius: 8px; padding: 10px 12px; font: inherit; background: var(--white); color: var(--text); }
.field textarea { resize: vertical; }
.hint { color: var(--gray); font-size: .88rem; margin: 4px 0 0; }
.field-error { color: #8A0B20; font-weight: 600; font-size: .92rem; margin: 4px 0 0; }
.kecil { font-size: .88rem; }
.area-cari { display: flex; gap: 8px; align-items: stretch; }
.area-cari input { flex: 1; min-width: 0; }
.area-cari .btn { flex: none; min-width: 72px; }
.area-terpilih { margin: 0 0 10px; }
.opsi-daftar { border: 0; margin: 0 0 10px; padding: 0; min-width: 0; }
.opsi-daftar legend { font-weight: 700; padding: 0; margin: 0 0 6px; }
.opsi { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 8px 12px; margin: 0 0 8px; border: 1px solid #B5B5B5; border-radius: var(--radius); background: var(--white); cursor: pointer; }
.opsi:has(input:checked) { border-color: var(--red); background: #FDF3F4; }
.opsi input { flex: none; width: 22px; height: 22px; margin: 0; accent-color: var(--red); }
.opsi-teks { flex: 1; min-width: 0; display: flex; flex-direction: column; overflow-wrap: anywhere; }
.opsi-teks .muted { font-size: .88rem; }
.opsi-harga { flex: none; font-weight: 800; }
.ringkas-barang { list-style: none; margin: 0 0 8px; padding: 0; }
.ringkas-barang li { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.ringkas-barang li > span:last-child { flex: none; font-weight: 700; }
.total-row dt, .total-row dd { font-size: 1.1rem; color: var(--text); }
.biaya { margin: 0; }
.biaya div { display: flex; justify-content: space-between; gap: 12px; padding: 6px 0; }
.biaya dt { color: var(--gray); }
.biaya dd { margin: 0; font-weight: 700; }
.kode-label { margin: 8px 0 0; color: var(--gray); font-size: .9rem; }
.kode-pesanan { margin: 0 0 4px; font-size: 1.7rem; font-weight: 800; letter-spacing: .02em; overflow-wrap: anywhere; }
.garis-waktu { list-style: none; display: grid; grid-template-columns: repeat(5, 1fr); gap: 4px; margin: 12px 0 16px; padding: 0; }
.langkah { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 4px; font-size: .78rem; line-height: 1.2; color: var(--gray); }
.langkah .titik { width: 30px; height: 30px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; background: #E3E3E3; color: #4A4A4A; }
.langkah-selesai .titik { background: var(--ok); color: #fff; }
.langkah-sekarang .titik { background: var(--red); color: #fff; }
.langkah-sekarang .nama { color: var(--text); font-weight: 700; }
.langkah-berhenti .titik { background: #6B6B6B; color: #fff; }
.status-box { border-radius: var(--radius); padding: 16px; margin: 0 0 14px; border: 1px solid var(--line); background: var(--white); }
.status-ok { border-color: #BFE0CC; background: #F1FAF4; }
.status-warn { border-color: #F0DFA8; background: #FFF9E6; }
.centang { width: 44px; height: 44px; line-height: 44px; margin: 0 0 8px; border-radius: 50%; background: var(--ok); color: #fff; text-align: center; font-size: 1.5rem; font-weight: 800; }
.resi { margin: 8px 0; }
.resi div { display: flex; justify-content: space-between; gap: 12px; padding: 4px 0; }
.resi dt { color: var(--gray); }
.resi dd { margin: 0; }
.resi-no { font-size: 1.15rem; overflow-wrap: anywhere; }
.bayar { background: var(--white); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin: 0 0 14px; text-align: center; }
.pita-contoh { background: #C8102E; color: #fff; font-weight: 800; padding: 8px 10px; margin: 0 0 8px; border-radius: 8px; letter-spacing: .02em; }
.qr-box { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 8px; margin: 0 auto 8px; max-width: 340px; }
.qr-box svg { display: block; width: 100%; height: auto; }
.bayar-label { margin: 8px 0 0; color: var(--gray); }
.bayar-total { font-size: 2rem; font-weight: 800; margin: 0 0 4px; }
.bayar-batas { margin: 0 0 12px; }
.cara-bayar { text-align: left; max-width: 460px; margin: 12px auto; }
.cara-bayar li { margin: 0 0 6px; }
.bayar .actions { justify-content: center; }
.bayar .btn-outline { margin-top: 0; }
.simulasi { margin-top: 14px; padding-top: 12px; border-top: 1px dashed #BDBDBD; }
.checkout .btn-small { width: auto; }
@media (min-width: 640px) {
    .checkout, .pesanan { max-width: 640px; }
    .langkah { font-size: .88rem; }
}

/* WhatsApp melayang */
.wa-float { position: fixed; right: 14px; bottom: 14px; z-index: 30; display: inline-flex; align-items: center; gap: 8px; min-height: 52px; padding: 0 16px 0 14px; background: #0F7A3F; color: #fff; border-radius: 999px; text-decoration: none; font-weight: 700; box-shadow: 0 3px 12px rgba(0,0,0,.28); }
.wa-float:hover { background: #0B6232; color: #fff; }
.wa-float span { font-size: .95rem; }

/* Footer */
.site-footer { background: #232323; color: #D9D9D9; padding: 28px 0 14px; margin-top: 24px; }
.site-footer a { color: #fff; }
.footer-grid { display: grid; gap: 20px; }
.footer-brand { font-weight: 800; font-size: 1.2rem; color: #fff; margin: 0 0 6px; }
.footer-title { font-weight: 700; color: #fff; margin: 0 0 6px; }
.site-footer .muted { color: #BDBDBD; }
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li a { display: inline-block; padding: 6px 0; }
.copyright { margin-top: 20px; padding-top: 12px; border-top: 1px solid #444; font-size: .85rem; color: #BDBDBD; padding-bottom: 64px; }

@media (min-width: 640px) {
    h1 { font-size: 1.75rem; }
    .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
    .cat-grid { grid-template-columns: repeat(3, 1fr); }
    .pager-nums { display: flex; }
    .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; }
    .cart-line { grid-template-columns: 96px 1fr auto; }
    .cart-thumb { width: 96px; height: 96px; }
    .line-total { grid-column: auto; border: 0; padding: 0; text-align: right; }
    .add-form { grid-template-columns: auto 88px 1fr; }
    .add-form button { grid-column: auto; }
}
@media (min-width: 760px) {
    .product { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 24px; }
    .desc { grid-column: 1 / -1; }
    .btn-outline { width: auto; }
}
@media (min-width: 960px) {
    .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
    .cat-grid { grid-template-columns: repeat(4, 1fr); }
    .header-row { grid-template-columns: auto 1fr auto; grid-template-areas: "brand search cart"; gap: 20px; }
    .search { max-width: 640px; }
    .cart-text { display: inline; }
    .hero { padding: 36px 32px; }
    .hero h1 { font-size: 2.2rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; transition: none !important; } }

@media (max-width: 639px) {
    /* Ponsel: nama halaman sudah ada di H1, jejak cukup sampai induknya. */
    .breadcrumb li[aria-current] { display: none; }
}

/* Banner izin pelacakan (LEG 5): di bagian atas halaman, mengalir normal, tidak menutupi tombol beli atau WhatsApp. */
.izin-banner { background: #FFF8E1; border-bottom: 1px solid #E8D9A6; color: var(--text); font-size: .85rem; line-height: 1.4; padding: 8px 16px; display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; }
.izin-banner[hidden], .izin-atur[hidden] { display: none; }
.izin-teks { margin: 0; flex: 1 1 260px; }
.izin-aksi { display: flex; gap: 8px; flex: none; }
.izin-tombol { min-height: 44px; padding: 0 16px; border-radius: var(--radius); border: 2px solid #8A8A8A; background: var(--white); color: var(--text); font: inherit; font-weight: 700; cursor: pointer; }
.izin-tombol.izin-setuju { background: var(--red); border-color: var(--red); color: #fff; }
.izin-atur { align-self: flex-start; margin: 4px 16px 12px; padding: 4px 6px; min-height: 32px; background: none; border: 0; color: var(--gray); font: inherit; font-size: .78rem; text-decoration: underline; cursor: pointer; }
