@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700;800&family=Outfit:wght@400;600;700;800&display=swap');

:root {
    /* Brand tokens (--primary, --primary-dark, --primary-glow, --bg, --bg-card,
       --border, --text, --text-muted, --radius-sm, --radius-md, --radius-lg,
       --duration-fast/med/slow, --ease, --tap-min/comfort/primary) are now
       provided by /prairieline.css which is linked before this file. Only
       portal-specific tokens live here. */

    /* Portal-specific form/input surfaces */
    --bg-input: rgba(255,255,255,0.06);
    --border-focus: rgba(76,175,80,0.6);
    --text-label: #aaa;

    /* Back-compat aliases for portal-only rule sites that haven't been
       migrated to the canonical --red / --amber names yet. */
    --danger:  var(--red);
    --warning: var(--amber);

    /* Legacy --radius alias — same value as canonical --radius-md. */
    --radius: var(--radius-md);

    /* Legacy --font alias — keep until rule sites migrate to --font-body. */
    --font: var(--font-body);
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    min-height: 100%;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    font-size: 15px;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* ── Layout ────────────────────────────── */

.portal-wrap {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    padding: 2rem 1rem 4rem;
}

/* Compact top-left link back to the storefront. Replaces the old centred
   logo + brand-name block — returning customers don't need the brand pushed
   at them; the form lands where the eye starts. */
.portal-back-link {
    position: absolute;
    top: 1rem;
    left: 1rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-decoration: none;
    font-weight: 500;
    padding: 0.4rem 0.6rem;
    border-radius: var(--radius-sm);
    transition: color var(--duration-fast) var(--ease),
                background var(--duration-fast) var(--ease);
    z-index: 10;
}
.portal-back-link:hover {
    color: var(--primary);
    background: var(--bg-card);
}

.portal-wrap.wide {
    max-width: 1200px;
    margin: 0 auto;
    padding: 2rem 2rem 4rem;
}

.portal-wrap.wide .portal-card {
    max-width: none;
}

.portal-card {
    width: 100%;
    max-width: 440px;
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: 2.25rem 2rem;
}

.portal-title {
    font-size: 1.5rem;
    font-weight: 700;
    margin-bottom: 0.35rem;
    color: #fff;
}

.portal-subtitle {
    font-size: 0.875rem;
    color: var(--text-muted);
    margin-bottom: 1.75rem;
    line-height: 1.5;
}

/* ── Forms ─────────────────────────────── */

.form-group {
    margin-bottom: 1rem;
}

.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
}

/* Variant that stacks on phones and only pairs at >=768px. Used where the
   columns would be too tight on a 375px viewport (e.g., email + phone). */
.form-row.form-row--mdup {
    grid-template-columns: 1fr;
}
@media (min-width: 768px) {
    .form-row.form-row--mdup {
        grid-template-columns: 1fr 1fr;
    }
}

label {
    display: block;
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-label);
    text-transform: uppercase;
    letter-spacing: 0.06em;
    margin-bottom: 0.4rem;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="date"],
input[type="tel"],
select,
textarea {
    width: 100%;
    background: var(--bg-input);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    color: var(--text);
    font-family: var(--font);
    font-size: 0.9rem;
    padding: 0.7rem 0.9rem;
    outline: none;
    transition: border-color 0.15s;
    -webkit-appearance: none;
}

input:focus, select:focus, textarea:focus {
    border-color: var(--border-focus);
    background: rgba(255,255,255,0.08);
}

input::placeholder { color: var(--text-muted); }

/* ── Buttons ────────────────────────────── */

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    width: 100%;
    padding: 0.8rem 1.5rem;
    border: none;
    border-radius: 14px;
    font-family: 'Outfit', sans-serif;
    font-size: 0.9rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
}

.btn:active { transform: scale(0.97); }
.btn:disabled { opacity: 0.4; cursor: not-allowed; transform: none; }

.btn-primary {
    background: var(--primary);
    color: #fff;
    box-shadow: 0 4px 12px var(--primary-glow);
}
.btn-primary:hover:not(:disabled) { 
    background: #5dbb61; 
    box-shadow: 0 6px 20px var(--primary-glow);
    transform: translateY(-1px);
}

.btn-secondary {
    background: var(--bg-input);
    color: var(--text);
    border: 1px solid var(--border);
}
.checkbox-container:hover input ~ .checkmark { background: rgba(255,255,255,0.1); }
.checkbox-container input:checked ~ .checkmark { background: var(--primary); border-color: var(--primary); }
.checkbox-container input:checked ~ .checkmark:after { display: block; }
.checkbox-container .checkmark:after {
    left: 6px; top: 2px; width: 5px; height: 10px;
    border: solid white; border-width: 0 2px 2px 0;
    transform: rotate(45deg);
}

/* Profile Photo Section */
.profile-photo-section {
    margin-bottom: 2rem;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border);
}

.photo-upload-container {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.current-photo {
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: rgba(255,255,255,0.05);
    border: 2px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    font-size: 2rem;
    color: var(--text-muted);
}

.current-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.photo-actions {
    flex: 1;
}

.photo-actions .hint {
    font-size: 0.8rem;
    color: var(--text-muted);
}

.btn-stack {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

.btn-secondary:hover:not(:disabled) { background: rgba(255,255,255,0.1); }

.btn-danger {
    background: rgba(239,83,80,0.15);
    color: var(--danger);
    border: 1px solid rgba(239,83,80,0.3);
}
.btn-danger:hover:not(:disabled) { background: rgba(239,83,80,0.25); }

.btn-sm {
    padding: 0.5rem 1rem;
    font-size: 0.8rem;
    width: auto;
}
.btn-stack {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 1.25rem;
}

/* ── Divider ────────────────────────────── */

.divider {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin: 1.25rem 0;
    color: var(--text-muted);
    font-size: 0.8rem;
}
.divider::before, .divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
}

/* ── Link ───────────────────────────────── */

.portal-link {
    display: block;
    text-align: center;
    color: var(--primary);
    font-size: 0.875rem;
    font-weight: 500;
    text-decoration: none;
    margin-top: 1rem;
    cursor: pointer;
}
.portal-link:hover { text-decoration: underline; }

/* ── Status pills ───────────────────────── */

.status-pill {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.8rem;
    border-radius: 999px;
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.06em;
    text-transform: uppercase;
}

.status-pill.verified {
    background: rgba(76,175,80,0.15);
    color: var(--primary);
    border: 1px solid rgba(76,175,80,0.3);
}
.status-pill.pending {
    background: rgba(255,179,0,0.12);
    color: var(--warning);
    border: 1px solid rgba(255,179,0,0.3);
}
.status-pill.rejected {
    background: rgba(239,83,80,0.12);
    color: var(--danger);
    border: 1px solid rgba(239,83,80,0.3);
}
.status-pill.unverified {
    background: rgba(255,255,255,0.06);
    color: var(--text-muted);
    border: 1px solid var(--border);
}

/* Order status pills (history list + order detail modal) */
.status-pill--pending {
    background: rgba(255,179,0,0.12);
    color: var(--warning);
    border: 1px solid rgba(255,179,0,0.3);
}
.status-pill--processing,
.status-pill--prepared {
    background: rgba(59,130,246,0.12);
    color: #60a5fa;
    border: 1px solid rgba(59,130,246,0.3);
}
.status-pill--completed {
    background: rgba(76,175,80,0.15);
    color: var(--primary);
    border: 1px solid rgba(76,175,80,0.3);
}
.status-pill--cancelled,
.status-pill--canceled {
    background: rgba(239,83,80,0.12);
    color: var(--danger);
    border: 1px solid rgba(239,83,80,0.3);
}

/* ── Alert banner ───────────────────────── */

.alert {
    padding: 0.85rem 1rem;
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    line-height: 1.5;
    margin-bottom: 1.25rem;
}
.alert-error   { background: rgba(239,83,80,0.12);  color: #ff8a80; border: 1px solid rgba(239,83,80,0.25); }
.alert-success { background: rgba(76,175,80,0.12);  color: #81c784; border: 1px solid rgba(76,175,80,0.25); }
.alert-info    { background: rgba(100,181,246,0.1); color: #90caf9; border: 1px solid rgba(100,181,246,0.2); }
.alert-warning { background: rgba(255,179,0,0.1);   color: var(--warning); border: 1px solid rgba(255,179,0,0.25); }

/* ── Upload zone ────────────────────────── */

.upload-zone {
    border: 2px dashed var(--border);
    border-radius: var(--radius);
    padding: 1.5rem 1rem;
    text-align: center;
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    position: relative;
}
.upload-zone:hover, .upload-zone.drag-over {
    border-color: var(--primary);
    background: var(--primary-glow);
}
.upload-zone input[type="file"] {
    position: absolute;
    inset: 0;
    opacity: 0;
    cursor: pointer;
    width: 100%;
    height: 100%;
}
.upload-zone-icon { font-size: 2rem; margin-bottom: 0.5rem; }
.upload-zone-label { font-size: 0.875rem; font-weight: 600; color: var(--text); margin-bottom: 0.25rem; }
.upload-zone-hint  { font-size: 0.75rem; color: var(--text-muted); }
.upload-zone.has-file { border-color: var(--primary); background: var(--primary-glow); }
.upload-zone.has-file .upload-zone-label { color: var(--primary); }

/* ── Dashboard tiles ────────────────────── */

.dash-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-bottom: 1.75rem;
}

.dash-avatar {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--primary-dark);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    flex-shrink: 0;
    overflow: hidden;
}
.dash-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.dash-name {
    font-size: 1.15rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.25rem;
}

.stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1.5rem;
}

.stat-tile {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 1rem;
}
.stat-tile-value {
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    line-height: 1;
    margin-bottom: 0.3rem;
}
.stat-tile-label {
    font-size: 0.7rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.section-heading {
    font-size: 0.7rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.75rem;
}

.info-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.875rem;
}
.info-row:last-child { border-bottom: none; }
.info-row-label { color: var(--text-muted); }
.info-row-value { color: var(--text); font-weight: 500; }

/* ── Pending view ───────────────────────── */

.big-icon {
    font-size: 3rem;
    text-align: center;
    margin-bottom: 1rem;
}

/* ── Spinner ────────────────────────────── */

.spinner {
    display: inline-block;
    width: 18px;
    height: 18px;
    border: 2px solid rgba(255,255,255,0.25);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    vertical-align: middle;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ── Checkbox ───────────────────────────── */

.check-row {
    display: flex;
    gap: 0.75rem;
    align-items: flex-start;
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.4;
    margin-top: 0.25rem;
}
.check-row input[type="checkbox"] {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 1px;
    accent-color: var(--primary);
    cursor: pointer;
}

/* ── Misc ───────────────────────────────── */

.text-center { text-align: center; }
.text-muted  { color: var(--text-muted); }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-1 { margin-bottom: 0.5rem; }
.hidden { display: none !important; }

.pipa-note {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    line-height: 1.5;
    margin-top: 1rem;
}

.view { display: none; }
.view.active { display: block; }

/* ── Modal ──────────────────────────────── */

.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.85);
    backdrop-filter: blur(8px);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    padding: 1.5rem;
}
.modal-overlay.active { display: flex; }

