/* SLIDER SECTION */
#case-carousel {
    --carousel-vh: 100svh;
    position: relative;
    background: #0b0f14;
    color: white;
    min-height: var(--carousel-vh);
    padding-block: 1rem;
    padding-inline: var(--hero-align-x, clamp(0.9rem, 3.4vw, 4.5rem));
    border-top: 1px solid rgba(255,255,255,0.05);
    border-bottom: 1px solid rgba(255,255,255,0.05);
    display: none;
}

@supports (height: 100dvh) {
    #case-carousel {
        --carousel-vh: 100dvh;
    }
}

.carousel-header h2 {
    font-size: clamp(2.5rem, 5vw, 5rem);
}

.carousel-header {
    padding-block: clamp(1.5rem, 4vw, 3rem);
}

/* Slider layout */
.slider-outer {
    display: flex;
    align-items: center;
    gap: 1rem;
    padding: 2rem 0;
    max-width: 100%;
    height: 100%;
}

/* Hides overflow so only visible cards show */
.slider-viewport {
    flex: 1;
    overflow: hidden;
}

/* The moving track */
#carousel-track {
    display: flex;
    gap: 1rem;
    transition: transform 0.5s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    padding: 0.5rem 0;
    
}

#case-carousel-mobile {
    display: block;
}

@media (min-width: 1025px), (min-width: 769px) and (orientation: landscape) {
    #carousel-track { gap: 3rem; }
    #case-carousel-mobile { display: none; }
    #case-carousel { display: block; }

    /* Give desktop carousel a little more breathing room. */
    #case-carousel {
        min-height: calc(var(--carousel-vh) + clamp(2.5rem, 4vh, 4rem));
        padding-top: clamp(1.25rem, 2.2vh, 2rem);
        padding-bottom: clamp(2.25rem, 4vh, 3.5rem);
    }

    .filter-row {
        margin-top: clamp(1.25rem, 2vh, 2rem);
        padding-bottom: clamp(1.5rem, 3vh, 2.25rem);
    }
}

@media (min-width: 1025px) and (max-height: 980px), (min-width: 769px) and (orientation: landscape) and (max-height: 980px) {
    #case-carousel {
        min-height: calc(var(--carousel-vh) + 5rem);
    }

    .slider-outer {
        padding: 1.75rem 0 2rem;
    }

    .filter-row {
        padding-bottom: 2.5rem;
    }
}

/* Cards */
#carousel-track li {
    flex-shrink: 0;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s ease, transform 0.3s ease;
}
#carousel-track li:hover {
    border-color: #f64900;
    transform: translateY(-5px);
}

/* Card info */
.card-info {
    background: rgba(0,0,0,0.5);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}
.carousel-card-category {
    font-size: 0.75rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: #f64900;
    margin-bottom: 0.5rem;
}
.carousel-card-title {
    font-size: 1.1rem;
    font-weight: 700;
    line-height: 1.2;
    color: white;
}

/* Arrow buttons */
.slider-arrow {
    flex-shrink: 0;
    width: 48px;
    /* height: 10vh; */
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    /* border-radius: 50%; */
    color: white;
    font-size: 1.2rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease, border-color 0.3s ease, opacity 0.3s ease;
}
.slider-arrow:hover {
    background: #f64900;
    border-color: #f64900;
}

/* Filter buttons */
.filter-row {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin: 1rem 0 0;
    flex-wrap: wrap;
    padding: 0 var(--hero-align-x, clamp(0.9rem, 3.4vw, 4.5rem));
}
.filter-btn {
    padding: 0.75rem 1.5rem;
    background: rgba(255,255,255,0.08);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    /* border-radius: 50px; */
    font-size: 0.85rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    cursor: pointer;
    transition: all 0.3s ease;
}
.filter-btn:hover {
    border-color: #f64900;
    color: #ffffff;
}
.filter-btn.active-filter {
    background: #f64900;
    border-color: #f64900;
    color: white;
}

@media (max-width: 768px), (orientation: portrait) and (max-width: 1024px) {
    .slider-outer { padding: 1.5rem 0; }
    .slider-arrow { width: 38px; height: 38px; font-size: 1rem; }
    .filter-btn   { padding: 0.6rem 1rem; font-size: 0.75rem; }
}









/*  MOBILE CAROUSEL  */
#case-carousel-mobile {
    overflow: hidden;
    padding-bottom: clamp(1.5rem, 5vw, 2.5rem);
}

/* Filter row  horizontal scroll, no wrapping */
.filter-row-mobile {
    display: flex;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    flex-wrap: nowrap;
    gap: 0.5rem;
    overflow-x: auto;
    padding: 0 clamp(0.6rem, 3.2vw, 1.25rem) 1rem;
    scrollbar-width: none;
    -ms-overflow-style: none;
    justify-content: center;
}
.filter-row-mobile::-webkit-scrollbar { display: none; }

