/**
 * Mobile Bottom Sheet CSS
 * Exact Fabrilife pattern:
 *   Main panel  → list (icon + name + subtitle + chevron >)
 *   Sub panel   → 3-col grid of letter-initial cards
 * Premium design: gradient header, glassmorphism, Inter font.
 */

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

:root {
    --sheet-radius: 28px;
    --sheet-shadow:
        0 -8px 40px rgba(0, 0, 0, 0.14), 0 -2px 12px rgba(0, 0, 0, 0.08);
    --sheet-curve: cubic-bezier(0.22, 1, 0.36, 1);
    --sheet-dur: 400ms;
    --sheet-z: 1050;
    --backdrop-z: 1040;
    --nav-z: 1030;
    --nav-h: 68px;
    --accent: #5b5ef4;
    --accent-light: #eef0ff;
}

/* ── Body lock ───────────────────────────────────── */
body.bottom-sheet-open {
    overflow: hidden !important;
}

/* ── Backdrop ────────────────────────────────────── */
.bottom-sheet-backdrop {
    position: fixed;
    inset: 0;
    background: rgba(10, 10, 30, 0.45);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    z-index: var(--backdrop-z);
    opacity: 0;
    pointer-events: none;
    will-change: opacity;
    transition: opacity var(--sheet-dur) var(--sheet-curve);
}
.bottom-sheet-backdrop.show {
    opacity: 1;
    pointer-events: auto;
}

/* ── Sheet container ─────────────────────────────── */
.bottom-sheet {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: auto;
    max-height: 85vh;
    background: #fff;
    border-top-left-radius: var(--sheet-radius);
    border-top-right-radius: var(--sheet-radius);
    box-shadow: var(--sheet-shadow);
    z-index: var(--sheet-z);
    transform: translate3d(0, 100%, 0);
    will-change: transform;
    padding-bottom: env(safe-area-inset-bottom, 0);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transition: transform var(--sheet-dur) var(--sheet-curve);
    font-family:
        "Inter",
        -apple-system,
        BlinkMacSystemFont,
        sans-serif;
}
.bottom-sheet.dragging {
    transition: none !important;
}

/* Panels area — fills all space below the header */
.bs-panels-area {
    flex: 1 1 auto;
    position: relative;
    overflow-y: auto;
    overflow-x: hidden;
    min-height: 0;
    -webkit-overflow-scrolling: touch;
}

/* ── Header ──────────────────────────────────────── */
.bottom-sheet-header {
    flex-shrink: 0;
    background: linear-gradient(135deg, #5b5ef4 0%, #8b5cf6 55%, #a78bfa 100%);
    padding: 14px 20px 18px;
    cursor: grab;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
    position: relative;
    overflow: hidden;
}
.bottom-sheet-header::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        rgba(255, 255, 255, 0.18) 0%,
        rgba(255, 255, 255, 0.04) 50%,
        rgba(255, 255, 255, 0.1) 100%
    );
    pointer-events: none;
}
.bottom-sheet-header::after {
    content: "";
    position: absolute;
    width: 180px;
    height: 180px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.07);
    top: -60px;
    right: -40px;
    pointer-events: none;
}
.bottom-sheet-header:active {
    cursor: grabbing;
}

.bottom-sheet-drag-handle {
    width: 44px;
    height: 5px;
    background: rgba(255, 255, 255, 0.4);
    border-radius: 4px;
    margin: 0 auto 14px;
}

.bottom-sheet-title {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.4px;
    color: #fff !important;
    text-shadow: 0 1px 4px rgba(0, 0, 0, 0.12);
    position: relative;
    z-index: 1;
}

/* Close button */
.bottom-sheet-close-btn {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: rgba(255, 255, 255, 0.2);
    color: #fff;
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
    transition:
        background 0.2s,
        transform 0.15s;
    position: relative;
    z-index: 1;
}
.bottom-sheet-close-btn:hover {
    background: rgba(255, 255, 255, 0.32);
}
.bottom-sheet-close-btn:active {
    transform: scale(0.88);
}
.bottom-sheet-close-btn i {
    font-size: 1.35rem;
    line-height: 1;
}

/* Back button */
.bs-back-btn {
    display: flex;
    align-items: center;
    gap: 6px;
    background: none;
    border: none;
    color: #fff;
    font-family: "Inter", sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    padding: 0;
    cursor: pointer;
    position: relative;
    z-index: 1;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: opacity 0.15s;
}
.bs-back-btn:active {
    opacity: 0.7;
}
.bs-back-btn i {
    font-size: 1rem;
}