.modal-content {
    animation: modalSlide 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes modalSlide {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* On small phones the product-detail + cart modals anchor to the bottom
   edge — override the animation to slide up from below. */
@media (max-width: 480px) {
    #modal-product-detail .modal-content,
    #modal-cart .modal-content {
        animation: modalSlideUp 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    }
}
@keyframes modalSlideUp {
    from { opacity: 0.6; transform: translateY(60px); }
    to   { opacity: 1;   transform: translateY(0); }
}


/* ── Danger Zone ────────────────────────── */

.btn-danger-ghost {
    background: transparent;
    color: var(--danger);
    border: 1px solid rgba(239,83,80,0.3);
    padding: 0.6rem 1rem;
    font-size: 0.75rem;
    margin-top: 0.5rem;
    width: auto;
}
.btn-danger-ghost:hover {
    background: rgba(239,83,80,0.1);
    border-color: var(--danger);
}

.error-text {
    color: var(--danger);
    font-size: 0.8rem;
    margin-top: 0.25rem;
}

/* ── Profile Adjustments ────────────────── */

#profile-verification-section {
    padding: 1rem;
    background: rgba(255,255,255,0.03);
    border: 1px solid var(--border);
    border-radius: var(--radius-sm);
    margin: 1.5rem 0;
}

/* ── Shop View ──────────────────────────── */

#view-shop {
    width: 100%;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.shop-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    gap: 1rem;
}

.shop-header-title h1 {
    font-size: 1.75rem;
    font-weight: 800;
    color: #fff;
    margin-bottom: 0.2rem;
}

.shop-header-title p {
    font-size: 0.9rem;
    color: var(--primary);
    font-weight: 600;
}

.gram-limit-pill {
    background: rgba(255,255,255,0.04);
    border: 1px solid var(--border);
    padding: 0.75rem 1.25rem;
    border-radius: var(--radius);
    text-align: right;
    min-width: 140px;
}

.gl-label {
    display: block;
    font-size: 0.65rem;
    font-weight: 700;
    text-transform: uppercase;
    color: var(--text-muted);
    margin-bottom: 0.25rem;
}

.gl-value {
    font-size: 1.1rem;
    font-weight: 800;
    color: #fff;
}

.gl-progress {
    height: 4px;
    background: rgba(255,255,255,0.1);
    border-radius: 2px;
    margin-top: 0.5rem;
    overflow: hidden;
}

.gl-progress-bar {
    height: 100%;
    background: var(--primary);
    transition: width 0.3s ease, background 0.3s ease;
}

.gl-progress-bar.warning { background: var(--warning); }
.gl-progress-bar.danger  { background: var(--danger); }

.shop-controls {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-bottom: 2rem;
    padding: 1rem;
    background: rgba(255,255,255,0.02);
    border-radius: 20px;
    border: 1px solid var(--border);
}

.shop-search {
    position: relative;
    width: 100%;
}

.shop-search i {
    position: absolute;
    left: 1.1rem;
    top: 50%;
    transform: translateY(-50%);
    color: var(--primary);
    font-size: 1rem;
}

.shop-search input {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    padding: 0.8rem 1.1rem 0.8rem 3rem;
    border-radius: 16px;
    font-size: 0.95rem;
    color: #fff;
    transition: all 0.2s ease;
}

.shop-search input:focus {
    background: rgba(255, 255, 255, 0.08);
    border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.filter-pill-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}

.filter-pill-label {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--text-muted);
    padding-left: 0.25rem;
}

.filter-pills {
    display: flex;
    gap: 0.6rem;
    overflow-x: auto;
    padding-bottom: 0.5rem;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Hide scrollbar for clean look */
}

.filter-pills::-webkit-scrollbar { display: none; }

.filter-pill {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: var(--text-muted);
    padding: 0.5rem 1.1rem;
    border-radius: 100px;
    font-size: 0.8rem;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.filter-pill:hover {
    background: rgba(255, 255, 255, 0.08);
    color: #fff;
    border-color: rgba(255, 255, 255, 0.15);
}

.filter-pill.active {
    background: var(--primary);
    color: #fff;
    border-color: var(--primary);
    box-shadow: 0 4px 12px var(--primary-glow);
    transform: translateY(-1px);
}

/* ──────────────────────────────────────────────────────────────────
   Persistent cart pill — fixed top-right of viewport across all views.
   Hidden when cart is empty; tapping opens the cart modal.
   ────────────────────────────────────────────────────────────────── */
.cart-pill {
    position: fixed;
    top: 0.9rem;
    right: 0.9rem;
    z-index: 200;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    padding: 0.55rem 0.95rem 0.55rem 0.7rem;
    background: rgba(76, 175, 80, 0.95);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.18);
    border-radius: 30px;
    font-weight: 700;
    font-size: 0.9rem;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 0 0 rgba(76, 175, 80, 0.4);
    transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.25s ease, background 0.2s ease;
}
.cart-pill[hidden] { display: none; }
.cart-pill:hover {
    transform: translateY(-2px) scale(1.04);
    background: rgba(86, 195, 90, 1);
    box-shadow: 0 12px 28px rgba(0,0,0,0.5), 0 0 24px rgba(76, 175, 80, 0.5);
}
.cart-pill:active { transform: scale(0.96); }

.cart-pill-icon { font-size: 1rem; }

.cart-pill-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 1.4rem;
    height: 1.4rem;
    padding: 0 0.4rem;
    background: rgba(0,0,0,0.35);
    border-radius: 999px;
    font-size: 0.78rem;
    font-weight: 800;
}

.cart-pill-total {
    font-family: 'Outfit', sans-serif;
    font-weight: 800;
}

/* Pulse animation triggered when an item is added. */
.cart-pill.is-bumping {
    animation: cartPillBump 480ms cubic-bezier(0.18, 1.5, 0.3, 1) 1;
}
@keyframes cartPillBump {
    0%   { transform: scale(1); box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 0 0 rgba(76, 175, 80, 0.7); }
    35%  { transform: scale(1.18); box-shadow: 0 14px 32px rgba(0,0,0,0.5), 0 0 32px 6px rgba(76, 175, 80, 0.7); }
    100% { transform: scale(1); box-shadow: 0 8px 24px rgba(0,0,0,0.45), 0 0 0 0 rgba(76, 175, 80, 0); }
}

/* ──────────────────────────────────────────────────────────────────
   Cart drawer modal — opened by tapping .cart-pill.
   Reuses .modal-overlay + .modal-content from the product-detail modal.
   ────────────────────────────────────────────────────────────────── */
.cart-modal { display: flex; flex-direction: column; max-height: 88vh; }

.cart-modal-header {
    padding: 1.25rem 1.4rem 0.85rem;
    border-bottom: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}
.cart-modal-header h2 {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.55rem;
}
.cart-modal-header h2 i { color: var(--primary); }

