/* Mobile Bottom Navigation - Optimized */
.mobile-bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    height: 64px;
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-top: 1px solid rgba(0, 0, 0, 0.08);
    box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.08);
    z-index: 1059;
    contain: layout style paint;
    will-change: transform;
    transform: translateZ(0);
    -webkit-font-smoothing: antialiased;
}

/* Navigation List */
.nav-icons {
    display: flex;
    justify-content: space-around;
    align-items: center;
    margin: 0;
    padding: 0 8px;
    height: 100%;
    list-style: none;
}

.nav-icons li {
    flex: 1;
    min-width: 0;
}

/* Navigation Links */
.nav-link {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    height: 100%;
    padding: 8px 0;
    color: #64748b;
    text-decoration: none;
    border: none;
    background: transparent;
    cursor: pointer;
    position: relative;
    transition: color 0.15s ease;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.nav-link:active {
    transform: scale(0.96);
    transition-duration: 0.1s;
}

/* Active State */
.nav-link.active {
    color: #3b82f6;
    font-weight: 600;
}

.nav-link.active .nav-icon svg {
    color: #3b82f6;
    fill: #3b82f6;
}

/* Hover Effects (for devices with hover) */
@media (hover: hover) {
    .nav-link:hover {
        color: #3b82f6;
    }
    
    .nav-link:hover .nav-icon {
        transform: translateY(-2px);
    }
}

/* Icons */
.nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
    margin-bottom: 4px;
    transition: transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
}

.nav-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
    transition: fill 0.2s ease;
}

/* Text */
.nav-text {
    font-size: 11px;
    font-weight: 500;
    line-height: 1.2;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 70px;
}

/* Cart Badge */
.cart-badge {
    position: absolute;
    top: 12px;
    right: calc(50% - 18px);
    background: #ef4444;
    color: white;
    font-size: 11px;
    font-weight: 700;
    min-width: 18px;
    height: 18px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0 4px;
    border: 2px solid rgba(255, 255, 255, 0.95);
    box-shadow: 0 2px 4px rgba(239, 68, 68, 0.3);
    animation: badgePulse 2s infinite;
}

@keyframes badgePulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* Active Animation */
.nav-link.active .nav-icon {
    animation: iconBounce 0.3s ease;
}

@keyframes iconBounce {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* Button Specific */
.filter-btn {
    appearance: none;
    -webkit-appearance: none;
    font: inherit;
    text-align: inherit;
}

/* Safe Area Support for Notch Phones */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .mobile-bottom-nav {
        padding-bottom: env(safe-area-inset-bottom);
        height: calc(64px + env(safe-area-inset-bottom));
    }
    
    .nav-icons {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* Responsive */
@media (max-width: 360px) {
    .nav-text {
        font-size: 10px;
        max-width: 60px;
    }
    
    .nav-icon {
        width: 22px;
        height: 22px;
    }
    
    .cart-badge {
        font-size: 10px;
        min-width: 16px;
        height: 16px;
        top: 10px;
    }
}

@media (min-width: 768px) {
    .mobile-bottom-nav {
        display: none !important;
    }
}

/* Reduced Motion */
@media (prefers-reduced-motion: reduce) {
    .nav-icon,
    .cart-badge,
    .nav-link {
        transition: none;
        animation: none;
    }
    
    .nav-link:active {
        transform: none;
    }
}

/* Dark Mode 
@media (prefers-color-scheme: dark) {
    .mobile-bottom-nav {
        background: rgba(30, 41, 59, 0.98);
        border-top: 1px solid rgba(255, 255, 255, 0.08);
        box-shadow: 0 -2px 20px rgba(0, 0, 0, 0.3);
    }
    
    .nav-link {
        color: #94a3b8;
    }
    
    .nav-link.active {
        color: #60a5fa;
    }
    
    .nav-link.active .nav-icon svg {
        color: #60a5fa;
        fill: #60a5fa;
    }
    
    .cart-badge {
        border-color: rgba(30, 41, 59, 0.95);
    }
}*/

/* High Contrast Mode */
@media (prefers-contrast: high) {
    .mobile-bottom-nav {
        background: #ffffff;
        border-top: 2px solid #000000;
    }
    
    .nav-link {
        color: #000000;
    }
    
    .nav-link.active {
        color: #0000ff;
        font-weight: 900;
    }
}

/* Performance Optimizations */
.mobile-bottom-nav {
    /* جلوگیری از repaint */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
}

.nav-icon svg {
    /* جلوگیری از فلیکر */
    shape-rendering: geometricPrecision;
}

/* Touch Feedback */
.nav-link::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(59, 130, 246, 0.1);
    border-radius: 12px;
    opacity: 0;
    transition: opacity 0.1s ease;
    pointer-events: none;
}

.nav-link:active::after {
    opacity: 1;
}

/* Loading State */
.mobile-bottom-nav.loading .nav-icon svg {
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% { opacity: 0.5; }
    50% { opacity: 1; }
    100% { opacity: 0.5; }
}
@media (max-width: 991px){
.offcanvas-menu-list a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: .75rem 0;
    color: #444;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
}
.offcanvas-menu-list {
    list-style: none;
    padding: 0;
    margin: 0;
}
.offcanvas-body {
    padding: 1rem 1rem 2rem 1rem;
}
.offcanvas-header {
    border-bottom: 1px solid #ddd;
}
.offcanvas-menu-list>li {
    border-bottom: 1px solid #eee;
}
.offcanvas-menu-list a:hover {
    color: #0047b3;
}
.submenu-toggle {
    display: inline-block;
    width: 8px;
    height: 8px;
    border-right: 2px solid #6c757d;
    border-bottom: 2px solid #6c757d;
    transform: rotate(45deg);
    transition: transform 0.3s ease;
    margin-left: 8px;
}
.submenu-list li a {
    font-weight: 500;
    color: #0a58ca;
    padding: .5rem 0;
    display: block;
}
.submenu-open+.submenu-list {
    max-height: 1000px;
}
.submenu-visible {
    padding: 0.5rem 0;
}
.submenu-list {
    list-style: none;
    margin: 0;
    max-height: 0;
}
}
.submenu-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.35s ease, padding 0.35s ease;
    padding: 0;
}