/**
 * Mobile Bottom Navigation Styles
 * Modern mobile-first navigation for Magento 2 Smartwave Porto theme
 */

/* ============================================
   Mobile Bottom Navigation Bar
   ============================================ */

.mobile-bottom-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    border-top: 1px solid #e0e0e0;
    z-index: 1000;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
    -webkit-box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
}

.bottom-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    padding: 8px 0;
    padding-bottom: calc(8px + env(safe-area-inset-bottom));
    max-width: 100%;
    background: #fff;
}

/* ============================================
   Navigation Items
   ============================================ */

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    flex: 1;
    text-decoration: none;
    color: #666666;
    transition: all 0.3s ease;
    padding: 4px 8px;
    position: relative;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    user-select: none;
}

/* Only apply hover on non-touch devices */
@media (hover: hover) and (pointer: fine) {
    .nav-item:hover {
        color: #e91e63;
        text-decoration: none;
    }
}

.nav-item:focus {
    color: #e91e63;
    text-decoration: none;
}

/* Prevent focus-visible on mobile touch */
@media (pointer: coarse) {
    .nav-item:focus {
        outline: none;
        color: inherit;
    }

    .nav-item:focus .nav-icon svg {
        stroke-width: 2;
    }
}

.nav-item.active {
    color: #e91e63;
}

.nav-item.active .nav-icon svg {
    stroke-width: 2.5;
}

/* ============================================
   Navigation Icons
   ============================================ */

.nav-icon {
    position: relative;
    margin-bottom: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    height: 26px;
}

.nav-icon svg {
    width: 24px;
    height: 24px;
    transition: transform 0.2s ease;
}

.nav-item:active .nav-icon svg {
    transform: scale(0.9);
}

/* ============================================
   Navigation Labels
   ============================================ */

.nav-label {
    font-size: 11px;
    font-weight: 500;
    text-align: center;
    line-height: 1.2;
    margin-top: 2px;
}

/* ============================================
   Cart Badge
   ============================================ */

.cart-badge {
    position: absolute;
    top: -6px;
    right: -8px;
    background: #e91e63;
    color: #ffffff;
    border-radius: 10px;
    padding: 2px 6px;
    font-size: 10px;
    font-weight: bold;
    min-width: 18px;
    height: 18px;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(233, 30, 99, 0.3);
    animation: badge-pulse 2s infinite;
}

@keyframes badge-pulse {

    0%,
    100% {
        transform: scale(1);
    }

    50% {
        transform: scale(1.1);
    }
}

/* ============================================
   Mobile Categories Overlay
   ============================================ */

.mobile-categories-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #ffffff;
    z-index: 2000;
    transform: translateX(-100%);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
}

.mobile-categories-overlay.active {
    transform: translateX(0);
}

.categories-overlay-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 16px 20px;
    border-bottom: 1px solid #e0e0e0;
    background: #ffffff;
    position: sticky;
    top: 0;
    z-index: 10;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.categories-overlay-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 600;
    color: #333333;
}

.close-categories {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    color: #666666;
    transition: color 0.2s ease;
    display: flex;
    align-items: center;
    justify-content: center;
}

.close-categories:hover,
.close-categories:focus {
    color: #e91e63;
}

.close-categories svg {
    width: 24px;
    height: 24px;
}

.categories-overlay-content {
    padding: 16px 0;
}

/* ============================================
   Mobile Responsive Styles
   ============================================ */

@media (max-width: 991px) {

    /* Show mobile bottom navigation */
    .mobile-bottom-nav {
        display: block;
    }

    /* Hide standard header navigation elements on mobile */
    .page-header .action.nav-toggle {
        display: none !important;
    }

    /* Hide cart from header on mobile */
    .page-header .minicart-wrapper {
        display: none !important;
    }

    /* Hide wishlist from header on mobile */
    .page-header .wishlist {
        display: none !important;
    }

    /* Hide account icon from header on mobile */
    .page-header .my-account {
        display: none !important;
    }

    /* Adjust body padding for fixed bottom nav */
    body {
        padding-bottom: 70px;
    }

    /* Ensure main content doesn't overlap with bottom nav */
    .page-wrapper {
        margin-bottom: 0;
    }

    /* Adjust footer if needed */
    .footer-container {
        margin-bottom: 0;
    }
}

/* Small mobile devices */
@media (max-width: 375px) {
    .nav-label {
        font-size: 10px;
    }

    .nav-icon svg {
        width: 22px;
        height: 22px;
    }

    .bottom-nav-container {
        padding: 6px 0;
        padding-bottom: calc(6px + env(safe-area-inset-bottom));
    }
}

/* Larger mobile devices */
@media (min-width: 576px) and (max-width: 991px) {
    .nav-label {
        font-size: 12px;
    }

    .nav-icon svg {
        width: 26px;
        height: 26px;
    }
}

/* Desktop - Hide mobile navigation */
@media (min-width: 992px) {
    .mobile-bottom-nav {
        display: none !important;
    }

    .mobile-categories-overlay {
        display: none !important;
    }

    body {
        padding-bottom: 0 !important;
    }
}

/* ============================================
   Dark Mode Support (Optional)
   ============================================ */
/* 
@media (prefers-color-scheme: dark) {
    .mobile-bottom-nav {
        background: #1a1a1a;
        border-top-color: #333333;
    }

    .bottom-nav-container {
        background: #1a1a1a;
    }

    .nav-item {
        color: #999999;
    }

    .nav-item.active,
    .nav-item:hover,
    .nav-item:focus {
        color: #e91e63;
    }

    .mobile-categories-overlay {
        background: #1a1a1a;
    }

    .categories-overlay-header {
        background: #1a1a1a;
        border-bottom-color: #333333;
    }

    .categories-overlay-header h3 {
        color: #ffffff;
    }

    .close-categories {
        color: #999999;
    }

    .close-categories:hover,
    .close-categories:focus {
        color: #e91e63;
    }
} */

/* ============================================
   Accessibility Improvements
   ============================================ */

.nav-item:focus-visible {
    outline: 2px solid #e91e63;
    outline-offset: 2px;
    border-radius: 4px;
}

a.nav-item:visited {
    color: #666666 !important;
    outline: none !important;

}

.close-categories:focus-visible {
    outline: 2px solid #e91e63;
    outline-offset: 2px;
    border-radius: 4px;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {

    .nav-item,
    .nav-icon svg,
    .mobile-categories-overlay,
    .close-categories,
    .cart-badge {
        transition: none;
        animation: none;
    }
}