.cart-modal-gramline { display: flex; flex-direction: column; gap: 0.3rem; }
.cart-modal-gramlabel {
    font-size: 0.72rem;
    font-weight: 700;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.cart-modal-gramtrack {
    height: 6px;
    background: rgba(255,255,255,0.08);
    border-radius: 3px;
    overflow: hidden;
}
.cart-modal-gramfill {
    height: 100%;
    background: var(--primary);
    border-radius: 3px;
    transition: width 0.3s ease, background 0.2s ease;
}
.cart-modal-gramfill.warning { background: #f6b93b; }
.cart-modal-gramfill.danger  { background: #ef5350; }

.cart-items-list {
    flex: 1;
    overflow-y: auto;
    padding: 0.6rem 1.4rem;
    min-height: 80px;
    max-height: 50vh;
}
.cart-items-empty {
    text-align: center;
    padding: 2.5rem 1rem;
    color: var(--text-muted);
    font-size: 0.9rem;
}

.cart-item {
    display: grid;
    grid-template-columns: 48px 1fr auto;
    gap: 0.75rem;
    padding: 0.7rem 0;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    align-items: center;
}
.cart-item:last-child { border-bottom: none; }
.cart-item-img {
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    overflow: hidden;
}
.cart-item-img img { width: 100%; height: 100%; object-fit: cover; }
.cart-item-body { min-width: 0; }
.cart-item-name {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.2rem;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.cart-item-meta {
    font-size: 0.7rem;
    color: var(--text-muted);
    display: flex;
    gap: 0.5rem;
}
.cart-item-meta b { color: #fff; font-weight: 700; }
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 0.4rem;
}
.cart-item-price {
    font-size: 0.95rem;
    font-weight: 800;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}
.cart-item-remove {
    width: 30px;
    height: 30px;
    border-radius: 8px;
    background: rgba(239, 83, 80, 0.12);
    color: #ef5350;
    border: 1px solid rgba(239, 83, 80, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s ease;
    font-size: 0.78rem;
}
.cart-item-remove:hover { background: rgba(239, 83, 80, 0.25); }

/* ── Quantity Control Buttons ─────────────────── */
.qty-display {
    font-size: 1.2rem;
    font-weight: 800;
    color: #fff;
    min-width: 24px;
    text-align: center;
    font-family: 'Outfit', sans-serif;
}

.qty-minus,
.qty-plus {
    width: 36px;
    height: 36px;
    border-radius: 8px;
    background: rgba(255,255,255,0.1);
    color: #fff;
    border: 1px solid rgba(255,255,255,0.15);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 1.3rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.2s ease;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
}

.qty-minus:hover,
.qty-plus:hover {
    background: rgba(255,255,255,0.18);
    border-color: rgba(255,255,255,0.25);
}

.qty-plus:active,
.qty-minus:active {
    transform: scale(0.95);
}

/* Small screens: compact layout */
@media (max-width: 480px) {
    .qty-display { font-size: 1rem; min-width: 20px; }
    .qty-minus, .qty-plus { width: 30px; height: 30px; font-size: 1.1rem; }
}

/* Focus states for accessibility */
.qty-minus:focus,
.qty-plus:focus,
.cart-item-remove:focus {
    outline: 2px solid var(--primary);
    outline-offset: 2px;
}

.cart-modal-footer {
    padding: 1rem 1.4rem 1.25rem;
    border-top: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.cart-modal-total-row {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    color: var(--text-muted);
    font-size: 0.85rem;
    font-weight: 600;
}
.cart-modal-total-row strong {
    color: #fff;
    font-family: 'Outfit', sans-serif;
    font-size: 1.4rem;
    font-weight: 800;
}
.cart-modal-reserve {
    width: 100%;
    padding: 0.85rem;
    font-size: 0.95rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
.cart-modal-reserve:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* Smaller screens: pill stays in same corner but slightly compacter. */
@media (max-width: 480px) {
    .cart-pill {
        top: 0.7rem;
        right: 0.7rem;
        padding: 0.45rem 0.8rem 0.45rem 0.6rem;
        font-size: 0.82rem;
    }
    .cart-pill-count { min-width: 1.25rem; height: 1.25rem; font-size: 0.72rem; }
}

@media (max-width: 768px) {
    .shop-header { flex-direction: column; align-items: flex-start; }
    .gram-limit-pill { width: 100%; text-align: left; }
    /* Single column on phones. Bottom padding clears the radial hubs (~56px + bottom 1.25rem). */
    .shop-products-grid { grid-template-columns: 1fr; gap: 0.5rem; padding-bottom: 6.5rem; }
}

.shop-location-picker {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    color: var(--primary);
    font-size: 0.9rem;
    font-weight: 600;
}

.shop-location-picker select {
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    padding: 0;
    cursor: pointer;
    text-decoration: underline;
}

.shop-location-picker select:focus {
    background: transparent;
}

/* ── Themed Status Cards ────────────────── */
.themed-status-card {
    padding: 1.5rem;
    border-radius: 18px;
    position: relative;
    overflow: hidden;
    margin-bottom: 1.5rem;
    transition: all 0.3s ease;
    border-left: 6px solid var(--primary);
}

.status-icon-circle {
    width: 50px;
    height: 50px;
    background: rgba(255,255,255,0.06);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin-right: 1.25rem;
    flex-shrink: 0;
}

.status-subtitle {
    font-size: 0.65rem;
    text-transform: uppercase;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--text-muted);
}

.status-title {
    font-size: 1.2rem;
    font-weight: 800;
    font-family: 'Outfit', sans-serif;
    color: #fff;
    margin-top: 0.1rem;
}

.status-desc {
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-top: 0.2rem;
    line-height: 1.4;
}

.status-pending { border-left-color: #8bc34a; }
.status-processing { border-left-color: #3b82f6; }
.status-prepared { 
    border-left-color: var(--primary); 
    background: linear-gradient(135deg, rgba(76,175,80,0.1), rgba(76,175,80,0.02));
}

.prepared-badge {
    margin-top: 1.25rem;
    padding: 0.6rem;
    background: var(--primary);
    color: #fff;
    text-align: center;
    border-radius: 10px;
    font-size: 0.8rem;
    font-weight: 800;
    letter-spacing: 0.05em;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.02); }
    100% { transform: scale(1); }
}

.bg-glass {
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
/* ── Status Card Theming ── */
.themed-status-card {
    padding: 1.25rem;
    border-radius: 16px;
    margin-bottom: 1.5rem;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.03);
    position: relative;
    overflow: hidden;
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.themed-status-card::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; height: 3px;
}

.status-pending::before   { background: var(--warning); }
.status-processing::before { background: var(--primary); }
.status-prepared::before   { background: #2196f3; }

.status-icon-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.05);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
}

.status-content { flex: 1; }
.status-subtitle { font-size: 0.6rem; text-transform: uppercase; font-weight: 800; letter-spacing: 0.1em; color: var(--text-muted); }
.status-title { font-size: 1.15rem; font-weight: 800; color: #fff; margin: 0.1rem 0; }
.status-desc { font-size: 0.8rem; color: var(--text-muted); line-height: 1.4; }

.prepared-badge {
    margin-top: 0.75rem;
    padding: 0.6rem;
    background: rgba(33, 150, 243, 0.12);
    border: 1px solid rgba(33, 150, 243, 0.25);
    color: #90caf9;
    border-radius: 10px;
    font-weight: 700;
    font-size: 0.8rem;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
}
/* ── Shop Navigation Overhaul ── */
.shop-nav {
    width: 100%;
    display: grid;
    grid-template-columns: 44px 1fr 180px;
    align-items: center;
    gap: 1.5rem;
    margin-bottom: 2rem;
    background: rgba(255, 255, 255, 0.02);
    border: 1px solid var(--border);
    padding: 1rem 1.5rem;
    border-radius: 20px;
    backdrop-filter: blur(10px);
}

.shop-nav-center {
    text-align: center;
}

.shop-title {
    font-size: 1.5rem;
    font-weight: 800;
    letter-spacing: -0.02em;
    color: #fff;
    margin: 0;
}

.shop-location-badge {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-top: 0.25rem;
    padding: 0.2rem 0.75rem;
    background: rgba(76, 175, 80, 0.1);
    border: 1px solid rgba(76, 175, 80, 0.2);
    border-radius: 100px;
    font-size: 0.75rem;
    color: var(--primary);
    font-weight: 700;
}

.shop-location-badge select {
    background: transparent;
    border: none;
    color: inherit;
    font: inherit;
    padding: 0;
    cursor: pointer;
    outline: none;
}

.gram-limit-card {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    padding: 0.6rem 0.8rem;
    border-radius: 14px;
}

.gl-info {
    display: flex;
    justify-content: space-between;
    font-size: 0.65rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    margin-bottom: 0.4rem;
}

.gl-label { color: var(--text-muted); }
.gl-value { color: var(--primary); }

.gl-progress-track {
    height: 4px;
    background: rgba(255, 255, 255, 0.08);
    border-radius: 2px;
    overflow: hidden;
}

.gl-progress-fill {
    height: 100%;
    background: linear-gradient(90deg, var(--primary), #81c784);
    box-shadow: 0 0 10px var(--primary-glow);
    transition: width 0.3s ease;
}

/* ── Product Grid ── */
.shop-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
    gap: 1.25rem;
    margin-bottom: 3rem;
}

.product-card {
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid var(--border);
    border-radius: 18px;
    padding: 1.25rem;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    position: relative;
    overflow: hidden;
}

.pc-img {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    width: 52px;
    height: 52px;
    border-radius: 10px;
    overflow: hidden;
    background: rgba(255,255,255,0.06);
    border: 1px solid rgba(255,255,255,0.08);
    flex-shrink: 0;
}

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

.pc-visit-store {
    font-size: 0.7rem;
    font-weight: 600;
    color: var(--text-muted);
    font-style: italic;
    text-align: right;
}

.product-card:hover {
    background: rgba(255, 255, 255, 0.06);
    border-color: rgba(76, 175, 80, 0.3);
    transform: translateY(-4px);
    box-shadow: 0 12px 24px rgba(0,0,0,0.3);
}

.pc-tag {
    font-size: 0.6rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--primary);
    background: rgba(76, 175, 80, 0.12);
    padding: 0.25rem 0.6rem;
    border-radius: 6px;
    width: fit-content;
    max-width: calc(100% - 68px);
}

.pc-name {
    font-size: 1.05rem;
    font-weight: 700;
    color: #fff;
    line-height: 1.2;
    height: 2.4em;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    padding-right: 64px;
}

.pc-brand {
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--text-muted);
}

.pc-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.5rem;
    background: rgba(255, 255, 255, 0.03);
    padding: 0.75rem;
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.pc-stat {
    display: flex;
    flex-direction: column;
    gap: 0.15rem;
}

.pc-stat-label {
    font-size: 0.55rem;
    font-weight: 800;
    text-transform: uppercase;
    color: var(--text-label);
    letter-spacing: 0.05em;
}

.pc-stat-value {
    font-size: 0.8rem;
    font-weight: 700;
    color: #eee;
}

.pc-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 0.5rem;
}

.pc-price {
    font-size: 1.25rem;
    font-weight: 800;
    color: #fff;
    font-family: 'Outfit', sans-serif;
}

.add-to-cart {
    width: 38px;
    height: 38px;
    background: var(--primary);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
    transition: all 0.2s ease;
    box-shadow: 0 4px 12px var(--primary-glow);
}

.add-to-cart:hover {
    transform: scale(1.1);
    background: var(--primary-dark);
}

.btn-danger {
    width: 38px;
    height: 38px;
    background: var(--danger);
    color: #fff;
    border-radius: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.9rem;
    box-shadow: 0 4px 12px rgba(239, 83, 80, 0.2);
}

@media (max-width: 768px) {
    /* Tighten the whole shop view on phones so cards get more vertical real estate. */
    .portal-wrap.wide { padding: 1rem 0.75rem 4rem; }
    .shop-nav {
        grid-template-columns: 40px 1fr;
        padding: 0.55rem 0.7rem;
        margin-bottom: 0.75rem;
        gap: 0.5rem;
        border-radius: 14px;
    }
    .shop-nav-right { display: none; }
    .shop-title { font-size: 1.05rem; }
    .shop-location-badge { font-size: 0.65rem; padding: 0.15rem 0.55rem; }
    .shop-controls {
        gap: 0.65rem;
        padding: 0.65rem;
        margin-bottom: 0.75rem;
        border-radius: 14px;
    }
    .shop-search input { padding: 0.65rem 1rem 0.65rem 2.6rem; font-size: 0.9rem; border-radius: 12px; }
    .shop-search i { left: 0.95rem; font-size: 0.9rem; }
    .active-filter-bar { padding: 0.4rem 0.6rem; margin-bottom: 0.6rem; }
}

/* ── History List ────────────────────────── */
.history-list {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
}
.history-item {
    background: var(--bg-card);
    border: 1px solid var(--border);
    border-radius: var(--radius-md);
    padding: 0.85rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    cursor: pointer;
    transition: all var(--duration-fast) var(--ease);
}
.history-item:hover {
    background: var(--bg-card-hover);
    border-color: var(--primary);
    transform: translateX(4px);
}
.history-icon {
    width: 38px;
    height: 38px;
    border-radius: 8px;
    background: rgba(255,255,255,0.06);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
}
.history-title {
    font-size: 0.88rem;
    font-weight: 700;
    color: #fff;
    margin-bottom: 0.15rem;
}
.history-date {
    font-size: 0.75rem;
    color: var(--text-muted);
}
.history-total {
    font-weight: 800;
    font-size: 0.95rem;
    color: var(--primary);
    font-family: 'Outfit', sans-serif;
}
.history-chevron {
    font-size: 0.75rem;
    color: var(--text-muted);
    opacity: 0.5;
}

/* ── Order Detail Modal ──────────────────── */
.modal-header-glass {
    background: rgba(255,255,255,0.03);
    backdrop-filter: blur(10px);
}
#btn-download-receipt {
    padding: 1rem;
    font-size: 0.8rem;
    letter-spacing: 0.08em;
}

@keyframes slideInUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}
.modal-content.active {
    animation: slideInUp 0.3s ease-out;
}

/* ──────────────────────────────────────────────────────────────────
   Radial Menu — Step 6: Hubs, arcs, geometry, spring transitions
   ────────────────────────────────────────────────────────────────── */

/* Backdrop dims and blurs the shop view when any hub is open. */
.radial-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    z-index: 90;
    opacity: 0;
    pointer-events: none;
    transition: opacity 180ms ease;
}
.radial-backdrop:not([hidden]) {
    opacity: 1;
    pointer-events: auto;
}