/* ── Panel system ────────────────────────────────── */
.bs-main-panel {
    position: relative;
    width: 100%;
    background: #f8f9ff;
    will-change: transform, filter;
    transition:
        transform var(--sheet-dur) var(--sheet-curve),
        filter var(--sheet-dur) var(--sheet-curve);
    padding-bottom: 8px;
}

.bs-sub-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: contain;
    background: #f8f9ff;
    will-change: transform;
    transition: transform var(--sheet-dur) var(--sheet-curve);
}

/* Custom scrollbar */
.bs-panels-area::-webkit-scrollbar,
.bs-main-panel::-webkit-scrollbar,
.bs-sub-panel::-webkit-scrollbar {
    width: 3px;
}
.bs-panels-area::-webkit-scrollbar-thumb,
.bs-main-panel::-webkit-scrollbar-thumb,
.bs-sub-panel::-webkit-scrollbar-thumb {
    background: rgba(91, 94, 244, 0.25);
    border-radius: 2px;
}

/* Main panel states */
.bs-main-panel {
    transform: translateX(0);
    z-index: 1;
}
.bs-main-panel.bs-pushed {
    transform: translateX(-28%);
    filter: brightness(0.9) blur(1px);
    pointer-events: none;
}

/* Sub panel states */
.bs-sub-panel {
    transform: translateX(100%);
    z-index: 2;
}
.bs-sub-panel.bs-active {
    transform: translateX(0);
}

/* ── Quick Browse ─────────────────────────────────── */
.quick-tabs-gray-section {
    background: #f0f1fe;
    padding: 16px 14px;
    border-bottom: 1px solid rgba(91, 94, 244, 0.08);
}
.quick-tabs-gray-section::before {
    content: "QUICK BROWSE";
    display: block;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 1.2px;
    color: var(--accent);
    margin-bottom: 10px;
}
.quick-tabs-scroll-container {
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.quick-tabs-scroll-container::-webkit-scrollbar {
    display: none;
}
.quick-tabs-wrapper {
    display: flex;
    gap: 10px;
    padding-bottom: 2px;
}

.quick-tab-card-vertical {
    background: #fff;
    border-radius: 16px;
    padding: 14px 16px 11px;
    flex: 1 1 0;
    min-width: 112px;
    text-align: center;
    box-shadow:
        0 2px 12px rgba(91, 94, 244, 0.08),
        0 1px 3px rgba(0, 0, 0, 0.04);
    border: 1.5px solid rgba(91, 94, 244, 0.07);
    transition:
        transform 0.18s var(--sheet-curve),
        box-shadow 0.18s;
    position: relative;
    overflow: hidden;
}
.quick-tab-card-vertical:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 24px rgba(91, 94, 244, 0.15);
}
.quick-tab-card-vertical:active {
    transform: scale(0.94);
}

.quick-tab-icon-box {
    width: 40px;
    height: 40px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 1.15rem !important;
    position: relative;
    z-index: 0;
}
.quick-tab-icon-box::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 12px;
    background: currentColor;
    opacity: 0.12;
    z-index: -1;
}
.quick-tab-label {
    font-size: 0.65rem;
    font-weight: 700;
    color: #3a3a4a;
    letter-spacing: 0.1px;
    line-height: 1.2;
}

/* ── Main list ────────────────────────────────────── */
.bs-main-list-wrapper {
    background: #fff;
    margin: 12px 12px 0;
    border-radius: 20px;
    box-shadow: 0 2px 14px rgba(0, 0, 0, 0.05);
    overflow: hidden;
}

.bs-section-label {
    font-size: 0.6rem;
    font-weight: 800;
    letter-spacing: 1.1px;
    color: var(--accent);
    padding: 14px 16px 8px;
    font-family: "Inter", sans-serif;
}

.bs-cat-list {
}

/* Individual category row */
.bs-cat-row {
    display: flex;
    align-items: center;
    gap: 14px;
    padding: 13px 16px;
    background: #fff;
    border-bottom: 1px solid rgba(91, 94, 244, 0.06);
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: background 0.14s;
}
.bs-cat-row:last-child {
    border-bottom: none;
}
.bs-cat-row:active {
    background: rgba(91, 94, 244, 0.04);
}

