/* =========================================================
   Bazarak application styles (RTL, mobile first)
   ========================================================= */

* {
    font-family: 'Vazirmatn', Tahoma, 'Segoe UI', sans-serif;
}

html {
    -webkit-text-size-adjust: 100%;
    /* NOTE: no overflow-x here — it would break .sidebar's position:sticky
       (the Phase-0 review flagged exactly this). The real overflow source
       (.bz-assistant using 100vw while offset from `left`) is fixed in
       assistant.css instead. */
}

body {
    background-color: var(--bg-0);
    color: var(--text-1);
    font-size: 16px;
    line-height: 1.7;
    min-height: 100vh;
}

/* Spam honeypot: still in the DOM (bots fill it) but invisible and — crucially
   in an RTL document — without any overflow. The old `left:-9999px` trick made
   the page scrollable by 9999px to the left, because RTL scrolls that way. */
.bz-honeypot {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    border: 0;
    overflow: hidden;
    clip: rect(0 0 0 0);
    clip-path: inset(50%);
    white-space: nowrap;
}

/* soft galaxy background for the top of main pages */
body.has-hero::before {
    content: '';
    position: fixed;
    inset: 0 0 auto 0;
    height: 420px;
    background:
        radial-gradient(600px 240px at 85% -40px, rgba(109, 77, 242, .35), transparent 70%),
        radial-gradient(500px 220px at 10% -60px, rgba(34, 211, 238, .25), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

a {
    color: var(--link);
    text-decoration: none;
}

h1, h2, h3, h4 {
    line-height: 1.4;
    color: var(--text-1);
}

.text-muted-2 {
    color: var(--text-2) !important;
}

/* ---------- shell ---------- */
.app-shell {
    position: relative;
    z-index: 1;
    min-height: 100vh;
    display: flex;
}

.app-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.app-content {
    flex: 1;
    padding: var(--sp-4) var(--sp-4) calc(var(--bottom-nav-h) + var(--sp-6));
}

.app-footer {
    padding: var(--sp-5) var(--sp-4) calc(var(--bottom-nav-h) + var(--sp-4));
    color: var(--text-3);
    font-size: 13px;
    border-top: 1px solid var(--border);
    margin-top: var(--sp-6);
}

/* ---------- header ---------- */
.app-header {
    position: sticky;
    top: 0;
    z-index: var(--z-header);
    min-height: var(--header-h);
    display: flex;
    align-items: center;
    gap: var(--sp-3);
    padding: var(--sp-2) var(--sp-4);
    background: var(--glass-bg);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    border-bottom: 1px solid var(--glass-border);
}

@supports not (backdrop-filter: blur(1px)) {
    .app-header,
    .glass {
        background: var(--surface);
    }
}

.brand {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    font-weight: 700;
    font-size: 20px;
    color: var(--text-1);
}

.brand-mark {
    width: 34px;
    height: 34px;
    border-radius: 11px;
    background: var(--grad-primary);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    box-shadow: 0 6px 18px -8px rgba(77, 99, 240, .9);
}

.location-chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    border-radius: var(--r-pill);
    background: var(--surface-2);
    color: var(--text-2);
    font-size: 13px;
    border: 1px solid var(--border);
}

.header-actions {
    margin-inline-start: auto;
    display: flex;
    align-items: center;
    gap: var(--sp-2);
}

.icon-btn {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    border: 1px solid var(--border);
    background: var(--surface);
    color: var(--text-1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--t-fast) var(--ease-out), background var(--t-fast);
}

.icon-btn:hover {
    transform: translateY(-1px);
    background: var(--surface-2);
    color: var(--text-1);
}

/* ---------- sidebar (desktop) ---------- */
.sidebar {
    display: none;
    width: var(--sidebar-w);
    flex-shrink: 0;
    padding: var(--sp-4) var(--sp-3);
    border-inline-start: 1px solid var(--border);
    background: var(--surface);
    position: sticky;
    top: 0;
    height: 100vh;
    overflow-y: auto;
}

.sidebar .nav-link {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 12px;
    border-radius: 12px;
    color: var(--text-2);
    font-weight: 500;
    margin-bottom: 4px;
}

.sidebar .nav-link:hover,
.sidebar .nav-link.active {
    background: var(--surface-2);
    color: var(--primary);
}

.sidebar-title {
    font-size: 12px;
    color: var(--text-3);
    margin: var(--sp-4) 12px var(--sp-2);
}

/* ---------- bottom nav (mobile) ---------- */
.bottom-nav {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: var(--z-bottom-nav);
    height: calc(var(--bottom-nav-h) + env(safe-area-inset-bottom, 0px));
    padding-bottom: env(safe-area-inset-bottom, 0px);
    display: flex;
    background: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border);
}

