/* Kalakhanegi storefront — Basalam-inspired, mobile-first, dark-first + orange */
:root,
html[data-theme="dark"] {
    --kal-primary: #ff871f;
    --kal-primary-dark: #e67610;
    --kal-ink: #f3f4f6;
    --kal-ink-soft: #d1d5db;
    --kal-muted: #9ca3af;
    --kal-bg: #0f1115;
    --kal-surface: #1a1d24;
    --kal-surface-2: #242833;
    --kal-border: rgba(255, 255, 255, 0.08);
    --kal-shadow: 0 8px 28px rgba(0, 0, 0, 0.45);
    --kal-radius: 16px;
    --kal-radius-sm: 12px;
    --kal-wrap: 1200px;
    --kal-font: Vazirmatn, Tahoma, "Segoe UI", sans-serif;
    --kal-header-h: 56px;
    --kal-bar-h: 64px;
    --kal-flash-ok: #14351f;
    --kal-flash-err: #3f1518;
    --kal-success: #34d399;
    --kal-danger: #f87171;
    color-scheme: dark;
}
html[data-theme="light"] {
    --kal-primary: #ff871f;
    --kal-primary-dark: #e67610;
    --kal-ink: #1f1f1f;
    --kal-ink-soft: #374151;
    --kal-muted: #6b7280;
    --kal-bg: #f5f5f5;
    --kal-surface: #ffffff;
    --kal-surface-2: #f3f4f6;
    --kal-border: rgba(0, 0, 0, 0.08);
    --kal-shadow: 0 4px 16px rgba(0, 0, 0, 0.06);
    --kal-flash-ok: #e8f5e9;
    --kal-flash-err: #ffebee;
    --kal-success: #2e7d32;
    --kal-danger: #b71c1c;
    color-scheme: light;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
    margin: 0;
    font-family: var(--kal-font);
    font-weight: 400;
    font-size: 14px;
    line-height: 1.65;
    background: var(--kal-bg);
    color: var(--kal-ink);
    padding-bottom: calc(var(--kal-bar-h) + 12px);
}
body.nav-open { overflow: hidden; }
a { color: var(--kal-ink); text-decoration: none; }
a:hover { color: var(--kal-primary); }
img { max-width: 100%; height: auto; display: block; }
button, input, select, textarea { font-family: inherit; }
h1, h2, h3 { font-weight: 700; line-height: 1.35; margin: 0 0 10px; }
.wrap { max-width: var(--kal-wrap); margin: 0 auto; padding: 0 12px; }
.price { color: var(--kal-primary); font-weight: 700; }
.price-old { color: var(--kal-muted); text-decoration: line-through; font-size: 13px; font-weight: 400; }
.flash { padding: 10px 14px; border-radius: var(--kal-radius-sm); margin: 12px 0; background: var(--kal-flash-ok); color: var(--kal-ink); }
.flash.error { background: var(--kal-flash-err); }

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    min-height: 44px;
    padding: 10px 18px;
    border: 0;
    border-radius: 999px;
    background: var(--kal-primary);
    color: #fff !important;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
}
.btn.secondary {
    background: var(--kal-surface-2);
    color: var(--kal-ink) !important;
    border: 1px solid var(--kal-border);
}
.btn.ghost {
    background: transparent;
    color: var(--kal-ink) !important;
    border: 1px solid var(--kal-border);
}
.btn:disabled, .btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.btn-block { width: 100%; }