.bs-cat-icon {
    width: 46px;
    height: 46px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.25rem;
    flex-shrink: 0;
    background: var(--category-bg, #e3f2fd);
    color: var(--category-fg, #1976d2);
}

.bs-cat-icon-image {
    display: block;
    width: 25px;
    height: 25px;
    background-color: var(--category-fg, #1976d2);
    -webkit-mask-image: var(--category-image);
    mask-image: var(--category-image);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
}

.bs-cat-text {
    display: flex;
    flex-direction: column;
    gap: 2px;
    color: inherit;
}
.bs-cat-name {
    font-size: 0.92rem;
    font-weight: 700;
    color: #1a1a2e;
    font-family: "Inter", sans-serif;
    line-height: 1.2;
}
.bs-cat-subtitle {
    font-size: 0.74rem;
    font-weight: 500;
    color: #9090a8;
    font-family: "Inter", sans-serif;
    line-height: 1.2;
}

.bs-cat-chevron {
    width: 28px;
    height: 28px;
    border-radius: 8px;
    background: var(--accent-light);
    color: var(--accent);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
    transition:
        background 0.15s,
        transform 0.15s;
}
.bs-cat-row:active .bs-cat-chevron {
    background: #dde0ff;
    transform: translateX(2px);
}

/* ── View All card ───────────────────────────────── */
.view-all-products-card {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    margin: 12px 12px 16px;
    border-radius: 20px;
    background: linear-gradient(135deg, #5b5ef4 0%, #8b5cf6 100%) !important;
    box-shadow: 0 6px 28px rgba(91, 94, 244, 0.35);
    transition:
        transform 0.18s var(--sheet-curve),
        box-shadow 0.18s;
    position: relative;
    overflow: hidden;
}
.view-all-products-card::before {
    content: "";
    position: absolute;
    width: 130px;
    height: 130px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.1);
    top: -40px;
    right: -30px;
    pointer-events: none;
}
.view-all-products-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 36px rgba(91, 94, 244, 0.42);
}
.view-all-products-card:active {
    transform: scale(0.975);
}

.view-all-icon-box {
    width: 44px;
    height: 44px;
    border-radius: 13px;
    background: rgba(255, 255, 255, 0.25) !important;
    color: #fff !important;
    font-size: 1.15rem;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}
.view-all-title {
    font-size: 0.92rem;
    font-weight: 800;
    color: #fff;
    font-family: "Inter", sans-serif;
}
.view-all-subtitle {
    font-size: 0.72rem;
    color: rgba(255, 255, 255, 0.72);
    font-family: "Inter", sans-serif;
}
.view-all-arrow {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.22);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 0.9rem;
    flex-shrink: 0;
    transition: transform 0.15s;
}
.view-all-products-card:hover .view-all-arrow {
    transform: translateX(3px);
}

/* ── Sub panel body ───────────────────────────────── */
.bs-sub-body {
    padding: 16px 14px 24px;
    min-height: 100%;
}

/* 3-column grid */
.bs-sub-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

/* Each grid card */
.bs-sub-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    background: #fff;
    border-radius: 16px;
    padding: 16px 8px 14px;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.06);
    border: 1.5px solid rgba(91, 94, 244, 0.06);
    transition:
        transform 0.18s var(--sheet-curve),
        box-shadow 0.18s,
        border-color 0.18s;
    -webkit-tap-highlight-color: transparent;
}
.bs-sub-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(91, 94, 244, 0.14);
    border-color: rgba(91, 94, 244, 0.18);
}
.bs-sub-card:active {
    transform: scale(0.94);
}

