/* =========================================
   MOBILE BOTTOM NAV - LUXURY GOLD STYLE
   OPTIMIZED FOR INSTAGRAM BROWSER & LOW-END DEVICES
   ========================================= */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 68px;
    background: #0a0a0a;
    border-top: 1px solid rgba(129, 216, 208, 0.2);
    z-index: 9990;
    padding-bottom: env(safe-area-inset-bottom, 0);

    /* Performance: GPU acceleration for smooth rendering */
    transform: translateZ(0);
    contain: layout paint;
    
    /* Instagram browser fixes */
    -webkit-transform: translate3d(0, 0, 0);
    backface-visibility: hidden;
    perspective: 1000px;
}

/* Show only on mobile */
@media (max-width: 768px) {
    .mobile-bottom-nav {
        display: flex;
    }

    /* Add padding to body so content isn't hidden behind nav */
    body {
        padding-bottom: 68px !important;
    }

    /* Hide on vault pages via body class too */
    body.vault-page .mobile-bottom-nav,
    body.selection-vault .mobile-bottom-nav {
        display: none !important;
    }

    body.vault-page,
    body.selection-vault {
        padding-bottom: 0 !important;
    }
    
    /* Instagram in-app browser viewport fix */
    @supports (-webkit-touch-callout: none) {
        .mobile-bottom-nav {
            bottom: constant(safe-area-inset-bottom);
            bottom: env(safe-area-inset-bottom);
        }
    }
}

.mobile-bottom-nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-around;
    width: 100%;
    height: 100%;
    max-width: 420px;
    margin: 0 auto;
    padding: 0 8px;
}

.mobile-bottom-nav__item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    flex: 1;
    height: 100%;
    text-decoration: none;
    color: #666; /* Gray by default, gold on active/hover */
    transition: color 0.2s ease; /* Optimized transition */
    position: relative;
    -webkit-tap-highlight-color: transparent;
    background: none;
    border: none;
    cursor: pointer;
    
    /* Touch target optimization for mobile */
    min-width: 48px;
    min-height: 48px;
    padding: 8px;
}

/* Active state with GPU acceleration */
.mobile-bottom-nav__item:active {
    transform: scale(0.95);
    transition: transform 0.1s ease;
}

.mobile-bottom-nav__item:hover,
.mobile-bottom-nav__item:focus {
    color: #81D8D0;
}

.mobile-bottom-nav__item.is-active {
    color: #81D8D0;
}

.mobile-bottom-nav__item.is-active::after {
    content: '';
    position: absolute;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 4px;
    background: #81D8D0;
    border-radius: 50%;
}

/* Icons */
.mobile-bottom-nav__icon {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 1.5;
    fill: none;
    
    /* Icon rendering optimization */
    flex-shrink: 0;
}

/* Labels */
.mobile-bottom-nav__label {
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    
    /* Text rendering optimization */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Cart Badge */
.mobile-bottom-nav__badge {
    position: absolute;
    top: 8px;
    right: 50%;
    transform: translateX(14px);
    min-width: 16px;
    height: 16px;
    background: #81D8D0;
    color: #000;
    font-family: 'Inter', sans-serif;
    font-size: 9px;
    font-weight: 700;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    
    /* Badge animation */
    transition: transform 0.2s ease;
}

.mobile-bottom-nav__badge:empty {
    display: none;
}

/* Badge pulse animation for new items */
@keyframes badge-pulse {
    0%, 100% { transform: translateX(14px) scale(1); }
    50% { transform: translateX(14px) scale(1.1); }
}

.mobile-bottom-nav__badge.new-item {
    animation: badge-pulse 0.5s ease-in-out;
}

/* Tweak for 6 items */
.mobile-bottom-nav__inner {
    padding: 0 2px; /* Ultra tight padding */
    gap: 0px; /* Zero gap, let flexbox distribute evenly */
    justify-content: space-between; /* Force full spread */
}
.mobile-bottom-nav__item {
    padding: 0 4px; /* Internal touch target padding */
    min-width: 0; /* Allow shrinking below content width if needed */
}
.mobile-bottom-nav__label {
    font-size: 8px;
    letter-spacing: -0.2px; /* Tighter tracking */
    white-space: nowrap; /* Prevent wrapping */
}
/* Specific tweak for Chat icon/text color */
.mobile-bottom-nav__item:last-child {
    color: #11ff00 !important;
}

/* Low-end device optimization: reduce animations */
@media (prefers-reduced-motion: reduce) {
    .mobile-bottom-nav,
    .mobile-bottom-nav__item,
    .mobile-bottom-nav__badge {
        transition: none !important;
        animation: none !important;
        will-change: auto !important;
    }
    
    .mobile-bottom-nav__item:active {
        transform: none;
    }
}