/* Three hubs anchor the bottom of the shop view (the bottom cart-bar was removed
   in the cart UI overhaul — the cart now lives as a top-right pill instead). */
.radial-hubs {
    position: fixed;
    bottom: 1.25rem;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% - 2rem);
    max-width: 380px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    z-index: 110;
    pointer-events: none; /* let kids opt-in so taps pass through gaps */
}

.radial-hub {
    pointer-events: auto;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1.5px solid rgba(76, 175, 80, 0.5);
    background: rgba(18, 22, 28, 0.85);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    color: var(--text);
    font-size: 1.25rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.35), 0 0 12px rgba(76, 175, 80, 0.15);
    transition: transform 220ms cubic-bezier(0.34, 1.56, 0.64, 1),
                background 200ms ease,
                box-shadow 220ms ease,
                border-color 200ms ease;
    position: relative;
}
.radial-hub:hover  { transform: translateY(-2px); }
.radial-hub:active { transform: translateY(0) scale(0.95); }
.radial-hub.is-active {
    background: var(--primary);
    border-color: rgba(255, 255, 255, 0.55);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.45), 0 0 28px rgba(76, 175, 80, 0.55);
}

/* (Search hub became a brand wheel; no icon swap on the brand hub.) */
.radial-hub .hub-icon-active { display: none; }

/* Filter hub badge — count of active filters. */
.hub-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    min-width: 20px;
    height: 20px;
    padding: 0 6px;
    border-radius: 10px;
    background: var(--primary);
    color: #fff;
    font-size: 0.7rem;
    font-weight: 800;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    pointer-events: none;
}

/* Each arc is an invisible anchor point. When OPEN it expands into a
   circular hit zone around the hub so drag gestures aren't lost into
   page-scroll behind, and so taps between items are still tracked.
   touch-action: none is the canonical way to claim touches from the
   browser (no scroll/zoom interception). */
.radial-arc {
    position: fixed;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 105;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}
.radial-arc.is-open {
    width: 360px;
    height: 360px;
    margin-left: -180px;
    margin-bottom: -180px;
    pointer-events: auto;
    border-radius: 50%;
}
@media (min-width: 769px) {
    .radial-arc.is-open {
        width: 460px;
        height: 460px;
        margin-left: -230px;
        margin-bottom: -230px;
    }
}
/* Items inherit touch-action; explicit for safety. */
.wheel-item { touch-action: none; }

/* Anchors line up with the centre of each hub.
   Hubs span (max-width 380px - 56px hub) split three ways across that width. */
#arc-brand,
#arc-terpene,
#arc-filter {
    bottom: calc(5.5rem + 28px); /* hub centre at 5.5rem + 28px (half hub) */
}
#arc-terpene { left: 50%; }
#arc-brand   { left: max(calc(50% - 190px + 28px), calc(1rem + 28px)); }
#arc-filter  { left: min(calc(50% + 190px - 28px), calc(100% - 1rem - 28px)); }

/* ── Arc Items ────────────────────────────────────────────────────── */

/* Wheel item — JS writes --wheel-angle, --wheel-radius, --wheel-scale,
   --wheel-opacity per item per render. Drag updates each frame; CSS only
   transitions the colour/box-shadow side of things, not transform. */
.wheel-item {
    position: absolute;
    top: 50%;
    left: 50%;
    transform:
        translate(-50%, -50%)
        translate(calc(cos(var(--wheel-angle, 0deg)) * var(--wheel-radius, 110px)),
                  calc(sin(var(--wheel-angle, 0deg)) * var(--wheel-radius, 110px)))
        scale(var(--wheel-scale, 1));
    opacity: var(--wheel-opacity, 1);
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 1.5px solid rgba(255, 255, 255, 0.18);
    background: rgba(18, 22, 28, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: var(--text);
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    user-select: none;
    line-height: 1;
    pointer-events: auto;
    transition: background 200ms ease, border-color 200ms ease, box-shadow 300ms ease;
    /* No transform/opacity transition: JS drives them at 60fps during drag. */
}

/* Closed arc: items hidden entirely (drag is disabled when arc is closed). */
.radial-arc:not(.is-open) .wheel-item {
    opacity: 0;
    pointer-events: none;
    transition: opacity 150ms ease;
}

/* Items beyond the visible window get JS-set --wheel-opacity:0 plus this class. */
.wheel-item.wheel-hidden { pointer-events: none; }

/* Focus item — magnification handled via --wheel-scale; this just elevates and pops. */
.wheel-item.wheel-focus {
    z-index: 5;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5),
                0 0 18px rgba(76, 175, 80, 0.25);
}

.wheel-item.is-active {
    border-color: var(--primary);
    box-shadow: 0 4px 16px rgba(76, 175, 80, 0.45);
    background: rgba(76, 175, 80, 0.18);
}

