/* Mobile Navigation Styles */
.mobile-nav {
    display: none;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #ffffff;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    padding: 15px 0 25px 0;
    border-top-left-radius: 15px;
    border-top-right-radius: 15px;
}

.mobile-nav-container {
    display: flex;
    justify-content: space-around;
    align-items: center;
    max-width: 600px;
    margin: 0 auto;
    padding: 0 15px;
}

.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #666;
    transition: all 0.3s ease;
    position: relative;
}

.nav-item.active {
    color: #b91c1c;
}

.nav-item i {
    font-size: 24px;
    margin-bottom: 4px;
}

.nav-item span {
    font-size: 12px;
    font-weight: 500;
}

.nav-item .cart-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #b91c1c;
    color: white;
    border-radius: 50%;
    padding: 0 6px;
    font-size: 12px;
    min-width: 20px;
    height: 20px;
    display: none;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    box-shadow: 0 2px 4px rgba(0,0,0,0.2);
    transition: all 0.2s ease;
    white-space: nowrap;
    line-height: 20px;
    text-align: center;
}

/* تنظیم خودکار برای اعداد بیشتر در موبایل */
.nav-item .cart-badge[data-count-length="3"] {
    min-width: 24px;
    height: 24px;
    font-size: 11px;
    padding: 0 7px;
    line-height: 24px;
}

.nav-item .cart-badge[data-count-length="4"] {
    min-width: 28px;
    height: 28px;
    font-size: 10px;
    padding: 0 8px;
    border-radius: 14px;
    line-height: 28px;
}

.nav-item .cart-badge[data-count-length="5"] {
    min-width: 32px;
    height: 32px;
    font-size: 9px;
    padding: 0 9px;
    border-radius: 16px;
    line-height: 32px;
}

/* Animation */
.nav-item:active {
    transform: scale(0.95);
}

/* Responsive Design */
/* Changed from 768px to 991px to match Bootstrap lg breakpoint (992px) */
/* This ensures mobile nav shows when desktop header buttons are hidden */
@media screen and (max-width: 991px) {
    .mobile-nav {
        display: block;
    }
    
    /* Body padding is handled in main style.css to avoid conflicts */
}

/* Custom Animations */
@keyframes navItemPop {
    0% { transform: scale(1); }
    50% { transform: scale(1.2); }
    100% { transform: scale(1); }
}

.nav-item:hover {
    color: #b91c1c;
    animation: navItemPop 0.3s ease;
}

/* Active State Indicator */
.nav-item.active::after {
    content: '';
    position: absolute;
    bottom: -10px;
    width: 5px;
    height: 5px;
    background: #007bff;
    border-radius: 50%;
}

/* Mobile Mega Menu */
.mobile-mega-menu {
    position: fixed;
    bottom: 70px;
    left: 0;
    right: 0;
    background: #ffffff;
    height: 80vh;
    z-index: 999;
    border-top-left-radius: 20px;
    border-top-right-radius: 20px;
    box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.1);
    display: none;
    overflow: hidden;
    transition: transform 0.3s ease-in-out;
}

.mobile-mega-menu.active {
    display: block;
    animation: slideUp 0.3s ease-in-out;
}

.mobile-mega-menu-header {
    padding: 15px 20px;
    border-bottom: 1px solid #eee;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: #fff;
    position: sticky;
    top: 0;
    z-index: 10;
    margin-bottom: 10px;
}

.mobile-mega-menu-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: #333;
}

.mobile-mega-menu-close {
    background: none;
    border: none;
    color: #666;
    font-size: 20px;
    padding: 5px;
    cursor: pointer;
}

.mobile-mega-menu-content {
    height: calc(100% - 60px);
    overflow-y: auto;
    padding: 15px;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
}

/* Category Grid Styles */
.mega-menu-items {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.mega-menu-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: #333;
    padding: 12px 8px;
    border-radius: 10px;
    background: #fff;
    transition: all 0.3s ease;
    text-align: center;
}

