/* ==========================================================================
   Gadgets4Geeks control panel — layered on top of g4g.css tokens.
   Everything here is namespaced `p-` so it never collides with the storefront.
   ========================================================================== */

:root {
    --p-side:   264px;
    --p-top:    66px;
    --p-gap:    clamp(16px, 2.2vw, 26px);
}

body.p-body { background: var(--bg-soft); }

/* ---------- Shell -------------------------------------------------------- */

.p-shell { min-height: 100vh; }

.p-side {
    position: fixed; inset: 0 auto 0 0; z-index: 40;
    width: var(--p-side);
    display: flex; flex-direction: column;
    background: var(--surface);
    border-right: 1px solid var(--line);
    transition: transform .45s var(--ease-out);
}

.p-side__head { padding: 18px 20px; border-bottom: 1px solid var(--line); }

.p-side__nav { flex: 1; overflow-y: auto; padding: 18px 14px; display: grid; gap: 4px; align-content: start; }

.p-side__group {
    font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
    letter-spacing: .2em; text-transform: uppercase; color: var(--muted);
    padding: 18px 12px 8px;
}

.p-side__group:first-child { padding-top: 4px; }

.p-nav {
    position: relative;
    display: flex; align-items: center; gap: 11px;
    padding: 10px 12px; border-radius: 11px;
    font-size: .91rem; font-weight: 500; color: var(--ink-2);
    transition: background .25s var(--ease), color .25s var(--ease);
}

.p-nav svg { width: 18px; height: 18px; flex: none; opacity: .85; }

.p-nav:hover { background: var(--surface-2); color: var(--ink); }

.p-nav.is-on { background: var(--brand-tint); color: var(--brand); font-weight: 600; }

.p-nav.is-on::before {
    content: ''; position: absolute; left: -14px; top: 50%; translate: 0 -50%;
    width: 3px; height: 22px; border-radius: 0 3px 3px 0; background: var(--brand);
}

.p-nav__count {
    margin-left: auto; padding: 2px 8px; border-radius: 999px;
    background: var(--surface-2); border: 1px solid var(--line);
    font-family: var(--font-mono); font-size: 10px; color: var(--muted);
}

.p-nav.is-on .p-nav__count { background: var(--brand); border-color: transparent; color: var(--on-brand); }

.p-side__foot { padding: 14px; border-top: 1px solid var(--line); }

.p-me {
    display: flex; align-items: center; gap: 11px;
    padding: 10px; border-radius: 13px; background: var(--surface-2); border: 1px solid var(--line);
}

.p-me b { display: block; font-family: var(--font-body); font-size: .86rem; font-weight: 600; line-height: 1.3; letter-spacing: 0; }

:where(.p-me) :where(span) { font-family: var(--font-mono); font-size: 10px; color: var(--muted); text-transform: uppercase; letter-spacing: .1em; }

.p-main { margin-left: var(--p-side); min-width: 0; }

.p-top {
    position: sticky; top: 0; z-index: 30;
    height: var(--p-top);
    display: flex; align-items: center; gap: 14px;
    padding: 0 var(--p-gap);
    background: var(--scrim);
    backdrop-filter: blur(14px) saturate(160%);
    -webkit-backdrop-filter: blur(14px) saturate(160%);
    border-bottom: 1px solid var(--line);
}

.p-top h1 { font-family: var(--font-display); font-size: 1.16rem; letter-spacing: -.025em; font-weight: 600; }

.p-top__crumb { font-family: var(--font-mono); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }

.p-top__right { margin-left: auto; display: flex; align-items: center; gap: 9px; }

.p-content { padding: var(--p-gap); display: grid; gap: var(--p-gap); align-content: start; }

.p-burger { display: none; }

@media (max-width: 1000px) {
    .p-side { transform: translateX(-100%); box-shadow: var(--shadow-lg); }
    .p-side.is-open { transform: translateX(0); }
    .p-main { margin-left: 0; }
    .p-burger { display: inline-grid; }
}

/* ---------- Cards + sections --------------------------------------------- */

/* ---------- Stat tiles ---------------------------------------------------- */

.p-stat {
    position: relative; overflow: hidden;
    padding: 20px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line);
    transition: transform .4s var(--ease-out), border-color .3s var(--ease), box-shadow .4s var(--ease);
}

.p-stat:hover { transform: translateY(-4px); border-color: var(--brand-line); box-shadow: var(--shadow-lg); }