/* Brand items are pill-shaped (wider than tall) so the brand name fits readably. */
.wheel-brand-item {
    width: auto !important;
    min-width: 78px;
    height: 40px;
    border-radius: 20px;
    padding: 0 0.7rem;
    flex-direction: row;
    gap: 0.4rem;
}
.wheel-brand-item .wheel-item-label {
    font-size: 0.68rem;
    font-weight: 700;
    line-height: 1;
    max-width: 64px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}
.wheel-brand-item .wheel-item-count {
    font-size: 0.6rem;
    color: var(--text-muted);
    font-weight: 700;
    background: rgba(255, 255, 255, 0.06);
    padding: 0.1rem 0.4rem;
    border-radius: 10px;
}
.wheel-brand-item.is-active .wheel-item-count {
    background: rgba(76, 175, 80, 0.3);
    color: #fff;
}

/* Empty-state placeholder when no brand data yet. */
.wheel-empty {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, calc(-100% - 24px));
    color: var(--text-muted);
    font-size: 0.75rem;
    font-style: italic;
    white-space: nowrap;
}

.filter-chip-brand {
    border-color: var(--primary);
}
.filter-chip-brand i { color: var(--primary); }

/* The wheel-track is the inner DOM container for the filter wheel.
   It has no layout role of its own; items position absolutely against the arc. */
.wheel-track {
    position: absolute;
    inset: 0;
    pointer-events: none;
}
.wheel-track > .wheel-item { pointer-events: auto; }

/* Category icon + label (stacked inside the small circle). */
.wheel-cat-item i { font-size: 1.1rem; color: var(--primary); }
.wheel-cat-item .wheel-item-label {
    font-size: 0.55rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.04em;
    margin-top: 2px;
    max-width: 56px;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}
.wheel-cat-item.is-active i             { color: #fff; }
.wheel-cat-item.is-active .wheel-item-label { color: var(--text); }

/* Strain item sits a touch larger; label centred. */
.wheel-strain-item .wheel-item-label {
    font-size: 0.65rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: var(--text);
}
.wheel-strain-item .wheel-item-count {
    position: absolute;
    top: -6px;
    right: -6px;
    background: var(--primary);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 5px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.35);
}

/* Terpene item — small dot of its terpene colour + tiny label below. */
.wheel-terpene-item .wheel-item-dot {
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: var(--terpene-color, var(--primary));
    box-shadow: 0 0 10px var(--terpene-color, var(--primary));
}
.wheel-terpene-item .wheel-item-label {
    font-size: 0.5rem;
    font-weight: 700;
    color: var(--text-muted);
    letter-spacing: 0.05em;
    margin-top: 2px;
    text-transform: uppercase;
}

/* ── Search Bubble ────────────────────────────────────────────────── */

.arc-search-bubble {
    position: absolute;
    top: 0;
    left: 0;
    transform: translate(-50%, calc(-100% - 16px)) scale(0.85);
    background: rgba(18, 22, 28, 0.95);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(76, 175, 80, 0.45);
    border-radius: 28px;
    padding: 0.5rem 0.75rem 0.5rem 1rem;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 240px;
    opacity: 0;
    pointer-events: none;
    transition: opacity 200ms ease, transform 280ms cubic-bezier(0.34, 1.56, 0.64, 1);
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
}
#arc-search.is-open .arc-search-bubble {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, calc(-100% - 24px)) scale(1);
}
.arc-search-bubble i { color: var(--primary); font-size: 0.9rem; }
#arc-search-input {
    background: transparent;
    border: none;
    color: var(--text);
    font: inherit;
    flex: 1;
    min-width: 0;
    outline: none;
}
.arc-search-clear {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.25rem;
    font-size: 0.85rem;
}
.arc-search-clear:hover { color: var(--danger); }

/* Recent search pills fan to the upper-right. */
.arc-recent {
    position: absolute;
    top: 0;
    left: 0;
    width: 0;
    height: 0;
}
.arc-recent-item {
    position: absolute;
    top: 0;
    left: 0;
    /* From bottom-left hub: shallow upper-RIGHT fan.
       CSS y is positive-down, so upper-right = angles -10°→-70° (i.e. 350°→290°). */
    --angle: calc(-10deg - var(--i, 0) * 15deg);
    --arc-r: 130px;
    transform: translate(-50%, -50%) scale(0.4);
    opacity: 0;
    pointer-events: none;
    transition: transform 320ms cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 220ms ease;
    background: rgba(18, 22, 28, 0.9);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(76, 175, 80, 0.3);
    border-radius: 16px;
    padding: 0.4rem 0.85rem;
    color: var(--text);
    font-size: 0.72rem;
    font-weight: 600;
    cursor: pointer;
    white-space: nowrap;
    line-height: 1;
}
#arc-search.is-open .arc-recent-item {
    opacity: 1;
    pointer-events: auto;
    transform: translate(-50%, -50%)
               translate(calc(cos(var(--angle)) * var(--arc-r)),
                        calc(sin(var(--angle)) * var(--arc-r)));
    transition-delay: calc(var(--i, 0) * 40ms);
}

/* ── Active Filter Bar ────────────────────────────────────────────── */

.active-filter-bar {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    padding: 0.75rem 0;
    align-items: center;
}
.filter-chip {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.3rem 0.55rem 0.3rem 0.85rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(76, 175, 80, 0.4);
    border-radius: 20px;
    font-size: 0.78rem;
    font-weight: 600;
    color: var(--text);
}
.filter-chip i { color: var(--primary); font-size: 0.8rem; }
.filter-chip button {
    background: transparent;
    border: none;
    color: var(--text-muted);
    cursor: pointer;
    padding: 0.15rem 0.3rem;
    font-size: 0.85rem;
    line-height: 1;
}
.filter-chip button:hover { color: var(--danger); }
.filter-clear-all {
    background: transparent;
    border: 1px dashed rgba(255, 255, 255, 0.25);
    border-radius: 20px;
    padding: 0.3rem 0.85rem;
    color: var(--text-muted);
    font-size: 0.72rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.filter-clear-all:hover { color: var(--text); border-color: var(--primary); }

/* ──────────────────────────────────────────────────────────────────
   Radial Menu — Step 7: Terpene palette + strain glow
   ────────────────────────────────────────────────────────────────── */

:root {
    /* Terpene palette (per radial_menu_plan.md) */
    --terp-myrcene:       #FFAB40;
    --terp-limonene:      #FFD54F;
    --terp-caryophyllene: #EF9A9A;
    --terp-terpinolene:   #80CBC4;
    --terp-linalool:      #CE93D8;
    --terp-humulene:      #FFCC80;
    --terp-pinene:        #81D4FA;
    --terp-ocimene:       #A5D6A7;

    /* Strain palette — match existing badge--* hues */
    --strain-indica:  #b388ff;
    --strain-sativa:  #ffb74d;
    --strain-hybrid:  #4caf50;
    --strain-cbd:     #64b5f6;
}

/* Each terpene class points its --terpene-color at the right palette var
   so the dot, label, hub-pulse, and chip can all share one source. */
.terpene-myrcene       { --terpene-color: var(--terp-myrcene);       }
.terpene-limonene      { --terpene-color: var(--terp-limonene);      }
.terpene-caryophyllene { --terpene-color: var(--terp-caryophyllene); }
.terpene-terpinolene   { --terpene-color: var(--terp-terpinolene);   }
.terpene-linalool      { --terpene-color: var(--terp-linalool);      }
.terpene-humulene      { --terpene-color: var(--terp-humulene);      }
.terpene-pinene        { --terpene-color: var(--terp-pinene);        }
.terpene-ocimene       { --terpene-color: var(--terp-ocimene);       }

/* Terpene arc item — coloured ring when active, dot is always coloured. */
.wheel-terpene-item.is-active {
    border-color: var(--terpene-color);
    background: color-mix(in srgb, var(--terpene-color) 20%, transparent);
    box-shadow: 0 0 16px color-mix(in srgb, var(--terpene-color) 60%, transparent);
}
.wheel-terpene-item.is-active .wheel-item-label { color: var(--terpene-color); }

/* Terpene chip in the active filter bar takes its terpene's colour. */
.filter-chip-terpene {
    background: color-mix(in srgb, var(--terpene-color) 14%, rgba(255,255,255,0.04));
    border-color: var(--terpene-color);
    color: var(--text);
}
.filter-chip-terpene i { color: var(--terpene-color); }

/* Centre hub pulses in the selected terpene's colour when one is active.
   JS adds .hub-active-terpene + data-terpene="<name>" so we can target the var. */
#hub-terpene.hub-active-terpene[data-terpene]    { /* selector requires both — JS sets together */ }
#hub-terpene.hub-active-terpene[data-terpene="Myrcene"]       { --terpene-color: var(--terp-myrcene); }
#hub-terpene.hub-active-terpene[data-terpene="Limonene"]      { --terpene-color: var(--terp-limonene); }
#hub-terpene.hub-active-terpene[data-terpene="Caryophyllene"] { --terpene-color: var(--terp-caryophyllene); }
#hub-terpene.hub-active-terpene[data-terpene="Terpinolene"]   { --terpene-color: var(--terp-terpinolene); }
#hub-terpene.hub-active-terpene[data-terpene="Linalool"]      { --terpene-color: var(--terp-linalool); }
#hub-terpene.hub-active-terpene[data-terpene="Humulene"]      { --terpene-color: var(--terp-humulene); }
#hub-terpene.hub-active-terpene[data-terpene="Pinene"]        { --terpene-color: var(--terp-pinene); }
#hub-terpene.hub-active-terpene[data-terpene="Ocimene"]       { --terpene-color: var(--terp-ocimene); }
#hub-terpene.hub-active-terpene {
    background: color-mix(in srgb, var(--terpene-color) 20%, rgba(18,22,28,0.85));
    border-color: var(--terpene-color);
    color: var(--terpene-color);
    box-shadow: 0 8px 24px rgba(0,0,0,0.45),
                0 0 24px color-mix(in srgb, var(--terpene-color) 60%, transparent);
    animation: hub-terpene-pulse 2.4s ease-in-out infinite;
}
@keyframes hub-terpene-pulse {
    0%, 100% { box-shadow: 0 8px 24px rgba(0,0,0,0.45),
                           0 0 18px color-mix(in srgb, var(--terpene-color) 50%, transparent); }
    50%      { box-shadow: 0 8px 28px rgba(0,0,0,0.5),
                           0 0 32px color-mix(in srgb, var(--terpene-color) 75%, transparent); }
}