.filter-btn-mobile {
    flex-shrink: 0;
    min-height: 2.4rem;
    padding: 0.55rem 1rem;
    background: rgba(255,255,255,0.07);
    color: white;
    border: 1px solid rgba(255,255,255,0.2);
    /* border-radius: 0; */
    font-size: 0.7rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.07em;
    cursor: pointer;
    transition: all 0.25s ease;
    white-space: nowrap;
}
.filter-btn-mobile:hover { border-color: #f64900; }
.filter-btn-mobile.active-filter {
    background: #f64900;
    border-color: #f64900;
    color: white;
    box-shadow: 0 8px 20px rgba(246, 73, 0, 0.25);
}

/* Viewport clips the track */
.mobile-carousel-viewport {
    overflow: hidden;
    padding: 0.5rem var(--hero-align-x, clamp(0.9rem, 3.4vw, 4.5rem));
}

/* Track  single card at a time */
#mobile-carousel-track {
    display: flex;
    gap: 0.75rem;
    transition: transform 0.45s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
    list-style: none;
    padding: 0;
    margin: 0;
}

/* Each card = full viewport width minus padding */
#mobile-carousel-track li {
    flex-shrink: 0;
    width: auto;
    box-sizing: border-box;
    border: 1px solid rgba(255,255,255,0.1);
    display: flex;
    flex-direction: column;
    transition: border-color 0.3s ease;
}

#mobile-carousel-track li img {
    width: 100%;
    aspect-ratio: 1 / 0.74;
    object-fit: contain;
    object-position: center;
    background: #111519;
    display: block;
    padding: 0.45rem;
}

#mobile-carousel-track .card-info-mobile {
    background: rgba(0,0,0,0.6);
    padding: 0.75rem;
    min-height: 82px;
}
#mobile-carousel-track .card-info-mobile .mob-category {
    font-size: 0.65rem;
    font-weight: 900;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #f64900;
    margin-bottom: 0.3rem;
}
#mobile-carousel-track .card-info-mobile .mob-title {
    font-size: 0.9rem;
    font-weight: 700;
    color: white;
    line-height: 1.2;
    overflow: hidden;
}

/* Controls row */
.mobile-carousel-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
    padding: 1rem 0 0.5rem;
}

.mobile-arrow {
    width: 44px;
    height: 44px;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.2);
    color: white;
    font-size: 1.15rem;
    border-radius: 0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.25s, border-color 0.25s, transform 0.2s;
}
.mobile-arrow:hover,
.mobile-arrow:active {
    background: #f64900;
    border-color: #f64900;
}
.mobile-arrow:active { transform: scale(0.96); }
.mobile-arrow:disabled {
    opacity: 0.25;
    pointer-events: none;
}

.mobile-counter {
    font-size: 0.8rem;
    font-weight: 700;
    color: rgba(255,255,255,0.5);
    min-width: 48px;
    text-align: center;
    letter-spacing: 0.05em;
}

@media (max-width: 640px) {
    #case-carousel-mobile .text-center {
        padding-top: 2.25rem;
        padding-bottom: 1.25rem;
        padding-left: var(--hero-align-x, clamp(0.9rem, 3.4vw, 4.5rem));
        padding-right: var(--hero-align-x, clamp(0.9rem, 3.4vw, 4.5rem));
    }

    #case-carousel-mobile h2 {
        font-size: clamp(1.6rem, 8vw, 2rem);
        line-height: 1.05;
    }

    #mobile-carousel-track .card-info-mobile {
        min-height: 88px;
    }

    #mobile-carousel-track .card-info-mobile .mob-title {
        font-size: 0.85rem;
        line-height: 1.2;
    }

    .filter-row-mobile {
        gap: 0.4rem;
    }

    .filter-btn-mobile {
        min-height: 2.15rem;
        padding: 0.45rem 0.8rem;
        font-size: 0.62rem;
    }

    .mobile-carousel-controls {
        gap: 0.8rem;
        padding-top: 0.75rem;
    }

    .mobile-arrow {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }

    .mobile-carousel-viewport {
        padding: 0 !important;
        margin-left: auto;
        margin-right: auto;
    }
}

@media (min-width: 640px) and (max-width: 768px), (min-width: 769px) and (max-width: 1024px) and (orientation: portrait) {
    #case-carousel-mobile {
        padding-bottom: 2.25rem;
    }

    #case-carousel-mobile .text-center {
        padding-top: 2.75rem;
        padding-bottom: 1.5rem;
        padding-left: var(--hero-align-x, clamp(0.9rem, 3.4vw, 4.5rem));
        padding-right: var(--hero-align-x, clamp(0.9rem, 3.4vw, 4.5rem));
    }

    #case-carousel-mobile h2 {
        font-size: clamp(2rem, 4.5vw, 2.6rem);
        line-height: 1.02;
    }

    .filter-row-mobile {
        gap: 0.65rem;
        padding: 0 clamp(0.85rem, 2.8vw, 1.6rem) 1.15rem;
    }

    .filter-btn-mobile {
        min-height: 2.5rem;
        padding: 0.6rem 1.05rem;
        font-size: 0.7rem;
    }

    .mobile-carousel-viewport {
        padding: 0 !important;
        margin-left: auto;
        margin-right: auto;
    }

    #mobile-carousel-track {
        gap: 0.9rem;
    }

    #mobile-carousel-track li img {
        aspect-ratio: 1 / 0.8;
        padding: 0.55rem;
    }

    #mobile-carousel-track .card-info-mobile {
        padding: 0.85rem;
        min-height: 96px;
    }

    #mobile-carousel-track .card-info-mobile .mob-title {
        font-size: 0.95rem;
    }

    .mobile-carousel-controls {
        gap: 1.1rem;
        padding-top: 0.85rem;
    }

    .mobile-arrow {
        width: 46px;
        height: 46px;
        font-size: 1.2rem;
    }

    .mobile-counter {
        font-size: 0.86rem;
    }
}

