/**
 * File: /shared/css/category-carousel.css
 * Purpose: Shared category carousel structure, navigation, interaction states,
 *          responsive behavior, and presentation.
 *
 * Defines the category carousel used across the Signs Platform.
 * Owl Carousel integration and category component behavior are owned here.
 *
 * Brand-specific visual values are supplied through CSS custom properties.
 *
 * Dependencies:
 * - /shared/css/tokens.css
 * - /brand/{brand}/css/tokens.css
 * - Owl Carousel
 *
 * This file must not contain:
 * - Hard-coded brand-specific colors
 * - Brand-specific imagery
 * - Category data
 * - Carousel initialization logic
 * - JavaScript behavior
 */


/* ==========================================
   CATEGORY CAROUSEL WRAPPER
   ========================================== */

/*
 * Keep category navigation visible while the user scrolls.
 */
 #carouselCategoriesWrapper {
    position: sticky;
    top: 0;
    z-index: 1020;

    padding: 0;

    background-color: var(--color-surface);
}


/* ==========================================
   CAROUSEL CONTAINER
   ========================================== */

#carouselCategoriesWrapper .carousel-container {
    overflow: hidden;

    padding: 4px 0;

    text-align: center;

    background-color: var(
        --brand-secondary,
        var(--color-surface)
    );
}


/* ==========================================
   CAROUSEL DIVIDER
   ========================================== */

/*
 * Brand accent is used for the decorative divider while
 * the divider's structure remains shared.
 */
#carouselCategoriesWrapper .carousel-divider {
    height: 1px;
    margin: 0;
    padding: 0;

    border: 0;

    background: linear-gradient(
        90deg,
        transparent,
        var(--brand-accent),
        var(--brand-accent-hover),
        var(--brand-accent),
        transparent
    );
}


/* ==========================================
   OWL CAROUSEL STAGE
   ========================================== */

.owl-stage {
    display: flex !important;
    align-items: center;
    justify-content: center;
}


/* ==========================================
   CATEGORY BUTTON
   ========================================== */

#carouselCategories .category,
.item.category {
    display: flex;
    align-items: center;
    justify-content: center;

    min-height: 38px;

    margin: 0 2px;
    padding: 6px 16px;

    background-color: var(--color-surface);

    color: var(
        --brand-text-accent,
        var(--color-text)
    );

    border: 1px solid var(
        --brand-accent,
        var(--color-border)
    );

    border-radius: 4px;

    font-family: "Raleway", "Helvetica Neue", sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
    letter-spacing: 0.4px;
    text-align: center;

    white-space: nowrap;

    cursor: pointer;

    box-shadow: var(--shadow-xs);

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        box-shadow 0.2s ease,
        transform 0.2s ease;
}


/* ==========================================
   CATEGORY HOVER
   ========================================== */

#carouselCategories .category:hover,
.item.category:hover {
    background-color: var(
        --brand-surface-soft,
        var(--color-surface-muted)
    );

    border-color: var(
        --brand-accent-hover,
        var(--color-border-hover)
    );

    color: var(
        --brand-text-accent-hover,
        var(--color-text)
    );

    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.12);

    transform: translateY(-1px);
}


/* ==========================================
   ACTIVE CATEGORY
   ========================================== */

/*
 * Support both the application's explicit .active state and
 * Owl Carousel's centered-item state.
 */
.item.category.active,
#carouselCategories .category.active,
#carouselCategories .owl-item.center .category {
    background: linear-gradient(
        135deg,
        var(--brand-accent),
        var(--brand-accent-hover)
    );

    border-color: var(--brand-accent-hover);

    color: var(
        --brand-text-on-primary,
        var(--color-surface)
    );

    box-shadow:
        0 3px 10px
        var(
            --brand-accent-shadow,
            rgba(0, 0, 0, 0.15)
        );

    transform: translateY(-1px);
}


/* ==========================================
   OWL NAVIGATION
   ========================================== */

.owl-nav {
    position: absolute;
    top: 50%;

    width: 100%;

    display: flex;
    justify-content: space-between;

    transform: translateY(-50%);

    pointer-events: none;
}


/* ==========================================
   OWL NAVIGATION BUTTONS
   ========================================== */

.owl-nav button {
    pointer-events: auto;

    padding: 3px 10px;

    background-color: var(--color-surface);

    color: var(
        --brand-primary,
        var(--color-text)
    );

    border: 1px solid var(--color-border);
    border-radius: 5px;

    font-size: 1rem;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease;
}


.owl-nav button:hover {
    background-color: var(--color-surface-muted);
    border-color: var(--color-border-hover);

    transform: translateY(-1px);
}


/* ==========================================
   MOBILE
   ========================================== */

@media (max-width: 768px) {
    #carouselCategories .category,
    .item.category {
        min-height: 34px;

        margin: 0 4px;
        padding: 3px 12px;

        font-size: 0.85rem;
    }
}