/* ── Strain palette (arc items + chips) ──────────────────────────── */

.wheel-strain-item.strain-indica  { border-color: var(--strain-indica); }
.wheel-strain-item.strain-sativa  { border-color: var(--strain-sativa); }
.wheel-strain-item.strain-hybrid  { border-color: var(--strain-hybrid); }
.wheel-strain-item.strain-cbd     { border-color: var(--strain-cbd); }

.wheel-strain-item.strain-indica  .wheel-item-label { color: var(--strain-indica); }
.wheel-strain-item.strain-sativa  .wheel-item-label { color: var(--strain-sativa); }
.wheel-strain-item.strain-hybrid  .wheel-item-label { color: var(--strain-hybrid); }
.wheel-strain-item.strain-cbd     .wheel-item-label { color: var(--strain-cbd); }

/* Active strain — fill in its colour. */
.wheel-strain-item.is-active.strain-indica  { background: color-mix(in srgb, var(--strain-indica) 30%, transparent); }
.wheel-strain-item.is-active.strain-sativa  { background: color-mix(in srgb, var(--strain-sativa) 30%, transparent); }
.wheel-strain-item.is-active.strain-hybrid  { background: color-mix(in srgb, var(--strain-hybrid) 30%, transparent); }
.wheel-strain-item.is-active.strain-cbd     { background: color-mix(in srgb, var(--strain-cbd)    30%, transparent); }

/* Strain chip variants */
.filter-chip-strain.strain-indica  { border-color: var(--strain-indica); color: var(--strain-indica); }
.filter-chip-strain.strain-sativa  { border-color: var(--strain-sativa); color: var(--strain-sativa); }
.filter-chip-strain.strain-hybrid  { border-color: var(--strain-hybrid); color: var(--strain-hybrid); }
.filter-chip-strain.strain-cbd     { border-color: var(--strain-cbd);    color: var(--strain-cbd); }

/* ── Strain glow — driven by --strain-glow / --strain-color set in JS ──
   On the wheel, --wheel-opacity already controls visibility per item, so we
   don't multiply opacity here; the glow intensity (box-shadow size + colour)
   communicates the ratio. Zero-count strains get the .strain-empty rule. */
.radial-arc.is-open .wheel-strain-item {
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3),
                0 0 var(--strain-glow, 0px) var(--strain-color, transparent);
}
.wheel-strain-item.strain-indica  { --strain-color: color-mix(in srgb, var(--strain-indica) 70%, transparent); }
.wheel-strain-item.strain-sativa  { --strain-color: color-mix(in srgb, var(--strain-sativa) 70%, transparent); }
.wheel-strain-item.strain-hybrid  { --strain-color: color-mix(in srgb, var(--strain-hybrid) 70%, transparent); }
.wheel-strain-item.strain-cbd     { --strain-color: color-mix(in srgb, var(--strain-cbd)    70%, transparent); }

/* Zero-count strain — dim and de-emphasise, but still tappable.
   (Wheel transform is JS-driven, so we don't override it here — just style.) */
.radial-arc.is-open .wheel-strain-item.strain-empty {
    border-color: rgba(255, 255, 255, 0.12);
    box-shadow: none;
    opacity: calc(var(--wheel-opacity, 1) * 0.45);
}
.wheel-strain-item.strain-empty .wheel-item-count { display: none; }
.wheel-strain-item.strain-empty .wheel-item-label { color: var(--text-muted); }

/* ──────────────────────────────────────────────────────────────────
   Radial Menu — Step 8: Mobile/Desktop split + pill-row sync
   ────────────────────────────────────────────────────────────────── */

/* Mobile (≤ 768px): radials replace pill rows entirely. */
@media (max-width: 768px) {
    .shop-controls .filter-pill-group { display: none; }
    /* Keep the search box at the top — radial search is supplementary on mobile,
       not a replacement for users who already know how to type. */
}

/* Desktop (≥ 769px): hubs sit a bit larger, arcs span wider, and pill rows
   stay visible. State stays synced through PORTAL.syncShopUI(). */
@media (min-width: 769px) {
    .radial-hubs {
        bottom: 1.5rem;
        max-width: 460px;
    }
    .radial-hub {
        width: 64px;
        height: 64px;
        font-size: 1.4rem;
    }

    #arc-brand,
    #arc-terpene,
    #arc-filter { bottom: calc(6rem + 32px); }
    #arc-brand  { left: max(calc(50% - 230px + 32px), calc(1rem + 32px)); }
    #arc-filter { left: min(calc(50% + 230px - 32px), calc(100% - 1rem - 32px)); }

    /* Larger items on desktop. Wheel radius is JS-driven (PORTAL.wheels.X.radius)
       so this only affects size — JS picks radius based on viewport width on shop init. */
    .wheel-item                       { width: 64px; height: 64px; }
    #arc-filter .wheel-cat-item       { width: 56px; height: 56px; }

    .wheel-cat-item i               { font-size: 1.25rem; }
    .wheel-cat-item .wheel-item-label { font-size: 0.6rem; max-width: 64px; }
    .wheel-strain-item .wheel-item-label { font-size: 0.7rem; }
    .wheel-terpene-item .wheel-item-dot  { width: 22px; height: 22px; }
    .wheel-terpene-item .wheel-item-label { font-size: 0.55rem; }
}

/* ──────────────────────────────────────────────────────────────────
   Product Detail Modal — opened on card image tap
   ────────────────────────────────────────────────────────────────── */

