/* Puja storefront — mobile first. Tokens on :root, redefined for dark mode. */
:root {
    --bg: #fffaf3;
    --surface: #ffffff;
    --surface-2: #fbf3e8;
    --ink: #2b1d16;
    --muted: #7a6559;
    --line: #efe2d3;
    --primary: #b1382a;
    --primary-2: #8f2a1f;
    --on-primary: #ffffff;
    --accent: #e8912c;
    --accent-soft: #fdebd3;
    --good: #2f7a46;
    --good-soft: #e3f3e7;
    --warn: #a15c00;
    --shadow: 0 1px 2px rgba(60, 30, 10, .06), 0 6px 18px rgba(60, 30, 10, .07);
    --radius: 14px;
    --header-h: 60px;
    color-scheme: light;
}
@media (prefers-color-scheme: dark) {
    :root:not([data-theme="light"]) {
        --bg: #16110e; --surface: #211a15; --surface-2: #2a211b; --ink: #f6ece2; --muted: #b8a597;
        --line: #3a2e26; --primary: #e0664f; --primary-2: #c9513b; --accent: #f0a54b; --accent-soft: #3d2c19;
        --good: #6cc58a; --good-soft: #1f3326; --warn: #f0b35c;
        --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35); color-scheme: dark;
    }
}
:root[data-theme="dark"] {
    --bg: #16110e; --surface: #211a15; --surface-2: #2a211b; --ink: #f6ece2; --muted: #b8a597;
    --line: #3a2e26; --primary: #e0664f; --primary-2: #c9513b; --accent: #f0a54b; --accent-soft: #3d2c19;
    --good: #6cc58a; --good-soft: #1f3326; --warn: #f0b35c;
    --shadow: 0 1px 2px rgba(0, 0, 0, .4), 0 6px 18px rgba(0, 0, 0, .35); color-scheme: dark;
}

* { box-sizing: border-box; }
html, body { margin: 0; }
body {
    background: var(--bg); color: var(--ink);
    font-family: 'Poppins', system-ui, -apple-system, 'Segoe UI', sans-serif;
    font-size: 14px; line-height: 1.45; -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
body.pj-locked { overflow: hidden; }
button { font: inherit; color: inherit; cursor: pointer; }
a { color: inherit; }
img { display: block; max-width: 100%; }
[hidden] { display: none !important; }

/* ── header ─────────────────────────────────────────────────────────────── */
.pj-header {
    position: sticky; top: 0; z-index: 30;
    display: flex; align-items: center; gap: 8px;
    min-height: calc(var(--header-h) + env(safe-area-inset-top, 0px));
    /* Line the icons up with the content column below (max 1180px, 16px gutter). */
    padding: 0 max(12px, calc((100% - 1180px) / 2 + 6px));
    padding-top: env(safe-area-inset-top, 0px);
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: saturate(1.4) blur(10px); -webkit-backdrop-filter: saturate(1.4) blur(10px);
    border-bottom: 1px solid var(--line);
}
.pj-icon-btn {
    flex: 0 0 auto; width: 40px; height: 40px; border-radius: 12px; border: 0;
    background: transparent; display: grid; place-items: center; font-size: 22px; position: relative;
}
@media (hover: hover) { .pj-icon-btn:hover { background: var(--surface-2); } }
.pj-icon-btn:focus-visible, .pj-chip:focus-visible, .pj-btn:focus-visible, .pj-card:focus-visible {
    outline: 2px solid var(--primary); outline-offset: 2px;
}
.pj-brand { display: flex; align-items: center; gap: 8px; text-decoration: none; flex: 0 0 auto; }
.pj-brand-mark {
    width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
    background: linear-gradient(135deg, var(--accent), var(--primary)); color: #fff; font-size: 18px; font-weight: 600;
}
.pj-brand-name { font-weight: 700; font-size: 16px; letter-spacing: .2px; white-space: nowrap; }
.pj-search {
    flex: 1 1 auto; min-width: 0; display: flex; align-items: center; gap: 8px;
    height: 40px; padding: 0 12px; border-radius: 12px;
    background: var(--surface); border: 1px solid var(--line); color: var(--muted);
}
.pj-search:focus-within { border-color: var(--primary); }
.pj-search input {
    flex: 1; min-width: 0; border: 0; outline: 0; background: transparent;
    font: inherit; color: var(--ink);
}
.pj-cart-count {
    position: absolute; top: 3px; right: 2px; min-width: 18px; height: 18px; padding: 0 5px;
    border-radius: 9px; background: var(--primary); color: var(--on-primary);
    font-size: 11px; font-weight: 600; line-height: 18px; text-align: center; pointer-events: none;
}
@media (max-width: 560px) {
    .pj-brand-name { display: none; }
}

/* ── layout ─────────────────────────────────────────────────────────────── */
.pj-main { max-width: 1180px; margin: 0 auto; padding: 8px 0 48px; }
.pj-section { margin-top: 18px; }
.pj-section-head {
    display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
    padding: 0 16px; margin-bottom: 10px;
}
.pj-section-title { margin: 0; font-size: 17px; font-weight: 600; }
.pj-section-sub { color: var(--muted); font-size: 12.5px; }
.pj-link { border: 0; background: none; color: var(--primary); font-weight: 600; font-size: 13px; padding: 4px 0; }

/* category quick chips */
.pj-chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 16px 2px; scrollbar-width: none; }
.pj-chips::-webkit-scrollbar { display: none; }
.pj-chip {
    flex: 0 0 auto; border: 1px solid var(--line); background: var(--surface);
    border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500; white-space: nowrap;
}
.pj-chip.is-active { background: var(--primary); border-color: var(--primary); color: var(--on-primary); }

