@charset "UTF-8";

/**
 * Modern Bottom Navigation Bar - App-Style
 * 
 * Purpose: iOS/Android-style bottom navigation for mobile devices
 * Dependencies: variables.css
 * 
 * Features:
 * - Fixed bottom position
 * - App-like icon design
 * - Active state indicators
 * - Safe area insets for notched phones
 * - Smooth transitions
 * 
 * @charset UTF-8
 * @version 1.0.0
 * @date 2026-01-25
 */

/* ============================================================
   BOTTOM NAVIGATION CONTAINER
   ============================================================ */

.bottom-nav {
    position: fixed !important;
    left: 0 !important;
    right: 0 !important;
    bottom: 0 !important;
    width: 100% !important;
    background: rgba(255, 255, 255, 0.95) !important;
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-top: 0.5px solid rgba(0, 0, 0, 0.08) !important;
    box-shadow: 0 -1px 0 rgba(0, 0, 0, 0.05), 0 -4px 20px rgba(0, 0, 0, 0.08) !important;
    z-index: 1000 !important;
    padding-bottom: env(safe-area-inset-bottom, 0);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.3s ease, visibility 0.3s ease;
    border-radius: 0 !important;
    display: flex !important;
    visibility: visible !important;
}

/* Override existing styles */
.bottom-nav.visible {
    bottom: 0 !important;
    transform: translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

/* Show on mobile and tablet (below lg breakpoint) */
.bottom-nav.d-lg-none {
    display: flex !important;
    justify-content: space-around !important;
    visibility: visible !important;
}

/* Hide on large screens and above (desktop - 992px and up) */
@media (min-width: 992px) {
    .bottom-nav.d-lg-none {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transform: translateY(100%) !important;
    }
}

/* Ensure it's visible on medium screens and below (max-width: 991px) */
@media (max-width: 991.98px) {
    .bottom-nav.d-lg-none {
        display: flex !important;
        visibility: visible !important;
        opacity: 1 !important;
        pointer-events: auto !important;
        transform: translateY(0) !important;
    }
}

/* ============================================================
   BOTTOM NAV LIST
   ============================================================ */

.bottom-nav ul {
    display: flex !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 8px !important;
    align-items: center;
    justify-content: space-around;
    height: 64px !important;
    padding-bottom: env(safe-area-inset-bottom, 0);
    gap: 4px;
}

.bottom-nav li {
    flex: 1 !important;
    display: flex !important;
    align-items: center;
    justify-content: center;
    margin: 0 !important;
    padding: 0 4px !important;
    list-style: none !important;
    max-width: 25%;
}

/* ============================================================
   BOTTOM NAV LINKS
   ============================================================ */

.bottom-nav-link {
    display: flex !important;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    padding: 6px 8px !important;
    text-decoration: none !important;
    color: #8e8e93 !important;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    border-radius: 10px;
    min-width: 64px;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    width: 100%;
    height: 100%;
    font-weight: 500;
}

.bottom-nav-link:active {
    transform: scale(0.92);
    background: rgba(0, 0, 0, 0.04);
    transition: transform 0.1s ease, background 0.1s ease;
}

/* ============================================================
   BOTTOM NAV ICONS
   ============================================================ */

.bottom-nav-icon {
    width: 26px !important;
    height: 26px !important;
    stroke: currentColor;
    fill: none;
    stroke-width: 2.2;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    color: currentColor;
    flex-shrink: 0;
}

/* Filled icons for active state */
.bottom-nav-link.active .bottom-nav-icon,
.bottom-nav-link[aria-current="page"] .bottom-nav-icon {
    fill: currentColor;
    stroke: currentColor;
    stroke-width: 2.5;
}

/* ============================================================
   ACTIVE STATE
   ============================================================ */

.bottom-nav-link.active,
.bottom-nav-link[aria-current="page"] {
    color: var(--bs-primary, #007AFF) !important;
}

.bottom-nav-link.active .bottom-nav-icon,
.bottom-nav-link[aria-current="page"] .bottom-nav-icon {
    color: var(--bs-primary, #007AFF) !important;
    transform: scale(1.05);
}

/* Active indicator dot - more prominent */
.bottom-nav-link.active::after,
.bottom-nav-link[aria-current="page"]::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: var(--bs-primary, #007AFF);
    border-radius: 50%;
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1);
}

.bottom-nav-link::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: transparent;
    border-radius: 50%;
    opacity: 0;
    transition: opacity 0.25s cubic-bezier(0.4, 0, 0.2, 1), transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Subtle active background highlight */
.bottom-nav-link.active,
.bottom-nav-link[aria-current="page"] {
    background: rgba(0, 122, 255, 0.06);
}

/* Active state for menu button when mobile nav is open */
body.nx-mobile-nav-open #nx-nav-toggler-bottom,
#nx-main-navbar.nx-active ~ * #nx-nav-toggler-bottom,
.bottom-nav-link.menu-active {
    color: var(--bs-primary, #007AFF) !important;
    background: rgba(0, 122, 255, 0.06);
}

body.nx-mobile-nav-open #nx-nav-toggler-bottom .bottom-nav-icon,
.bottom-nav-link.menu-active .bottom-nav-icon {
    color: var(--bs-primary, #007AFF) !important;
    transform: scale(1.05);
}

body.nx-mobile-nav-open #nx-nav-toggler-bottom::after,
.bottom-nav-link.menu-active::after {
    content: '';
    position: absolute;
    bottom: 6px;
    left: 50%;
    transform: translateX(-50%);
    width: 5px;
    height: 5px;
    background: var(--bs-primary, #007AFF);
    border-radius: 50%;
    opacity: 1;
    box-shadow: 0 0 0 2px rgba(0, 122, 255, 0.1);
}

/* ============================================================
   LABELS (Optional - if you want text labels)
   ============================================================ */

.bottom-nav-link span {
    font-size: 10px;
    font-weight: 500;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    display: none; /* Hide labels for icon-only design */
}

/* Show labels if needed */
.bottom-nav.with-labels .bottom-nav-link span {
    display: block;
}

.bottom-nav.with-labels {
    height: 70px;
}

.bottom-nav.with-labels ul {
    height: 70px;
}

/* ============================================================
   HOVER STATES (Desktop hover)
   ============================================================ */

@media (hover: hover) {
    .bottom-nav-link:hover {
        color: var(--bs-primary, #007AFF);
        background: rgba(0, 122, 255, 0.04);
    }
    
    .bottom-nav-link:hover .bottom-nav-icon {
        transform: scale(1.03);
    }
    
    .bottom-nav-link:not(.active):not([aria-current="page"]):hover {
        color: #5a5a5f;
    }
}

/* ============================================================
   SAFE AREA SUPPORT (Notched phones)
   ============================================================ */

@supports (padding: max(0px)) {
    .bottom-nav {
        padding-bottom: max(8px, env(safe-area-inset-bottom));
    }
    
    .bottom-nav ul {
        padding-bottom: max(0px, env(safe-area-inset-bottom));
    }
}

/* ============================================================
   VISIBILITY STATES
   ============================================================ */

.bottom-nav.visible {
    transform: translateY(0) !important;
    opacity: 1 !important;
    visibility: visible !important;
    display: flex !important;
}

.bottom-nav:not(.visible) {
    transform: translateY(100%);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Ensure bottom nav is visible on mobile/tablet when has d-lg-none class */
.bottom-nav.d-lg-none.visible {
    display: flex !important;
    justify-content: space-around !important;
    visibility: visible !important;
    opacity: 1 !important;
    transform: translateY(0) !important;
}

/* Override for large screens - always hide */
@media (min-width: 992px) {
    .bottom-nav.d-lg-none.visible {
        display: none !important;
        visibility: hidden !important;
        opacity: 0 !important;
        pointer-events: none !important;
        transform: translateY(100%) !important;
    }
}

/* ============================================================
   RESPONSIVE ADJUSTMENTS
   ============================================================ */

@media (max-width: 375px) {
    .bottom-nav ul {
        height: 60px;
        padding: 0 4px;
    }
    
    .bottom-nav-link {
        padding: 6px 4px;
        min-width: 56px;
    }
    
    .bottom-nav-icon {
        width: 24px;
        height: 24px;
    }
}

/* Medium screens - better spacing */
@media (min-width: 376px) and (max-width: 480px) {
    .bottom-nav ul {
        padding: 0 12px;
    }
    
    .bottom-nav li {
        padding: 0 6px;
    }
}

/* ============================================================
   ACCESSIBILITY
   ============================================================ */

.bottom-nav-link:focus-visible {
    outline: 2px solid var(--bs-primary, #007AFF);
    outline-offset: 2px;
    border-radius: 10px;
    background: rgba(0, 122, 255, 0.08);
}

.bottom-nav-link:focus:not(:focus-visible) {
    outline: none;
}

/* ============================================================
   BODY PADDING ADJUSTMENT (Prevent content from being hidden)
   ============================================================ */

/* Override existing body padding-bottom rules for bottom nav */
/* Add padding to body on mobile/tablet to account for fixed bottom nav */
@media (max-width: 991.98px) {
    body {
        padding-bottom: 64px !important;
    }
    
    /* Account for safe area insets on notched devices */
    @supports (padding: max(0px)) {
        body {
            padding-bottom: max(64px, calc(64px + env(safe-area-inset-bottom))) !important;
        }
    }
}

/* Remove padding on large screens where bottom nav is hidden */
@media (min-width: 992px) {
    body {
        padding-bottom: 0 !important;
    }
}

/* Smaller padding on very small screens */
@media (max-width: 375px) {
    body {
        padding-bottom: 60px !important;
    }
    
    @supports (padding: max(0px)) {
        body {
            padding-bottom: max(60px, calc(60px + env(safe-area-inset-bottom))) !important;
        }
    }
}

/* Remove padding on large screens where bottom nav is hidden (already handled above) */

/* ============================================================
   NOTES
   ============================================================ */

/**
 * Design Pattern:
 * - 4-5 icons evenly spaced
 * - Icons are 24px × 24px
 * - Active state: colored icon + dot indicator
 * - Smooth transitions on tap
 * - Safe area support for iPhone X+
 * 
 * Icons:
 * 1. Gift box (Offers)
 * 2. Home
 * 3. Grid (Categories/Menu)
 * 4. Person (Profile)
 * 
 * Active State:
 * - Icon changes color to primary
 * - Small dot appears below icon
 * - Slight scale animation
 * 
 * Performance:
 * - Uses transform for animations
 * - Backdrop filter for glassmorphism
 * - Fixed positioning for smooth scrolling
 */