.product-detail-card {
    overflow: hidden;
    /* Cap the modal at 92% of the dynamic viewport height so it always fits
       on screen — image shrinks and the body scrolls as needed. */
    max-height: 92dvh;
    max-height: 92vh; /* fallback for browsers without dvh */
    display: flex;
    flex-direction: column;
}
.pd-close {
    position: absolute;
    top: 0.75rem;
    right: 0.75rem;
    z-index: 5;
    background: rgba(0, 0, 0, 0.55);
    color: #fff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 200ms ease, transform 200ms ease;
}
.pd-close:hover { background: rgba(0, 0, 0, 0.75); transform: scale(1.05); }
.pd-image-wrap {
    height: 220px;
    flex-shrink: 0; /* never collapse the image on tall modals */
    background: linear-gradient(135deg, rgba(76,175,80,0.08), rgba(0,0,0,0.3));
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    border-bottom: 1px solid var(--border);
    /* On very short viewports (landscape phone), shrink the image zone. */
    transition: height 200ms ease;
}
@media (max-height: 600px) {
    .pd-image-wrap { height: 130px; }
}
.pd-image-wrap img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    padding: 0.75rem;
}
/* The body scrolls within the capped card height. */
.pd-body {
    padding: 1.5rem;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    flex: 1 1 auto;
    min-height: 0; /* needed for flex children to honour overflow-y */
}
.pd-brand {
    font-size: 0.7rem;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    text-transform: uppercase;
    font-weight: 700;
    /* Prevent very long brand names from overflowing. */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.pd-name {
    font-size: 1.3rem;
    font-weight: 800;
    margin: 0.3rem 0 0.85rem;
    color: var(--text);
    line-height: 1.25;
}
.pd-badges {
    display: flex;
    gap: 0.4rem;
    flex-wrap: wrap;
    margin-bottom: 1rem;
}
.pd-badge {
    font-size: 0.65rem;
    font-weight: 700;
    padding: 0.25rem 0.6rem;
    border-radius: 12px;
    border: 1px solid currentColor;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.pd-stats {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0.75rem;
    margin-bottom: 1rem;
}
.pd-stat {
    background: rgba(255, 255, 255, 0.04);
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 0.6rem 0.85rem;
}
.pd-stat-label {
    font-size: 0.65rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    font-weight: 700;
}
.pd-stat-value {
    font-size: 0.95rem;
    color: var(--text);
    font-weight: 700;
    margin-top: 0.15rem;
    display: block;
}
.pd-terpenes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.4rem;
    margin-bottom: 1rem;
}
.pd-terpene-pill {
    font-size: 0.7rem;
    font-weight: 700;
    padding: 0.25rem 0.65rem;
    border-radius: 12px;
    background: color-mix(in srgb, var(--terpene-color, var(--primary)) 18%, transparent);
    color: var(--terpene-color, var(--primary));
    border: 1px solid var(--terpene-color, var(--primary));
}
.pd-description {
    font-size: 0.85rem;
    color: var(--text-muted);
    line-height: 1.55;
    margin-bottom: 1.25rem;
    /* No inner scroll needed — .pd-body handles overflow now.
       padding-right keeps text clear of the body's scrollbar track. */
    padding-right: 0.25rem;
}
.pd-action {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 1rem;
    border-top: 1px solid var(--border);
}
.pd-price {
    font-size: 1.4rem;
    font-weight: 800;
    color: var(--text);
    font-family: 'Outfit', sans-serif;
}
.pd-cart-btn {
    background: var(--primary);
    color: #fff;
    border: none;
    border-radius: 24px;
    padding: 0.7rem 1.25rem;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: background 200ms ease, transform 200ms ease;
}
.pd-cart-btn:hover { background: var(--primary-dark); transform: translateY(-1px); }
.pd-cart-btn.in-cart { background: var(--danger); }
.pd-visit-store {
    font-size: 0.75rem;
    color: var(--text-muted);
    font-style: italic;
    font-weight: 600;
}

/* Card image is now tappable — give it a hover affordance. */
.pc-img { cursor: pointer; transition: transform 200ms ease; }
.pc-img:hover { transform: scale(1.04); }

/* ──────────────────────────────────────────────────────────────────
   Inline expand block — only visible on mobile (≤768px) when the
   card has .is-expanded. Hidden by default on every breakpoint.
   ────────────────────────────────────────────────────────────────── */
.pc-expand { display: none; }

.pc-more-btn {
    background: rgba(76, 175, 80, 0.14);
    color: var(--primary);
    border: 1px solid rgba(76, 175, 80, 0.35);
    border-radius: 8px;
    padding: 0.4rem 0.7rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    cursor: pointer;
    width: fit-content;
}
.pc-more-btn:hover, .pc-more-btn:active { background: rgba(76, 175, 80, 0.25); }

/* ──────────────────────────────────────────────────────────────────
   Mobile (≤768px): compact horizontal-row cards.
     col 1 = 56px thumbnail (vertically centred, spans rows 1-3)
     col 2 = name (row 1) / brand (row 2) / terpenes (row 3)
     col 3 = price + add-button (vertically centred, spans rows 1-3)
     row 4 = full-width inline expand (revealed by .is-expanded)
   Uses explicit grid-row / grid-column so the layout is predictable
   regardless of whether .pc-terpenes is empty or .pc-expand is hidden.
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .product-card {
        display: grid;
        grid-template-columns: 56px 1fr auto;
        column-gap: 0.6rem;
        row-gap: 0;
        padding: 0.55rem 0.7rem;
        border-radius: 14px;
        position: relative;
        overflow: hidden;
    }
    .product-card:hover { transform: none; box-shadow: none; background: rgba(255,255,255,0.03); }

    .product-card .pc-img {
        position: static;
        grid-column: 1;
        grid-row: 1 / span 3;
        width: 56px;
        height: 56px;
        border-radius: 10px;
        align-self: center;
    }

    .product-card .pc-tag,
    .product-card .pc-stats { display: none; }

    .product-card .pc-name {
        grid-column: 2;
        grid-row: 1;
        font-size: 0.86rem;
        line-height: 1.2;
        font-weight: 700;
        max-height: 2.4em;
        height: auto;
        -webkit-line-clamp: 2;
        padding: 0;
        margin: 0;
        align-self: end;
    }
    .product-card .pc-brand {
        grid-column: 2;
        grid-row: 2;
        font-size: 0.68rem;
        margin: 1px 0;
        align-self: center;
    }
    .product-card .pc-terpenes {
        grid-column: 2;
        grid-row: 3;
        gap: 0.2rem;
        min-height: 0;
        align-self: start;
        flex-wrap: nowrap;
        overflow: hidden;
    }
    .product-card .badge--terpene {
        font-size: 0.55rem;
        padding: 0.04rem 0.3rem;
        flex-shrink: 0;
    }

    .product-card .pc-footer {
        grid-column: 3;
        grid-row: 1 / span 3;
        flex-direction: column;
        align-items: flex-end;
        justify-content: center;
        gap: 0.3rem;
        margin: 0;
        align-self: center;
    }
    .product-card .pc-price { font-size: 0.95rem; }
    .product-card .add-to-cart,
    .product-card .btn-danger { width: 34px; height: 34px; font-size: 0.85rem; border-radius: 9px; }

    .product-card .pc-expand {
        grid-column: 1 / -1;
        grid-row: 4;
        display: none;
        flex-direction: column;
        gap: 0.45rem;
        margin-top: 0.5rem;
        padding-top: 0.5rem;
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        animation: pcExpandFade 220ms ease-out;
    }
    .product-card.is-expanded .pc-expand { display: flex; }

    .pc-expand-stats {
        display: flex;
        gap: 0.85rem;
        flex-wrap: wrap;
        font-size: 0.7rem;
        color: var(--text-muted);
    }
    .pc-expand-stats b { color: #fff; font-weight: 800; }
    .pc-expand-desc {
        font-size: 0.76rem;
        color: #d8dde4;
        line-height: 1.45;
    }
    .pc-more-btn { align-self: flex-start; }

    .product-card.is-expanded {
        background: rgba(76, 175, 80, 0.07);
        border-color: rgba(76, 175, 80, 0.4);
    }
}

@keyframes pcExpandFade {
    from { opacity: 0; transform: translateY(-4px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ──────────────────────────────────────────────────────────────────
   Add-to-cart celebration:
     1) .cart-fly-ball — a small green ball that travels from the click
        point to the cart pill (top-right) over ~520ms.
     2) .cart-fireworks + .cart-spark — 16 coloured sparks fan out at
        the pill's location when the ball "lands."
   Both honour prefers-reduced-motion.
   ────────────────────────────────────────────────────────────────── */
.cart-fly-ball {
    position: fixed;
    width: 18px;
    height: 18px;
    border-radius: 50%;
    background: radial-gradient(circle at 35% 35%, #b9f0a8, #4caf50 65%, #2e7d32);
    box-shadow: 0 0 14px rgba(76, 175, 80, 0.95), 0 0 24px rgba(76, 175, 80, 0.6);
    transform: translate(-50%, -50%);
    pointer-events: none;
    z-index: 9998;
    animation: cartFlyBall 520ms cubic-bezier(0.42, 0, 0.58, 1) forwards;
}
@keyframes cartFlyBall {
    0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 0.9; }
    20%  { transform: translate(-50%, -50%) scale(1.15); opacity: 1; }
    100% {
        transform: translate(calc(-50% + var(--end-dx, 0px)), calc(-50% + var(--end-dy, 0px))) scale(0.5);
        opacity: 1;
    }
}

.cart-fireworks {
    position: fixed;
    width: 0;
    height: 0;
    pointer-events: none;
    z-index: 9999;
}
.cart-spark {
    position: absolute;
    display: block;
    left: 0;
    top: 0;
    width: 8px;
    height: 8px;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    box-shadow: 0 0 8px currentColor;
    animation: cartSpark 700ms cubic-bezier(0.18, 0.7, 0.3, 1) forwards;
}
@keyframes cartSpark {
    0%   { transform: translate(-50%, -50%) scale(0.4); opacity: 1; }
    50%  { opacity: 1; }
    100% {
        transform: translate(calc(-50% + var(--dx, 0px)), calc(-50% + var(--dy, 0px))) scale(0.2);
        opacity: 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .cart-fly-ball, .cart-spark { animation: none !important; }
    .cart-fly-ball, .cart-fireworks { display: none !important; }
    .cart-pill.is-bumping { animation: none !important; }
}

/* ──────────────────────────────────────────────────────────────────
   Idle hint + help button
   ────────────────────────────────────────────────────────────────── */

.radial-hint {
    position: fixed;
    /* Sits just above the radial hubs, which now anchor bottom: 1.25rem (mobile) / 1.5rem (desktop). */
    bottom: calc(1.25rem + 56px + 0.5rem);
    left: 50%;
    transform: translateX(-50%) translateY(8px);
    background: rgba(76, 175, 80, 0.95);
    color: #fff;
    padding: 0.55rem 1rem;
    border-radius: 24px;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.78rem;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.5);
    z-index: 120;
    opacity: 0;
    transition: opacity 300ms ease, transform 300ms ease;
    pointer-events: none;
    white-space: nowrap;
}
.radial-hint.is-visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}
.radial-hint i { font-size: 0.9rem; }

.radial-help-btn {
    position: fixed;
    /* Sits in the bottom-right corner above the radial hubs without overlapping them. */
    bottom: calc(1.25rem + 56px + 0.5rem);
    right: 0.85rem;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(18, 22, 28, 0.85);
    backdrop-filter: blur(12px);
    border: 1px solid rgba(255, 255, 255, 0.18);
    color: var(--text-muted);
    cursor: pointer;
    z-index: 95;
    font-size: 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 200ms, border-color 200ms, transform 200ms;
}
.radial-help-btn:hover {
    color: var(--primary);
    border-color: var(--primary);
    transform: scale(1.08);
}

.radial-help-list {
    list-style: none;
    padding: 0;
    margin: 1rem 0;
}
.radial-help-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    padding: 0.6rem 0;
    border-bottom: 1px solid var(--border);
    font-size: 0.85rem;
    line-height: 1.5;
}
.radial-help-list li:last-child { border-bottom: none; }
.radial-help-list i {
    color: var(--primary);
    margin-top: 0.2rem;
    flex-shrink: 0;
    width: 16px;
    text-align: center;
}