.p-stat::after {
    content: ''; position: absolute; inset: 0; pointer-events: none;
    background: radial-gradient(140px circle at 108% -18%, var(--brand-tint), transparent 68%);
}

.p-stat__ico {
    width: 38px; height: 38px; border-radius: 11px; display: grid; place-items: center;
    background: var(--brand-tint); color: var(--brand); margin-bottom: 14px;
}

.p-stat__ico svg { width: 18px; height: 18px; }

.p-stat b {
    position: relative; display: block;
    font-family: var(--font-display); font-size: clamp(1.5rem, 2.4vw, 1.95rem);
    letter-spacing: -.035em; line-height: 1.1;
}

.p-stat__label { position: relative; font-size: .84rem; color: var(--ink-2); font-weight: 500; }

.p-stat__meta { position: relative; display: block; font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-top: 6px; }

/* ---------- Table --------------------------------------------------------- */

.p-tablewrap { overflow-x: auto; }

.p-table { width: 100%; border-collapse: collapse; min-width: 760px; }

.p-table th {
    text-align: left; padding: 11px 16px;
    font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
    letter-spacing: .16em; text-transform: uppercase; color: var(--muted);
    border-bottom: 1px solid var(--line); white-space: nowrap;
}

.p-table td { padding: 13px 16px; border-bottom: 1px solid var(--line); vertical-align: middle; }

.p-table tbody tr { transition: background .2s var(--ease); }

.p-table tbody tr:hover { background: var(--surface-2); }

.p-table tbody tr:last-child td { border-bottom: 0; }

.p-table__num { font-family: var(--font-mono); font-size: .84rem; font-variant-numeric: tabular-nums; }

.p-table__actions { display: flex; gap: 6px; justify-content: flex-end; }

/* ---------- Chips + badges ------------------------------------------------ */

/* ---------- Forms --------------------------------------------------------- */

/* Radio cards used for the illustration picker */

.p-artgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(84px, 1fr)); gap: 8px; }

.p-art { position: relative; cursor: pointer; }

.p-art input { position: absolute; opacity: 0; pointer-events: none; }

.p-art__box {
    display: grid; place-items: center; padding: 10px 6px; border-radius: 12px;
    background: var(--surface-2); border: 1px solid var(--line);
    transition: all .25s var(--ease);
}

.p-art__box svg { width: 100%; height: 40px; }

.p-art__box span { font-family: var(--font-mono); font-size: 8.5px; color: var(--muted); margin-top: 4px; letter-spacing: .04em; }

.p-art:hover .p-art__box { border-color: var(--brand-line); }

.p-art input:checked + .p-art__box {
    border-color: var(--brand); background: var(--brand-tint);
    box-shadow: 0 0 0 3px var(--brand-tint);
}

/* ---------- Image manager -------------------------------------------------- */

.p-drop {
    position: relative; display: grid; place-items: center; gap: 8px;
    padding: 30px 20px; border-radius: var(--radius-sm);
    border: 2px dashed var(--line-strong); background: var(--surface-2);
    text-align: center; cursor: pointer;
    transition: border-color .3s var(--ease), background .3s var(--ease);
}

.p-drop:hover, .p-drop.is-over { border-color: var(--brand); background: var(--brand-tint); }

.p-drop input[type="file"] { position: absolute; inset: 0; opacity: 0; cursor: pointer; }

.p-drop__ico { width: 42px; height: 42px; border-radius: 12px; display: grid; place-items: center; background: var(--brand-tint); color: var(--brand); }

.p-drop__ico svg { width: 20px; height: 20px; }

.p-drop b { font-size: .92rem; }

.p-drop span { font-size: .78rem; color: var(--muted); }

.p-shots { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; margin-top: 14px; }

.p-shot {
    position: relative; aspect-ratio: 4 / 3; border-radius: 12px; overflow: hidden;
    border: 1px solid var(--line); background: var(--surface-2);
}

.p-shot img { width: 100%; height: 100%; object-fit: cover; }

.p-shot__tools {
    position: absolute; inset: auto 0 0 0; display: flex; gap: 4px; padding: 6px;
    background: linear-gradient(to top, rgba(0, 0, 0, .72), transparent);
    opacity: 0; transform: translateY(6px); transition: all .3s var(--ease-out);
}

.p-shot:hover .p-shot__tools { opacity: 1; transform: none; }

.p-shot__btn {
    flex: 1; padding: 5px; border-radius: 7px; background: rgba(255, 255, 255, .16);
    color: #fff; font-family: var(--font-mono); font-size: 9px; letter-spacing: .08em; text-transform: uppercase;
    backdrop-filter: blur(6px);
    transition: background .25s var(--ease);
}

