/* ===== MODERN CATEGORY MENU - MOBILE FIRST DESIGN ===== */

/* Reset and Base */
* {
    box-sizing: border-box;
}

/* Category Menu Container */
.modern-category-menu {
    position: sticky;
    top: 70px;
    z-index: 9998;
    background: white;
    border-bottom: 1px solid #e5e7eb;
    box-shadow: none;
    transition: all 0.3s ease;
    margin-top: 0;
}

.modern-category-menu.header-hidden {
    top: 0;
}

.category-menu-wrapper {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 16px;
}

/* ===== DESKTOP LAYOUT ===== */
.desktop-category-layout {
    display: none;
    align-items: center;
    gap: 20px;
    padding: 12px 0;
}

@media (min-width: 769px) {
    .desktop-category-layout {
        display: flex;
    }
}

/* Mega Categories Button */
.mega-categories-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 12px 20px;
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    flex-shrink: 0;
}

.mega-categories-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.3);
}

.mega-categories-btn .btn-content {
    display: flex;
    align-items: center;
    gap: 10px;
}

.mega-categories-btn .btn-icon {
    font-size: 20px;
}

.mega-categories-btn .btn-text {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.mega-categories-btn .main-text {
    font-weight: 600;
    font-size: 14px;
}

.mega-categories-btn .sub-text {
    font-size: 11px;
    opacity: 0.9;
}

/* Quick Categories Navigation */
.quick-nav-categories {
    flex: 1;
    overflow: hidden;
}

.nav-scroll-container {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.nav-scroll-container::-webkit-scrollbar {
    display: none;
}

.quick-category-item {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 16px;
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #374151;
    text-decoration: none;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    transition: all 0.2s ease;
}

.quick-category-item:hover,
.quick-category-item.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
    text-decoration: none;
}

.quick-category-item .item-count {
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
    font-size: 11px;
}

/* Promotion Links */
.promotion-links {
    display: flex;
    gap: 8px;
    flex-shrink: 0;
}

.promo-link {
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 8px 12px;
    border-radius: 8px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 600;
    transition: all 0.2s ease;
}

.promo-link.featured-promo {
    background: #fef3c7;
    color: #92400e;
}

.promo-link.new-promo {
    background: #fce7f3;
    color: #9f1239;
}

.promo-link.sale-promo {
    background: #dbeafe;
    color: #1e40af;
}

.promo-link:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
    text-decoration: none;
}

.promo-badge {
    font-size: 10px;
    background: rgba(0, 0, 0, 0.1);
    padding: 2px 6px;
    border-radius: 10px;
}

/* ===== MOBILE LAYOUT ===== */
.mobile-category-layout {
    display: flex;
    padding: 10px 0;
}

@media (min-width: 769px) {
    .mobile-category-layout {
        display: none;
    }
}

.mobile-category-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    gap: 12px;
}

.mobile-categories-toggle {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 16px;
    border-radius: 10px;
    font-weight: 600;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
    cursor: pointer;
}

.mobile-categories-toggle i {
    font-size: 18px;
}

.mobile-quick-scroll {
    display: flex;
    gap: 6px;
    overflow-x: auto;
    flex: 1;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.mobile-quick-scroll::-webkit-scrollbar {
    display: none;
}

.mobile-quick-item {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    padding: 8px 12px;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 500;
    color: #374151;
    text-decoration: none;
    white-space: nowrap;
}

.mobile-quick-item:hover {
    background: #667eea;
    color: white;
    border-color: #667eea;
    text-decoration: none;
}

.mobile-filter-btn {
    background: #f8fafc;
    border: 1px solid #e5e7eb;
    color: #374151;
    padding: 10px 14px;
    border-radius: 10px;
    font-size: 16px;
    cursor: pointer;
    flex-shrink: 0;
}

/* ===== MEGA CATEGORIES DROPDOWN ===== */
.mega-categories-dropdown {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mega-categories-dropdown.show {
    opacity: 1;
    visibility: visible;
}

.mega-dropdown-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: white;
    border-radius: 16px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
    max-width: 900px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    z-index: 99999;
}

.dropdown-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid #e5e7eb;
}

.dropdown-title {
    font-size: 20px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.dropdown-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
    border-radius: 6px;
    transition: all 0.2s ease;
}