@media (min-width: 769px) {
    .radial-help-btn { bottom: calc(1.5rem + 64px + 0.5rem); right: 1.5rem; width: 32px; height: 32px; }
}

/* ── Terpene pills on product cards ────────────────────────────────────── */
.pc-terpenes {
    display: flex;
    flex-wrap: wrap;
    gap: 0.2rem;
    min-height: 1.4rem;
}

.badge--terpene {
    display: inline-block;
    padding: 0.05rem 0.3rem;
    border-radius: 4px;
    font-size: 0.58rem;
    font-weight: 600;
    text-transform: lowercase;
    letter-spacing: 0.01em;
    white-space: nowrap;
    cursor: pointer;
}

/* Terpene tooltip */
#terpene-tip {
    display: none;
    position: fixed;
    z-index: 9999;
    pointer-events: none;
    width: 220px;
    border: 1px solid #2e2f36;
    border-radius: 10px;
    padding: 0.6rem 0.8rem;
    box-shadow: 0 8px 28px rgba(0,0,0,0.85);
    line-height: 1.45;
}
.terpene-tip__name {
    font-size: 0.88rem;
    font-weight: 800;
    display: block;
    letter-spacing: 0.02em;
}
.terpene-tip__bp {
    font-size: 0.72rem;
    color: rgba(255,255,255,0.55);
    float: right;
    margin-top: 0.15rem;
    font-weight: 600;
}
.terpene-tip__desc {
    font-size: 0.76rem;
    color: #e5e7eb;
    margin: 0.3rem 0 0;
    clear: both;
}

/* Reduced motion — keep things accessible. Skip the spring overshoot. */
@media (prefers-reduced-motion: reduce) {
    .wheel-item,
    .radial-arc.is-open .wheel-item,
    .radial-arc:not(.is-open) .wheel-item,
    .arc-search-bubble,
    .arc-recent-item,
    .radial-hub,
    #hub-terpene.hub-active-terpene {
        transition-timing-function: ease !important;
        animation: none !important;
    }
    .radial-arc.is-open .wheel-item { transition-delay: 0ms !important; }
}

/* ──────────────────────────────────────────────────────────────────
   Portal responsive rebuild — Phase A (dashboard)
   Tablet widens all portal-cards; desktop flips the dashboard view
   to a 2-column grid (history left, sticky identity rail right).
   ────────────────────────────────────────────────────────────────── */

@media (min-width: 768px) and (max-width: 1279px) {
    .portal-card {
        max-width: 720px;
        padding: 2rem 2.5rem;
    }
}

@media (min-width: 1280px) {
    /* Widen the wrap only when the dashboard view is active so the other
       6 views keep their centred 440-720px treatment. */
    .portal-wrap:has(#view-dashboard.active) {
        max-width: 1200px;
    }

    /* Two-column grid: left column holds active-order + history, right column
       is a single .dash-rail wrapper that flex-stacks all rail content. With
       the rail in one grid cell (not 5 separate cells), it collapses to its
       natural content height regardless of how tall the left column grows. */
    #view-dashboard.dash-layout {
        max-width: none;
        display: grid;
        grid-template-columns: minmax(0, 1fr) 360px;
        grid-template-rows: auto 1fr;
        column-gap: 2.5rem;
        row-gap: 1.25rem;
        padding: 2.5rem;
        align-items: start;
    }

    /* Left column (rows 1 & 2): active-order on top, history below. */
    #view-dashboard.dash-layout > #dashboard-active-order { grid-column: 1; grid-row: 1; }
    #view-dashboard.dash-layout > .dash-history-block     { grid-column: 1; grid-row: 2; min-width: 0; }

    /* Right rail: single cell spanning both rows, packs tightly from the top.
       align-self: start ensures the rail sticks to the top of column 2 even
       when the left column is much taller. */
    #view-dashboard.dash-layout > .dash-rail {
        grid-column: 2;
        grid-row: 1 / span 2;
        align-self: start;
        display: flex;
        flex-direction: column;
        gap: 1.25rem;
        position: sticky;
        top: 1.5rem;
        max-height: calc(100vh - 3rem);
        overflow-y: auto;
    }

    /* Reset margins inside the flex rail — the parent gap handles spacing. */
    #view-dashboard.dash-layout .dash-rail .dash-header        { margin-bottom: 0; }
    #view-dashboard.dash-layout .dash-rail .stat-grid          { margin-bottom: 0; }
    #view-dashboard.dash-layout .dash-rail .btn-stack          { margin-top: 0; }
    #view-dashboard.dash-layout .dash-rail .pipa-note          { margin-top: 0; font-size: 0.7rem; }

    /* When the active order banner is absent its row collapses to 0 height,
       and history slides up to start at the top of column 1. The rail is
       unaffected — it always anchors to the top of column 2. */
}

/* On mobile/tablet, .dash-rail is just a passthrough — its children should
   flow inline with the rest of the card as if the wrapper wasn't there. */
@media (max-width: 1279px) {
    .dash-rail { display: contents; }
}

/* ──────────────────────────────────────────────────────────────────
   Portal responsive rebuild — Phase B (profile view)
   Desktop: 2-column split with sticky photo+consents on the left,
   form fields on the right, account-security danger zone full-width
   below. Mobile/tablet stack naturally via source order.
   ────────────────────────────────────────────────────────────────── */

@media (min-width: 1280px) {
    .portal-wrap:has(#view-profile.active) {
        max-width: 1080px;
    }

    #view-profile.prof-layout {
        max-width: none;
        display: grid;
        grid-template-columns: 380px minmax(0, 1fr);
        grid-template-areas:
            "title  title"
            "sub    sub"
            "alert  alert"
            "photo  fields"
            "danger danger";
        column-gap: 2.5rem;
        row-gap: 1.25rem;
        padding: 2.5rem;
        align-items: start;
    }

    #view-profile.prof-layout > .portal-title    { grid-area: title; margin-bottom: 0; }
    #view-profile.prof-layout > .portal-subtitle { grid-area: sub;   margin-bottom: 0; }
    #view-profile.prof-layout > #profile-alert   { grid-area: alert; }
    #view-profile.prof-layout .prof-photo-block  {
        grid-area: photo;
        position: sticky;
        top: 1.5rem;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 1.5rem;
    }
    #view-profile.prof-layout .prof-fields-block { grid-area: fields; min-width: 0; }
    #view-profile.prof-layout .prof-danger-zone  {
        grid-area: danger;
        padding-top: 1.5rem;
        border-top: 1px solid var(--border);
    }
}

/* ──────────────────────────────────────────────────────────────────
   Portal responsive rebuild — Phase C (onboarding form views)
   Desktop: form left, brand panel right for login / signup / verify.
   Status pages (pending, rejected) keep their narrow centred card.
   ────────────────────────────────────────────────────────────────── */

/* Brand block is hidden below 1280px so phone/tablet are unaffected. */
.onb-brand-block { display: none; }

.onb-brand-heading {
    font-family: var(--font-display);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--text-heading);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}
.onb-brand-tagline {
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    font-size: 0.95rem;
    line-height: 1.5;
}
.onb-brand-image {
    width: 100%;
    aspect-ratio: 4 / 3;
    object-fit: cover;
    border-radius: var(--radius-md);
    border: 1px solid var(--border);
}
.onb-brand-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-direction: column;
    gap: 0.85rem;
}
.onb-brand-list li {
    display: flex;
    align-items: flex-start;
    gap: 0.75rem;
    font-size: 0.9rem;
    line-height: 1.5;
}
.onb-brand-list li i {
    color: var(--primary);
    font-size: 0.9rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
    width: 1rem;
    text-align: center;
}
.onb-brand-list li i.fa-times { color: var(--red); }
.onb-brand-list li strong { color: var(--text); font-weight: 600; }
.onb-brand-list li span   { color: var(--text-muted); }

@media (min-width: 1280px) {
    .portal-wrap:has(#view-login.active),
    .portal-wrap:has(#view-signup.active),
    .portal-wrap:has(#view-verify.active) {
        max-width: 1080px;
    }

    .portal-card.onb-layout {
        max-width: none;
        display: grid;
        grid-template-columns: 520px minmax(0, 1fr);
        column-gap: 3rem;
        padding: 2.5rem;
        align-items: start;
    }

    .onb-form-block  { min-width: 0; }
    .onb-brand-block {
        display: block;
        position: sticky;
        top: 1.5rem;
        background: var(--bg-card);
        border: 1px solid var(--border);
        border-radius: var(--radius-md);
        padding: 1.75rem;
    }
}

/* ──────────────────────────────────────────────────────────────────
   Mobile modal polish — on very small phones reduce the overlay
   padding so the product-detail / cart modals use more screen width.
   ────────────────────────────────────────────────────────────────── */
@media (max-width: 480px) {
    .modal-overlay {
        padding: 0.5rem;
        align-items: flex-end; /* slide up from bottom — more natural on phones */
    }

    /* When sliding up from the bottom, square off the bottom corners. */
    #modal-product-detail .modal-content,
    #modal-cart .modal-content {
        border-bottom-left-radius: 0;
        border-bottom-right-radius: 0;
        width: 100%;
        max-width: 100%;
    }

    /* Product detail specific: let image fill the full width. */
    #modal-product-detail .pd-image-wrap {
        height: 180px;
    }
}