.bottom-nav a {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    font-size: 11px;
    color: var(--text-3);
    min-height: 44px;
}

.bottom-nav a.active {
    color: var(--primary);
    font-weight: 700;
}

.bottom-nav a.fab span.fab-icon {
    width: 46px;
    height: 46px;
    margin-top: -22px;
    border-radius: 50%;
    background: var(--grad-primary);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 10px 22px -10px rgba(77, 99, 240, .9);
}

/* ---------- hero + search ---------- */
.hero {
    padding: var(--sp-5) 0 var(--sp-4);
}

.hero h1 {
    font-size: 26px;
    font-weight: 700;
    margin-bottom: 6px;
}

.hero p {
    color: var(--text-2);
    margin-bottom: var(--sp-4);
}

.search-bar {
    display: flex;
    align-items: center;
    gap: var(--sp-2);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-lg);
    padding: 8px 14px;
    box-shadow: var(--shadow-card);
}

.search-bar input {
    flex: 1;
    border: 0;
    outline: 0;
    background: transparent;
    color: var(--text-1);
    font-size: 15px;
    min-height: 40px;
}

.search-bar .search-go {
    border: 0;
    background: var(--grad-primary);
    color: #fff;
    border-radius: 14px;
    width: 44px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform var(--t-fast) var(--ease-spring);
}

.search-bar .search-go:hover {
    transform: scale(1.05);
}

/* ---------- quick categories ---------- */
.quick-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: var(--sp-3);
}

.quick-item {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    padding: var(--sp-3) var(--sp-2);
    text-align: center;
    color: var(--text-1);
    transition: transform var(--t-base) var(--ease-out), border-color var(--t-base);
    display: block;
}

.quick-item:hover {
    transform: translateY(-3px);
    border-color: var(--primary);
    color: var(--text-1);
}

.quick-item .qi-icon {
    width: 46px;
    height: 46px;
    margin: 0 auto 8px;
    border-radius: 15px;
    background: var(--surface-2);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.quick-item span {
    font-size: 12.5px;
    color: var(--text-2);
    display: block;
    line-height: 1.5;
}

/* ---------- sections ---------- */
.section {
    margin-top: var(--sp-6);
}

.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: var(--sp-3);
}

.section-head h2 {
    font-size: 18px;
    font-weight: 700;
    margin: 0;
}

.section-head a {
    font-size: 13px;
}

/* ---------- cards ---------- */
.card-bz {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-md);
    overflow: hidden;
    transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base);
    height: 100%;
}

.card-bz:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow-card);
    color: var(--text-1);
}

.card-bz .cover {
    height: 120px;
    background:
        linear-gradient(180deg, rgba(7, 11, 24, 0) 40%, rgba(7, 11, 24, .55)),
        linear-gradient(135deg, var(--surface-2), var(--surface));
    position: relative;
}

.card-bz .cover .cat-tag {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    font-size: 11px;
    background: rgba(7, 11, 24, .55);
    color: #fff;
    padding: 4px 10px;
    border-radius: var(--r-pill);
    backdrop-filter: blur(6px);
}

.card-bz .body {
    padding: var(--sp-3);
}

.card-bz .biz-name {
    font-weight: 700;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.card-bz .biz-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    color: var(--text-3);
    font-size: 12.5px;
    flex-wrap: wrap;
}

.rating {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    color: var(--warning);
    font-weight: 700;
    font-size: 13px;
}

.badge-trust {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    padding: 3px 8px;
    border-radius: var(--r-pill);
    background: rgba(34, 197, 94, .14);
    color: var(--success);
    font-weight: 700;
    border: 1px solid rgba(34, 197, 94, .3);
}