.dropdown-close:hover {
    background: #f3f4f6;
    color: #1f2937;
}

.categories-mega-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 16px;
    padding: 24px;
}

.category-column {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.mega-category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    text-decoration: none;
    transition: all 0.2s ease;
    border: 1px solid transparent;
}

.mega-category-item:hover {
    background: #f8fafc;
    border-color: #e5e7eb;
    text-decoration: none;
}

.category-icon-wrapper {
    width: 48px;
    height: 48px;
    border-radius: 10px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.category-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 10px;
}

.category-default-icon {
    font-size: 24px;
    color: #667eea;
}

.category-details {
    flex: 1;
}

.category-title {
    font-size: 14px;
    font-weight: 600;
    color: #1f2937;
    margin: 0 0 4px 0;
}

.category-count {
    font-size: 12px;
    color: #6b7280;
    display: block;
}

.category-status {
    display: inline-block;
    font-size: 10px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 10px;
    margin-top: 4px;
}

.category-status.available {
    background: #d1fae5;
    color: #065f46;
}

.category-status.unavailable {
    background: #fee2e2;
    color: #991b1b;
}

/* ===== MOBILE CATEGORIES OVERLAY ===== */
.mobile-categories-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 99998;
    opacity: 0;
    visibility: hidden;
    transition: all 0.3s ease;
}

.mobile-categories-overlay.active {
    opacity: 1;
    visibility: visible;
}

.mobile-categories-content {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: white;
    overflow-y: auto;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 99999;
}

.mobile-categories-overlay.active .mobile-categories-content {
    transform: translateX(0);
}

.mobile-categories-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 20px;
    border-bottom: 1px solid #e5e7eb;
    background: #f8fafc;
}

.mobile-categories-header h3 {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    margin: 0;
}

.mobile-categories-close {
    background: none;
    border: none;
    font-size: 24px;
    color: #6b7280;
    cursor: pointer;
    padding: 4px;
}

.mobile-categories-list {
    padding: 12px 0;
}

.mobile-category-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 20px;
    color: #374151;
    text-decoration: none;
    border-bottom: 1px solid #f3f4f6;
}

.mobile-category-item:hover {
    background: #f8fafc;
    text-decoration: none;
}

.mobile-category-icon {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    background: #f8fafc;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.mobile-category-icon img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
}

.mobile-category-icon i {
    font-size: 20px;
    color: #667eea;
}

.mobile-category-info {
    flex: 1;
}

.mobile-category-name {
    display: block;
    font-weight: 600;
    font-size: 14px;
    color: #1f2937;
}

.mobile-category-count {
    display: block;
    font-size: 12px;
    color: #6b7280;
}

.mobile-category-arrow {
    color: #9ca3af;
    font-size: 16px;
}

.mobile-promo-section {
    padding: 20px;
    border-top: 1px solid #e5e7eb;
}

.mobile-promo-section h6 {
    font-size: 14px;
    font-weight: 700;
    color: #1f2937;
    margin-bottom: 12px;
}

.mobile-promo-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 10px;
}

.mobile-promo-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 8px;
    border-radius: 10px;
    text-decoration: none;
    font-size: 11px;
    font-weight: 600;
    text-align: center;
}

.mobile-promo-item.featured {
    background: #fef3c7;
    color: #92400e;
}

.mobile-promo-item.new {
    background: #fce7f3;
    color: #9f1239;
}

.mobile-promo-item.sale {
    background: #dbeafe;
    color: #1e40af;
}

.mobile-promo-item i {
    font-size: 20px;
}

/* ===== RESPONSIVE ADJUSTMENTS ===== */
@media (max-width: 768px) {
    .modern-category-menu {
        top: 64px;
    }
    
    body {
        padding-top: 64px !important;
    }
}

@media (max-width: 480px) {
    .modern-category-menu {
        top: 56px;
    }
    
    .category-menu-wrapper {
        padding: 0 12px;
    }
    
    .mobile-categories-toggle {
        padding: 8px 12px;
        font-size: 12px;
    }
    
    .mobile-quick-item {
        padding: 6px 10px;
        font-size: 11px;
    }
}

/* Prevent body scroll when overlays are open */
body.menu-open {
    overflow: hidden;
}
