/**
 * Sutore Pre-filter Strip Styles
 *
 * Farfetch-style skeleton and pill styling with horizontal scroll support.
 *
 * @package SutoreFilter
 * @version 1.0.0
 */

/* =============================================
   Strip Container
   ============================================= */

.sutore-prefilter-strip {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 0;
    margin-bottom: 16px;
    width: 100%;
    overflow: hidden;
}

.sutore-prefilter-strip[hidden] {
    display: none !important;
}

/* =============================================
   Pills Container
   ============================================= */

.sutore-prefilter-pills {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    overflow-y: hidden;
    -webkit-overflow-scrolling: touch;
    scroll-snap-type: x proximity;
    /* Changed from mandatory for smoother mobile scrolling */
    scrollbar-width: none;
    /* Firefox */
    -ms-overflow-style: none;
    /* IE/Edge */
    padding: 4px 0;
    /* Space for focus ring */
    flex: 1;
    min-width: 0;
    opacity: 1;
    transition: opacity 0.2s ease;
}

/* Fade state for smooth skeleton-to-pills transition */
.sutore-prefilter-pills--fade {
    opacity: 0;
}

.sutore-prefilter-pills::-webkit-scrollbar {
    display: none;
    /* Chrome/Safari */
}

/* =============================================
   Pill Base Styles
   ============================================= */

.sutore-prefilter-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    padding: 10px 18px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 400;
    text-decoration: none;
    scroll-snap-align: start;
    transition: all 0.2s ease;
    white-space: nowrap;
}

/* Real pill (link) */
a.sutore-prefilter-pill {
    background: #fff;
    border: 1px solid #e0e0e0;
    color: #1a1a1a;
}

a.sutore-prefilter-pill:hover {
    background: #f5f5f5;
    border-color: #ccc;
    color: #1a1a1a;
    text-decoration: none;
}

a.sutore-prefilter-pill:focus {
    outline: 2px solid #1a1a1a;
    outline-offset: 2px;
}

/* Pill with count badge */
.sutore-prefilter-pill__count {
    margin-left: 6px;
    font-size: 12px;
    color: #666;
    font-weight: 400;
}

/* =============================================
   Skeleton Pills
   ============================================= */

.sutore-prefilter-pill--skeleton {
    width: 90px;
    height: 40px;
    background: linear-gradient(90deg,
            #f0f0f0 0%,
            #f0f0f0 40%,
            #e8e8e8 50%,
            #f0f0f0 60%,
            #f0f0f0 100%);
    background-size: 200% 100%;
    animation: sutore-skeleton-shimmer 1.5s ease-in-out infinite;
    border: none;
}

/* Vary skeleton widths for natural look */
.sutore-prefilter-pill--skeleton:nth-child(1) {
    width: 85px;
}

.sutore-prefilter-pill--skeleton:nth-child(2) {
    width: 95px;
}

.sutore-prefilter-pill--skeleton:nth-child(3) {
    width: 75px;
}

.sutore-prefilter-pill--skeleton:nth-child(4) {
    width: 100px;
}

.sutore-prefilter-pill--skeleton:nth-child(5) {
    width: 80px;
}

.sutore-prefilter-pill--skeleton:nth-child(6) {
    width: 90px;
}

.sutore-prefilter-pill--skeleton:nth-child(7) {
    width: 85px;
}

.sutore-prefilter-pill--skeleton:nth-child(8) {
    width: 95px;
}

@keyframes sutore-skeleton-shimmer {
    0% {
        background-position: 200% 0;
    }

    100% {
        background-position: -200% 0;
    }
}

/* =============================================
   Hiding State (empty/error)
   ============================================= */

.sutore-prefilter-strip--hidden {
    opacity: 0;
    visibility: hidden;
    height: 0;
    padding: 0;
    margin: 0;
    overflow: hidden;
    transition: opacity 0.3s ease, height 0.3s ease;
}

/* =============================================
   Mobile Responsive
   ============================================= */

@media (max-width: 768px) {
    .sutore-prefilter-strip {
        padding: 12px 0;
        gap: 10px;
    }

    .sutore-prefilter-pill {
        padding: 8px 14px;
        font-size: 13px;
    }

    .sutore-prefilter-pill--skeleton {
        height: 36px;
    }
}

@media (max-width: 480px) {
    .sutore-prefilter-pills {
        gap: 6px;
    }

    .sutore-prefilter-pill {
        padding: 8px 12px;
        font-size: 12px;
    }
}

/* =============================================
   Loading State (optional future use)
   ============================================= */

.sutore-prefilter-strip--loading .sutore-prefilter-pills {
    pointer-events: none;
}

/* =============================================
   RTL Support
   ============================================= */

[dir="rtl"] .sutore-prefilter-strip {
    flex-direction: row-reverse;
}

[dir="rtl"] .sutore-prefilter-pills {
    direction: rtl;
}

[dir="rtl"] .sutore-prefilter-pill__count {
    margin-left: 0;
    margin-right: 6px;
}