/* ============================================================
   SaharParts — Mobile bottom nav + mobile search sheet
   Light theme with brand-blue active state.
   ============================================================ */

.sp-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 72px;
    z-index: 1000;
    direction: rtl;
    -webkit-tap-highlight-color: transparent;
    font-family: var(--brand-font, 'Vazirmatn', sans-serif);
}

.sp-bottom-nav-surface {
    position: absolute;
    inset: 0;
    background: #FFFFFF;
    border-top: 1px solid var(--brand-border, #E2E8F0);
    box-shadow: 0 -4px 16px rgba(15, 23, 42, 0.06);
    z-index: 1;
    backface-visibility: hidden;
}

.sp-bottom-nav-animate .sp-bottom-nav-surface {
    transition: clip-path 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}
.sp-bottom-nav-animate .sp-bottom-nav-float {
    transition: transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.sp-bottom-nav-float {
    position: absolute;
    top: 0;
    left: 0;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    border: 6px solid #FFFFFF;
    background: var(--brand-primary, #0F4C81);
    box-shadow: 0 6px 20px rgba(15, 76, 129, 0.30);
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 22px;
    pointer-events: none;
    will-change: transform, opacity;
    backface-visibility: hidden;
    opacity: 1;
    transition: opacity 0.2s ease;
}

.sp-bottom-nav-surface ul {
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    list-style: none;
    margin: 0;
    padding: 8px 0 calc(10px + env(safe-area-inset-bottom, 0px));
    height: 100%;
    position: relative;
    z-index: 1;
}

.sp-bottom-nav-surface li {
    flex: 1;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.sp-bottom-nav-surface li > a {
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    color: var(--brand-text-muted, #64748B);
    text-decoration: none;
    padding: 8px 4px 4px;
    border-radius: 12px;
    position: relative;
    gap: 3px;
    min-height: 48px;
    min-width: 48px;
    -webkit-tap-highlight-color: transparent;
    user-select: none;
    -webkit-user-select: none;
    transition: color 0.25s ease;
}
.sp-bottom-nav-surface li > a:not(.active) {
    opacity: 0.75;
    transition: color 0.25s ease, opacity 0.25s ease;
}
.sp-bottom-nav-surface li > a:not(.active):hover {
    color: var(--brand-primary, #0F4C81);
    opacity: 1;
}
.sp-bottom-nav-surface li > a:active {
    transform: scale(0.92);
}

.sp-bottom-nav-surface li > a.active {
    color: transparent !important;
    opacity: 0 !important;
    pointer-events: auto;
}
.sp-bottom-nav-surface li > a.active i,
.sp-bottom-nav-surface li > a.active i::before,
.sp-bottom-nav-surface li > a.active > span {
    opacity: 0 !important;
    visibility: hidden !important;
    color: transparent !important;
}

.sp-bottom-nav-surface i {
    font-size: 22px;
    line-height: 1;
}

.sp-bottom-nav-surface li > a::after {
    content: '';
    position: absolute;
    inset: 2px;
    border-radius: 12px;
    background: radial-gradient(circle at center, rgba(15, 76, 129, 0.10) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s;
    pointer-events: none;
    z-index: 0;
}
.sp-bottom-nav-surface li > a:active::after {
    opacity: 1;
    transition: opacity 0s;
}

.sp-bottom-nav .sp-mobile-cart-badge {
    font-size: 10px;
    position: absolute;
    top: 2px;
    left: 50%;
    transform: translateX(calc(-50% + 16px));
    background: var(--brand-accent, #F59E0B);
    color: #fff;
    font-weight: 800;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid #FFFFFF;
    z-index: 4;
    line-height: 1;
    pointer-events: none;
}

body.sp-mobile-nav-active {
    padding-bottom: calc(72px + env(safe-area-inset-bottom, 0px));
}

/* ── Account dropdown ────────────────────────────────────── */
.sp-bottom-nav .sp-mobile-account-dropdown {
    display: none;
    position: fixed;
    bottom: calc(82px + env(safe-area-inset-bottom, 0px));
    left: 10px;
    right: 10px;
    background: #FFFFFF;
    border: 1px solid var(--brand-border, #E2E8F0);
    border-radius: 16px;
    box-shadow: 0 -4px 24px rgba(15, 23, 42, 0.12);
    z-index: 1001;
    max-width: 320px;
    margin: 0 auto;
    overflow: hidden;
    direction: rtl;
}
.sp-bottom-nav .sp-mobile-account-dropdown.open { display: block; }
.sp-bottom-nav .sp-mobile-account-info { padding: 18px 18px 10px; }
.sp-bottom-nav .sp-mobile-account-name {
    font-size: 16px;
    font-weight: 700;
    color: var(--brand-text, #172033);
    margin-bottom: 4px;
}
.sp-bottom-nav .sp-mobile-account-mobile {
    font-size: 13px;
    color: var(--brand-text-muted, #64748B);
}
.sp-bottom-nav .sp-mobile-account-divider {
    height: 1px;
    background: var(--brand-border, #E2E8F0);
    margin: 4px 0;
}
.sp-bottom-nav .sp-mobile-account-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 18px;
    color: var(--brand-text, #172033);
    text-decoration: none;
    font-size: 14px;
    transition: background 0.2s;
    flex-direction: row;
    opacity: 1;
    min-height: auto;
    visibility: visible;
}
.sp-bottom-nav .sp-mobile-account-item:hover {
    background: var(--brand-primary-light, #EAF4FB);
}
.sp-bottom-nav .sp-mobile-account-item i {
    font-size: 18px;
    width: 24px;
    text-align: center;
    color: var(--brand-primary, #0F4C81);
}

/* ── Responsive ──────────────────────────────────────────── */
@media (min-width: 769px) {
    .sp-bottom-nav,
    body.sp-mobile-nav-active { display: none !important; }
}
@media (max-width: 768px) {
    .sp-bottom-nav { display: block; }
    .sp-bottom-nav-float { display: flex; }
}
@media (max-width: 480px) {
    .sp-bottom-nav { height: 64px; }
    .sp-bottom-nav-float {
        width: 48px;
        height: 48px;
        border-width: 5px;
        font-size: 19px;
    }
    .sp-bottom-nav-surface li > a {
        font-size: 10px;
        padding: 6px 2px 2px;
        min-height: 44px;
    }
    .sp-bottom-nav-surface i { font-size: 20px; }
    .sp-bottom-nav .sp-mobile-cart-badge {
        transform: translateX(calc(-50% + 14px));
        top: 0;
        min-width: 16px;
        height: 16px;
        font-size: 9px;
    }
    body.sp-mobile-nav-active { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
    .sp-bottom-nav .sp-mobile-account-dropdown {
        bottom: calc(74px + env(safe-area-inset-bottom, 0px));
    }
}

@media (prefers-reduced-motion: reduce) {
    .sp-bottom-nav-animate .sp-bottom-nav-surface,
    .sp-bottom-nav-animate .sp-bottom-nav-float,
    .sp-mobile-search-backdrop,
    .sp-mobile-search-sheet { transition: none; }
}

.sp-bottom-nav-surface li > a:focus-visible {
    outline: 2px solid var(--brand-primary, #0F4C81);
    outline-offset: -4px;
    border-radius: 14px;
}

/* ── Mobile search sheet (light) ─────────────────────────── */
.sp-mobile-search-modal {
    position: fixed;
    inset: 0;
    z-index: 1100;
    display: none;
    direction: rtl;
    -webkit-tap-highlight-color: transparent;
}
.sp-mobile-search-modal.open { display: block; }
.sp-mobile-search-backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.28s ease;
}
.sp-mobile-search-modal.open .sp-mobile-search-backdrop { opacity: 1; }
.sp-mobile-search-sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: min(78vh, 560px);
    background: #FFFFFF;
    border-radius: 24px 24px 0 0;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
    padding: 10px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translate3d(0, 100%, 0);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    z-index: 1;
    overflow: hidden;
}
.sp-mobile-search-modal.open .sp-mobile-search-sheet {
    transform: translate3d(0, 0, 0);
}
.sp-mobile-search-handle {
    width: 40px;
    height: 4px;
    border-radius: 2px;
    background: var(--brand-border, #E2E8F0);
    margin: 4px auto 14px;
    flex-shrink: 0;
}
.sp-mobile-search-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: var(--brand-text, #172033);
    font-size: 16px;
    font-weight: 700;
    margin-bottom: 14px;
    flex-shrink: 0;
}
.sp-mobile-search-close {
    background: var(--brand-bg, #F8FAFC);
    border: none;
    color: var(--brand-text-muted, #64748B);
    width: 36px;
    height: 36px;
    border-radius: 50%;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}
.sp-mobile-search-close:hover { background: var(--brand-border, #E2E8F0); }
.sp-mobile-search-box {
    display: flex;
    align-items: center;
    height: 52px;
    border-radius: 16px;
    overflow: hidden;
    background: var(--brand-bg, #F8FAFC);
    border: 1px solid var(--brand-border, #E2E8F0);
    flex-shrink: 0;
}
.sp-mobile-search-icon {
    color: var(--brand-text-muted, #64748B);
    font-size: 16px;
    padding-inline-start: 16px;
    flex-shrink: 0;
}
.sp-mobile-search-box .sp-search-input {
    flex: 1;
    border: none;
    padding: 0 12px;
    outline: none;
    background: transparent;
    color: var(--brand-text, #172033);
    font-size: 15px;
    min-width: 0;
    height: 100%;
}
.sp-mobile-search-box .sp-search-input::placeholder { color: #94A3B8; }
.sp-mobile-search-box .sp-search-btn {
    width: 48px;
    height: 100%;
    border: none;
    background: var(--brand-primary, #0F4C81);
    color: #fff;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}
.sp-mobile-search-suggestions {
    position: static !important;
    margin-bottom: 12px;
    max-height: min(48vh, 360px);
    overflow-y: auto;
    flex: 1;
    background: #FFFFFF !important;
    border: 1px solid var(--brand-border, #E2E8F0) !important;
    border-radius: 14px !important;
    box-shadow: none !important;
    flex-shrink: 0;
}
.sp-mobile-search-suggestions[style*="display: block"],
.sp-mobile-search-suggestions[style*="display:block"] {
    flex-shrink: 1;
}
body.sp-mobile-search-open { overflow: hidden; }

@media (min-width: 769px) {
    .sp-mobile-search-modal { display: none !important; }
}

/* ============================================================
   Mobile drawers: category + my vehicle
   ============================================================ */
.sp-mobile-drawer {
    position: fixed;
    inset: 0;
    z-index: 1150;
    display: none;
    direction: rtl;
    font-family: var(--brand-font, 'Vazirmatn', sans-serif);
}
.sp-mobile-drawer.open { display: block; }
.sp-mobile-drawer__backdrop {
    position: absolute;
    inset: 0;
    background: rgba(15, 23, 42, 0.45);
    opacity: 0;
    transition: opacity 0.28s ease;
}
.sp-mobile-drawer.open .sp-mobile-drawer__backdrop { opacity: 1; }
.sp-mobile-drawer__sheet {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    max-height: 84vh;
    background: #fff;
    border-radius: 22px 22px 0 0;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18);
    padding: 8px 16px calc(20px + env(safe-area-inset-bottom, 0px));
    transform: translate3d(0, 100%, 0);
    transition: transform 0.32s cubic-bezier(0.22, 1, 0.36, 1);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}
.sp-mobile-drawer.open .sp-mobile-drawer__sheet { transform: translate3d(0, 0, 0); }
.sp-mobile-drawer__handle {
    width: 40px; height: 4px; border-radius: 2px;
    background: var(--brand-border, #E2E8F0);
    margin: 4px auto 12px;
    flex-shrink: 0;
}
.sp-mobile-drawer__header {
    display: flex; align-items: center; justify-content: space-between;
    font-size: 16px; font-weight: 700;
    color: var(--brand-text, #172033);
    margin-bottom: 12px; flex-shrink: 0;
}
.sp-mobile-drawer__close {
    background: var(--brand-bg, #F8FAFC); border: none;
    color: var(--brand-text-muted, #64748B);
    width: 34px; height: 34px; border-radius: 50%;
    font-size: 22px; line-height: 1; cursor: pointer;
    display: flex; align-items: center; justify-content: center;
}
.sp-mobile-drawer__body { overflow-y: auto; flex: 1; }
.sp-mobile-drawer__search {
    display: flex; align-items: center; gap: 10px;
    height: 46px; padding: 0 14px; margin-bottom: 12px;
    border: 1px solid var(--brand-border, #E2E8F0);
    border-radius: 12px; background: var(--brand-bg, #F8FAFC);
}
.sp-mobile-drawer__search i { color: var(--brand-text-muted, #64748B); }
.sp-mobile-drawer__search input {
    flex: 1; border: 0; outline: 0; background: transparent;
    font: inherit; font-size: 14px; color: var(--brand-text, #172033);
}

/* Category accordion */
.sp-cat-acc { list-style: none; margin: 0; padding: 0; }
.sp-cat-acc__item { border-bottom: 1px solid var(--brand-border, #E2E8F0); }
.sp-cat-acc__head {
    display: flex; align-items: center; justify-content: space-between;
    padding: 13px 2px; color: var(--brand-text, #172033);
    text-decoration: none; font-size: 14px; font-weight: 600;
}
.sp-cat-acc__head i { color: var(--brand-text-muted, #64748B); font-size: 12px; }
.sp-cat-acc__sub {
    list-style: none; margin: 0 0 10px; padding: 0 0 0 12px;
    display: flex; flex-direction: column; gap: 2px;
}
.sp-cat-acc__sub a {
    display: block; padding: 6px 0; font-size: 13px;
    color: var(--brand-text-muted, #64748B); text-decoration: none;
}
.sp-cat-acc__sub a:hover { color: var(--brand-primary, #0F4C81); }
.sp-cat-acc__empty { padding: 16px 2px; color: var(--brand-text-muted, #64748B); font-size: 13px; }

/* My vehicle */
.sp-myveh-empty { text-align: center; padding: 24px 0; color: var(--brand-text-muted, #64748B); }
.sp-myveh-empty i { font-size: 2rem; color: var(--brand-primary, #0F4C81); display: block; margin-bottom: 10px; }
.sp-myveh-saved { display: flex; flex-direction: column; gap: 10px; }
.sp-myveh-saved__label { margin: 0; font-size: 12px; color: var(--brand-text-muted, #64748B); }
.sp-myveh-saved__name { margin: 0 0 6px; font-size: 16px; font-weight: 700; color: var(--brand-text, #172033); }
.sp-myveh-form { display: grid; gap: 12px; }
.sp-myveh-form label { display: grid; gap: 6px; }
.sp-myveh-form label > span { font-size: 12px; font-weight: 600; color: var(--brand-text-muted, #64748B); }
.sp-myveh-form select {
    width: 100%; height: 46px; padding: 0 12px;
    border: 1px solid var(--brand-border, #E2E8F0);
    border-radius: 10px; background: #fff; font: inherit; font-size: 14px;
    color: var(--brand-text, #172033); outline: 0;
}
.sp-myveh-form select:focus { border-color: var(--brand-primary, #0F4C81); }
body.sp-drawer-open { overflow: hidden; }

@media (min-width: 769px) {
    .sp-mobile-drawer { display: none !important; }
}