/* horizontal carousel */
.pj-rail {
    display: grid; grid-auto-flow: column; grid-auto-columns: 148px; gap: 12px;
    overflow-x: auto; padding: 2px 16px 10px; scroll-snap-type: x mandatory; scrollbar-width: none;
    scroll-padding-inline: 16px;
}
.pj-rail::-webkit-scrollbar { display: none; }
.pj-rail > * { scroll-snap-align: start; }
@media (min-width: 768px) { .pj-rail { grid-auto-columns: 180px; } }

/* big-photo grid */
.pj-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 0 16px; }
@media (min-width: 640px) { .pj-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1000px) { .pj-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; } }

/* ── product card ───────────────────────────────────────────────────────── */
.pj-card {
    position: relative; display: flex; flex-direction: column; text-align: left;
    background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
    overflow: hidden; box-shadow: var(--shadow); padding: 0; min-width: 0;
    transition: transform .15s ease, box-shadow .15s ease;
}
@media (hover: hover) { .pj-card:hover { transform: translateY(-2px); } }
.pj-card-media { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); overflow: hidden; }
.pj-card-media img { width: 100%; height: 100%; object-fit: cover; }
.pj-badge {
    position: absolute; top: 8px; left: 8px; padding: 3px 8px; border-radius: 8px;
    background: var(--accent); color: #fff; font-size: 11.5px; font-weight: 700; letter-spacing: .2px;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.pj-tag {
    position: absolute; top: 8px; right: 8px; padding: 3px 8px; border-radius: 8px;
    background: rgba(20, 12, 8, .72); color: #fff; font-size: 11px; font-weight: 500;
}
.pj-card-body { padding: 10px 11px 12px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.pj-card-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; margin: 0;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.pj-card-meta { color: var(--muted); font-size: 12px; }
.pj-price-row { display: flex; align-items: baseline; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 4px; }
.pj-price { font-weight: 700; font-size: 15px; }
.pj-mrp { color: var(--muted); text-decoration: line-through; font-size: 12px; }
.pj-card-add {
    display: flex; align-items: center; justify-content: center;
    margin-top: 8px; width: 100%; height: 34px; border-radius: 10px; border: 1px solid var(--primary);
    background: transparent; color: var(--primary); font-weight: 600; font-size: 13px;
}
@media (hover: hover) { .pj-card:hover .pj-card-add { background: var(--primary); color: var(--on-primary); } }
.pj-card:active { transform: scale(.98); }
.pj-card.is-out .pj-card-media img { filter: grayscale(.7); opacity: .7; }
.pj-rail .pj-card-name { font-size: 12.5px; }
.pj-rail .pj-price { font-size: 14px; }

/* ── empty / loading ────────────────────────────────────────────────────── */
.pj-loading, .pj-empty {
    display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
    padding: 80px 24px; color: var(--muted); text-align: center;
}
.pj-empty i { font-size: 36px; color: var(--accent); }
.pj-spinner {
    width: 32px; height: 32px; border-radius: 50%;
    border: 3px solid var(--line); border-top-color: var(--primary); animation: pj-spin .8s linear infinite;
}
@keyframes pj-spin { to { transform: rotate(360deg); } }

.pj-page-head { display: flex; align-items: center; gap: 6px; padding: 8px 10px 0; }
.pj-page-title { margin: 0; font-size: 19px; font-weight: 600; }
.pj-page-sub { color: var(--muted); font-size: 12.5px; padding: 0 16px; }

/* ── drawers & scrim ────────────────────────────────────────────────────── */
.pj-scrim {
    position: fixed; inset: 0; z-index: 40; background: rgba(25, 15, 10, .32);
    -webkit-backdrop-filter: blur(6px) saturate(1.1); backdrop-filter: blur(6px) saturate(1.1);
    opacity: 0; transition: opacity .2s ease;
}
.pj-scrim.is-open { opacity: 1; }
.pj-drawer {
    position: fixed; top: 0; bottom: 0; z-index: 50; width: min(50vw, 380px); min-width: 280px;
    background: var(--surface); box-shadow: var(--shadow);
    display: flex; flex-direction: column; transition: transform .25s ease;
    padding-top: env(safe-area-inset-top, 0px);
}
.pj-drawer-left { left: 0; transform: translateX(-102%); border-right: 1px solid var(--line); }
.pj-drawer-right { right: 0; transform: translateX(102%); border-left: 1px solid var(--line); width: min(92vw, 420px); }
.pj-drawer.is-open { transform: none; }
@media (max-width: 560px) { .pj-drawer-left { width: 78vw; min-width: 0; } }
.pj-drawer-head {
    display: flex; align-items: center; justify-content: space-between; gap: 8px;
    padding: 12px 12px 12px 16px; border-bottom: 1px solid var(--line);
}
.pj-drawer-title { margin: 0; font-size: 16px; font-weight: 600; }
.pj-drawer-body { flex: 1; overflow-y: auto; padding: 8px 0 16px; }
.pj-menu-group { padding: 10px 16px 4px; font-size: 11px; font-weight: 600; letter-spacing: .8px; text-transform: uppercase; color: var(--muted); }
.pj-menu-item {
    display: flex; align-items: center; gap: 10px; width: 100%; border: 0; background: none;
    padding: 10px 16px; text-align: left; font-size: 14px; font-weight: 500;
}
.pj-menu-item:hover { background: var(--surface-2); }
.pj-menu-item .pj-menu-code {
    flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center;
    background: var(--accent-soft); color: var(--primary); font-size: 11.5px; font-weight: 700;
}
.pj-menu-item .bi-chevron-right { margin-left: auto; color: var(--muted); font-size: 12px; }
.pj-menu-subs { padding: 0 0 6px 56px; display: flex; flex-direction: column; }
.pj-menu-sub { border: 0; background: none; text-align: left; padding: 6px 0; color: var(--muted); font-size: 13.5px; }
.pj-menu-sub:hover { color: var(--primary); }
.pj-contact { margin: 12px 16px 0; padding: 12px; border-radius: 12px; background: var(--surface-2); display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.pj-contact a { display: flex; gap: 8px; align-items: flex-start; text-decoration: none; }
.pj-contact i { color: var(--primary); }

/* ── bottom sheet ───────────────────────────────────────────────────────── */
.pj-sheet {
    position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
    max-height: 92vh; overflow-y: auto; background: var(--surface);
    border-radius: 20px 20px 0 0; box-shadow: 0 -8px 30px rgba(0, 0, 0, .18);
    transform: translateY(105%); transition: transform .28s cubic-bezier(.2, .8, .2, 1);
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.pj-sheet.is-open { transform: none; }
@media (min-width: 900px) {
    .pj-sheet { left: 50%; right: auto; width: min(1140px, 94vw); bottom: auto; top: 50%; border-radius: 20px;
        transform: translate(-50%, -46%) scale(.98); opacity: 0; pointer-events: none;
        transition: transform .22s ease, opacity .22s ease; max-height: 92vh; }
    .pj-sheet.is-open { transform: translate(-50%, -50%); opacity: 1; pointer-events: auto; }
    .pj-sheet.pj-sheet-media { min-height: min(720px, 90vh); }
}
.pj-sheet-grip { width: 40px; height: 4px; border-radius: 2px; background: var(--line); margin: 8px auto 0; }
.pj-sheet-close { position: absolute; top: 10px; right: 10px; z-index: 6; background: var(--surface); box-shadow: var(--shadow); }
.pj-sheet-inner { display: grid; grid-template-columns: 1fr; }
@media (min-width: 900px) {
    .pj-sheet-inner { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); align-items: start; }
    .pj-sheet-grip { display: none; }
}

/* Gallery: big photo + thumbnail strip, wheel / pinch zoom (app.js bindGallery). */
.pj-gallery { position: relative; background: var(--surface); }
.pj-gallery-main { position: relative; }
.pj-zoom-stage {
    position: relative; overflow: hidden; aspect-ratio: 1 / 1; background: var(--surface);
    cursor: zoom-in; touch-action: pan-y; user-select: none; -webkit-user-select: none;
}
.pj-zoom-stage.is-zoomed { cursor: grab; touch-action: none; }
.pj-zoom-stage.is-zoomed:active { cursor: grabbing; }
.pj-zoom-stage img {
    width: 100%; height: 100%; object-fit: contain; transform-origin: 0 0;
    pointer-events: none; -webkit-user-drag: none; will-change: transform;
}
.pj-gal-arrow {
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 2;
    width: 40px; height: 40px; border-radius: 50%; border: 0;
    background: var(--surface); color: var(--ink); box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
    display: inline-flex; align-items: center; justify-content: center; font-size: 16px;
    opacity: 0; transition: opacity .15s ease;
}
.pj-gal-arrow.is-prev { left: 12px; } .pj-gal-arrow.is-next { right: 12px; }
.pj-gallery-main:hover .pj-gal-arrow, .pj-gal-arrow:focus-visible { opacity: 1; }
.pj-gal-count {
    position: absolute; left: 12px; bottom: 12px; z-index: 2; padding: 2px 8px; border-radius: 999px;
    background: rgba(20, 12, 8, .55); color: #fff; font-size: 11.5px; font-weight: 600;
}
.pj-zoom-hint {
    position: absolute; right: 12px; bottom: 12px; z-index: 2; display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 9px; border-radius: 999px; background: rgba(20, 12, 8, .55); color: #fff;
    font-size: 11.5px; pointer-events: none; transition: opacity .2s ease;
}
.pj-hint-touch { display: none; }
@media (hover: none) { .pj-hint-wheel { display: none; } .pj-hint-touch { display: inline; } .pj-gal-arrow { display: none; } }
.pj-zoom-reset {
    position: absolute; right: 12px; bottom: 12px; z-index: 2; display: none;
    width: 34px; height: 34px; border-radius: 50%; border: 0;
    background: var(--surface); color: var(--ink); box-shadow: 0 2px 10px rgba(0, 0, 0, .18);
}
.pj-gallery-main:has(.is-zoomed) .pj-zoom-hint, .pj-gallery-main:has(.is-zoomed) .pj-gal-arrow { opacity: 0; pointer-events: none; }
.pj-gallery-main:has(.is-zoomed) .pj-zoom-reset { display: inline-flex; align-items: center; justify-content: center; }
/* Hover magnifier (desktop): lens over the photo, enlarged view over the details. */
.pj-lens {
    position: absolute; z-index: 1; pointer-events: none; border: 1px solid rgba(255, 255, 255, .9);
    background: rgba(255, 255, 255, .18); box-shadow: 0 0 0 9999px rgba(20, 12, 8, .28);
}
.pj-zoom-stage.is-lensing { cursor: crosshair; }
.pj-zoom-stage.is-lensing ~ .pj-zoom-hint, .pj-zoom-stage.is-lensing ~ .pj-gal-arrow { opacity: 0; }
.pj-zoom-pane {
    position: absolute; left: calc(100% + 30px); z-index: 5; pointer-events: none;
    background-color: var(--surface); background-repeat: no-repeat;
    border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 12px 40px rgba(20, 12, 8, .22);
}
.pj-zoom-pane[hidden], .pj-lens[hidden] { display: none; }

/* Size dropdown (more than SIZE_CHIPS_MAX sizes) */
.pj-select-wrap { position: relative; }
.pj-select {
    width: 100%; appearance: none; -webkit-appearance: none; cursor: pointer;
    height: 42px; padding: 0 36px 0 12px; border-radius: 12px;
    border: 1.5px solid var(--line); background: var(--surface); color: var(--ink);
    font: inherit; font-size: 13.5px; font-weight: 600;
}
.pj-select:focus { outline: none; border-color: var(--primary); }
.pj-select-wrap > i { position: absolute; right: 12px; top: 50%; transform: translateY(-50%); pointer-events: none; color: var(--muted); }
.pj-slot .pj-select-wrap { margin-top: 6px; }
.pj-slot .pj-select { height: 36px; font-size: 12.5px; border-radius: 9px; }
@media (max-width: 640px) { .pj-select { font-size: 16px; } }
.pj-thumbs {
    display: flex; gap: 10px; padding: 12px 14px; overflow-x: auto; scrollbar-width: thin;
    scroll-snap-type: x proximity;
}
.pj-thumb {
    flex: 0 0 auto; width: 68px; height: 68px; padding: 0; border-radius: 12px; overflow: hidden;
    border: 1.5px solid var(--line); background: var(--surface); scroll-snap-align: start;
    transition: border-color .15s ease, box-shadow .15s ease;
}
.pj-thumb img { width: 100%; height: 100%; object-fit: cover; display: block; }
.pj-thumb.is-active { border: 2px solid var(--good); box-shadow: 0 0 0 2px var(--good-soft); }
@media (hover: hover) { .pj-thumb:hover { border-color: var(--muted); } }
@media (min-width: 900px) {
    .pj-sheet-media .pj-gallery { position: sticky; top: 0; padding: 22px 0 6px 22px; z-index: 2; } /* zoom pane over the details */
    .pj-sheet-media .pj-zoom-stage { border-radius: 16px; border: 1px solid var(--line); }
    .pj-sheet-media .pj-thumbs { padding: 14px 0 6px; }
    .pj-thumb { width: 84px; height: 84px; }
}
@media (max-width: 899px) { .pj-zoom-stage { aspect-ratio: auto; height: min(56vh, 100vw); } }

.pj-detail { padding: 16px 18px 20px; display: flex; flex-direction: column; gap: 12px; }
@media (min-width: 900px) { .pj-sheet-media .pj-detail { padding: 30px 30px 26px; gap: 14px; } .pj-sheet-media .pj-detail-name { font-size: 24px; } }

/* Bestseller (per variant) */
.pj-best {
    position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 8px; background: #f6c445; color: #3a2400;
    font-size: 11px; font-weight: 700; box-shadow: 0 2px 6px rgba(0, 0, 0, .15);
}
.pj-best i, .pj-pill-best i, .pj-variant-best i { font-size: .85em; }
.pj-pill-best { background: #fdf0c4; color: #7a5200; }
.pj-variant { position: relative; }
.pj-variant-best {
    position: absolute; top: -7px; right: -7px; width: 20px; height: 20px; border-radius: 50%;
    background: #f6c445; color: #3a2400; display: inline-flex; align-items: center; justify-content: center;
    font-size: 11px; box-shadow: 0 1px 4px rgba(0, 0, 0, .2);
}

/* Combo validity */
.pj-time {
    position: absolute; left: 8px; bottom: 8px; display: inline-flex; align-items: center; gap: 4px;
    padding: 3px 8px; border-radius: 8px; background: rgba(20, 12, 8, .72); color: #fff; font-size: 11px; font-weight: 600;
}
.pj-time.is-soon { background: var(--primary); }
.pj-validity { display: inline-flex; align-items: center; gap: 6px; align-self: flex-start;
    padding: 5px 10px; border-radius: 10px; background: var(--surface-2); font-size: 12.5px; font-weight: 600; }
.pj-validity.is-soon { background: var(--accent-soft); color: var(--warn); }

/* Customisable combo slots */
.pj-slots-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.pj-slots { display: flex; flex-direction: column; gap: 8px; }
.pj-slot {
    display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; gap: 10px; align-items: center;
    padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface);
}
.pj-slot-img { width: 52px; height: 52px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.pj-slot-name { font-weight: 600; font-size: 13.5px; line-height: 1.3; }
.pj-slot-sizes { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
.pj-size {
    border: 1.5px solid var(--line); background: var(--surface); border-radius: 9px;
    padding: 4px 9px; font-size: 12px; font-weight: 600; color: var(--ink);
}
.pj-size small { color: var(--muted); font-weight: 500; }
.pj-size.is-active { border-color: var(--primary); background: var(--accent-soft); }
.pj-size:disabled { opacity: .45; text-decoration: line-through; cursor: not-allowed; }
.pj-slot-warn { color: var(--warn); font-size: 11.5px; font-weight: 600; margin-top: 4px; }
.pj-qty.pj-qty-sm { height: 34px; border-radius: 9px; }
.pj-qty.pj-qty-sm button { width: 30px; font-size: 15px; }
.pj-qty.pj-qty-sm button:disabled { opacity: .35; cursor: not-allowed; }
.pj-qty.pj-qty-sm span { min-width: 22px; }
@media (max-width: 400px) {
    .pj-slot { grid-template-columns: 44px minmax(0, 1fr); }
    .pj-slot-img { width: 44px; height: 44px; }
    .pj-slot .pj-qty-sm { grid-column: 2; justify-self: start; }
}
.pj-detail-kicker { color: var(--muted); font-size: 12px; }
.pj-detail-name { margin: 0; font-size: 20px; font-weight: 600; line-height: 1.25; }
.pj-detail-price { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.pj-detail-price .pj-price { font-size: 22px; }
.pj-off { color: var(--good); font-weight: 600; font-size: 13px; }
.pj-note { font-size: 12px; color: var(--muted); }
.pj-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: .6px; }
.pj-variants { display: flex; flex-wrap: wrap; gap: 8px; }
.pj-variant {
    border: 1.5px solid var(--line); background: var(--surface); border-radius: 12px;
    padding: 8px 12px; text-align: left; min-width: 96px; display: flex; flex-direction: column; gap: 1px;
}
.pj-variant b { font-size: 13px; font-weight: 600; }
.pj-variant small { color: var(--muted); font-size: 11.5px; }
.pj-variant.is-active { border-color: var(--primary); background: var(--accent-soft); }
.pj-variant:disabled { opacity: .45; cursor: not-allowed; text-decoration: line-through; }
.pj-bullets { margin: 0; padding-left: 18px; display: flex; flex-direction: column; gap: 3px; color: var(--ink); }
.pj-items { display: flex; flex-direction: column; gap: 6px; }
.pj-item-row { display: flex; justify-content: space-between; gap: 10px; padding: 8px 10px; border-radius: 10px; background: var(--surface-2); font-size: 13px; }
.pj-buy { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.pj-qty { display: flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; height: 44px; }
.pj-qty button { width: 40px; height: 100%; border: 0; background: none; font-size: 18px; }
.pj-qty span { min-width: 28px; text-align: center; font-weight: 600; }
.pj-btn {
    flex: 1; height: 44px; border-radius: 12px; border: 0; padding: 0 16px;
    background: var(--primary); color: var(--on-primary); font-weight: 600; font-size: 14px;
    display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none;
}
.pj-btn:hover { background: var(--primary-2); }
.pj-btn:disabled { opacity: .5; cursor: not-allowed; }
.pj-btn-ghost { background: transparent; color: var(--primary); border: 1px solid var(--primary); }
.pj-btn-ghost:hover { background: var(--accent-soft); }
.pj-pill { display: inline-flex; align-items: center; gap: 5px; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; }
.pj-pill-good { background: var(--good-soft); color: var(--good); }
.pj-pill-warn { background: var(--accent-soft); color: var(--warn); }
.pj-rent-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.pj-rent-box { padding: 10px 12px; border-radius: 12px; background: var(--surface-2); }
.pj-rent-box b { display: block; font-size: 17px; }

/* ── cart ───────────────────────────────────────────────────────────────── */
.pj-cart-line { display: grid; grid-template-columns: 56px 1fr auto; gap: 10px; align-items: center; padding: 10px 16px; border-bottom: 1px solid var(--line); }
.pj-cart-line img { width: 56px; height: 56px; border-radius: 10px; object-fit: cover; background: var(--surface-2); }
.pj-cart-name { font-weight: 600; font-size: 13px; line-height: 1.3; }
.pj-cart-sub { color: var(--muted); font-size: 12px; }
.pj-cart-right { display: flex; flex-direction: column; align-items: flex-end; gap: 6px; }
.pj-cart-right .pj-qty { height: 32px; border-radius: 9px; }
.pj-cart-right .pj-qty button { width: 30px; font-size: 15px; }
.pj-cart-foot { border-top: 1px solid var(--line); padding: 14px 16px calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 8px; }
.pj-sum { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); }
.pj-sum.is-total { color: var(--ink); font-size: 16px; font-weight: 700; }
.pj-sum .pj-save { color: var(--good); font-weight: 600; }

/* ── toast ──────────────────────────────────────────────────────────────── */
.pj-toast {
    position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom, 0px)); z-index: 80;
    transform: translateX(-50%); background: var(--ink); color: var(--bg);
    padding: 10px 16px; border-radius: 12px; font-size: 13px; font-weight: 500; box-shadow: var(--shadow);
    max-width: calc(100vw - 32px);
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { transition: none !important; animation: none !important; }
}

/* ── account & ordering ─────────────────────────────────────────────────── */
.pj-account-btn.is-in::after {
    content: ''; position: absolute; top: 8px; right: 7px; width: 8px; height: 8px; border-radius: 50%;
    background: var(--good); box-shadow: 0 0 0 2px var(--bg);
}
@media (min-width: 900px) {
    .pj-sheet.pj-sheet-narrow { width: 440px; }
    .pj-sheet-narrow .pj-sheet-inner { grid-template-columns: 1fr; }
}
.pj-form { padding: 22px 20px 24px; display: flex; flex-direction: column; gap: 14px; }
.pj-lead { font-size: 13px; margin: -6px 0 0; }
.pj-field { display: flex; flex-direction: column; gap: 5px; min-width: 0; flex: 1; }
.pj-field > span { font-size: 12px; font-weight: 600; color: var(--muted); }
.pj-field-row { display: flex; gap: 10px; align-items: flex-end; }
@media (max-width: 340px) { .pj-field-row { flex-direction: column; } }
.pj-input, .pj-phone {
    width: 100%; border: 1px solid var(--line); background: var(--surface); color: var(--ink);
    border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 15px; outline: 0;
}
textarea.pj-input { resize: vertical; min-height: 44px; }
.pj-input:focus, .pj-phone:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--accent-soft); }
.pj-phone { display: flex; align-items: center; gap: 10px; padding: 0 12px; }
.pj-phone > span { color: var(--muted); font-weight: 600; padding-right: 10px; border-right: 1px solid var(--line); }
.pj-phone input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: inherit; font-size: 15px; padding: 10px 0; letter-spacing: .5px; }
.pj-otp { font-size: 22px; letter-spacing: 10px; text-align: center; font-weight: 600; }
.pj-devnote { display: flex; gap: 8px; align-items: center; padding: 9px 12px; border-radius: 10px; background: var(--accent-soft); color: var(--warn); font-size: 12.5px; }
.pj-alert { display: flex; flex-direction: column; gap: 4px; padding: 10px 12px; border-radius: 10px; background: color-mix(in srgb, var(--primary) 10%, transparent); color: var(--primary); font-size: 13px; }
.pj-alert > div { display: flex; gap: 8px; align-items: flex-start; }
.pj-alert .pj-link { align-self: flex-start; }
.pj-hint { display: flex; gap: 8px; align-items: center; font-size: 12.5px; color: var(--good); background: var(--good-soft); padding: 8px 10px; border-radius: 10px; }
.pj-spinner-sm { width: 16px; height: 16px; border-width: 2px; border-color: rgba(255, 255, 255, .45); border-top-color: #fff; }

.pj-acct-head { display: flex; align-items: center; gap: 12px; }
.pj-avatar { width: 46px; height: 46px; border-radius: 50%; display: grid; place-items: center; flex: 0 0 auto;
    background: linear-gradient(135deg, var(--accent), var(--primary)); color: #fff; font-weight: 700; font-size: 18px; }
.pj-row-btn { display: flex; align-items: center; gap: 12px; width: 100%; padding: 12px; border: 1px solid var(--line);
    border-radius: 12px; background: var(--surface); text-align: left; font-weight: 500; }
.pj-row-btn:hover { background: var(--surface-2); }
.pj-row-btn span { flex: 1; }
.pj-row-btn .bi-chevron-right { color: var(--muted); font-size: 12px; }
.pj-saved-addr { display: flex; align-items: center; gap: 8px; padding: 8px 4px 8px 12px; border-radius: 12px; background: var(--surface-2); }
.pj-saved-addr > div { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.pj-saved-addr small, .pj-choice small { color: var(--muted); font-size: 12px; line-height: 1.35; }
.pj-saved-addr .pj-icon-btn { font-size: 16px; color: var(--muted); }

/* checkout / order layout: one column on phones, main + sticky summary on desktop */
.pj-co { display: grid; grid-template-columns: 1fr; gap: 12px; padding: 10px 16px 24px; }
@media (min-width: 900px) {
    .pj-co { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; gap: 16px; }
    .pj-co-side { position: sticky; top: calc(var(--header-h) + 12px); }
}
.pj-co-main { display: flex; flex-direction: column; gap: 12px; min-width: 0; }
.pj-panel { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.pj-panel-title { margin: 0; font-size: 15px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.pj-panel-title small { font-weight: 400; color: var(--muted); font-size: 12px; }
.pj-step { width: 22px; height: 22px; border-radius: 50%; display: grid; place-items: center; font-size: 12px; font-weight: 700;
    background: var(--accent-soft); color: var(--primary); }
.pj-choices { display: flex; flex-direction: column; gap: 8px; }
.pj-choice { display: flex; gap: 10px; align-items: flex-start; padding: 11px 12px; border: 1.5px solid var(--line); border-radius: 12px; cursor: pointer; }
.pj-choice:has(input:checked) { border-color: var(--primary); background: color-mix(in srgb, var(--accent-soft) 70%, transparent); }
.pj-choice input { margin-top: 3px; accent-color: var(--primary); flex: 0 0 auto; }
.pj-choice > span { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pj-choice b { font-weight: 600; font-size: 13.5px; }
.pj-addr-form { display: flex; flex-direction: column; gap: 10px; padding-top: 2px; }
.pj-co-lines { display: flex; flex-direction: column; gap: 8px; padding-bottom: 8px; border-bottom: 1px dashed var(--line); }
.pj-co-line { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; }
.pj-co-line small { color: var(--muted); }
.pj-co-line b { white-space: nowrap; }
.pj-place { margin-top: 4px; }
/* .pj-btn grows along a row; inside these column layouts it must keep its height. */
.pj-form .pj-btn, .pj-panel .pj-btn, .pj-cart-foot .pj-btn, .pj-detail > .pj-btn { flex: 0 0 auto; }

.pj-banner { display: flex; gap: 12px; align-items: flex-start; margin: 10px 16px 0; padding: 12px 14px; border-radius: var(--radius);
    background: var(--good-soft); color: var(--good); }
.pj-banner i { font-size: 20px; }
.pj-banner div { display: flex; flex-direction: column; gap: 2px; }
.pj-banner b { color: var(--ink); }
.pj-banner span { color: var(--muted); font-size: 12.5px; }
.pj-banner.is-warn { background: var(--accent-soft); color: var(--warn); }
.pj-banner.is-muted { background: var(--surface-2); color: var(--muted); margin: 6px 0 0; }

.pj-list { display: flex; flex-direction: column; gap: 10px; padding: 0 16px; }
.pj-order-card { display: flex; flex-direction: column; gap: 4px; padding: 12px 14px; border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface); text-decoration: none; box-shadow: var(--shadow); }
a.pj-order-card:hover { border-color: var(--accent); }
.pj-order-top { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.pj-order-top .pj-note { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.pj-order-meta { font-size: 12.5px; color: var(--muted); }

.pj-status { display: inline-flex; align-items: center; padding: 3px 9px; border-radius: 999px; font-size: 11.5px; font-weight: 600; white-space: nowrap;
    background: var(--accent-soft); color: var(--warn); }
.pj-st-confirmed, .pj-st-packed, .pj-st-dispatched { background: color-mix(in srgb, #1a78c2 14%, transparent); color: #1a78c2; }
.pj-st-delivered, .pj-st-returned { background: var(--good-soft); color: var(--good); }
.pj-st-cancelled { background: var(--surface-2); color: var(--muted); }

.pj-track { list-style: none; margin: 8px 0 0; padding: 0; display: flex; }
.pj-track li { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; font-size: 11px; color: var(--muted); position: relative; text-align: center; }
.pj-track li span { width: 14px; height: 14px; border-radius: 50%; background: var(--line); position: relative; z-index: 1; }
.pj-track li::before { content: ''; position: absolute; top: 6px; left: -50%; width: 100%; height: 2px; background: var(--line); }
.pj-track li:first-child::before { display: none; }
.pj-track li.is-done span, .pj-track li.is-now span { background: var(--good); }
.pj-track li.is-done::before, .pj-track li.is-now::before { background: var(--good); }
.pj-track li.is-now { color: var(--ink); font-weight: 600; }
.pj-track li.is-now span { box-shadow: 0 0 0 4px var(--good-soft); }
.pj-history { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 8px; font-size: 13px; }
.pj-history li { display: flex; justify-content: space-between; gap: 10px; }
.pj-history span { color: var(--muted); font-size: 12px; }

.pj-bk-item { flex-direction: row; align-items: center; gap: 12px; }
.pj-bk-item img { width: 64px; height: 64px; border-radius: 12px; object-fit: cover; flex: 0 0 auto; }
.pj-bk-item > div { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.pj-qty-field { width: fit-content; height: 44px; }

/* ── phones ─────────────────────────────────────────────────────────────── */
html { -webkit-text-size-adjust: 100%; }
button, a, .pj-choice { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
.pj-cartbar, .pj-paybar { display: none; }

@media (max-width: 640px) {
    /* Header: icons on the first row, a full-width search on the second. */
    .pj-header { flex-wrap: wrap; row-gap: 0; padding-bottom: 10px; }
    .pj-header > .pj-brand { margin-right: auto; }
    .pj-brand-name { display: inline; font-size: 15px; }
    .pj-search { order: 10; flex: 1 0 100%; height: 42px; }
    /* 16px stops iOS from zooming the page when an input is focused. */
    .pj-search input, .pj-input, .pj-phone input { font-size: 16px; }
    .pj-otp { font-size: 22px; }

    .pj-main { padding-bottom: calc(32px + env(safe-area-inset-bottom, 0px)); }
    body.pj-has-bar .pj-main { padding-bottom: calc(96px + env(safe-area-inset-bottom, 0px)); }
    .pj-section-title { font-size: 16px; }
    .pj-grid { gap: 10px; padding: 0 12px; }
    .pj-card-body { padding: 9px 10px 10px; }
    .pj-card-add { height: 36px; }
    .pj-chips { padding-left: 12px; padding-right: 12px; }
    .pj-rail { padding-left: 12px; padding-right: 12px; scroll-padding-inline: 12px; grid-auto-columns: 128px; gap: 10px; }
    .pj-rail .pj-card-media { aspect-ratio: 5 / 4; }
    .pj-rail .pj-price-row { flex-wrap: nowrap; white-space: nowrap; }
    .pj-rail .pj-card-name { -webkit-line-clamp: 1; }
    .pj-rail .pj-card-body { padding: 8px 8px 9px; gap: 2px; }
    .pj-rail .pj-card-name { font-size: 12.5px; }
    .pj-rail .pj-card-meta { font-size: 11.5px; }
    .pj-rail .pj-price { font-size: 13.5px; }
    .pj-rail .pj-mrp { font-size: 11px; }
    .pj-rail .pj-card-add { height: 30px; margin-top: 6px; font-size: 12px; border-radius: 9px; }
    .pj-rail .pj-badge, .pj-rail .pj-tag { font-size: 10.5px; padding: 2px 6px; top: 6px; }
    .pj-rail .pj-badge { left: 6px; } .pj-rail .pj-tag { right: 6px; }

    /* Bigger thumbs-sized controls. */
    .pj-cart-right .pj-qty { height: 36px; }
    .pj-cart-right .pj-qty button { width: 36px; }
    .pj-drawer-left { width: 84vw; }
    .pj-drawer-right { width: 100vw; }

    /* Toast sits under the header so it never covers a bottom button. */
    .pj-toast { bottom: auto; top: calc(10px + env(safe-area-inset-top, 0px)); left: 12px; right: 12px; transform: none; max-width: none; text-align: center; }

    /* Product sheet: keep "Add to cart" in reach while reading. */
    .pj-sheet { max-height: 94vh; }
    .pj-sheet .pj-buy {
        position: sticky; bottom: 0; z-index: 2; margin: 4px -18px -20px;
        padding: 10px 18px calc(12px + env(safe-area-inset-bottom, 0px));
        background: var(--surface); border-top: 1px solid var(--line);
    }
    .pj-sheet-grip { width: 44px; height: 5px; margin-top: 10px; }

    /* Pinned bars */
    .pj-cartbar, .pj-paybar {
        display: flex; align-items: center; gap: 12px; position: fixed; left: 0; right: 0; bottom: 0; z-index: 35;
        padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
        background: var(--surface); border-top: 1px solid var(--line); box-shadow: 0 -6px 20px rgba(60, 30, 10, .10);
    }
    .pj-cartbar[hidden] { display: none !important; }
    .pj-cartbar > div, .pj-paybar > div { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
    .pj-cartbar > div span, .pj-paybar > div span { font-size: 12px; color: var(--muted); }
    .pj-cartbar > div b, .pj-paybar > div b { font-size: 16px; }
    .pj-cartbar .pj-btn, .pj-paybar .pj-btn { flex: 1 1 auto; max-width: 220px; margin-left: auto; }
    .pj-paybar > div span { order: -1; }
    /* With the pay bar showing, the in-panel button would be a duplicate. */
    .pj-co-side .pj-place { display: none; }
    .pj-co { padding: 8px 12px calc(96px + env(safe-area-inset-bottom, 0px)); }
    .pj-panel { padding: 13px 14px; }
    .pj-page-head { padding-left: 6px; }
    .pj-page-title { font-size: 18px; }
    .pj-banner { margin-left: 12px; margin-right: 12px; }
    .pj-list { padding: 0 12px; }
}
@media (max-width: 340px) {
    .pj-grid { gap: 8px; }
}

/* Sheets that open on a photo (product / combo / rental): on phones the photo
   runs to the rounded top edge, and the grab handle + close sit on top of it. */
@media (max-width: 899px) {
    .pj-sheet.pj-sheet-media { overflow-x: hidden; }
    .pj-sheet-media .pj-sheet-grip {
        position: absolute; top: 8px; left: 50%; transform: translateX(-50%); margin: 0; z-index: 3;
        background: rgba(255, 255, 255, .75); box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
    }
    .pj-sheet-media .pj-gallery { border-radius: 20px 20px 0 0; overflow: hidden; }
    .pj-sheet-media .pj-sheet-close {
        top: 12px; right: 12px; width: 36px; height: 36px; border-radius: 50%; font-size: 15px;
        background: rgba(20, 12, 8, .45); color: #fff; box-shadow: none;
        -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    }
}
@media (max-width: 640px) {
    .pj-sheet .pj-buy { gap: 8px; }
    .pj-sheet .pj-buy .pj-qty button { width: 34px; }
    .pj-sheet .pj-buy .pj-qty span { min-width: 22px; }
    .pj-btn { white-space: nowrap; }
    .pj-sheet .pj-buy .pj-btn { font-size: 13.5px; padding: 0 12px; min-width: 0; }
}

/* ── rows: outer card on desktop ────────────────────────────────────────── */
.pj-rail-wrap { position: relative; }
.pj-rail-arrow { display: none; }
@media (min-width: 768px) {
    .pj-section-rail {
        margin: 18px 16px 0; padding: 16px 0 12px; border-radius: 18px;
        background: var(--surface-2); border: 1px solid var(--line);
    }
    .pj-section-rail .pj-section-head { padding: 0 20px; }
    .pj-section-rail .pj-rail { padding: 4px 20px 8px; scroll-padding-inline: 20px; }
    /* Fade the cut-off edge so a clipped card reads as "more this way". */
    .pj-rail-wrap.has-overflow::before, .pj-rail-wrap.has-overflow::after {
        content: ''; position: absolute; top: 0; bottom: 0; width: 64px; pointer-events: none; z-index: 1;
        transition: opacity .2s ease;
    }
    .pj-rail-wrap.has-overflow::before { left: 0; background: linear-gradient(to right, var(--surface-2), transparent); }
    .pj-rail-wrap.has-overflow::after { right: 0; background: linear-gradient(to left, var(--surface-2), transparent); }
    .pj-rail-wrap.at-start::before, .pj-rail-wrap.at-end::after { opacity: 0; }
    .pj-rail-wrap.has-overflow .pj-rail-arrow {
        display: grid; place-items: center; position: absolute; top: calc(50% - 26px); z-index: 2;
        width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
        background: var(--surface); color: var(--ink); box-shadow: var(--shadow); font-size: 16px;
        transition: opacity .2s ease, transform .15s ease;
    }
    .pj-rail-arrow.is-prev { left: 10px; }
    .pj-rail-arrow.is-next { right: 10px; }
    .pj-rail-arrow:hover { transform: scale(1.06); }
    .pj-rail-wrap.at-start .is-prev, .pj-rail-wrap.at-end .is-next { opacity: 0; pointer-events: none; }
}
