/* Horizontal Subcategory Navigation Styles */
:root {
    --primary-orange: #D4AF37;
    --secondary-orange: #D4AF37;
    --white: #ffffff;
    --black: #000000;
    --gray-text: #666666;
    --light-gray: #f5f5f5;
    --dark-gray: #333333;
    --border-light: #e0e0e0;
    --shadow-light: 0 2px 8px rgba(0,0,0,0.1);
    --transition: all 0.3s ease;
}

/* Subcategory Navigation Wrapper */
.subcategory-nav-wrapper {
    position: sticky;
    top: 120px; /* Account for header height */
    z-index: 100;
    background: white;
    border-bottom: 1px solid var(--border-light);
    box-shadow: var(--shadow-light);
    margin-bottom: 2rem;
    border-radius: 8px;
}

.subcategory-nav-container {
    position: relative;
    overflow: hidden;
}

/* Desktop Scroll Buttons */
@media (min-width: 769px) {
    .scroll-btn {
        position: absolute;
        top: 50%;
        transform: translateY(-50%);
        width: 36px;
        height: 36px;
        background: white;
        border: 1px solid var(--border-light);
        border-radius: 50%;
        cursor: pointer;
        z-index: 3;
        box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        transition: all 0.3s ease;
        display: flex;
        align-items: center;
        justify-content: center;
        color: var(--gray-text);
        font-size: 12px;
        opacity: 0.8;
    }
    
    .scroll-btn:hover {
        background: var(--primary-orange);
        color: white;
        transform: translateY(-50%) scale(1.1);
        opacity: 1;
    }
    
    .scroll-btn.left {
        left: 10px;
    }
    
    .scroll-btn.right {
        right: 10px;
    }
    
    .scroll-btn:disabled {
        opacity: 0.3;
        cursor: not-allowed;
        background: #f5f5f5;
    }
}

.subcategory-nav {
    display: flex;
    gap: 0;
    overflow-x: auto;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
    padding: 0;
    margin: 0;
}

.subcategory-nav::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

/* Subcategory Navigation Buttons */
.subcategory-nav-btn {
    flex: 0 0 auto;
    padding: 16px 24px;
    background: white;
    border: none;
    color: var(--gray-text);
    font-size: 0.95rem;
    font-weight: 500;
    text-decoration: none;
    transition: var(--transition);
    cursor: pointer;
    border-bottom: 3px solid transparent;
    white-space: nowrap;
    position: relative;
    min-width: 120px;
    text-align: center;
}

.subcategory-nav-btn:hover {
    background: var(--light-gray);
    color: var(--primary-orange);
    border-bottom-color: var(--primary-orange);
}

.subcategory-nav-btn.active {
    background: linear-gradient(135deg, var(--primary-orange), var(--secondary-orange));
    color: white;
    border-bottom-color: var(--secondary-orange);
    font-weight: 600;
}

.subcategory-nav-btn.active:hover {
    background: linear-gradient(135deg, var(--secondary-orange), var(--primary-orange));
    color: white;
}

/* Scroll Indicators */
.subcategory-nav-container::before,
.subcategory-nav-container::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 20px;
    pointer-events: none;
    z-index: 2;
    transition: opacity 0.3s ease;
}

.subcategory-nav-container::before {
    left: 0;
    background: linear-gradient(to right, white, transparent);
}

.subcategory-nav-container::after {
    right: 0;
    background: linear-gradient(to left, white, transparent);
}

/* Product Sections */
.product-section {
    margin-bottom: 4rem;
    scroll-margin-top: 140px; /* Account for sticky nav */
}

.section-title-sticky {
    display: flex;
    justify-content: between;
    align-items: center;
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--light-gray);
}

.section-heading {
    font-size: 1.8rem;
    font-weight: 700;
    color: var(--dark-gray);
    margin: 0;
    position: relative;
}

.section-heading::after {
    content: '';
    position: absolute;
    bottom: -1rem;
    left: 0;
    width: 60px;
    height: 3px;
    background: linear-gradient(135deg, var(--primary-orange), var(--secondary-orange));
    border-radius: 2px;
}

.section-count {
    font-size: 0.9rem;
    color: var(--gray-text);
    background: var(--light-gray);
    padding: 4px 12px;
    border-radius: 20px;
    font-weight: 500;
}

/* Mobile Responsive */
@media (max-width: 768px) {
    .subcategory-nav-wrapper {
        top: 100px;
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0;
    }
    
    .subcategory-nav-btn {
        padding: 12px 16px;
        font-size: 0.85rem;
        min-width: 100px;
    }
    
    .section-heading {
        font-size: 1.5rem;
    }
    
    .product-section {
        scroll-margin-top: 120px;
    }
}

@media (max-width: 480px) {
    .subcategory-nav-btn {
        padding: 10px 12px;
        font-size: 0.8rem;
        min-width: 80px;
    }
    
    .section-heading {
        font-size: 1.3rem;
    }
    
    .section-title-sticky {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.5rem;
    }
}

/* Smooth Scrolling Enhancement */
html {
    scroll-behavior: smooth;
}

