/* CategoryBar Component Styles */

.categories {
    padding: 1rem 0 2rem;
    background: #f5f5f5;
    color: #333;
}

/* Category Bar Header */
.category-bar-header {
    text-align: center;
    margin-bottom: 1rem;
    padding: 0 1rem;
}

.category-bar-title {
    font-family: 'Raleway', sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    color: #333;
}

.category-bar-subtitle {
    font-family: 'Inter', sans-serif;
    font-size: 0.875rem;
    opacity: 0.8;
    margin: 0;
    color: #333;
    text-align: center;
}

/* Legacy support for old h2 styling */
.categories h2 {
    text-align: center;
    font-family: 'Raleway', sans-serif;
    font-size: 1.25rem;
    text-transform: uppercase;
    font-weight: 600;
    margin-bottom: 0;
    color: #333;
}

.categories-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 1rem;
    margin: 0 auto;
    padding: 0 2rem;
    max-width: 1400px;
}

.category-item {
    text-decoration: none;
    color: #333;
    transition: all 0.3s ease;
    padding: 0;
    background: white;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    cursor: pointer;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: flex-start;
    overflow: hidden;
    min-height: 120px;
}

.category-name {
    font-family: 'Inter', sans-serif;
    font-size: 1rem;
    transition: color 0.3s ease;
    font-weight: 600;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    flex: 1;
    padding: 1rem;
    text-align: center;
}

.category-word {
    display: block;
    line-height: 1;
    margin-bottom: 0.15rem;
}

.category-word:last-child {
    margin-bottom: 0;
}

/* Desktop: Larger text */
@media screen and (min-width: 1024px) {
    .category-item {
        min-height: 140px;
    }

    .category-name {
        font-size: 1.5rem;
        font-weight: 700;
    }
}

.category-item:hover {
    transform: translateY(-5px);
    background: #4783c4;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    border-color: #4783c4;
}

.category-item:hover .category-name {
    color: white;
}

.category-item.active {
    border: 2px solid #e02226;
    box-shadow: 0 0 15px rgba(224, 34, 38, 0.3);
}

.category-item.active .category-name {
    color: #e02226;
    font-weight: bold;
}

.category-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 50%;
    background: transparent;
    transition: all 0.3s ease;
    position: relative;
    padding: 0;
    margin: 0;
}

/* Category icon image styling */
.category-icon-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    display: block;
}

/* Tablet - Horizontal Scrolling */
@media screen and (max-width: 1200px) {
    .categories-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: thin;
        scrollbar-color: rgba(224, 34, 38, 0.3) rgba(255, 255, 255, 0.1);
        padding: 0.5rem 2rem;
        gap: 1rem;
        grid-template-columns: none;
        justify-content: flex-start;
    }

    .categories-grid::-webkit-scrollbar {
        height: 8px;
    }

    .categories-grid::-webkit-scrollbar-track {
        background: rgba(255, 255, 255, 0.1);
        border-radius: 4px;
    }

    .categories-grid::-webkit-scrollbar-thumb {
        background: rgba(224, 34, 38, 0.3);
        border-radius: 4px;
    }

    .categories-grid::-webkit-scrollbar-thumb:hover {
        background: rgba(224, 34, 38, 0.5);
    }

    .category-item {
        flex: 0 0 auto;
        width: 200px;
        scroll-snap-align: start;
    }
}

/* Mobile Responsive Styles */
@media screen and (max-width: 768px) {
    .categories {
        padding: 1rem 0;
    }

    .categories-grid {
        display: flex;
        overflow-x: auto;
        scroll-snap-type: x mandatory;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none; /* Firefox */
        -ms-overflow-style: none; /* IE and Edge */
        padding: 0.5rem 1rem;
        gap: 0.5rem;
        grid-template-columns: none;
        -webkit-mask-image: linear-gradient(to right, black 80%, transparent 100%);
        mask-image: linear-gradient(to right, black 80%, transparent 100%);
    }

    /* Reset animation properties on mobile */
    .category-item {
        opacity: 1 !important;
        transform: none !important;
        flex: 0 0 auto;
        width: 120px;
        scroll-snap-align: start;
        min-height: auto;
        flex-direction: column;
    }

    .categories-grid::-webkit-scrollbar {
        display: none; /* Chrome, Safari and Opera */
    }

    .category-icon {
        flex: 0 0 auto;
        width: 100%;
        aspect-ratio: 1;
    }

    .category-name {
        font-size: 1.375rem;
        padding: 0 0.5rem 1.5rem;
    }

    .category-item:active,
    .category-item:focus {
        background: linear-gradient(90deg, #002868 0%, #bf0a30 100%) !important;
    }

    .category-item:active .category-name,
    .category-item:focus .category-name {
        color: white !important;
    }
}
