/* ========================================
   ENHANCED CATEGORY TABS STYLES
   ======================================== */

/* Category tabs container */
.product-category-tabs {
    margin: 2rem 0;
    position: relative;
    overflow: hidden;
    padding: 1rem 0;
}

/* Background decoration for tabs container */
.product-category-tabs::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 70%;
    height: 100%;
    background: radial-gradient(circle, rgba(78, 80, 55, 0.03) 0%, transparent 70%);
    pointer-events: none;
    z-index: -1;
}

.category-tabs-container {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 1rem;
    justify-content: center;
    align-items: center;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 1rem;
    position: relative;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    box-sizing: border-box;
    /* Ensure proper spacing for all tabs */
    min-height: 200px;
}

/* Hide scrollbar for webkit browsers */
.category-tabs-container::-webkit-scrollbar {
    display: none;
}

/* Scroll indicator for horizontal scroll */
.category-tabs-container::before,
.category-tabs-container::after {
    content: '';
    position: sticky;
    top: 0;
    width: 2rem;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8));
    pointer-events: none;
    z-index: 10;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-tabs-container::before {
    left: 0;
    background: linear-gradient(90deg, rgba(255, 255, 255, 0.8), transparent);
}

.category-tabs-container::after {
    right: 0;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.8));
}

/* Show scroll indicators when content overflows */
.category-tabs-container.scrollable::before,
.category-tabs-container.scrollable::after {
    opacity: 1;
}

/* Individual category tab */
.category-tab {
    position: relative;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.9) 0%, rgba(248, 249, 250, 0.8) 100%);
    border: 2px solid rgba(233, 236, 239, 0.8);
    border-radius: 16px;
    padding: 1rem 0.75rem;
    width: 140px;
    min-width: 140px;
    max-width: 140px;
    flex: 0 0 140px;
    height: 100px;
    cursor: pointer;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    overflow: hidden;
    display: flex !important;
    flex-direction: column;
    align-items: center;
    text-align: center;
    box-shadow: 
        0 6px 24px rgba(0, 0, 0, 0.1),
        0 3px 12px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-sizing: border-box;
    opacity: 1 !important;
    visibility: visible !important;
    /* Ensure proper positioning */
    position: relative;
    z-index: 1;
}

/* Glassmorphism effect */
.category-tab::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.05) 100%);
    border-radius: 24px;
    z-index: 1;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.category-tab:hover::before {
    opacity: 1;
}

/* Tab hover effects */
.category-tab:hover {
    transform: translateY(-12px) scale(1.03);
    border-color: rgba(78, 80, 55, 0.6);
    box-shadow: 
        0 20px 60px rgba(78, 80, 55, 0.15),
        0 8px 32px rgba(78, 80, 55, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.9);
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(240, 242, 245, 0.9) 100%);
    z-index: 10;
}

