/**
 * Mobile Bottom Navigation Tab
 * Responsive Bottom Tab Navigation for Mobile Devices Only
 * Last Updated: December 10, 2025
 */

/* ========================================
   MOBILE BOTTOM NAVIGATION
======================================== */

/* Hide bottom nav on desktop by default */
.mobile-bottom-nav {
    display: none;
}

/* Show only on mobile devices (max-width: 991px) */
@media (max-width: 991px) {
    .mobile-bottom-nav {
        display: block;
        position: fixed;
        bottom: env(safe-area-inset-bottom, 0);
        left: 0;
        right: 0;
        width: 100%;
        background: #d5edfa;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.15);
        z-index: 1000;
        padding: 0.5rem 0;
        border-top: 2px solid rgba(0, 174, 239, 0.2);
        backdrop-filter: blur(10px);
        -webkit-backdrop-filter: blur(10px);
    }

    .mobile-nav-container {
        display: flex;
        justify-content: space-around;
        align-items: center;
        max-width: 100%;
        margin: 0 auto;
        padding: 0 0.5rem;
    }

    .mobile-nav-item {
        flex: 1;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        text-decoration: none;
        color: #64748b;
        padding: 0.5rem 0.25rem;
        border-radius: 12px;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        position: relative;
        min-height: 60px;
        cursor: pointer;
    }

    /* GLOBAL HIDE CART FROM MOBILE NAV */
    .mobile-nav-item[aria-label="Cart"],
    .mobile-nav-item[href*="cart.php"] {
        display: none !important;
    }

    .mobile-nav-item:hover {
        text-decoration: none;
        color: #0A47A3;
        background: rgba(0, 174, 239, 0.05);
        transform: translateY(-2px);
    }

    .mobile-nav-item.active {
        color: #0A47A3;
        background: linear-gradient(135deg, rgba(0, 174, 239, 0.1), rgba(135, 206, 235, 0.1));
    }

    .mobile-nav-item.active::before {
        content: '';
        position: absolute;
        top: -2px;
        left: 50%;
        transform: translateX(-50%);
        width: 40px;
        height: 3px;
        background: linear-gradient(90deg, #0A47A3, #1E90FF);
        border-radius: 0 0 3px 3px;
        animation: slideDown 0.3s ease;
    }

    @keyframes slideDown {
        from {
            opacity: 0;
            transform: translateX(-50%) translateY(-5px);
        }

        to {
            opacity: 1;
            transform: translateX(-50%) translateY(0);
        }
    }

    .mobile-nav-icon {
        font-size: 1.4rem;
        margin-bottom: 0.25rem;
        transition: all 0.3s ease;
    }

    .mobile-nav-item.active .mobile-nav-icon {
        transform: scale(1.15);
        color: #0A47A3;
        filter: drop-shadow(0 2px 4px rgba(0, 174, 239, 0.3));
    }

    .mobile-nav-item:hover .mobile-nav-icon {
        transform: scale(1.1);
    }

    .mobile-nav-label {
        font-size: 0.7rem;
        font-weight: 600;
        text-transform: uppercase;
        letter-spacing: 0.5px;
        margin-top: 0.15rem;
        transition: all 0.3s ease;
    }

    .mobile-nav-item.active .mobile-nav-label {
        font-weight: 700;
        color: #0A47A3;
    }

    /* Add padding to body to prevent content from being hidden behind the fixed nav */
    body {
        padding-bottom: calc(65px + env(safe-area-inset-bottom, 0));
    }

    /* Ripple effect on tap */
    .mobile-nav-item::after {
        content: '';
        position: absolute;
        top: 50%;
        left: 50%;
        width: 0;
        height: 0;
        border-radius: 50%;
        background: rgba(0, 174, 239, 0.2);
        transform: translate(-50%, -50%);
        transition: width 0.4s, height 0.4s;
    }

    .mobile-nav-item:active::after {
        width: 100%;
        height: 100%;
    }
}

/* Extra small devices (320px - 374px) */
@media (max-width: 374px) {
    .mobile-bottom-nav {
        padding: 0.4rem 0;
    }

    .mobile-nav-item {
        min-height: 55px;
        padding: 0.4rem 0.2rem;
    }

    .mobile-nav-icon {
        font-size: 1.2rem;
    }

    .mobile-nav-label {
        font-size: 0.65rem;
    }

    body {
        padding-bottom: calc(60px + env(safe-area-inset-bottom, 0));
    }
}

/* Small mobile devices (375px - 424px) */
@media (min-width: 375px) and (max-width: 424px) {
    .mobile-nav-icon {
        font-size: 1.3rem;
    }

    .mobile-nav-label {
        font-size: 0.68rem;
    }
}

/* Large mobile devices (425px - 767px) */
@media (min-width: 425px) and (max-width: 767px) {
    .mobile-nav-icon {
        font-size: 1.5rem;
    }

    .mobile-nav-label {
        font-size: 0.72rem;
    }

    .mobile-nav-item {
        min-height: 65px;
    }
}

/* Tablet devices (768px - 991px) */
@media (min-width: 768px) and (max-width: 991px) {
    .mobile-nav-icon {
        font-size: 1.6rem;
    }

    .mobile-nav-label {
        font-size: 0.75rem;
    }

    .mobile-nav-item {
        min-height: 70px;
        padding: 0.6rem 0.5rem;
    }

    body {
        padding-bottom: calc(70px + env(safe-area-inset-bottom, 0));
    }
}

/* Light mode enforced - Dark mode disabled for consistent light theme */
@media (prefers-color-scheme: dark) {
    .mobile-bottom-nav {
        background: #d5edfa;
        border-top-color: rgba(0, 174, 239, 0.2);
    }

    .mobile-nav-item {
        color: #64748b;
    }

    .mobile-nav-item.active {
        color: #0A47A3;
        background: linear-gradient(135deg, rgba(0, 174, 239, 0.1), rgba(135, 206, 235, 0.1));
    }

    .mobile-nav-item:hover {
        color: #0A47A3;
        background: rgba(0, 174, 239, 0.05);
    }
}

/* Accessibility improvements */
.mobile-nav-item:focus {
    outline: 2px solid #0A47A3;
    outline-offset: 2px;
}

.mobile-nav-item:focus:not(:focus-visible) {
    outline: none;
}

/* Safe area insets for devices with notches and gesture bars */
/* Additional internal padding for better spacing on iOS and Android */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        padding-bottom: calc(0.5rem + env(safe-area-inset-bottom));
    }
}