.p-shot__btn:hover { background: var(--brand); color: var(--on-brand); }

.p-shot__flag {
    position: absolute; top: 7px; left: 7px;
    padding: 3px 8px; border-radius: 6px; background: var(--brand); color: var(--on-brand);
    font-family: var(--font-mono); font-size: 8.5px; font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}

.p-shot--pending { border-style: dashed; border-color: var(--brand-line); }

/* ---------- Toolbar / filters ---------------------------------------------- */

.p-toolbar { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

.p-search { position: relative; flex: 1; min-width: 200px; }

.p-search svg { position: absolute; left: 13px; top: 50%; translate: 0 -50%; width: 16px; height: 16px; color: var(--muted); }

.p-search input { padding-left: 38px; }

.p-tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--surface-2); border: 1px solid var(--line); }

.p-tab {
    padding: 7px 15px; border-radius: 999px; font-size: .84rem; font-weight: 500; color: var(--muted);
    transition: all .25s var(--ease); white-space: nowrap;
}

.p-tab:hover { color: var(--ink); }

.p-tab.is-on { background: var(--surface); color: var(--ink); font-weight: 600; box-shadow: var(--shadow-sm); }

/* ---------- Bulk bar --------------------------------------------------------- */

.p-bulk {
    position: sticky; bottom: 16px; z-index: 20;
    display: flex; flex-wrap: wrap; align-items: center; gap: 10px;
    margin: 14px var(--p-gap) 0;
    padding: 12px 16px; border-radius: 14px;
    background: var(--ink); color: var(--bg);
    box-shadow: var(--shadow-lg);
    transform: translateY(140%); opacity: 0; pointer-events: none;
    transition: all .45s var(--ease-out);
}

.p-bulk.is-on { transform: none; opacity: 1; pointer-events: auto; }

.p-bulk b { font-family: var(--font-mono); font-size: .82rem; }

.p-bulk select {
    padding: 8px 12px; border-radius: 9px; font-size: .85rem;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); color: inherit;
}