.badge-trust.off {
    background: rgba(148, 163, 184, .16);
    color: var(--text-3);
    border-color: rgba(148, 163, 184, .3);
}

.price {
    font-weight: 700;
    color: var(--primary);
    font-size: 14px;
}

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 7px 14px;
    border-radius: var(--r-pill);
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-2);
    font-size: 13px;
    white-space: nowrap;
}

.chip.active {
    background: var(--primary);
    border-color: var(--primary);
    color: #fff;
}

.chip-row {
    display: flex;
    flex-wrap: wrap;
    gap: var(--sp-2);
    overflow-x: visible;
    padding-bottom: 4px;
    scrollbar-width: none;
}

.chip-row::-webkit-scrollbar {
    display: none;
}

/* ---------- promo / info banners ---------- */
.promo-card {
    background: var(--grad-primary);
    color: #fff;
    border-radius: var(--r-lg);
    padding: var(--sp-5);
    position: relative;
    overflow: hidden;
    box-shadow: 0 18px 40px -20px rgba(77, 99, 240, .9);
}

.promo-card h3 {
    color: #fff;
    font-size: 18px;
    margin-bottom: 6px;
}

.promo-card p {
    color: rgba(255, 255, 255, .85);
    font-size: 13.5px;
    margin-bottom: var(--sp-3);
}

.promo-card .btn-light-blur {
    background: rgba(255, 255, 255, .18);
    border: 1px solid rgba(255, 255, 255, .35);
    color: #fff;
    border-radius: var(--r-pill);
    padding: 8px 18px;
    font-size: 13.5px;
    font-weight: 700;
    display: inline-flex;
    gap: 6px;
    align-items: center;
}

.glass {
    background: var(--glass-bg);
    border: 1px solid var(--glass-border);
    border-radius: var(--r-lg);
    backdrop-filter: blur(16px) saturate(140%);
    -webkit-backdrop-filter: blur(16px) saturate(140%);
    padding: var(--sp-4);
}

/* ---------- buttons ---------- */
.btn-bz {
    border: 0;
    background: var(--grad-primary);
    color: #fff;
    border-radius: var(--r-sm);
    font-weight: 700;
    padding: 12px 22px;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 12px 26px -14px rgba(77, 99, 240, .95);
    transition: transform var(--t-fast) var(--ease-spring), filter var(--t-fast);
}