/* Active tab state */
.category-tab.active {
    background: linear-gradient(135deg, #4c3b31 0%, #9a7c6b 100%);
    border-color: #4e5037;
    color: white;
    box-shadow: 
        0 12px 40px rgba(177, 136, 87, 0.3),
        0 6px 20px rgba(78, 80, 55, 0.2),
        inset 0 1px 0 rgba(177, 136, 87, 0.2);
    transform: translateY(-4px) scale(1.01);
    z-index: 5;
}

/* Active tab glow effect */
.category-tab.active::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    background: linear-gradient(45deg, #9a7c6b, #4c3b31, #6b574b, #504037);
    border-radius: 26px;
    z-index: -1;
    opacity: 0.7;
    animation: activeGlow 3s ease-in-out infinite;
}

@keyframes activeGlow {
    0%, 100% { opacity: 0.7; }
    50% { opacity: 1; }
}

/* Tab icon container */
.tab-icon {
    width: 40px;
    height: 40px;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 0.625rem;
    transition: all 0.4s ease;
    position: relative;
    z-index: 2;
    box-shadow: 
        0 4px 16px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

/* Active tab icon */
.category-tab.active .tab-icon {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
    transform: scale(1.1);
    box-shadow: 
        0 6px 20px rgba(0, 0, 0, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

/* Tab icon */
.tab-icon i {
    font-size: 1.6rem;
    color: #4c3b31;
    transition: all 0.4s ease;
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.1));
}

/* Active tab icon color */
.category-tab.active .tab-icon i {
    color: white;
    transform: scale(1.05);
    filter: drop-shadow(0 2px 4px rgba(0, 0, 0, 0.2));
}

/* Tab content container */
.tab-content {
    display: flex;
    flex-direction: column;
    gap: 0.375rem;
    z-index: 2;
    position: relative;
    width: 100%;
}

/* Tab title */
.tab-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: #2c3e50;
    line-height: 1.2;
    transition: color 0.4s ease;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
    /* Ensure text is always visible */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 100%;
}

/* Active tab title */
.category-tab.active .tab-title {
    color: white;
    font-weight: 800;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

/* Tab subtitle */
.tab-subtitle {
    font-size: 0.7rem;
    color: #6c757d;
    font-weight: 500;
    opacity: 0.9;
    transition: color 0.4s ease;
    font-style: italic;
    line-height: 1.1;
}

/* Active tab subtitle */
.category-tab.active .tab-subtitle {
    color: rgba(255, 255, 255, 0.95);
    font-weight: 600;
}

/* Tab indicator */
.tab-indicator {
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 5px;
    background: linear-gradient(45deg, #9a7c6b, #4c3b31, #6b574b, #504037);
    border-radius: 3px;
    transition: width 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 8px rgba(78, 80, 55, 0.3);
}

/* Active tab indicator */
.category-tab.active .tab-indicator {
    width: 85%;
}

/* Hover indicator effect */
.category-tab:hover .tab-indicator {
    width: 70%;
}

/* Responsive design for large screens */
@media (min-width: 1200px) {
    .category-tabs-container {
        justify-content: center;
        gap: 1rem;
    }
    
    .category-tab {
        width: 160px;
        min-width: 160px;
        max-width: 160px;
        flex: 0 0 160px;
        height: 110px;
    }
}

/* Responsive design for medium screens */
@media (max-width: 1199px) and (min-width: 992px) {
    .category-tabs-container {
        justify-content: center;
        gap: 0.875rem;
    }
    
    .category-tab {
        width: 140px;
        min-width: 140px;
        max-width: 140px;
        flex: 0 0 140px;
        height: 100px;
    }
}

/* Responsive design for tablets */
@media (max-width: 991px) and (min-width: 768px) {
    .category-tabs-container {
        justify-content: flex-start;
        gap: 0.75rem;
        padding: 0 0.75rem;
    }
    
    .category-tab {
        width: 130px;
        min-width: 130px;
        max-width: 130px;
        flex: 0 0 130px;
        height: 95px;
        padding: 0.875rem 0.625rem;
    }
    
    .tab-icon {
        width: 40px;
        height: 40px;
        margin-bottom: 0.625rem;
    }
    
    .tab-icon i {
        font-size: 1.1rem;
    }
    
    .tab-title {
        font-size: 0.85rem;
    }
    
    .tab-subtitle {
        font-size: 0.7rem;
    }
}

/* Responsive design for small tablets */
@media (max-width: 767px) and (min-width: 576px) {
    .category-tabs-container {
        justify-content: flex-start;
        gap: 0.625rem;
        padding: 0 0.5rem;
    }
    
    .category-tab {
        width: 120px;
        min-width: 120px;
        max-width: 120px;
        flex: 0 0 120px;
        height: 85px;
        padding: 0.75rem 0.5rem;
    }
    
    .tab-icon {
        width: 35px;
        height: 35px;
        margin-bottom: 0.5rem;
    }
    
    .tab-icon i {
        font-size: 1rem;
    }
    
    .tab-title {
        font-size: 0.8rem;
    }
    
    .tab-subtitle {
        font-size: 0.65rem;
    }
}

/* Responsive design for mobile */
@media (max-width: 575px) {
    .category-tabs-container {
        justify-content: flex-start;
        gap: 0.5rem;
        padding: 0 0.25rem;
        scroll-snap-type: x mandatory;
    }
    
    .category-tab {
        width: 110px;
        min-width: 110px;
        max-width: 110px;
        flex: 0 0 110px;
        height: 80px;
        padding: 0.625rem 0.5rem;
        scroll-snap-align: start;
    }
    
    .tab-icon {
        width: 30px;
        height: 30px;
        margin-bottom: 0.375rem;
    }
    
    .tab-icon i {
        font-size: 0.9rem;
    }
    
    .tab-title {
        font-size: 0.75rem;
    }
    
    .tab-subtitle {
        font-size: 0.6rem;
    }
}

/* Extra small screens */
@media (max-width: 480px) {
    .category-tab {
        width: 100px;
        min-width: 100px;
        max-width: 100px;
        flex: 0 0 100px;
        height: 70px;
        padding: 0.5rem 0.375rem;
    }
    
    .tab-icon {
        width: 25px;
        height: 25px;
        margin-bottom: 0.25rem;
    }
    
    .tab-icon i {
        font-size: 0.8rem;
    }
    
    .tab-title {
        font-size: 0.7rem;
    }
    
    .tab-subtitle {
        font-size: 0.55rem;
    }
}

/* Animation for tab entrance */
@keyframes tabEntrance {
    from {
        opacity: 0;
        transform: translateY(40px) scale(0.85);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.category-tab {
    animation: tabEntrance 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

/* Stagger animation for multiple tabs */
.category-tab:nth-child(1) { animation-delay: 0.1s; }
.category-tab:nth-child(2) { animation-delay: 0.2s; }
.category-tab:nth-child(3) { animation-delay: 0.3s; }
.category-tab:nth-child(4) { animation-delay: 0.4s; }
.category-tab:nth-child(5) { animation-delay: 0.5s; }

/* Hover animation for icon */
.category-tab:hover .tab-icon {
    transform: scale(1.15) rotate(8deg);
}

/* Active tab hover effects */
.category-tab.active:hover {
    transform: translateY(-8px) scale(1.02);
}

/* Focus states for accessibility */
.category-tab:focus {
    outline: none;
    box-shadow: 
        0 0 0 4px rgba(78, 80, 55, 0.3),
        0 8px 32px rgba(0, 0, 0, 0.1);
}

/* Loading state */
.category-tab.loading {
    opacity: 0.6;
    pointer-events: none;
    transform: scale(0.95);
}

/* Success state animation */
@keyframes successPulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.08); }
    100% { transform: scale(1); }
}

.category-tab.success {
    animation: successPulse 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}


    @media (prefers-color-scheme: light ) {
    .category-tab {
        background: linear-gradient(45deg, #9a7c6b, #4c3b31, #6b574b, #504037);
        border-color: rgba(74, 85, 104, 0.8);
            color: #e2e8f0;
        }

        
    
    .category-tab:hover {
        background: linear-gradient(45deg, #9a7c6b, #4c3b31, #6b574b, #504037);
        border-color: #9a7c6b;
    }
        
    .tab-icon {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
        color: white;
    }
    
    .tab-title {
        color: #e2e8f0;
    }
    
    .tab-subtitle {
        color: #a0aec0;
    }
}

@media (prefers-color-scheme: dark ) {
    .category-tab {
        background: linear-gradient(45deg, #9a7c6b, #4c3b31, #6b574b, #504037);
        border-color: rgba(74, 85, 104, 0.8);
            color: #e2e8f0;
        }

        
    
    .category-tab:hover {
        background: linear-gradient(45deg, #9a7c6b, #4c3b31, #6b574b, #504037);
        border-color: #9a7c6b;
    }
        
    .tab-icon {
        background: linear-gradient(135deg, rgba(255, 255, 255, 0.25) 0%, rgba(255, 255, 255, 0.15) 100%);
        color: white;
    }
    
    .tab-title {
        color: #e2e8f0;
    }
    
    .tab-subtitle {
        color: #a0aec0;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .category-tab {
        border-width: 3px;
        box-shadow: 0 4px 16px rgba(0, 0, 0, 0.3);
    }
    
    .category-tab.active {
        border-width: 4px;
        box-shadow: 0 6px 24px rgba(0, 0, 0, 0.5);
    }
}

/* Reduced motion support */
@media (prefers-reduced-motion: reduce) {
    .category-tab,
    .tab-icon,
    .tab-indicator {
        transition: none;
        animation: none;
    }
    
    .category-tab:hover {
        transform: none;
    }
    
    .category-tab.active {
        transform: none;
    }
}

/* Additional improvements for better visibility */
.category-tab {
    /* Ensure proper stacking context */
    isolation: isolate;
   
}

/* Better contrast for tab titles */
.tab-title {
    font-weight: 700;
    letter-spacing: 0.025em;
}

/* Enhanced hover states */
.category-tab:hover {
    /* Ensure hover state is always visible */
    z-index: 10;
}

/* Improved active state visibility */
.category-tab.active {
    /* Ensure active state is prominent */
    z-index: 5;
    position: relative;
}

/* Better spacing between tabs */
.category-tabs-container {
    /* Ensure consistent spacing */
    gap: 1rem;
}

/* Responsive gap adjustments */
@media (max-width: 768px) {
    .category-tabs-container {
        gap: 0.75rem;
    }
}

@media (max-width: 576px) {
    .category-tabs-container {
        gap: 0.5rem;
    }
} 