/* ==================== Category Navigation ==================== */
.category-nav-wrapper {
    background: var(--card-bg);
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 4px 12px var(--shadow);
    margin-bottom: 40px;
}

.category-nav-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

/* Hide scrollbar but keep functionality */
.category-nav-container::-webkit-scrollbar {
    height: 6px;
}

.category-nav-container::-webkit-scrollbar-track {
    background: var(--bg-cream);
    border-radius: 10px;
}

.category-nav-container::-webkit-scrollbar-thumb {
    background: var(--decorative-gray);
    border-radius: 10px;
}

.category-nav-container::-webkit-scrollbar-thumb:hover {
    background: var(--price-copper);
}

#category-nav {
    display: flex;
    gap: 12px;
    min-width: min-content;
}

/* Category Buttons */
.category-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    padding: 12px 20px;
    background: var(--bg-cream);
    border: 2px solid var(--decorative-gray);
    border-radius: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    white-space: nowrap;
    min-width: 120px;
    position: relative;
    overflow: hidden;
}

.category-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, var(--price-copper), #B87333);
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
}

.category-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(205, 127, 50, 0.3);
    border-color: var(--price-copper);
}

.category-btn.active {
    background: var(--price-copper);
    border-color: var(--price-copper);
    color: white;
    box-shadow: 0 4px 12px rgba(205, 127, 50, 0.4);
}

.category-btn.active::before {
    opacity: 1;
}

/* Category Button Content */
.category-icon {
    font-size: 2rem;
    display: block;
    transition: transform 0.3s ease;
}

.category-btn:hover .category-icon {
    transform: scale(1.1);
}

.category-btn.active .category-icon {
    transform: scale(1.15);
}

.category-name {
    font-size: 0.9rem;
    font-weight: 600;
    color: var(--text-black);
    transition: color 0.3s ease;
}

.category-btn.active .category-name {
    color: white;
}

.category-count {
    font-size: 0.75rem;
    padding: 2px 8px;
    background: white;
    color: var(--price-copper);
    border-radius: 12px;
    font-weight: 700;
    transition: all 0.3s ease;
}

.category-btn.active .category-count {
    background: rgba(255, 255, 255, 0.9);
    color: var(--price-copper);
}

/* RTL Support */
body[dir="rtl"] #category-nav {
    direction: rtl;
}

body[dir="rtl"] .category-btn {
    direction: rtl;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .category-nav-container {
        padding: 15px;
    }

    #category-nav {
        gap: 10px;
    }

    .category-btn {
        min-width: 100px;
        padding: 10px 16px;
    }

    .category-icon {
        font-size: 1.5rem;
    }

    .category-name {
        font-size: 0.8rem;
    }

    .category-count {
        font-size: 0.7rem;
        padding: 2px 6px;
    }
}

@media (max-width: 480px) {
    .category-btn {
        min-width: 90px;
        padding: 8px 12px;
    }

    .category-icon {
        font-size: 1.3rem;
    }

    .category-name {
        font-size: 0.75rem;
    }
}

/* Print: Hide category navigation */
@media print {
    .category-nav-wrapper {
        display: none;
    }
}