.btn-bz:hover,
.btn-bz:focus {
    color: #fff;
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.btn-bz:active {
    transform: scale(.98);
}

.btn-bz[disabled] {
    opacity: .6;
    pointer-events: none;
}

.btn-ghost-bz {
    background: var(--surface);
    color: var(--text-1);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    font-weight: 600;
    padding: 11px 20px;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-ghost-bz:hover {
    background: var(--surface-2);
    color: var(--text-1);
}

/* ---------- forms ---------- */
.form-label {
    font-weight: 600;
    font-size: 13.5px;
    color: var(--text-2);
}

.form-control,
.form-select {
    background: var(--surface);
    border: 1px solid var(--border);
    color: var(--text-1);
    border-radius: var(--r-sm);
    min-height: 48px;
    padding: 10px 14px;
}

.form-control:focus,
.form-select:focus {
    background: var(--surface);
    border-color: var(--primary);
    box-shadow: 0 0 0 .2rem rgba(61, 99, 240, .18);
    color: var(--text-1);
}

.form-control::placeholder {
    color: var(--text-3);
}

/* ---------- empty state / skeleton ---------- */
.empty-state {
    text-align: center;
    padding: var(--sp-6) var(--sp-4);
    color: var(--text-2);
}

.empty-state .es-icon {
    width: 84px;
    height: 84px;
    margin: 0 auto var(--sp-3);
    border-radius: 28px;
    background: var(--surface-2);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.skeleton {
    background: linear-gradient(90deg, var(--surface-2) 25%, var(--surface) 50%, var(--surface-2) 75%);
    background-size: 200% 100%;
    animation: bz-shimmer 1.4s infinite;
    border-radius: 10px;
}

@keyframes bz-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* ---------- error pages ---------- */
.error-page {
    min-height: 70vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: var(--sp-6) var(--sp-4);
}

.error-page .code {
    font-size: 92px;
    font-weight: 700;
    line-height: 1;
    background: var(--grad-primary);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
}

/* ---------- toast ---------- */
.bz-toast {
    position: fixed;
    bottom: calc(var(--bottom-nav-h) + 16px);
    inset-inline: 16px;
    z-index: var(--z-toast);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--r-sm);
    padding: 12px 16px;
    box-shadow: var(--shadow-card);
    font-size: 14px;
    display: none;
}

/* ---------- responsive ---------- */
@media (min-width: 768px) {
    .quick-grid {
        grid-template-columns: repeat(6, 1fr);
    }

    .hero h1 {
        font-size: 32px;
    }
}

@media (min-width: 992px) {
    .sidebar {
        display: block;
    }

    .bottom-nav {
        display: none;
    }

    .app-content {
        padding: var(--sp-5) var(--sp-6) var(--sp-6);
        max-width: 1200px;
    }

    .app-footer {
        padding: var(--sp-5) var(--sp-6);
    }

    .quick-grid {
        grid-template-columns: repeat(8, 1fr);
    }
}

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

/* ---------- auth pages (phase 1) ---------- */
.auth-wrap {
    display: flex;
    justify-content: center;
    padding: clamp(12px, 4vh, 40px) 0;
}

.auth-card {
    width: 100%;
    max-width: 460px;
    padding: clamp(20px, 5vw, 36px);
    border-radius: var(--r-lg);
    text-align: center;
    box-shadow: var(--shadow-card);
}

.auth-card h1 {
    font-size: clamp(20px, 3vw, 26px);
    margin: 14px 0 6px;
}

.auth-card form {
    text-align: right;
}

.auth-card .form-text {
    text-align: right;
    color: var(--text-3);
    font-size: 12.5px;
}

.auth-icon {
    width: 64px;
    height: 64px;
    border-radius: 20px;
    margin: 0 auto;
    background: var(--surface-2);
    color: var(--primary);
    display: flex;
    align-items: center;
    justify-content: center;
}

.auth-note {
    font-size: 13px;
    line-height: 1.9;
}

/* OTP: 6 boxes (docs/02-uiux.md) */
.otp-boxes {
    display: flex;
    gap: 8px;
    justify-content: center;
    direction: ltr;
}

.otp-boxes input {
    width: clamp(40px, 11vw, 52px);
    height: clamp(50px, 13vw, 60px);
    text-align: center;
    font-size: clamp(20px, 5vw, 26px);
    font-weight: 700;
    border: 1.5px solid var(--border);
    border-radius: 14px;
    background: var(--surface);
    color: var(--text-1);
    transition: border-color var(--t-fast) var(--ease-out), box-shadow var(--t-fast) var(--ease-out);
}

.otp-boxes input:focus {
    outline: none;
    border-color: var(--primary);
    box-shadow: 0 0 0 4px rgba(61, 99, 240, .15);
}

/* flash alerts (layout) */
.bz-alert {
    border-radius: var(--r-md);
    border-width: 1px;
    font-size: 14.5px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.bz-alert .btn-close {
    margin-inline-start: auto;
}

/* ---------- account (phase 1) ---------- */
.account-hero {
    display: flex;
    gap: var(--sp-4);
    align-items: center;
    flex-wrap: wrap;
    padding: var(--sp-5);
}

.account-avatar {
    width: 64px;
    height: 64px;
    border-radius: 22px;
    background: var(--grad-primary);
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.account-avatar.is-blocked {
    filter: grayscale(1);
}

.chip-btn {
    cursor: pointer;
    font-family: inherit;
    transition: border-color var(--t-fast), color var(--t-fast);
}

.chip-btn:hover,
.chip-btn:focus-visible {
    border-color: var(--primary);
    color: var(--primary);
}

.bz-table {
    font-size: 14px;
}

.bz-table th {
    color: var(--text-3);
    font-weight: 600;
    font-size: 12.5px;
}

.bz-table td {
    color: var(--text-2);
}

.bz-table th,
.bz-table td {
    padding: 10px 8px;
    border-color: var(--border);
}

/* ---- Import wizard (union panel) ---- */
.btn-danger-bz {
    border: 0;
    background: linear-gradient(135deg, #e74c3c, #c0392b);
    color: #fff;
    border-radius: var(--r-sm);
    font-weight: 700;
    padding: 12px 22px;
    min-height: 46px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    text-decoration: none;
}

.btn-danger-bz:hover,
.btn-danger-bz:focus {
    color: #fff;
    transform: translateY(-1px);
    filter: brightness(1.06);
}

.bz-steps {
    list-style: none;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 0;
    margin: 0;
}

.bz-steps-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-size: 13px;
    color: var(--text-3);
    background: rgba(127, 127, 127, .07);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 6px 12px;
}

.bz-steps-num {
    width: 22px;
    height: 22px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    background: rgba(127, 127, 127, .14);
    font-size: 12px;
    font-weight: 700;
}

.bz-steps-item.is-active {
    color: #fff;
    border-color: transparent;
    background: var(--grad-primary);
}

.bz-steps-item.is-active .bz-steps-num {
    background: rgba(255, 255, 255, .22);
}

.bz-steps-item.is-done {
    color: var(--text-2);
}

.bz-steps-item.is-done .bz-steps-num {
    background: rgba(46, 204, 113, .18);
    color: #2ecc71;
}

/* ---- Order wizard + tracking (phase 4) ---- */
.wizard-bar {
    position: sticky;
    bottom: calc(var(--bottom-nav-h, 64px) + 8px);
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    margin-top: 20px;
    padding: 12px 14px;
    border: 1px solid var(--glass-border, rgba(255, 255, 255, .08));
    border-radius: var(--r-md, 14px);
    background: var(--glass-bg, rgba(127, 127, 127, .06));
    backdrop-filter: blur(10px);
    z-index: 5;
}

.bz-timeline {
    list-style: none;
    margin: 0;
    padding: 0;
}

.bz-timeline li {
    position: relative;
    padding: 6px 22px 12px 4px;
    border-inline-start: 2px solid var(--border);
    margin-inline-start: 6px;
}

.bz-timeline li:last-child {
    border-inline-start-color: transparent;
}

.bz-timeline li::before {
    content: '';
    position: absolute;
    inset-inline-start: -7px;
    top: 12px;
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: var(--primary, #3d63f0);
    box-shadow: 0 0 0 3px rgba(61, 99, 240, .16);
}

.bz-timeline .t-note {
    font-size: 12.5px;
    color: var(--text-3, #8b8d98);
}

.bz-code {
    font-size: 2rem;
    font-weight: 800;
    letter-spacing: .45em;
    direction: ltr;
    text-align: center;
    color: var(--primary, #3d63f0);
    font-variant-numeric: tabular-nums;
}

/* ---- Goods sticky order bar (phase 7: نوار چسبان سفارش) ---- */
.bz-sticky-bar {
    position: fixed;
    inset-inline: 0;
    bottom: calc(var(--bottom-nav-h, 64px) + env(safe-area-inset-bottom, 0px));
    z-index: var(--z-bottom-nav, 40);
    padding: 10px 14px;
    background: var(--nav-bg, rgba(255, 255, 255, .86));
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-top: 1px solid var(--glass-border, rgba(127, 127, 127, .16));
}

@media (min-width: 992px) {
    .bz-sticky-bar {
        inset-inline: auto;
        left: 50%;
        transform: translateX(-50%);
        bottom: 24px;
        width: min(680px, 92vw);
        border: 1px solid var(--glass-border, rgba(127, 127, 127, .16));
        border-radius: var(--r-md, 14px);
        box-shadow: 0 18px 40px -18px rgba(0, 0, 0, .45);
    }
}


/* =========================================================
   Phase 8 — interaction: bell badge, order chat, star rating
   ========================================================= */
.bz-badge {
    position: absolute;
    top: -4px;
    inset-inline-start: -4px;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    background: #E5484D;
    color: #fff;
    font-size: 10.5px;
    line-height: 17px;
    text-align: center;
    font-weight: 700;
    border: 2px solid var(--bz-surface, #fff);
}

.chat-box {
    display: flex;
    flex-direction: column;
    gap: 0.55rem;
    max-height: 340px;
    min-height: 90px;
    overflow-y: auto;
    padding: 0.75rem;
    border-radius: 12px;
    background: rgba(127, 127, 127, 0.08);
}

.chat-row {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    max-width: 78%;
}

.chat-row.mine {
    align-self: flex-end;
    align-items: flex-end;
}

.chat-meta {
    font-size: 11px;
    color: var(--text-muted, #8b93a7);
    margin-bottom: 2px;
}

.chat-bubble {
    padding: 0.45rem 0.7rem;
    border-radius: 12px;
    background: rgba(127, 127, 127, 0.14);
    font-size: 14px;
    white-space: pre-wrap;
    word-break: break-word;
}

.chat-row.mine .chat-bubble {
    background: rgba(61, 99, 240, 0.18);
}

.chat-form {
    display: flex;
    gap: 0.5rem;
    align-items: flex-end;
}

.chat-form textarea {
    flex: 1;
    resize: none;
}

.chat-form button {
    white-space: nowrap;
}

/* star rating widget (order review form) */
.js-stars .js-star {
    border: 0;
    background: transparent;
    color: rgba(127, 127, 127, 0.45);
    font-size: 26px;
    line-height: 1;
    padding: 0 2px;
    cursor: pointer;
}

.js-stars .js-star.on {
    color: #F5A524;
}

.stars-view {
    letter-spacing: 2px;
}
/* ---------- Jalali datetime picker (no-CDN, phase 10+) ---------- */
.jdp-panel {
    position: absolute;
    z-index: 2000;
    width: 300px;
    padding: 0.6rem;
    border-radius: 14px;
    background: var(--surface, #fff);
    border: 1px solid var(--border, #E3E8FA);
    box-shadow: 0 14px 40px -14px rgba(11, 16, 32, .35);
    font-size: 13.5px;
}

.jdp-head {
    display: flex;
    align-items: center;
    gap: 4px;
    margin-bottom: 6px;
}

.jdp-nav {
    border: 0;
    background: var(--surface-2, #EEF2FF);
    color: var(--text-1, #0B1020);
    border-radius: 9px;
    width: 28px;
    height: 28px;
    line-height: 1;
    cursor: pointer;
    flex: 0 0 auto;
}

.jdp-nav:hover { background: var(--primary, #3D63F0); color: var(--on-primary, #fff); }

.jdp-sel {
    border: 1px solid var(--border, #E3E8FA);
    background: var(--bg-1, #fff);
    color: var(--text-1, #0B1020);
    border-radius: 9px;
    height: 28px;
    font-size: 13px;
    padding: 0 6px;
    flex: 1 1 auto;
    min-width: 0;
}

.jdp-grid { direction: rtl; }

.jdp-week, .jdp-days { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }

.jdp-wd {
    text-align: center;
    color: var(--text-3, #7C87AB);
    font-size: 12px;
    padding: 4px 0;
}

.jdp-days { margin-top: 2px; }

.jdp-day {
    border: 0;
    background: transparent;
    color: var(--text-1, #0B1020);
    border-radius: 9px;
    height: 32px;
    cursor: pointer;
    font-size: 13px;
    font-family: inherit;
}

.jdp-day:hover:not(:disabled) { background: var(--surface-2, #EEF2FF); }

.jdp-day.is-off {
    color: var(--text-3, #7C87AB);
    opacity: .38;
    cursor: not-allowed;
}

.jdp-day.is-today { box-shadow: inset 0 0 0 1.5px var(--accent, #22D3EE); }

.jdp-day.is-sel {
    background: var(--primary, #3D63F0);
    color: var(--on-primary, #fff);
}

.jdp-time {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 8px 0 6px;
}

.jdp-time .jdp-sel { flex: 0 0 74px; }

.jdp-sep { font-weight: 700; color: var(--text-2, #4A5578); }

.jdp-foot { display: flex; align-items: center; gap: 6px; }

.jdp-chip {
    border: 1px solid var(--border, #E3E8FA);
    background: var(--bg-1, #fff);
    color: var(--text-1, #0B1020);
    border-radius: 999px;
    padding: 4px 10px;
    font-size: 12.5px;
    cursor: pointer;
    font-family: inherit;
}

.jdp-chip:hover { background: var(--surface-2, #EEF2FF); }

.jdp-chip.jdp-ok {
    margin-inline-start: auto;
    background: var(--primary, #3D63F0);
    border-color: var(--primary, #3D63F0);
    color: var(--on-primary, #fff);
}

/* ---------- interactive map (vendored Leaflet, phase 11) ---------- */
.bz-map {
    height: 420px;
    border-radius: 14px;
    overflow: hidden;
    border: 1px solid var(--border, #E3E8FA);
    margin-bottom: 0.75rem;
    background: var(--surface-2, #EEF2FF);
}

.bz-map .bz-map-dot {
    display: block;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: var(--primary, #3D63F0);
    border: 3px solid #fff;
    box-shadow: 0 2px 6px rgba(11, 16, 32, .35);
}

.bz-map .leaflet-popup-content-wrapper {
    border-radius: 12px;
    font-family: inherit;
    font-size: 13px;
    direction: rtl;
    text-align: right;
}

.bz-map .leaflet-popup-content { margin: 10px 12px; }

@media (max-width: 576px) {
    .bz-map { height: 320px; }
}

/* ---------- footer (contact / newsletter / supporters) ---------- */
.footer-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: var(--sp-4);
    padding-bottom: var(--sp-4);
    border-bottom: 1px solid var(--border);
}
.footer-brand {
    display: flex;
    align-items: center;
    gap: 8px;
    font-weight: 800;
    margin-bottom: 6px;
}
.supporter-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: var(--sp-3);
}
.supporter-badges span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    font-size: 11.5px;
    color: var(--text-3);
    background: var(--surface-2, #EEF2FF);
    border: 1px solid var(--border);
    border-radius: 999px;
    padding: 5px 10px;
}

/* ---------- mobile full-menu drawer ---------- */
.bottom-nav button.bottom-menu-btn {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    border: 0;
    background: transparent;
    color: var(--text-3);
    font-size: 11px;
    padding: 0;
    cursor: pointer;
}
.hamburger { display: flex; flex-direction: column; gap: 3px; width: 22px; }
.hamburger i { display: block; height: 2px; border-radius: 2px; background: currentColor; }
.bz-drawer-overlay {
    position: fixed;
    inset: 0;
    z-index: calc(var(--z-bottom-nav, 40) + 5);
    background: rgba(11, 16, 32, .45);
    backdrop-filter: blur(2px);
}
.bz-drawer {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: calc(var(--z-bottom-nav, 40) + 6);
    max-height: 86vh;
    overflow-y: auto;
    background: var(--surface);
    color: var(--text);
    border-radius: 22px 22px 0 0;
    border-top: 1px solid var(--border);
    box-shadow: 0 -16px 50px rgba(11, 16, 32, .25);
    transform: translateY(105%);
    transition: transform .22s ease;
    padding-bottom: env(safe-area-inset-bottom, 0px);
}
.bz-drawer.open { transform: translateY(0); }
.bz-drawer-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px 10px;
    border-bottom: 1px solid var(--border);
    position: sticky;
    top: 0;
    background: var(--surface);
    z-index: 1;
}
.bz-drawer-head strong { display: flex; align-items: center; gap: 8px; }
.bz-drawer-body { padding: 10px 14px 18px; }
.bz-drawer-body .sidebar-title { margin: 14px 8px 6px; }
.bz-drawer-body .nav-link { display: flex; align-items: center; gap: 10px; padding: 10px 10px; border-radius: 12px; color: var(--text-2); }
.bz-drawer-body .nav-link:active { background: var(--surface-2); }
@media (min-width: 992px) {
    .bz-drawer, .bz-drawer-overlay { display: none !important; }
}
/* Feature 48: senior-friendly mode. */
html[data-senior="1"] { font-size: 19px; }
html[data-senior="1"] body { font-size: 1.02rem; }
html[data-senior="1"] .btn-bz,
html[data-senior="1"] .btn-ghost-bz { padding: 0.85rem 1.15rem; }
html[data-senior="1"] .btn-bz,
html[data-senior="1"] .btn-ghost-bz,
html[data-senior="1"] .icon-btn,
html[data-senior="1"] .nav-link,
html[data-senior="1"] .form-control,
html[data-senior="1"] .form-select { min-height: 48px; }
html[data-senior="1"] .form-control,
html[data-senior="1"] .form-select { font-size: 1rem; }
html[data-senior="1"] .bottom-nav a { font-size: 0.8rem; }