.p-bulk select option { color: #111; }

.p-check { width: 17px; height: 17px; accent-color: var(--brand); cursor: pointer; }

/* ---------- Empty state ------------------------------------------------------ */

.p-empty { text-align: center; padding: 60px 24px; }

.p-empty__ico {
    width: 62px; height: 62px; border-radius: 18px; margin: 0 auto 18px;
    display: grid; place-items: center; background: var(--surface-2); border: 1px solid var(--line); color: var(--muted);
}

.p-empty__ico svg { width: 26px; height: 26px; }

.p-empty h3 { font-family: var(--font-display); font-size: 1.1rem; margin-bottom: 6px; }

.p-empty p { color: var(--muted); font-size: .9rem; max-width: 40ch; margin: 0 auto 20px; }

/* ---------- Flash + alerts ---------------------------------------------------- */

.p-flash {
    display: flex; align-items: center; gap: 11px;
    padding: 13px 16px; border-radius: 13px;
    border: 1px solid rgba(22, 163, 74, .35); background: rgba(22, 163, 74, .12); color: #16a34a;
    font-size: .9rem; font-weight: 500;
    animation: revealUp .5s var(--ease-out) both;
}

.p-flash--bad { border-color: rgba(220, 38, 38, .35); background: rgba(220, 38, 38, .1); color: #ef4444; }

.p-flash svg { width: 18px; height: 18px; flex: none; }

.p-flash button { margin-left: auto; color: inherit; opacity: .6; }

.p-flash button:hover { opacity: 1; }

/* ---------- Pagination --------------------------------------------------------- */

/* ---------- Modal ---------------------------------------------------------------- */

.p-modal {
    position: fixed; inset: 0; z-index: 120;
    display: grid; place-items: center; padding: 20px;
    background: rgba(4, 4, 6, .6); backdrop-filter: blur(5px);
    opacity: 0; visibility: hidden; transition: opacity .3s var(--ease), visibility .3s;
}

.p-modal.is-on { opacity: 1; visibility: visible; }

.p-modal__box {
    width: min(420px, 100%); padding: 26px; border-radius: var(--radius);
    background: var(--surface); border: 1px solid var(--line); box-shadow: var(--shadow-lg);
    transform: scale(.94) translateY(10px); transition: transform .4s var(--ease-bump);
    text-align: center;
}

.p-modal.is-on .p-modal__box { transform: none; }

.p-modal__ico {
    width: 52px; height: 52px; border-radius: 16px; margin: 0 auto 16px; display: grid; place-items: center;
    background: rgba(220, 38, 38, .12); color: #ef4444;
}

.p-modal__ico svg { width: 24px; height: 24px; }

.p-modal h3 { font-family: var(--font-display); font-size: 1.15rem; margin-bottom: 8px; }

.p-modal p { color: var(--muted); font-size: .9rem; margin-bottom: 22px; }

.p-modal__row { display: flex; gap: 10px; }

.p-modal__row > * { flex: 1; }

.btn--danger { background: #dc2626; color: #fff; }

.btn--danger:hover { background: #b91c1c; }

/* ---------- Misc ------------------------------------------------------------------- */

.p-bar { height: 6px; border-radius: 999px; background: var(--surface-3); overflow: hidden; }

.p-bar i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--brand), var(--brand-2)); }

/* ==========================================================================
   Auth screens
   ========================================================================== */

.a-wrap { min-height: 100vh; display: grid; grid-template-columns: 1.05fr .95fr; }

@media (max-width: 940px) {
    .a-wrap { grid-template-columns: 1fr; }
    .a-side { display: none; }
}

.a-side {
    position: relative; overflow: hidden;
    padding: clamp(32px, 5vw, 56px);
    display: flex; flex-direction: column; justify-content: space-between;
    background: linear-gradient(160deg, var(--brand-deep), var(--brand) 46%, var(--brand-2));
    color: var(--on-brand);
}

.a-side::before {
    content: ''; position: absolute; inset: -40%;
    background: conic-gradient(from 0deg, transparent, rgba(255, 255, 255, .18), transparent 45%);
    animation: spin 18s linear infinite;
}

.a-side::after {
    content: ''; position: absolute; inset: 0;
    background-image:
        linear-gradient(to right, rgba(255, 255, 255, .10) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(255, 255, 255, .10) 1px, transparent 1px);
    background-size: 54px 54px;
    -webkit-mask-image: radial-gradient(90% 70% at 30% 30%, #000, transparent 72%);
    mask-image: radial-gradient(90% 70% at 30% 30%, #000, transparent 72%);
}

.a-side > * { position: relative; z-index: 1; }

.a-side h2 { font-family: var(--font-display); font-size: clamp(1.9rem, 3.4vw, 2.7rem); line-height: 1.08; letter-spacing: -.035em; }

.a-side p { max-width: 40ch; margin-top: 14px; opacity: .9; }

.a-art { margin: auto 0; display: grid; place-items: center; }

.a-art svg { width: min(300px, 72%); animation: floaty 7s var(--ease) infinite alternate; filter: drop-shadow(0 26px 34px rgba(0, 0, 0, .28)); }

.a-points { display: grid; gap: 12px; }

.a-point { display: flex; align-items: center; gap: 11px; font-size: .9rem; }

.a-point svg { width: 17px; height: 17px; flex: none; }

.a-form { display: grid; place-items: center; padding: clamp(28px, 5vw, 56px); background: var(--bg); }

.a-form__box { width: min(420px, 100%); display: grid; gap: 20px; }

.a-form__box h1 { font-family: var(--font-display); font-size: 1.7rem; letter-spacing: -.03em; }

.a-form__box > p { color: var(--muted); font-size: .92rem; margin-top: 6px; }

.a-form form { display: grid; gap: 16px; }

.a-alt { text-align: center; font-size: .88rem; color: var(--muted); }

.a-alt a { color: var(--brand); font-weight: 600; }

.a-demo { display: grid; gap: 8px; padding: 16px; border-radius: 14px; background: var(--surface-2); border: 1px dashed var(--line-strong); }

.a-demo b { font-family: var(--font-mono); font-size: 9.5px; letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.a-demo button {
    display: flex; align-items: center; gap: 10px; width: 100%; text-align: left;
    padding: 8px 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--surface);
    font-size: .84rem; transition: border-color .25s var(--ease), transform .25s var(--ease);
}

.a-demo button:hover { border-color: var(--brand); transform: translateX(3px); }

.a-demo button span { font-family: var(--font-mono); font-size: 10px; color: var(--muted); margin-left: auto; }

.a-demo button svg { width: 17px; height: 17px; flex: none; color: var(--brand); }

.a-demo button b { font-weight: 600; }

/* ==========================================================================
   Fulfilment, delivery zones and the richer category grid
   ========================================================================== */

/* ---------- COD pill in the top bar ---------- */

.codpill {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; border-radius: 999px;
    border: 1px solid var(--line); background: var(--surface-2);
    font-family: var(--font-mono); font-size: 10.5px; font-weight: 700;
    letter-spacing: .1em; text-transform: uppercase; color: var(--muted);
    transition: all .3s var(--ease);
}

.codpill i { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }

.codpill:hover { border-color: var(--brand-line); color: var(--ink); }

.codpill.is-on { background: rgba(22, 163, 74, .12); border-color: rgba(22, 163, 74, .35); color: #16a34a; }

/* ---------- Pipeline rail ---------- */

.pipe {
    display: grid; grid-auto-flow: column; grid-auto-columns: minmax(168px, 1fr);
    gap: 10px; overflow-x: auto; padding-bottom: 4px;
}

.pipe__step {
    display: flex; align-items: center; gap: 11px;
    padding: 13px 15px; border-radius: var(--radius-sm);
    border: 1px solid var(--line); background: var(--surface);
    transition: all .3s var(--ease);
}

.pipe__step:hover { border-color: var(--brand-line); transform: translateY(-2px); }

.pipe__step.is-on { border-color: var(--brand); background: var(--brand-tint); }

.pipe__ico {
    width: 34px; height: 34px; border-radius: 11px; flex: none; display: grid; place-items: center;
    background: var(--surface-2); color: var(--muted);
}

.pipe__step.is-on .pipe__ico { background: var(--brand); color: var(--on-brand); }

.pipe__step--bad.is-on { border-color: #ef4444; background: rgba(220, 38, 38, .1); }

.pipe__step--bad.is-on .pipe__ico { background: #ef4444; color: #fff; }

.pipe__ico svg { width: 16px; height: 16px; }

.pipe__body { min-width: 0; }

.pipe__body b { display: block; font-size: .82rem; font-weight: 600; line-height: 1.25; }

.pipe__body em { font-style: normal; font-family: var(--font-mono); font-size: 15px; font-weight: 700; color: var(--brand); }

/* ---------- Stage chips ---------- */

@keyframes pulseSoft {
    0%, 100% { opacity: 1; }
    50% { opacity: .35; }
}

/* ---------- Order tracker ---------- */

/* ---------- Activity feed ---------- */

.feed { display: grid; gap: 2px; }

.feed__item { position: relative; display: grid; grid-template-columns: 34px 1fr; gap: 13px; padding: 11px 0; }

.feed__item:not(:last-child)::before {
    content: ''; position: absolute; left: 17px; top: 42px; bottom: -6px; width: 2px; background: var(--line);
}

.feed__dot {
    width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center;
    background: var(--brand-tint); color: var(--brand); z-index: 1;
}

.feed__dot svg { width: 15px; height: 15px; }

.feed__item b { display: block; font-size: .9rem; font-weight: 600; }

.feed__item .mono { display: block; font-size: 10px; color: var(--muted); margin-top: 2px; }

.feed__item em { display: block; font-style: normal; font-size: .84rem; color: var(--ink-2); margin-top: 5px; }

/* ---------- Delivery map ---------- */

.mapwrap { position: relative; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--line); }

.mapwrap__canvas { height: clamp(280px, 42vh, 460px); width: 100%; background: var(--surface-2); }

/* No tiles: dim Google's grey error canvas so the circles stay readable. */

.mapwrap__canvas.is-tileless { filter: invert(.9) hue-rotate(180deg) saturate(.8) brightness(1.05); }

.mapwrap__canvas.is-picking { cursor: crosshair; outline: 3px solid var(--brand); outline-offset: -3px; }

.mapwrap__legend {
    position: absolute; left: 12px; bottom: 12px; display: flex; gap: 14px;
    padding: 8px 13px; border-radius: 999px;
    background: var(--scrim); backdrop-filter: blur(8px); border: 1px solid var(--line);
    font-family: var(--font-mono); font-size: 10px; letter-spacing: .06em; text-transform: uppercase; color: var(--ink-2);
}

.mapwrap__legend span { display: inline-flex; align-items: center; gap: 7px; }

.dot { width: 9px; height: 9px; border-radius: 50%; }

.dot--free { background: #16a34a; }

.dot--paid { background: var(--brand); }

.mapsearch { margin-bottom: 10px; }

/* ---------- Zone panels ---------- */

.zone { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); overflow: hidden; }

.zone[open] { border-color: var(--brand-line); }

.zone summary {
    display: flex; align-items: center; gap: 13px; padding: 14px 16px; cursor: pointer; list-style: none;
}

.zone summary::-webkit-details-marker { display: none; }

.zone__badge { width: 38px; height: 38px; border-radius: 12px; flex: none; display: grid; place-items: center; }

.zone__badge svg { width: 17px; height: 17px; }

.zone__badge--free { background: rgba(22, 163, 74, .14); color: #16a34a; }

.zone__badge--paid { background: var(--brand-tint); color: var(--brand); }

.zone__head { min-width: 0; flex: 1; }

.zone__head b { display: block; font-size: .95rem; font-weight: 600; }

.zone__head em { font-style: normal; font-family: var(--font-mono); font-size: 10.5px; color: var(--muted); }

.zone__flags { display: flex; align-items: center; gap: 7px; flex: none; }

.zone__flags svg { width: 16px; height: 16px; color: var(--muted); transition: transform .3s var(--ease); }

.zone[open] .zone__flags svg { transform: rotate(90deg); }

.zone__form { display: grid; gap: 16px; padding: 4px 16px 18px; border-top: 1px solid var(--line); }

.kindpick { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }

.kindpick__opt { cursor: pointer; }

.kindpick__opt input { position: absolute; opacity: 0; pointer-events: none; }

.kindpick__opt > span {
    display: block; padding: 11px 13px; border-radius: 12px;
    border: 1px solid var(--line); background: var(--surface-2);
    transition: all .25s var(--ease);
}

.kindpick__opt b { display: block; font-size: .88rem; font-weight: 600; }

.kindpick__opt em { font-style: normal; font-size: .76rem; color: var(--muted); }

.kindpick__opt input:checked + span { border-color: var(--brand); background: var(--brand-tint); }

@media (max-width: 560px) {
    .kindpick { grid-template-columns: 1fr; }
}

/* ---------- Category grid ---------- */

.catgrid { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }

.catcard {
    display: flex; flex-direction: column; overflow: hidden;
    border-radius: var(--radius); border: 1px solid var(--line); background: var(--surface);
    transition: border-color .3s var(--ease), transform .35s var(--ease-out), box-shadow .35s var(--ease);
}

.catcard:hover { border-color: var(--brand-line); transform: translateY(-3px); box-shadow: var(--shadow-lg); }

.catcard.is-off { opacity: .72; }

.catcard__media {
    position: relative; aspect-ratio: 16 / 9; display: grid; place-items: center; padding: 18px;
    background: radial-gradient(90% 80% at 50% 110%, var(--brand-tint), transparent 60%), var(--surface-2);
    border-bottom: 1px solid var(--line);
}

.catcard__media img { width: 100%; height: 100%; object-fit: cover; position: absolute; inset: 0; }

.catcard__media svg { width: 62%; max-height: 82%; }

.catcard__count {
    position: absolute; left: 12px; bottom: 12px; z-index: 1;
    padding: 5px 11px; border-radius: 999px;
    background: var(--scrim); backdrop-filter: blur(6px); border: 1px solid var(--line);
    font-family: var(--font-mono); font-size: 10px; color: var(--ink-2);
}

.catcard__off {
    position: absolute; right: 12px; top: 12px; z-index: 1;
    padding: 5px 11px; border-radius: 999px; background: #ef4444; color: #fff;
    font-family: var(--font-mono); font-size: 9.5px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
}

.catcard__body { display: grid; gap: 12px; padding: 16px; }

.catcard__foot { display: flex; align-items: center; gap: 8px; padding-top: 4px; }

.p-drop--sm { padding: 14px 12px; gap: 6px; }

.p-drop--sm .p-drop__ico { width: 34px; height: 34px; }

.p-drop--sm span { font-size: .78rem; }

.p-drop img[data-drop-preview] { max-height: 120px; border-radius: 10px; margin-top: 8px; }

/* ---------- Map fallback when the Google key is not authorised ---------- */

.mapfall {
    display: grid; gap: 8px; padding: 16px 18px; text-align: center;
    border: 1px solid var(--brand-line); background: var(--brand-tint);
    border-radius: var(--radius-sm); margin-bottom: 10px;
}

.mapfall__ico {
    width: 40px; height: 40px; border-radius: 12px; margin: 0 auto; display: grid; place-items: center;
    background: var(--brand-tint); color: var(--brand);
    font-family: var(--font-display); font-size: 1.2rem; font-weight: 700;
}

.mapfall b { font-size: .96rem; }

.mapfall p { font-size: .84rem; color: var(--muted); max-width: 62ch; margin: 0 auto; line-height: 1.65; }

.mapfall p b { color: var(--ink); font-weight: 600; }

.mapfall__frame { margin-top: 10px; border-radius: 12px; overflow: hidden; border: 1px solid var(--line); }

.mapfall__frame iframe { width: 100%; height: 240px; border: 0; display: block; filter: saturate(.9); }

.pipe__step.has-work { border-color: var(--brand-line); }

.pipe__step.has-work .pipe__ico { background: var(--brand-tint); color: var(--brand); }

/* ---------- GST block ---------- */
.taxblock { margin-top: 20px; padding-top: 20px; border-top: 1px solid var(--line); }
.taxblock__head { display: flex; align-items: center; gap: 14px; margin-bottom: 16px; }
.taxrow {
    display: flex; align-items: center; gap: 14px;
    padding: 11px 14px; border-radius: 13px;
    border: 1px solid var(--line); background: var(--surface-2);
    transition: border-color .25s var(--ease);
}
.taxrow:has(input[type="checkbox"]:checked) { border-color: var(--brand-line); background: var(--brand-tint); }
.taxrow .p-switch { flex: 1; }
.taxrow__rate { position: relative; flex: none; width: 96px; }
.taxrow__rate input { padding-right: 28px; text-align: right; }
.taxrow__rate em {
    position: absolute; right: 12px; top: 50%; translate: 0 -50%;
    font-style: normal; font-family: var(--font-mono); font-size: 12px; color: var(--muted);
}

/* ---------- Featured rail controls ---------- */
.railcell { display: flex; align-items: center; gap: 8px; }
.starbtn {
    width: 32px; height: 32px; border-radius: 10px; flex: none;
    display: grid; place-items: center;
    border: 1px solid var(--line); background: var(--surface-2); color: var(--muted);
    transition: all .25s var(--ease-bump);
}
.starbtn svg { width: 15px; height: 15px; fill: currentColor; }
.starbtn:hover { border-color: var(--brand-line); color: var(--brand); transform: translateY(-1px); }
.starbtn.is-on {
    background: linear-gradient(135deg, var(--brand), var(--brand-2));
    border-color: transparent; color: var(--on-brand);
    box-shadow: 0 6px 16px -6px var(--glow);
}
.orderbox { width: 60px; padding: 6px 8px; text-align: center; }

.railsave {
    display: flex; flex-wrap: wrap; align-items: center; gap: 14px;
    padding: 14px 18px; border-radius: var(--radius);
    border: 1px dashed var(--brand-line); background: var(--brand-tint);
}
.railsave span { display: flex; align-items: center; gap: 9px; flex: 1; min-width: 220px; font-size: .84rem; color: var(--ink-2); }
.railsave svg { width: 17px; height: 17px; color: var(--brand); flex: none; }
.railsave b { font-weight: 600; color: var(--ink); }

/* ---------- Illustration workshop (Catalogue → Illustrations) ---------- */
.p-code {
    font-family: var(--font-mono); font-size: .74rem; line-height: 1.55;
    resize: vertical; min-height: 96px; white-space: pre; overflow-wrap: normal; overflow-x: auto;
}

.p-svg { border-top: 1px dashed var(--line); padding-top: 10px; display: grid; gap: 8px; }

.p-svg summary {
    cursor: pointer; font-size: .8rem; color: var(--muted);
    font-family: var(--font-mono); letter-spacing: .03em;
}

.p-svg summary:hover { color: var(--brand); }

.p-artpreview {
    display: grid; place-items: center; gap: 6px; padding: 18px;
    border-radius: var(--radius); border: 1px dashed var(--line); background: var(--surface-2);
}

.p-artpreview svg { width: 100%; max-width: 220px; height: 110px; }

.p-artpreview .p-hint { font-family: var(--font-mono); font-size: .72rem; letter-spacing: .04em; }

/* ---------- Option builder (Catalogue → Products → Options) ---------- */
.p-presets { display: grid; gap: 10px; }

.p-presets__row {
    display: grid; grid-template-columns: 108px minmax(0, 1fr); gap: 12px; align-items: start;
}

.p-presets__label {
    font-family: var(--font-mono); font-size: 10px; letter-spacing: .1em; text-transform: uppercase;
    color: var(--muted); padding-top: 9px;
}

.p-presets__set { display: flex; flex-wrap: wrap; gap: 8px; }

.p-preset {
    display: inline-flex; align-items: center; gap: 8px;
    padding: 7px 12px 7px 9px; border-radius: 11px;
    border: 1px dashed var(--line-strong); background: var(--surface-2); color: var(--ink);
    text-align: left; transition: border-color .25s var(--ease), background .25s var(--ease), transform .25s var(--ease);
}

.p-preset:hover { border-color: var(--brand); border-style: solid; background: var(--brand-tint); transform: translateY(-1px); }
.p-preset svg { width: 14px; height: 14px; color: var(--brand); flex: none; }
.p-preset b { display: block; font-size: .82rem; font-weight: 600; }
.p-preset em { display: block; font-style: normal; font-size: .7rem; color: var(--muted); }

.p-opts { display: grid; gap: 12px; }

.p-opts__empty {
    padding: 20px; border-radius: var(--radius); border: 1px dashed var(--line);
    background: var(--surface-2); color: var(--muted); font-size: .84rem; text-align: center;
}

.p-opt {
    border: 1px solid var(--line); border-radius: var(--radius);
    background: var(--surface-2); overflow: hidden;
}

.p-opt.is-color { border-color: var(--brand-line); }

.p-opt__head {
    display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) auto auto;
    gap: 10px; align-items: center;
    padding: 12px; border-bottom: 1px solid var(--line); background: var(--surface);
}

@media (max-width: 760px) {
    .p-opt__head { grid-template-columns: minmax(0, 1fr) auto; }
    .p-opt__type { grid-column: 1 / -1; }
    .p-presets__row { grid-template-columns: 1fr; }
    .p-presets__label { padding-top: 0; }
}

.p-opt__name, .p-opt__type { min-width: 0; }

.p-opt__req {
    display: inline-flex; align-items: center; gap: 7px; flex: none;
    font-size: .78rem; color: var(--muted); cursor: pointer; white-space: nowrap;
}

.p-opt__x {
    width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center;
    border: 1px solid var(--line); background: var(--surface); color: var(--muted);
    transition: color .25s var(--ease), border-color .25s var(--ease);
}

.p-opt__x:hover { color: #e11d48; border-color: #e11d48; }
.p-opt__x svg { width: 15px; height: 15px; }

.p-opt__values { display: grid; gap: 8px; padding: 12px; }

.p-optval {
    display: grid; grid-template-columns: auto minmax(0, 1fr) 132px auto;
    gap: 8px; align-items: center;
}

.p-opt:not(.is-color) .p-optval { grid-template-columns: minmax(0, 1fr) 132px auto; }

@media (max-width: 620px) {
    .p-optval, .p-opt:not(.is-color) .p-optval { grid-template-columns: minmax(0, 1fr) auto; }
    .p-optval__delta { grid-column: 1 / -1; }
}

.p-color {
    width: 38px; height: 38px; flex: none; padding: 3px; cursor: pointer;
    border: 1px solid var(--line); border-radius: 10px; background: var(--surface);
}

.p-color::-webkit-color-swatch-wrapper { padding: 0; }
.p-color::-webkit-color-swatch { border: 0; border-radius: 7px; }
.p-color::-moz-color-swatch { border: 0; border-radius: 7px; }

.p-optval__delta {
    display: flex; align-items: center; gap: 6px;
    border: 1px solid var(--line); border-radius: 11px; background: var(--surface); padding-left: 10px;
}

.p-optval__delta > span { font-family: var(--font-mono); font-size: .78rem; color: var(--muted); }
.p-optval__delta .p-input { border: 0; background: transparent; padding-left: 0; }
.p-optval__delta:focus-within { border-color: var(--brand); }

.p-optval__x {
    width: 32px; height: 32px; flex: none; border-radius: 9px; display: grid; place-items: center;
    color: var(--muted); border: 1px solid transparent;
    transition: color .25s var(--ease), border-color .25s var(--ease);
}

.p-optval__x:hover { color: #e11d48; border-color: var(--line); }
.p-optval__x svg { width: 14px; height: 14px; }

.p-opt__foot {
    display: flex; flex-wrap: wrap; align-items: center; gap: 12px;
    padding: 0 12px 12px;
}

.p-opt__hint { flex: 1; min-width: 200px; margin: 0; }

/* A closed account, still listed so support can find it and hand it back. */
.p-chip--gone {
    margin-top: 5px; color: #ef4444;
    background: rgba(239, 68, 68, .1);
    border-color: rgba(239, 68, 68, .28);
}