/* Loading States */
.subcategory-nav-btn.loading {
    opacity: 0.6;
    pointer-events: none;
}

.subcategory-nav-btn.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 16px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Intersection Observer Enhancements */
.product-section.visible .section-heading {
    animation: slideInFromLeft 0.6s ease-out;
}

@keyframes slideInFromLeft {
    from {
        opacity: 0;
        transform: translateX(-30px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

/* Focus States for Accessibility */
.subcategory-nav-btn:focus {
    outline: 2px solid var(--primary-orange);
    outline-offset: 2px;
}

.subcategory-nav-btn:focus:not(:focus-visible) {
    outline: none;
}

/* High Contrast Mode Support */
@media (prefers-contrast: high) {
    .subcategory-nav-btn {
        border: 1px solid var(--gray-text);
    }
    
    .subcategory-nav-btn.active {
        border: 2px solid var(--primary-orange);
        background: var(--primary-orange);
    }
}

/* Reduced Motion Support */
@media (prefers-reduced-motion: reduce) {
    .subcategory-nav-btn,
    .section-heading,
    html {
        transition: none;
        animation: none;
        scroll-behavior: auto;
    }
}

/* Horizontal Categories Grid Styles */
.categories-horizontal-section {
    background: white;
    border-radius: 12px;
    box-shadow: var(--shadow-light);
    padding: 2rem;
    margin-bottom: 2rem;
}

.categories-header h5 {
    color: var(--dark-gray);
    font-weight: 700;
    margin-bottom: 1.5rem;
    font-size: 1.3rem;
}

.categories-horizontal-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
    align-items: stretch;
}

.category-item-horizontal {
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem 1.5rem;
    background: var(--light-gray);
    border: 2px solid transparent;
    border-radius: 8px;
    text-decoration: none;
    color: var(--gray-text);
    font-weight: 500;
    font-size: 0.95rem;
    transition: var(--transition);
    min-height: 60px;
    text-align: center;
    line-height: 1.4;
}

.category-item-horizontal:hover {
    background: rgba(255, 107, 53, 0.1);
    border-color: var(--primary-orange);
    color: var(--primary-orange);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(255, 107, 53, 0.2);
}

.category-item-horizontal.active {
    background: linear-gradient(135deg, var(--primary-orange), var(--secondary-orange));
    color: white;
    border-color: var(--primary-orange);
    font-weight: 600;
    box-shadow: 0 4px 15px rgba(255, 107, 53, 0.3);
}

.category-item-horizontal.active:hover {
    background: linear-gradient(135deg, var(--secondary-orange), var(--primary-orange));
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 107, 53, 0.4);
    color: white;
}

.category-item-horizontal.subcategory {
    background: rgba(247, 147, 30, 0.1);
    border-color: rgba(247, 147, 30, 0.3);
    color: var(--secondary-orange);
    font-size: 0.9rem;
    position: relative;
}

.category-item-horizontal.subcategory::before {
    content: '└';
    position: absolute;
    left: 8px;
    font-size: 1.2rem;
    opacity: 0.6;
}

.category-item-horizontal.subcategory:hover {
    background: rgba(247, 147, 30, 0.2);
    border-color: var(--secondary-orange);
    color: var(--secondary-orange);
}

.category-item-horizontal.subcategory.active {
    background: linear-gradient(135deg, var(--secondary-orange), var(--primary-orange));
    color: white;
    border-color: var(--secondary-orange);
}

/* Mobile Responsive for Categories Grid */
@media (max-width: 768px) {
    .categories-horizontal-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.8rem;
    }
    
    .category-item-horizontal {
        padding: 0.8rem 1rem;
        font-size: 0.85rem;
        min-height: 50px;
    }
    
    .categories-horizontal-section {
        padding: 1.5rem;
        margin-left: -15px;
        margin-right: -15px;
        border-radius: 0;
    }
}

@media (max-width: 480px) {
    .categories-horizontal-grid {
        grid-template-columns: 1fr;
        gap: 0.6rem;
    }
    
    .category-item-horizontal {
        padding: 0.7rem 1rem;
        font-size: 0.8rem;
        min-height: 45px;
    }
    
    .categories-header h5 {
        font-size: 1.1rem;
        margin-bottom: 1rem;
    }
    
    .categories-horizontal-section {
        padding: 1rem;
    }
}

/* Animation for category items */
.category-item-horizontal {
    position: relative;
    overflow: hidden;
}

.category-item-horizontal::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.3), transparent);
    transition: left 0.5s ease;
}

.category-item-horizontal:hover::after {
    left: 100%;
}

.category-item-horizontal.active::after {
    display: none;
}

/* Focus states for accessibility */
.category-item-horizontal:focus {
    outline: 3px solid var(--primary-orange);
    outline-offset: 2px;
}

.category-item-horizontal:focus:not(:focus-visible) {
    outline: none;
}

/* Loading state for category items */
.category-item-horizontal.loading {
    opacity: 0.6;
    pointer-events: none;
    position: relative;
}

.category-item-horizontal.loading::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid transparent;
    border-top: 2px solid currentColor;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}