/* Circle with initials */
.bs-sub-card-icon {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.1rem;
    font-weight: 800;
    font-family: "Inter", sans-serif;
    letter-spacing: -0.5px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.bs-sub-card-label {
    font-size: 0.72rem;
    font-weight: 600;
    color: #2a2a3e;
    font-family: "Inter", sans-serif;
    line-height: 1.25;
    text-align: center;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* "View All" card special style */
.bs-sub-card--viewall .bs-sub-card-icon--viewall {
    background: linear-gradient(135deg, #5b5ef4, #8b5cf6) !important;
    color: #fff !important;
    font-size: 1.2rem;
}
.bs-sub-card--viewall .bs-sub-card-label {
    color: var(--accent);
    font-weight: 700;
}

/* ══════════════════════════════════════════════════
   BOTTOM NAVIGATION — Premium Redesign
   Centre Category button is elevated & floating.
══════════════════════════════════════════════════ */

/* Nav bar */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 72px;
    background: rgba(255, 255, 255, 0.96);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    border-top: 1px solid rgba(91, 94, 244, 0.08);
    box-shadow:
        0 -6px 32px rgba(91, 94, 244, 0.08),
        0 -1px 0 rgba(0, 0, 0, 0.04);
    z-index: var(--nav-z);
    padding-bottom: env(safe-area-inset-bottom, 0);
    box-sizing: content-box;
    will-change: transform;
    transition: transform var(--sheet-dur) var(--sheet-curve);
    font-family: "Inter", sans-serif;
    display: flex;
    align-items: stretch;
    padding: 0 4px;
    padding-bottom: env(safe-area-inset-bottom, 0);
}
.mobile-bottom-nav.nav-hidden {
    transform: translate3d(0, 100%, 0);
}

/* ── Regular nav items ── */
.mobile-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    color: #b0b0c8;
    font-weight: 600;
    text-decoration: none;
    border: none;
    background: transparent;
    position: relative;
    padding: 0;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s ease;
}

/* Active pill background */
.mobile-nav-item.active {
    color: var(--accent);
}

.mobile-nav-item.active .mobile-nav-icon-wrap {
    background: linear-gradient(
        135deg,
        rgba(91, 94, 244, 0.12),
        rgba(139, 92, 246, 0.1)
    );
}

/* Icon wrapper for pill effect */
.mobile-nav-icon-wrap {
    width: 44px;
    height: 28px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition:
        background 0.2s ease,
        transform 0.15s cubic-bezier(0.22, 1, 0.36, 1);
}

.mobile-nav-item:active .mobile-nav-icon-wrap {
    transform: scale(0.85);
}

.mobile-nav-item i {
    font-size: 1.3rem;
    line-height: 1;
    display: block;
}

.mobile-nav-label {
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.15px;
    line-height: 1;
}

/* ── Centre floating Category button ── */
.mobile-nav-btn-trigger {
    flex: 0 0 72px; /* fixed width so it doesn't squish */
    position: relative;
    top: -14px; /* lifts it above the nav bar */
    padding: 0;
    margin: 0 4px;
}

.mobile-nav-btn-trigger .nav-center-fab {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: linear-gradient(135deg, #5b5ef4 0%, #8b5cf6 100%);
    box-shadow:
        0 6px 20px rgba(91, 94, 244, 0.5),
        0 2px 8px rgba(91, 94, 244, 0.3),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    transition:
        transform 0.2s cubic-bezier(0.22, 1, 0.36, 1),
        box-shadow 0.2s ease;
    -webkit-tap-highlight-color: transparent;
    /* shimmer ring */
    position: relative;
    overflow: hidden;
}

.mobile-nav-btn-trigger .nav-center-fab::before {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(
        135deg,
        rgba(255, 255, 255, 0.22) 0%,
        rgba(255, 255, 255, 0) 60%
    );
    pointer-events: none;
}

.mobile-nav-btn-trigger:hover .nav-center-fab {
    box-shadow:
        0 10px 28px rgba(91, 94, 244, 0.55),
        0 4px 12px rgba(91, 94, 244, 0.35);
    transform: translateY(-2px) scale(1.04);
}

.mobile-nav-btn-trigger:active .nav-center-fab {
    transform: scale(0.9);
    box-shadow:
        0 4px 12px rgba(91, 94, 244, 0.4),
        0 1px 4px rgba(91, 94, 244, 0.2);
}

.mobile-nav-btn-trigger .mobile-nav-label {
    color: var(--accent);
    margin-top: 2px;
}

/* Badge */
.bag-badge {
    background: linear-gradient(135deg, #f87171, #dc2626);
    color: #fff;
    font-size: 0.56rem;
    font-weight: 800;
    width: 16px;
    height: 16px;
    top: -3px;
    right: -5px;
    line-height: 1;
    box-shadow: 0 1px 4px rgba(220, 38, 38, 0.45);
    border: 1.5px solid #fff;
}

/* ── Misc ─────────────────────────────────────────── */
.navbar.fixed-top {
    position: fixed !important;
    top: 0 !important;
    right: 0 !important;
    left: 0 !important;
    z-index: 1030 !important;
}
body {
    padding-top: 75px !important;
}
@media (max-width: 767.98px) {
    body {
        padding-top: 60px !important;
    }
}

/* Mobile navigation and its sheet must never appear on tablet/desktop. */
@media (min-width: 768px) {
    .mobile-bottom-nav,
    .bottom-sheet,
    .bottom-sheet-backdrop {
        display: none !important;
    }

    body.bottom-sheet-open {
        overflow: auto !important;
    }
}
