/**
 * Sagar Starters - Mobile Bottom Navigation Bar
 * Flipkart & Amazon App Style Modern Design System
 */

/* ── Bottom Nav Container ─────────────────────────────── */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    height: 58px;
    background-color: #ffffff;
    display: flex;
    justify-content: space-around;
    align-items: stretch;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
    border-top: 1px solid #e5e7eb;
    border-radius: 0 !important; /* Flat & flush app-grade edges */
    z-index: 1040;
    padding-bottom: env(safe-area-inset-bottom, 0px);
    transition: background-color 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Nav Item ─────────────────────────────────────────── */
.bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-decoration: none !important;
    color: #64748b; /* Neutral modern slate */
    flex: 1;
    height: 100%;
    position: relative;
    overflow: hidden;
    padding: 5px 2px 3px 2px;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1), transform 0.15s ease;
}

.bottom-nav-item:active {
    transform: scale(0.93);
}

/* ── Flipkart-Style Top Active Accent Indicator Line ──── */
.bottom-nav-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%) scaleX(0);
    width: 36px;
    height: 3px;
    background: var(--primary, #0d6efd);
    border-radius: 0 0 3px 3px;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), opacity 0.2s ease;
    opacity: 0;
    pointer-events: none;
}

.bottom-nav-item.active::before {
    transform: translateX(-50%) scaleX(1);
    opacity: 1;
}

/* ── Icon Wrapper ─────────────────────────────────────── */
.bottom-nav-icon-wrap {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 24px;
    margin-bottom: 2px;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.2s ease;
}

.bottom-nav-icon-wrap i {
    font-size: 19px;
    line-height: 1;
    display: inline-block;
    transition: transform 0.25s cubic-bezier(0.175, 0.885, 0.32, 1.275), color 0.2s ease;
}

/* ── Label Text ───────────────────────────────────────── */
.bottom-nav-item span {
    font-size: 10.5px;
    line-height: 1.15;
    font-weight: 500;
    letter-spacing: 0.1px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, 'Inter', Helvetica, Arial, sans-serif;
    transition: color 0.2s ease, font-weight 0.2s ease;
    text-align: center;
    white-space: nowrap;
}

/* ── Active State (Flipkart Vibrant Theme) ───────────── */
.bottom-nav-item.active {
    color: var(--primary, #0d6efd) !important;
}

.bottom-nav-item.active .bottom-nav-icon-wrap i {
    color: var(--primary, #0d6efd) !important;
    transform: translateY(-1.5px) scale(1.1);
}

.bottom-nav-item.active span {
    color: var(--primary, #0d6efd) !important;
    font-weight: 700 !important;
}

/* ── Live Cart Count Badge (Flipkart/Amazon Red Pill) ─── */
.bottom-nav-badge {
    position: absolute;
    top: -5px;
    right: -7px;
    background: #ef4444; /* Vibrant notification red */
    color: #ffffff !important;
    font-size: 10px;
    font-weight: 700;
    line-height: 1;
    min-width: 17px;
    height: 17px;
    padding: 0 4px;
    border-radius: 9px;
    border: 2px solid #ffffff; /* Cut-out border effect */
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.35);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    pointer-events: none;
    z-index: 2;
    animation: bottomNavBadgePop 0.28s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

@keyframes bottomNavBadgePop {
    0% { transform: scale(0.5); opacity: 0; }
    100% { transform: scale(1); opacity: 1; }
}

/* ── Tactile Wave Ripple ──────────────────────────────── */
.bottom-nav-item .ripple {
    position: absolute;
    border-radius: 50%;
    background: rgba(13, 110, 253, 0.15);
    transform: scale(0);
    animation: bottomNavRipple 0.5s ease-out;
    pointer-events: none;
}

@keyframes bottomNavRipple {
    to {
        transform: scale(4);
        opacity: 0;
    }
}

/* ── Mobile Body Spacing (Prevents content clipping) ──── */
@media (max-width: 767.98px) {
    body {
        padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

/* ── Desktop Hide ─────────────────────────────────────── */
@media (min-width: 768px) {
    .bottom-nav {
        display: none !important;
    }
    body {
        padding-bottom: 0 !important;
    }
}

/* ── Dark Mode Support ────────────────────────────────── */
body.dark-mode-active .bottom-nav,
[data-mdb-theme="dark"] .bottom-nav,
[data-bs-theme="dark"] .bottom-nav {
    background-color: #171b24 !important;
    border-top: 1px solid #282f3d !important;
    box-shadow: 0 -2px 14px rgba(0, 0, 0, 0.5) !important;
}

body.dark-mode-active .bottom-nav-item,
[data-mdb-theme="dark"] .bottom-nav-item,
[data-bs-theme="dark"] .bottom-nav-item {
    color: #94a3b8 !important;
}

body.dark-mode-active .bottom-nav-item.active,
[data-mdb-theme="dark"] .bottom-nav-item.active,
[data-bs-theme="dark"] .bottom-nav-item.active {
    color: #3b82f6 !important;
}

body.dark-mode-active .bottom-nav-item.active .bottom-nav-icon-wrap i,
[data-mdb-theme="dark"] .bottom-nav-item.active .bottom-nav-icon-wrap i,
[data-bs-theme="dark"] .bottom-nav-item.active .bottom-nav-icon-wrap i {
    color: #3b82f6 !important;
}

body.dark-mode-active .bottom-nav-item.active span,
[data-mdb-theme="dark"] .bottom-nav-item.active span,
[data-bs-theme="dark"] .bottom-nav-item.active span {
    color: #60a5fa !important;
}

body.dark-mode-active .bottom-nav-item::before,
[data-mdb-theme="dark"] .bottom-nav-item::before,
[data-bs-theme="dark"] .bottom-nav-item::before {
    background: #3b82f6 !important;
}

body.dark-mode-active .bottom-nav-badge,
[data-mdb-theme="dark"] .bottom-nav-badge,
[data-bs-theme="dark"] .bottom-nav-badge {
    border-color: #171b24 !important;
}