/**
 * Footer Navigation Styles - Bottom Nav Bar
 * Fixed position navigation that stays at bottom while content scrolls
 */

/* Bottom Navigation Bar - FIXED at bottom by default */
.bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    width: 100%;
    background-color: #00a651;
    /* Darker green-black for extreme contrast */
    display: flex;
    justify-content: space-around;
    align-items: flex-start;
    padding-top: 12px !important;
    padding-bottom: calc(15px + var(--safe-bottom, env(safe-area-inset-bottom, 20px))) !important;
    z-index: 2147483647 !important;
    min-height: var(--app-footer-height) !important;
    height: auto !important;
    max-height: calc(150px + var(--safe-bottom, env(safe-area-inset-bottom, 20px))) !important;
    /* Fixed height to prevent CLS */
    box-shadow: 0 -4px 30px rgba(0, 0, 0, 0.4);
    box-sizing: border-box;
    border-radius: 25px 25px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.15);
    contain: layout style paint;
    will-change: transform;
    transform: translateZ(0);
    /* Force GPU acceleration */
    pointer-events: auto !important;
}

/* Navigation Item */
.bottom-nav .nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 8px 16px;
    border-radius: 12px;
    position: relative;
    color: #ffffff;
    /* Use pure white for accessibility */
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    min-width: 60px;
    /* Prevent width shifts */
    text-align: center;
    contain: layout style;
}

.bottom-nav .nav-item:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.bottom-nav .nav-item:active {
    transform: scale(0.95);
}

/* Navigation Icon */
.bottom-nav .nav-icon {
    width: 24px;
    height: 24px;
    filter: brightness(0) invert(1);
    opacity: 0.9;
    transition: all 0.2s ease;
}

.bottom-nav .nav-item.active .nav-icon {
    opacity: 1;
    transform: scale(1.1);
}

/* Navigation Label */
.bottom-nav .nav-item span {
    font-size: 11px;
    font-weight: 600;
    /* Bolder text for better contrast */
    color: inherit;
    letter-spacing: 0.3px;
}

/* Active State */
.bottom-nav .nav-item.active {
    background-color: rgb(47 97 37 / 20%);
    color: #ffffff;
}

.bottom-nav .nav-item.active .nav-icon {
    filter: brightness(0) saturate(100%) invert(100%) sepia(87%) brightness(95%) contrast(101%);
    opacity: 1;
}

/* Cart Count Badge */
.bottom-nav .cart-count {
    position: absolute;
    top: 0;
    right: 8px;
    background: #ff4757;
    color: white;
    font-size: 10px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 8px rgba(255, 71, 87, 0.4);
}

/* Dark Mode Support */
html.dark-mode .bottom-nav,
body.dark-mode .bottom-nav {
    background: #353535 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

html.dark-mode .top-nav,
body.dark-mode .top-nav {
    background: #353535 !important;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
}

html.dark-mode .bottom-nav .nav-item,
body.dark-mode .bottom-nav .nav-item {
    color: rgba(255, 255, 255, 0.7);
}

html.dark-mode .bottom-nav .nav-item.active,
body.dark-mode .bottom-nav .nav-item.active {
    background-color: rgba(255, 255, 255, 0.15);
    color: #ffffff;
}

/* Responsive adjustments */
@media (max-width: 360px) {
    .bottom-nav .nav-item {
        padding: 6px 10px;
        min-width: 50px;
        /* Maintain minimum width */
    }

    .bottom-nav .nav-icon {
        width: 20px;
        height: 20px;
    }

    .bottom-nav .nav-item span {
        font-size: 9px;
    }

    .bottom-nav {
        min-height: 60px;
        height: 60px;
        /* Consistent height on mobile */
        padding: 8px 0;
        padding-bottom: calc(8px + var(--safe-bottom, env(safe-area-inset-bottom, 0px)));
    }
}

/* Site Footer - Brand & Links Section at bottom of scroll */
.site-footer {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 40px 20px;
    margin-top: 40px;
    border-radius: 40px 40px 0 0;
    min-height: 160px;
    /* Reserve space to eliminate CLS (measured height) */
    contain: layout style;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 15px;
    margin-bottom: 25px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    padding: 8px 16px;
    border-radius: 20px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-links a:hover {
    color: #fff;
    background: rgba(0, 166, 81, 0.2);
    border-color: rgba(0, 166, 81, 0.3);
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 166, 81, 0.2);
}

.footer-info p {
    color: rgba(255, 255, 255, 0.4);
    font-size: 11px;
    margin: 6px 0;
    letter-spacing: 0.2px;
    line-height: 1.5;
}

.footer-info strong {
    color: rgba(255, 255, 255, 0.7);
    font-weight: 600;
}

html.dark-mode .site-footer {
    background: rgba(15, 23, 42, 0.3);
}