/* —— Header (Basalam pattern) —— */
.site-header {
    position: sticky;
    top: 0;
    z-index: 80;
    background: var(--kal-surface);
    border-bottom: 1px solid var(--kal-border);
}
.site-header__bar {
    display: flex;
    align-items: center;
    gap: 8px;
    min-height: var(--kal-header-h);
    padding: 8px 0;
}
.brand {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    font-weight: 700;
    font-size: 16px;
    flex-shrink: 0;
}
.brand img { height: 36px; width: auto; }
.brand span { display: none; }
.nav-toggle {
    display: inline-flex;
    flex-direction: column;
    justify-content: center;
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 10px;
    background: transparent;
    cursor: pointer;
    flex-shrink: 0;
}
.nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    background: var(--kal-ink);
    margin: 2px auto;
}
.cat-trigger {
    display: none;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
}
.search-main {
    flex: 1;
    display: flex;
    align-items: center;
    min-width: 0;
    background: var(--kal-surface-2);
    border-radius: 999px;
    padding: 0 4px 0 12px;
    border: 1px solid transparent;
    position: relative;
    z-index: 5;
}
.search-main:focus-within {
    background: var(--kal-surface);
    border-color: var(--kal-primary);
}
.search-main input {
    flex: 1;
    min-width: 0;
    margin: 0;
    border: 0;
    background: transparent;
    padding: 10px 8px;
    outline: none;
    color: var(--kal-ink);
}
.search-main button {
    width: 40px;
    height: 40px;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: var(--kal-muted);
    cursor: pointer;
    font-size: 16px;
}
.site-links {
    display: none;
    align-items: center;
    gap: 14px;
    flex-shrink: 0;
}
.site-links a { font-size: 13px; font-weight: 500; }
.site-menu { display: none; }
.header-icon {
    width: 40px;
    height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    color: var(--kal-ink);
    position: relative;
    flex-shrink: 0;
}
.header-icon .badge {
    position: absolute;
    top: 4px;
    inset-inline-end: 4px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border-radius: 999px;
    background: var(--kal-primary);
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.site-drawer {
    position: fixed;
    inset: 0 auto 0 0;
    width: min(320px, 88vw);
    background: var(--kal-surface);
    box-shadow: var(--kal-shadow);
    padding: 20px 16px calc(var(--kal-bar-h) + 24px);
    transform: translateX(-105%);
    transition: transform 0.2s ease;
    z-index: 90;
    overflow-y: auto;
}
html[dir="rtl"] .site-drawer { inset: 0 0 0 auto; transform: translateX(105%); }
html[dir="rtl"] body.nav-open .site-drawer { transform: translateX(0); }
.site-drawer__backdrop {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    z-index: 89;
}
body.nav-open .site-drawer { transform: translateX(0); }
body.nav-open .site-drawer__backdrop { opacity: 1; pointer-events: auto; }
.drawer-group { margin-bottom: 18px; }
.drawer-group h3 { margin: 0 0 8px; font-size: 13px; color: var(--kal-muted); }
.drawer-group a {
    display: block;
    padding: 12px 0;
    border-bottom: 1px solid var(--kal-border);
    font-weight: 500;
}

/* —— Mobile bottom bar —— */
.mobile-bar {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    position: fixed;
    inset-inline: 10px;
    bottom: calc(10px + env(safe-area-inset-bottom, 0px));
    z-index: 70;
    background: color-mix(in srgb, var(--kal-surface) 92%, transparent);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border: 1px solid var(--kal-border);
    border-radius: 18px;
    box-shadow: var(--kal-shadow);
    padding: 6px 2px 8px;
}
.mobile-bar a {
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    font-size: 10px;
    font-weight: 500;
    color: var(--kal-muted);
    padding: 4px 2px;
    position: relative;
}
.mobile-bar .mb-ico { font-size: 18px; line-height: 1; }
.mobile-bar a.active { color: var(--kal-primary); }
.mobile-bar .badge {
    position: absolute;
    top: 0;
    inset-inline-end: 10%;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    font-size: 10px;
    line-height: 16px;
    border-radius: 999px;
    background: var(--kal-primary);
    color: #fff;
    text-align: center;
}

/* —— Trust strip —— */
.trust-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px;
    padding: 12px 0;
}
.trust-item {
    background: var(--kal-surface);
    border-radius: var(--kal-radius-sm);
    padding: 12px 10px;
    text-align: center;
    font-size: 12px;
    font-weight: 500;
    color: var(--kal-muted);
    box-shadow: var(--kal-shadow);
}