.mega-menu-item:active {
    transform: scale(0.95);
}

.mega-menu-item i {
    font-size: 24px;
    margin-bottom: 8px;
    color: #007bff;
}

.mega-menu-item span {
    font-size: 12px;
    color: #666;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 32px;
}

/* Warehouse Section Styles */
.warehouse-section {
    margin-bottom: 15px;
    background: #fff;
    border-radius: 12px;
    overflow: visible;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05);
    scroll-margin-top: 70px;
    position: relative;
}

.warehouse-header {
    padding: 15px;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s ease;
}

.warehouse-header:hover {
    background-color: #f8f9fa;
}

.warehouse-header .mega-menu-section-title {
    display: flex;
    align-items: center;
    margin: 0;
    font-size: 15px;
    color: #333;
}

.warehouse-header .mega-menu-section-title i {
    margin-left: 10px;
    font-size: 18px;
}

.warehouse-header .fa-chevron-down {
    margin-right: auto;
    transition: transform 0.3s ease;
}

.warehouse-section.open .fa-chevron-down {
    transform: rotate(180deg);
}

.warehouse-categories {
    padding: 15px;
    background: #f8f9fa;
    border-top: 1px solid #eee;
    display: none;
    position: relative;
    z-index: 1;
}

.warehouse-section.open .warehouse-categories {
    display: block;
    animation: fadeIn 0.3s ease-out;
}

.warehouse-section.open {
    scroll-margin-block: 0;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

/* اصلاح استایل اسکرولبار */
.mobile-mega-menu-content::-webkit-scrollbar {
    width: 5px;
}

.mobile-mega-menu-content::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}

.mobile-mega-menu-content::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.mobile-mega-menu-content::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}

/* اضافه کردن فضای اضافی در انتها */
.mobile-mega-menu-content::after {
    content: '';
    display: block;
    height: 100px;
}

/* Loading Spinner */
.loading-spinner {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
    color: #007bff;
}

.loading-spinner i {
    font-size: 24px;
}

/* Empty State */
.text-muted {
    color: #6c757d;
    text-align: center;
    padding: 15px;
    font-size: 14px;
}

/* Animations */
@keyframes slideUp {
    from {
        transform: translateY(100%);
    }
    to {
        transform: translateY(0);
    }
}

/* Backdrop */
.mobile-mega-menu-backdrop {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 998;
    display: none;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
}

.mobile-mega-menu-backdrop.active {
    display: block;
    opacity: 1;
}

/* Scrollbar Styling */
.mobile-mega-menu-content::-webkit-scrollbar {
    width: 6px;
}

.mobile-mega-menu-content::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.mobile-mega-menu-content::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}

.mobile-mega-menu-content::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* New Simple Mobile Menu Styles */
.mobile-warehouse-section {
    margin-bottom: 5px;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #f0f0f0;
}

.mobile-warehouse-header {
    padding: 15px 20px;
    background: #f8f9fa;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    transition: background-color 0.2s ease;
}

.mobile-warehouse-header:hover {
    background: #e9ecef;
}

.mobile-warehouse-header h4 {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #333;
    flex: 1;
}

.mobile-warehouse-header i {
    color: #666;
    font-size: 12px;
    transition: transform 0.3s ease;
}

.mobile-warehouse-categories {
    background: #fff;
    border-top: 1px solid #f0f0f0;
}

.mobile-category-item {
    display: block;
    padding: 12px 20px;
    color: #555;
    text-decoration: none;
    border-bottom: 1px solid #f8f9fa;
    transition: background-color 0.2s ease;
}

.mobile-category-item:last-child {
    border-bottom: none;
}

.mobile-category-item:hover {
    background: #f8f9fa;
    color: #e6123d;
    text-decoration: none;
}

.mobile-category-item span {
    font-size: 13px;
} 