/* PettyCart storefront — mobile first, app-like. --brand is set per store. */
:root {
    --brand: #0f766e;
    --brand-ink: color-mix(in srgb, var(--brand) 78%, #000);
    --brand-soft: color-mix(in srgb, var(--brand) 10%, #fff);
    --brand-soft-2: color-mix(in srgb, var(--brand) 18%, #fff);
    --ink: #111a19; --ink-2: #3d4847; --muted: #6f7b7a; --line: #e8edec; --bg: #f5f7f6; --card: #fff;
    --sale: #e11d48; --ok: #16a34a; --wa: #25d366;
    --r: 16px; --r-sm: 12px;
    --tabbar-h: 64px;
    --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { scroll-behavior: smooth; }
body { margin: 0; font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif; color: var(--ink); background: var(--bg); -webkit-font-smoothing: antialiased; font-size: 15px; line-height: 1.45; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font: inherit; color: inherit; }
.d-none { display: none !important; }
.ms-auto { margin-left: auto !important; }

/* desktop: keep the phone-width experience, centred */
.app { max-width: 520px; margin: 0 auto; min-height: 100vh; background: var(--bg); position: relative; }
@media (min-width: 560px) {
    body { background: radial-gradient(circle at 20% 10%, var(--brand-soft-2), transparent 40%), radial-gradient(circle at 85% 80%, var(--brand-soft), transparent 45%), #eef1f0; }
    .app { box-shadow: 0 0 0 1px rgba(0,0,0,.04), 0 30px 80px -30px rgba(0,0,0,.25); }
}

/* app bar */
.appbar { position: sticky; top: 0; z-index: 30; display: flex; align-items: center; gap: 4px; height: 60px; padding: 0 10px 0 14px; background: rgba(255,255,255,.92); backdrop-filter: saturate(1.6) blur(14px); -webkit-backdrop-filter: saturate(1.6) blur(14px); border-bottom: 1px solid var(--line); }
.ab-brand { display: flex; align-items: center; gap: 10px; min-width: 0; font-weight: 800; letter-spacing: -.02em; font-size: 1.08rem; }
.ab-brand img { max-height: 38px; max-width: 170px; object-fit: contain; }
.ab-initial { width: 34px; height: 34px; border-radius: 10px; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; flex: none; }
.ab-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ab-btn { width: 42px; height: 42px; display: grid; place-items: center; border-radius: 12px; font-size: 1.25rem; position: relative; flex: none; }
.ab-btn:active { background: var(--brand-soft); }
.badge-dot { position: absolute; top: 4px; right: 3px; min-width: 18px; height: 18px; padding: 0 5px; border-radius: 10px; background: var(--sale); color: #fff; font-size: .68rem; font-weight: 800; display: grid; place-items: center; border: 2px solid #fff; }

.page { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 18px); }
.section { padding: 18px 14px 4px; }
.sec-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.sec-head h2 { font-size: 1.08rem; font-weight: 800; letter-spacing: -.02em; margin: 0; }
.sec-head a { font-size: .85rem; font-weight: 700; color: var(--brand); }

/* hero */
.hero { margin: 12px 14px 0; border-radius: 22px; overflow: hidden; position: relative; min-height: 168px; background: linear-gradient(135deg, var(--brand), var(--brand-ink)); color: #fff; display: flex; align-items: flex-end; }
.hero img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.hero.has-img::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 35%, rgba(0,0,0,.55)); }
.hero-in { position: relative; z-index: 1; padding: 20px; }
.hero h1 { margin: 0; font-size: 1.45rem; line-height: 1.15; font-weight: 800; letter-spacing: -.03em; }
.hero p { margin: 6px 0 0; opacity: .92; font-size: .92rem; }
.hero:not(.has-img)::before { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -60px; top: -80px; background: rgba(255,255,255,.12); }

.searchbar { margin: 14px 14px 0; display: flex; align-items: center; gap: 10px; background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 0 14px; height: 50px; color: var(--muted); box-shadow: 0 6px 20px -14px rgba(0,0,0,.25); }
.searchbar i { font-size: 1.1rem; color: var(--brand); }

/* category chips */
.cat-scroll { display: flex; gap: 14px; overflow-x: auto; padding: 2px 14px 6px; margin: 0 -14px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.cat-scroll::-webkit-scrollbar, .h-scroll::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.cat-item { flex: none; width: 74px; text-align: center; scroll-snap-align: start; }
.cat-item .ci-img { width: 66px; height: 66px; margin: 0 auto 6px; border-radius: 20px; background: var(--brand-soft); overflow: hidden; display: grid; place-items: center; font-size: 1.4rem; font-weight: 800; color: var(--brand); border: 1px solid var(--line); }
.cat-item .ci-img img { width: 100%; height: 100%; object-fit: cover; }
.cat-item span { font-size: .75rem; font-weight: 600; line-height: 1.2; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

.chips { display: flex; gap: 8px; overflow-x: auto; padding: 0 14px 4px; margin: 0 -14px; scrollbar-width: none; }
.chip { flex: none; padding: 8px 14px; border-radius: 30px; background: #fff; border: 1px solid var(--line); font-size: .85rem; font-weight: 600; white-space: nowrap; }
.chip.on { background: var(--brand); color: #fff; border-color: var(--brand); }

/* product grid */
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.h-scroll { display: grid; grid-auto-flow: column; grid-auto-columns: 42%; gap: 12px; overflow-x: auto; padding: 0 14px 6px; margin: 0 -14px; scroll-snap-type: x mandatory; scrollbar-width: none; }
.h-scroll > * { scroll-snap-align: start; }
.pcard { background: var(--card); border-radius: var(--r); overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; position: relative; transition: transform .15s; }
.pcard:active { transform: scale(.98); }
.pc-img { aspect-ratio: 1; background: #f1f4f3; position: relative; overflow: hidden; }
.pc-img img { width: 100%; height: 100%; object-fit: cover; }
.pc-off { position: absolute; top: 8px; left: 8px; background: var(--sale); color: #fff; font-size: .7rem; font-weight: 800; padding: 3px 7px; border-radius: 8px; }
.pc-tag { position: absolute; top: 8px; left: 8px; background: rgba(17,26,25,.75); color: #fff; font-size: .68rem; font-weight: 700; padding: 3px 7px; border-radius: 8px; }
.pc-out { position: absolute; inset: 0; background: rgba(255,255,255,.65); display: grid; place-items: center; font-weight: 800; color: var(--muted); font-size: .85rem; }
.pc-body { padding: 10px 10px 12px; display: flex; flex-direction: column; flex: 1; }
.pc-name { font-size: .88rem; font-weight: 600; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 2.3em; }
.pc-unit { font-size: .72rem; color: var(--muted); margin-top: 2px; }
.pc-foot { display: flex; align-items: center; margin-top: auto; padding-top: 8px; gap: 6px; }
.price { font-weight: 800; font-size: .98rem; letter-spacing: -.01em; }
.mrp { color: var(--muted); text-decoration: line-through; font-size: .78rem; font-weight: 500; }
.add-btn { margin-left: auto; width: 34px; height: 34px; border-radius: 11px; background: var(--brand); color: #fff; display: grid; place-items: center; font-size: 1.1rem; flex: none; box-shadow: 0 6px 14px -6px var(--brand); }
.add-btn:active { transform: scale(.9); }
.add-btn.ask { width: auto; padding: 0 10px; font-size: .78rem; font-weight: 700; background: var(--brand-soft); color: var(--brand); box-shadow: none; }

/* product page */
.gallery { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; background: #fff; scrollbar-width: none; }
.gallery::-webkit-scrollbar { display: none; }
.gallery img { flex: none; width: 100%; aspect-ratio: 1; object-fit: contain; scroll-snap-align: center; background: #fff; }
.g-dots { display: flex; justify-content: center; gap: 6px; padding: 8px 0 0; background: #fff; }
.g-dots i { width: 6px; height: 6px; border-radius: 6px; background: #d5dcdb; transition: all .2s; }
.g-dots i.on { width: 18px; background: var(--brand); }
.pd { background: #fff; padding: 16px 16px 20px; border-radius: 0 0 24px 24px; }
.pd h1 { font-size: 1.3rem; font-weight: 800; letter-spacing: -.02em; margin: 4px 0 8px; line-height: 1.25; }
.pd .crumbs { font-size: .78rem; color: var(--muted); }
.pd .crumbs a { color: var(--brand); font-weight: 600; }
.pd-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pd-price .price { font-size: 1.5rem; }
.pd-price .save { color: var(--ok); font-weight: 700; font-size: .85rem; }
.pd-short { color: var(--ink-2); margin: 10px 0 0; }
.stock-ok { color: var(--ok); font-size: .82rem; font-weight: 700; margin-top: 6px; }
.stock-low { color: #d97706; font-size: .82rem; font-weight: 700; margin-top: 6px; }
.desc-card { background: #fff; margin: 12px 0 0; padding: 16px; border-radius: 20px; }
.desc-card h2 { font-size: 1rem; font-weight: 800; margin: 0 0 8px; }
.desc { color: var(--ink-2); font-size: .93rem; }
.desc ul { padding-left: 1.2em; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; background: #fff; }
.qty button { width: 38px; height: 40px; font-size: 1.1rem; color: var(--brand); font-weight: 800; }
.qty input { width: 38px; text-align: center; border: 0; font-weight: 800; background: transparent; -moz-appearance: textfield; }
.qty input::-webkit-outer-spin-button, .qty input::-webkit-inner-spin-button { -webkit-appearance: none; }

.buybar { position: fixed; z-index: 40; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; display: flex; gap: 10px; align-items: center; padding: 10px 14px calc(10px + var(--safe-b)); background: rgba(255,255,255,.96); backdrop-filter: blur(12px); border-top: 1px solid var(--line); }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 50px; padding: 0 18px; border-radius: 14px; font-weight: 800; font-size: .95rem; transition: transform .1s, filter .15s; white-space: nowrap; }
.btn:active { transform: scale(.97); }
.btn-brand { background: var(--brand); color: #fff; box-shadow: 0 10px 22px -12px var(--brand); }
.btn-soft { background: var(--brand-soft); color: var(--brand); }
.btn-wa { background: var(--wa); color: #fff; box-shadow: 0 10px 22px -12px var(--wa); }
.btn-ghost { background: #fff; border: 1px solid var(--line); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }
.flex1 { flex: 1; }

/* cart */
.cart-item { display: flex; gap: 12px; background: #fff; border-radius: var(--r); padding: 10px; border: 1px solid var(--line); margin-bottom: 10px; }
.cart-item img { width: 76px; height: 76px; border-radius: 12px; object-fit: cover; background: #f1f4f3; flex: none; }
.cart-item .ci-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.cart-item .ci-name { font-weight: 700; font-size: .9rem; line-height: 1.3; }
.cart-item .ci-row { display: flex; align-items: center; margin-top: auto; gap: 8px; }
.cart-item .qty button { width: 32px; height: 34px; }
.cart-item .qty input { width: 30px; }
.ci-remove { color: var(--muted); font-size: 1.05rem; padding: 2px; }
.summary { background: #fff; border-radius: 20px; padding: 16px; border: 1px solid var(--line); }
.sum-row { display: flex; justify-content: space-between; padding: 5px 0; color: var(--ink-2); }
.sum-row.total { color: var(--ink); font-weight: 800; font-size: 1.12rem; border-top: 1px dashed var(--line); margin-top: 6px; padding-top: 12px; }
.ship-meter { background: var(--brand-soft); border-radius: 14px; padding: 12px 14px; font-size: .85rem; margin-bottom: 12px; color: var(--brand-ink); }
.ship-meter .bar { height: 6px; border-radius: 6px; background: #fff; margin-top: 8px; overflow: hidden; }
.ship-meter .bar i { display: block; height: 100%; background: var(--brand); border-radius: 6px; }

/* forms */
.field { margin-bottom: 12px; }
.field label { display: block; font-weight: 700; font-size: .82rem; margin-bottom: 5px; color: var(--ink-2); }
.input { width: 100%; height: 50px; border-radius: 14px; border: 1.5px solid var(--line); background: #fff; padding: 0 14px; outline: none; transition: border-color .15s, box-shadow .15s; }
textarea.input { height: auto; padding: 12px 14px; resize: vertical; }
.input:focus { border-color: var(--brand); box-shadow: 0 0 0 4px var(--brand-soft); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.card { background: #fff; border-radius: 20px; padding: 16px; border: 1px solid var(--line); margin-bottom: 12px; }
.card h3 { margin: 0 0 12px; font-size: 1rem; font-weight: 800; }
.pay-opt { display: flex; align-items: center; gap: 12px; border: 1.5px solid var(--line); border-radius: 14px; padding: 12px 14px; margin-bottom: 10px; cursor: pointer; transition: all .15s; }
.pay-opt input { accent-color: var(--brand); width: 20px; height: 20px; }
.pay-opt i { font-size: 1.5rem; }
.pay-opt b { display: block; font-size: .92rem; }
.pay-opt small { color: var(--muted); }
.pay-opt:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.alert { padding: 12px 14px; border-radius: 14px; font-size: .88rem; margin: 0 0 12px; }
.alert-danger { background: #fee2e2; color: #991b1b; }
.alert-success { background: #dcfce7; color: #166534; }
.alert-info { background: var(--brand-soft); color: var(--brand-ink); }

/* search */
.search-top { position: sticky; top: 60px; z-index: 20; background: var(--bg); padding: 12px 14px 8px; }
.search-input { display: flex; align-items: center; gap: 10px; background: #fff; border: 1.5px solid var(--brand); border-radius: 14px; padding: 0 12px; height: 50px; box-shadow: 0 0 0 4px var(--brand-soft); }
.search-input input { border: 0; outline: 0; flex: 1; height: 100%; font-size: 1rem; background: transparent; min-width: 0; }
.search-input i { color: var(--brand); font-size: 1.1rem; }
.suggest { background: #fff; border-radius: 14px; margin-top: 8px; border: 1px solid var(--line); overflow: hidden; }
.suggest a { display: flex; align-items: center; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line); font-size: .9rem; }
.suggest a:last-child { border-bottom: 0; }
.suggest img { width: 38px; height: 38px; border-radius: 10px; object-fit: cover; background: #f1f4f3; }
.suggest mark { background: var(--brand-soft-2); color: inherit; padding: 0 1px; border-radius: 3px; }
.sort-row { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin: 4px 0 12px; font-size: .85rem; color: var(--muted); }
.sort-row select { border: 1px solid var(--line); border-radius: 10px; padding: 6px 10px; background: #fff; font-weight: 600; }
.recent { display: flex; flex-wrap: wrap; gap: 8px; }

.empty-state { text-align: center; padding: 50px 24px; color: var(--muted); }
.empty-state i { font-size: 3rem; color: var(--brand); opacity: .35; display: block; margin-bottom: 10px; }
.empty-state h3 { color: var(--ink); margin: 0 0 4px; }

/* about / contact card */
.about { background: #fff; border-radius: 20px; padding: 18px; border: 1px solid var(--line); }
.about p { color: var(--ink-2); margin: 0 0 12px; }
.contact-btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

/* footer */
.shop-foot { margin: 26px 14px 0; padding: 20px 4px 10px; border-top: 1px solid var(--line); text-align: center; color: var(--muted); font-size: .84rem; }
.sf-name { font-weight: 800; color: var(--ink); font-size: 1rem; margin-bottom: 6px; }
.sf-line { margin-bottom: 10px; }
.sf-contacts, .sf-social, .sf-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 8px 16px; margin: 10px 0; }
.sf-contacts a { font-weight: 700; color: var(--ink-2); }
.sf-social a { font-size: 1.3rem; color: var(--brand); }
.sf-links a { text-decoration: underline; text-underline-offset: 3px; }
.sf-powered { display: inline-block; margin-top: 12px; font-size: .76rem; padding: 6px 12px; border-radius: 30px; background: #fff; border: 1px solid var(--line); }

/* tab bar */
.tabbar { position: fixed; z-index: 35; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 520px; height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b); display: flex; background: rgba(255,255,255,.96); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabbar a { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: .68rem; font-weight: 700; color: var(--muted); position: relative; }
.tabbar a i { font-size: 1.32rem; }
.tabbar a.on { color: var(--brand); }
.tabbar a em { position: absolute; top: 7px; left: 54%; min-width: 17px; height: 17px; border-radius: 9px; background: var(--sale); color: #fff; font-style: normal; font-size: .64rem; display: grid; place-items: center; padding: 0 4px; }
.tabbar .tb-wa i { color: var(--wa); }

/* install banner + toast */
.install-banner { position: fixed; z-index: 50; left: 50%; transform: translateX(-50%); bottom: calc(var(--tabbar-h) + var(--safe-b) + 10px); width: calc(100% - 20px); max-width: 500px; display: flex; align-items: center; gap: 10px; padding: 10px 10px 10px 12px; background: #111a19; color: #fff; border-radius: 18px; box-shadow: 0 20px 40px -16px rgba(0,0,0,.5); animation: up .35s ease; }
.install-banner[hidden] { display: none; }
.install-banner img { width: 42px; height: 42px; border-radius: 12px; background: #fff; object-fit: cover; flex: none; }
.ib-text { flex: 1; min-width: 0; font-size: .8rem; line-height: 1.3; }
.ib-text b { display: block; font-size: .9rem; }
.ib-text span { opacity: .75; }
.ib-btn { background: var(--brand); color: #fff; font-weight: 800; padding: 9px 14px; border-radius: 12px; font-size: .85rem; }
.ib-close { color: #fff; opacity: .6; padding: 6px; }
@keyframes up { from { transform: translate(-50%, 30px); opacity: 0; } }
.toast-pc { position: fixed; z-index: 60; left: 50%; top: 70px; transform: translate(-50%, -20px); background: #111a19; color: #fff; padding: 11px 16px; border-radius: 14px; font-weight: 700; font-size: .88rem; opacity: 0; pointer-events: none; transition: all .25s; max-width: 90%; display: flex; gap: 8px; align-items: center; }
.toast-pc.show { opacity: 1; transform: translate(-50%, 0); }
.toast-pc a { color: #fff; text-decoration: underline; margin-left: 6px; }

/* order success */
.success-hero { text-align: center; padding: 28px 18px 10px; }
.success-hero .tick { width: 76px; height: 76px; margin: 0 auto 12px; border-radius: 50%; display: grid; place-items: center; font-size: 2.4rem; background: #dcfce7; color: var(--ok); animation: pop .4s ease; }
.success-hero.pending .tick { background: #fef3c7; color: #d97706; }
.success-hero h1 { margin: 0; font-size: 1.35rem; font-weight: 800; letter-spacing: -.02em; }
.success-hero p { color: var(--muted); margin: 6px 0 0; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } }
.line-item { display: flex; justify-content: space-between; gap: 10px; padding: 7px 0; border-bottom: 1px dashed var(--line); font-size: .9rem; }
.line-item:last-child { border-bottom: 0; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.text-c { text-align: center; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; } .mb12 { margin-bottom: 12px; }
.static-page { background: #fff; margin: 14px; padding: 20px; border-radius: 20px; border: 1px solid var(--line); }
.static-page h1 { margin-top: 0; font-size: 1.4rem; }
.closed { text-align: center; padding: 80px 24px; }
.closed i { font-size: 3.4rem; color: var(--brand); }

/* enquiry bottom sheet */
.sheet-backdrop { position: fixed; inset: 0; z-index: 70; background: rgba(17, 26, 25, .45); animation: fade .2s; }
.sheet { position: fixed; z-index: 71; left: 50%; bottom: 0; transform: translateX(-50%); width: 100%; max-width: 520px; max-height: 92vh; overflow-y: auto; background: var(--bg); border-radius: 24px 24px 0 0; padding: 6px 16px calc(18px + var(--safe-b)); animation: sheetUp .28s cubic-bezier(.2, .9, .3, 1); }
.sheet[hidden], .sheet-backdrop[hidden] { display: none; }
.sheet-grip { width: 42px; height: 5px; border-radius: 5px; background: #d3dbda; margin: 6px auto 8px; }
.sheet-head { display: flex; align-items: center; margin-bottom: 8px; }
.sheet-head h2 { font-size: 1.15rem; font-weight: 800; margin: 0; flex: 1; }
.sheet-done { text-align: center; padding: 28px 10px 18px; }
.sheet-done i { font-size: 3rem; color: var(--ok); }
@keyframes sheetUp { from { transform: translate(-50%, 100%); } }
@keyframes fade { from { opacity: 0; } }