/* —— Category chips / stories —— */
.h-scroll {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 4px 2px 12px;
}
.h-scroll::-webkit-scrollbar { display: none; }
.cat-chip {
    flex: 0 0 auto;
    width: 72px;
    text-align: center;
    font-size: 11px;
    font-weight: 500;
    color: var(--kal-ink);
}
.cat-chip__icon {
    width: 56px;
    height: 56px;
    margin: 0 auto 6px;
    border-radius: 50%;
    background: var(--kal-surface);
    border: 1px solid var(--kal-border);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 22px;
    box-shadow: var(--kal-shadow);
}
.cat-chip span { display: block; line-height: 1.3; }

/* —— Hero / slider —— */
.hero-slider {
    position: relative;
    border-radius: var(--kal-radius);
    overflow: hidden;
    background: var(--kal-surface-2);
    aspect-ratio: 16 / 9;
    margin-bottom: 14px;
}
.hero-slider img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
.hero-slider__cap {
    position: absolute;
    inset-inline: 0;
    bottom: 0;
    padding: 16px;
    background: linear-gradient(transparent, rgba(0, 0, 0, 0.55));
    color: #fff;
}
.hero-slider__cap strong { display: block; font-size: 15px; margin-bottom: 2px; }

/* —— Section blocks —— */
.section { margin: 8px 0 20px; }
.section-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-bottom: 10px;
}
.section-head h2 { margin: 0; font-size: 16px; }
.section-head a { font-size: 12px; font-weight: 500; color: var(--kal-primary); }
.section-orange {
    background: linear-gradient(135deg, #ff8a2a, #ff6a00);
    border-radius: var(--kal-radius);
    padding: 14px 12px 16px;
    color: #fff;
}
.section-orange .section-head h2,
.section-orange .section-head a { color: #fff; }
.promo-card {
    display: flex;
    align-items: center;
    gap: 12px;
    background: var(--kal-surface);
    border-radius: var(--kal-radius);
    padding: 12px 14px;
    margin: 12px 0;
    box-shadow: var(--kal-shadow);
}
.promo-card__body { flex: 1; min-width: 0; }
.promo-card__body strong { display: block; font-size: 14px; }
.promo-card__body span { font-size: 12px; color: var(--kal-muted); }

/* —— Product grid / cards —— */
.grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
}
.card-product {
    background: var(--kal-surface);
    border-radius: var(--kal-radius-sm);
    overflow: hidden;
    box-shadow: var(--kal-shadow);
    position: relative;
    display: flex;
    flex-direction: column;
}
.card-product img {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    background: var(--kal-surface-2);
}
.card-product .body {
    padding: 10px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
}
.card-product .title {
    font-size: 13px;
    font-weight: 500;
    line-height: 1.45;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 2.9em;
}
.card-product .stock-line { font-size: 11px; color: var(--kal-muted); }
.card-product .stock-badge {
    position: absolute;
    top: 8px;
    inset-inline-start: 8px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 10px;
    font-weight: 500;
    padding: 3px 8px;
    border-radius: 999px;
}
.card-product.out-of-stock { opacity: 0.78; }
.card-product.out-of-stock .stock-badge { background: #b71c1c; }
.card-rail .card-product { flex: 0 0 46%; max-width: 180px; }

/* —— Listing toolbar —— */
.list-toolbar {
    position: sticky;
    top: var(--kal-header-h);
    z-index: 40;
    background: var(--kal-bg);
    padding: 8px 0 10px;
    margin: 0 -12px;
    padding-inline: 12px;
}
.list-meta { font-size: 12px; color: var(--kal-muted); margin-bottom: 8px; }
.sort-chips {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    padding-bottom: 2px;
}
.sort-chips::-webkit-scrollbar { display: none; }
.sort-chips a, .sort-chips button {
    flex: 0 0 auto;
    border: 0;
    background: var(--kal-surface);
    color: var(--kal-ink);
    border-radius: 999px;
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 500;
    box-shadow: var(--kal-shadow);
    cursor: pointer;
}
.sort-chips a.active, .sort-chips button.active {
    background: rgba(255, 135, 31, 0.16);
    color: var(--kal-primary);
    box-shadow: inset 0 0 0 1px var(--kal-primary);
}
.filter-row {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    flex-wrap: wrap;
}
.filter-row select, .filter-row label {
    background: var(--kal-surface);
    border-radius: 999px;
    border: 1px solid var(--kal-border);
    padding: 8px 12px;
    font-size: 12px;
    margin: 0;
}
.filter-row select { width: auto; min-width: 120px; }
.pagination {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    justify-content: center;
    padding: 16px 0 28px;
}
.pagination a {
    min-width: 36px;
    height: 36px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    background: var(--kal-surface);
    box-shadow: var(--kal-shadow);
    font-size: 13px;
}
.pagination a.active {
    background: var(--kal-primary);
    color: #fff !important;
}

/* —— PDP —— */
.breadcrumb {
    font-size: 12px;
    color: var(--kal-muted);
    padding: 10px 0 4px;
    overflow-x: auto;
    white-space: nowrap;
}
.breadcrumb a { color: var(--kal-muted); }
.pdp { padding-bottom: 88px; }
.pdp-gallery {
    background: var(--kal-surface);
    border-radius: var(--kal-radius);
    overflow: hidden;
    margin-bottom: 12px;
    box-shadow: var(--kal-shadow);
}
.pdp-gallery__main {
    width: 100%;
    aspect-ratio: 1;
    object-fit: contain;
    background: var(--kal-surface-2);
}
.pdp-thumbs {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    padding: 10px;
    scrollbar-width: none;
}
.pdp-thumbs::-webkit-scrollbar { display: none; }
.pdp-thumbs button {
    flex: 0 0 auto;
    border: 2px solid transparent;
    padding: 0;
    border-radius: 10px;
    background: none;
    cursor: pointer;
    overflow: hidden;
}
.pdp-thumbs button.active { border-color: var(--kal-primary); }
.pdp-thumbs img { width: 56px; height: 56px; object-fit: cover; }
.pdp-buybox {
    background: var(--kal-surface);
    border-radius: var(--kal-radius);
    padding: 16px;
    box-shadow: var(--kal-shadow);
    margin-bottom: 12px;
}
.pdp-buybox h1 { font-size: 18px; margin-bottom: 8px; }
.pdp-price-row {
    display: flex;
    align-items: baseline;
    gap: 10px;
    margin: 8px 0;
}
.pdp-price-row .price { font-size: 22px; }
.stock-pill {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 999px;
    font-size: 12px;
    font-weight: 500;
    background: rgba(255, 135, 31, 0.16);
    color: var(--kal-primary);
}
.stock-pill.out { background: rgba(248, 113, 113, 0.16); color: var(--kal-danger); }
.pdp-meta { color: var(--kal-muted); font-size: 13px; margin: 10px 0; }
.pdp-actions { display: grid; gap: 8px; margin-top: 14px; }
.pdp-actions .qty-row {
    display: flex;
    align-items: center;
    gap: 10px;
    flex-wrap: wrap;
}
.qty-stepper {
    display: inline-flex;
    align-items: center;
    border: 1px solid var(--kal-border);
    border-radius: 12px;
    background: var(--kal-surface-2);
    overflow: hidden;
}
.qty-stepper button {
    width: 40px;
    height: 40px;
    border: 0;
    background: transparent;
    color: var(--kal-ink);
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    line-height: 1;
}
.qty-stepper button:hover { color: var(--kal-primary); }
.qty-stepper input[type="number"] {
    width: 52px !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    text-align: center;
    padding: 8px 0 !important;
    -moz-appearance: textfield;
}
.qty-stepper input[type="number"]::-webkit-outer-spin-button,
.qty-stepper input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
.pdp-actions input[type="number"] {
    width: 88px;
    margin: 0;
    border-radius: 12px;
}
.wish-toggle {
    position: absolute;
    top: 10px;
    inset-inline-end: 10px;
    z-index: 3;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 0;
    background: color-mix(in srgb, var(--kal-surface) 88%, transparent);
    backdrop-filter: blur(8px);
    color: var(--kal-ink);
    font-size: 18px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: var(--kal-shadow);
}
.wish-toggle.is-on { color: #e11d48; }
.pdp-gallery { position: relative; }
.search-suggest {
    position: absolute;
    top: calc(100% + 6px);
    inset-inline: 0;
    z-index: 90;
    background: var(--kal-surface);
    border: 1px solid var(--kal-border);
    border-radius: 14px;
    box-shadow: var(--kal-shadow);
    max-height: 320px;
    overflow: auto;
    display: none;
}
.search-suggest.is-open { display: block; }
.search-suggest a {
    display: flex;
    gap: 10px;
    align-items: center;
    padding: 10px 12px;
    border-bottom: 1px solid var(--kal-border);
    color: var(--kal-ink);
}
.search-suggest a:last-child { border-bottom: 0; }
.search-suggest a:hover { background: var(--kal-surface-2); }
.search-suggest img {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    object-fit: cover;
    background: var(--kal-surface-2);
}
.search-suggest .meta { flex: 1; min-width: 0; }
.search-suggest .meta strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.search-suggest .meta span { font-size: 12px; color: var(--kal-primary); }
.search-suggest .empty { padding: 14px; color: var(--kal-muted); font-size: 13px; }
.banner-rail a {
    flex: 0 0 78%;
    max-width: 320px;
}
.banner-rail img {
    width: 100%;
    border-radius: var(--kal-radius);
    aspect-ratio: 16 / 9;
    object-fit: cover;
}
.cms-page {
    padding: 20px 0 36px;
    max-width: 720px;
}
.cms-page .prose {
    font-size: 14px;
    line-height: 1.85;
    color: var(--kal-ink-soft);
}
.cms-page .prose img { border-radius: 12px; margin: 12px 0; }
.chip-row {
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 10px;
}
.video-card .body .title { min-height: auto; -webkit-line-clamp: 2; }
.map-layout { display: grid; grid-template-columns: 1fr; gap: 12px; min-height: 60vh; padding-bottom: 24px; }
.map-sidebar, .map-canvas-wrap {
    background: var(--kal-surface);
    border: 1px solid var(--kal-border);
    border-radius: var(--kal-radius);
    box-shadow: var(--kal-shadow);
    overflow: hidden;
}
.map-sidebar { padding: 16px; }
.map-canvas { height: 60vh; min-height: 420px; background: var(--kal-surface-2); }
.map-offer {
    margin-top: 16px;
    padding: 12px;
    background: var(--kal-surface-2);
    border-radius: 12px;
}
.map-offer img { width: 100%; max-height: 180px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.map-filter-group { margin-bottom: 18px; }
.map-filter-group p { margin: 0 0 8px; font-weight: 700; color: var(--kal-ink); }
.map-filter-group label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 8px;
    font-size: 14px;
    color: var(--kal-ink);
}
.map-filter-group img { width: 18px; height: 18px; object-fit: contain; }
.map-filter-group input[type="checkbox"] { width: auto; margin: 0; }
.flash[data-auto-hide] { transition: opacity .35s ease, transform .35s ease; }
.flash.is-hiding { opacity: 0; transform: translateY(-6px); }
@media (min-width: 900px) {
    .map-layout { grid-template-columns: 320px 1fr; }
    .map-canvas { height: 70vh; min-height: 520px; }
}
.pdp-sticky {
    position: fixed;
    inset-inline: 0;
    bottom: 0;
    z-index: 65;
    background: var(--kal-surface);
    border-top: 1px solid var(--kal-border);
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 10px;
    box-shadow: 0 -8px 24px rgba(0, 0, 0, 0.35);
}
.pdp-sticky .price { font-size: 16px; white-space: nowrap; }
.pdp-sticky .btn { flex: 1; border-radius: 14px; }
body.has-pdp-sticky { padding-bottom: 0; }
body.has-pdp-sticky .mobile-bar,
body.has-pdp-sticky .wa-fab { display: none !important; }
.pdp-section {
    background: var(--kal-surface);
    border-radius: var(--kal-radius);
    padding: 16px;
    box-shadow: var(--kal-shadow);
    margin-bottom: 12px;
    border: 1px solid var(--kal-border);
}
.pdp-section h2 { font-size: 15px; margin-bottom: 10px; }
.pdp-section .prose { font-size: 13.5px; color: var(--kal-ink-soft); line-height: 1.85; }
.attr-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.attr-table th, .attr-table td {
    padding: 8px 4px;
    border-bottom: 1px solid var(--kal-border);
    text-align: right;
}
.attr-table th { width: 40%; color: var(--kal-muted); font-weight: 500; }
.comment-card {
    background: var(--kal-surface-2);
    border-radius: 12px;
    padding: 12px;
    margin-bottom: 8px;
}
.comment-card .who { font-size: 12px; color: var(--kal-muted); margin-bottom: 4px; }

/* —— Forms / misc —— */
input, textarea, select {
    width: 100%;
    padding: 12px 14px;
    margin: 6px 0 14px;
    border: 1px solid var(--kal-border);
    border-radius: 12px;
    background: var(--kal-surface-2);
    color: var(--kal-ink);
    outline: none;
    transition: border-color .15s ease, box-shadow .15s ease;
}
input:focus, textarea:focus, select:focus {
    border-color: var(--kal-primary);
    box-shadow: 0 0 0 3px rgba(255, 135, 31, 0.2);
}
input:disabled, input[readonly] { opacity: 0.65; }
label { font-size: 13px; color: var(--kal-muted); font-weight: 500; }
.ltr { direction: ltr; text-align: left; }
.form-box, .auth-card {
    max-width: 440px;
    margin: 28px auto;
    background: var(--kal-surface);
    padding: 24px 20px;
    border-radius: var(--kal-radius);
    box-shadow: var(--kal-shadow);
    border: 1px solid var(--kal-border);
}
.auth-card h1 { font-size: 22px; margin-bottom: 6px; }
.auth-card .lead { color: var(--kal-muted); font-size: 13px; margin: 0 0 18px; }
.auth-card .auth-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 16px;
    margin-top: 16px;
    font-size: 13px;
}
.auth-card .auth-links a { color: var(--kal-primary); font-weight: 500; }

.page-head {
    padding: 18px 0 8px;
}
.page-head h1 { font-size: 22px; margin: 0 0 4px; }
.page-head p { margin: 0; color: var(--kal-muted); font-size: 13px; }
.page-card {
    background: var(--kal-surface);
    border: 1px solid var(--kal-border);
    border-radius: var(--kal-radius);
    padding: 16px;
    box-shadow: var(--kal-shadow);
    margin-bottom: 12px;
}
.page-card h2 { font-size: 15px; margin: 0 0 12px; }
.page-card--flush { padding: 0; overflow: hidden; }
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: var(--kal-muted);
}
.empty-state a { color: var(--kal-primary); font-weight: 600; }

/* Cart */
.cart-layout {
    display: grid;
    gap: 12px;
    padding-bottom: 24px;
}
.cart-line {
    display: grid;
    grid-template-columns: 72px 1fr;
    gap: 12px;
    padding: 14px;
    border-bottom: 1px solid var(--kal-border);
}
.cart-line:last-child { border-bottom: 0; }
.cart-line.is-bad { background: rgba(248, 113, 113, 0.08); }
.cart-line__img {
    width: 72px;
    height: 72px;
    border-radius: 12px;
    object-fit: cover;
    background: var(--kal-surface-2);
}
.cart-line__title {
    font-weight: 600;
    font-size: 13px;
    line-height: 1.45;
    margin: 0 0 4px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cart-line__meta { font-size: 12px; color: var(--kal-muted); margin-bottom: 8px; }
.cart-line__meta.is-bad { color: var(--kal-danger); }
.cart-line__row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    justify-content: space-between;
}
.cart-line__qty {
    width: 72px !important;
    margin: 0 !important;
    text-align: center;
    padding: 8px !important;
}
.cart-line__sum { font-weight: 700; color: var(--kal-primary); white-space: nowrap; }
.cart-line__remove {
    font-size: 12px;
    color: var(--kal-danger) !important;
    font-weight: 500;
}
.cart-summary {
    position: sticky;
    bottom: calc(var(--kal-bar-h) + 8px);
    z-index: 30;
}
.cart-summary .row {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    font-size: 13px;
    margin: 6px 0;
    color: var(--kal-ink-soft);
}
.cart-summary .row.total {
    font-size: 16px;
    font-weight: 700;
    color: var(--kal-ink);
    margin-top: 12px;
    padding-top: 12px;
    border-top: 1px solid var(--kal-border);
}
.cart-summary .row.total .price { font-size: 18px; }
.coupon-row {
    display: flex;
    gap: 8px;
    margin: 12px 0;
}
.coupon-row input { margin: 0; flex: 1; }
.checkout-grid {
    display: grid;
    gap: 12px;
    padding-bottom: 28px;
}
.addr-pick {
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.addr-pick label {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    padding: 12px;
    border-radius: 12px;
    background: var(--kal-surface-2);
    border: 1px solid transparent;
    cursor: pointer;
    color: var(--kal-ink);
    margin: 0;
}
.addr-pick label:has(input:checked) {
    border-color: var(--kal-primary);
    background: rgba(255, 135, 31, 0.12);
}
.addr-pick input { width: auto; margin: 2px 0 0; flex-shrink: 0; }
.kv-table { width: 100%; border-collapse: collapse; }
.kv-table th, .kv-table td {
    padding: 10px 4px;
    border-bottom: 1px solid var(--kal-border);
    text-align: right;
    font-size: 13px;
}
.kv-table th { width: 36%; color: var(--kal-muted); font-weight: 500; }
.status-hero {
    font-size: 22px;
    font-weight: 700;
    color: var(--kal-primary);
    margin: 4px 0 14px;
}
.account-stack { display: grid; gap: 12px; }
.wallet-figure {
    font-size: 28px;
    font-weight: 700;
    color: var(--kal-primary);
    margin: 0;
}
.wallet-figure small { font-size: 13px; color: var(--kal-muted); font-weight: 500; }
.wallet-bits {
    font-size: 12px;
    color: var(--kal-muted);
    margin: 8px 0 14px;
    line-height: 1.8;
}
.order-list { display: flex; flex-direction: column; gap: 8px; }
.order-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 12px;
    border-radius: 12px;
    background: var(--kal-surface-2);
}
.order-row__id { font-weight: 700; }
.order-row__meta { font-size: 12px; color: var(--kal-muted); }
.contact-grid { display: grid; gap: 12px; }
.wish-card { position: relative; }
.wish-card .wish-remove {
    position: absolute;
    top: 8px;
    inset-inline-end: 8px;
    z-index: 2;
}
.wish-card .wish-remove .btn {
    min-height: 32px;
    padding: 4px 10px;
    font-size: 11px;
    border-radius: 999px;
}
.theme-toggle {
    width: 40px;
    height: 40px;
    border: 1px solid var(--kal-border);
    border-radius: 12px;
    background: var(--kal-surface-2);
    color: var(--kal-ink);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    font-size: 16px;
    line-height: 1;
}
.theme-toggle:hover { border-color: var(--kal-primary); color: var(--kal-primary); }
.footer {
    padding: 28px 0 24px;
    color: var(--kal-muted);
    font-size: 12px;
    border-top: 1px solid var(--kal-border);
    margin-top: 8px;
    background: var(--kal-surface);
}
.footer-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-bottom: 14px; }
.footer-cols h3 { font-size: 13px; margin: 0 0 8px; color: var(--kal-ink); }
.footer-cols a { display: block; margin: 4px 0; }
.page-grid { display: grid; gap: 16px; }
.side-card {
    background: var(--kal-surface);
    border-radius: var(--kal-radius);
    padding: 16px;
    box-shadow: var(--kal-shadow);
    border: 1px solid var(--kal-border);
}
.side-nav { display: flex; flex-direction: column; gap: 6px; }
.side-nav a { padding: 10px 12px; border-radius: 10px; background: var(--kal-surface-2); font-weight: 500; }
.side-nav a.active, .side-nav a:hover { background: rgba(255, 135, 31, 0.16); color: var(--kal-primary); }
.wa-fab {
    position: fixed;
    left: 14px;
    bottom: calc(var(--kal-bar-h) + 18px);
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #25D366;
    color: #fff !important;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 700;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    z-index: 60;
}
table { width: 100%; border-collapse: collapse; background: transparent; }
th, td { padding: 10px 4px; border-bottom: 1px solid var(--kal-border); text-align: right; font-size: 13px; }
.hero { padding: 18px 0 8px; }
.hero h1 { font-size: 22px; margin: 0 0 4px; }
.hero p, .hero a { color: var(--kal-muted); font-size: 13px; }

/* —— Desktop enhancements —— */
@media (min-width: 768px) {
    body { padding-bottom: 0; font-size: 15px; }
    .wrap { padding: 0 20px; }
    .brand span { display: inline; }
    .nav-toggle { display: none; }
    .cat-trigger { display: inline-flex; }
    .site-links { display: inline-flex; }
    .site-menu {
        display: flex;
        align-items: center;
        gap: 12px;
        width: 100%;
        padding: 0 0 10px;
        overflow-x: auto;
    }
    .site-header__bar { flex-wrap: wrap; }
    .search-main { order: 0; max-width: none; flex: 1; }
    .mobile-bar { display: none; }
    .wa-fab { bottom: 18px; }
    .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
    .trust-strip { grid-template-columns: repeat(4, 1fr); }
    .hero-slider { aspect-ratio: 21 / 8; }
    .list-toolbar { top: 64px; }
    .pdp {
        display: grid;
        grid-template-columns: 1.05fr 0.95fr;
        gap: 20px;
        align-items: start;
        padding-bottom: 40px;
    }
    .pdp-gallery { grid-row: 1 / span 3; position: sticky; top: 80px; }
    .pdp-sticky { display: none; }
    body.has-pdp-sticky .wa-fab { display: flex !important; }
    .pdp-buybox h1 { font-size: 24px; }
    .card-rail .card-product { flex-basis: 200px; max-width: 220px; }
    .page-grid { grid-template-columns: minmax(0, 1fr) 280px; }
    .footer-cols { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
    .cart-layout { grid-template-columns: minmax(0, 1fr) 320px; align-items: start; }
    .cart-summary { position: sticky; top: 80px; bottom: auto; }
    .checkout-grid { grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr); align-items: start; }
    .contact-grid { grid-template-columns: 1fr 1.1fr; }
    .account-stack { grid-template-columns: 1fr 1.15fr; align-items: start; }
}
@media (min-width: 1100px) {
    .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
}

/* —— Motion polish (opt-in, respects reduced-motion) —— */
@keyframes kal-fade-up {
    from { opacity: 0; transform: translateY(12px); }
    to { opacity: 1; transform: translateY(0); }
}
@keyframes kal-soft-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(255, 122, 0, 0.35); }
    50% { box-shadow: 0 0 0 8px rgba(255, 122, 0, 0); }
}
.reveal {
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.45s ease, transform 0.45s ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}
.hero-slider {
    animation: kal-fade-up 0.55s ease both;
}
.card-product {
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card-product:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(15, 23, 42, 0.12);
}
.card-product img {
    transition: transform 0.35s ease;
}
.card-product:hover img {
    transform: scale(1.03);
}
.btn-primary, .btn-buy {
    transition: transform 0.15s ease, filter 0.15s ease;
}
.btn-primary:hover, .btn-buy:hover {
    filter: brightness(1.05);
    transform: translateY(-1px);
}
.wa-fab {
    animation: kal-soft-pulse 2.4s ease-in-out infinite;
}
@media (prefers-reduced-motion: reduce) {
    .reveal,
    .hero-slider,
    .card-product,
    .card-product img,
    .btn-primary,
    .btn-buy,
    .wa-fab {
        animation: none !important;
        transition: none !important;
        transform: none !important;
        opacity: 1 !important;
    }
}
