/**
 * B01 Slider - Banner Carousel Component
 * CSS ISOLATION: ALL classes prefixed with .saly-ps-
 * NO generic class names like .slider, .btn, .container
 * DESIGN: Figma-based with Spartan font, purple accents (#4B1195)
 */

/* Import Spartan font from Google Fonts */
@import url('https://fonts.googleapis.com/css2?family=Spartan:wght@400;600;700&display=swap');

.saly-ps-block-slider {
    position: relative;
    z-index: 0; /* Create stacking context to isolate internal z-indices from navbar */
    width: 100%;
    margin-bottom: 2rem;
    /* NOTE: CSS variables removed - now inherited from :root (injected by front/head.tpl)
     * This follows the same pattern as B02-B11 blocks.
     * Variables used: --saly-ps-primary-color, --saly-ps-primary-200, --saly-ps-primary-700
     */
    --text-color: #333333;
    /* Shared card frame around the WHOLE block (slider + tabs) — design system .card:
     * white bg, 1px --gray-300 border, --radius-lg, --shadow-sm; overflow clips both rows. */
    background: #ffffff;
    border: 1px solid #EBEEF1;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 50px rgba(51, 51, 51, 0.03);
}

.saly-ps-slider-container {
    position: relative;
    width: 100%;
    overflow-x: hidden;
    overflow-y: visible; /* Allow tabs to extend below */
    border-radius: 0; /* corners handled by the shared card frame on .saly-ps-block-slider */
}

.saly-ps-slider-track {
    position: relative;
    width: 100%;
    height: 100%;
}

.saly-ps-slider-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transition: opacity 0.5s ease-in-out;
}

.saly-ps-slider-slide--active {
    opacity: 1;
    z-index: 1;
}

.saly-ps-slider-slide--transition-slide {
    animation: salyPsSlideIn 0.5s ease-in-out;
}

@keyframes salyPsSlideIn {
    from { transform: translateX(100%); }
    to { transform: translateX(0); }
}

.saly-ps-slider-slide-link {
    display: block;
    width: 100%;
    height: 100%;
}

.saly-ps-slider-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* TEXT OVERLAY - Figma Design */
.saly-ps-slider-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 32px;
    display: flex;
    align-items: flex-end;
    z-index: 5;
    pointer-events: none; /* Only CTA is clickable */
}

.saly-ps-slider-content {
    max-width: 702px;
    pointer-events: auto;
}

.saly-ps-slider-title {
    font-family: 'Spartan', sans-serif;
    font-weight: 700;
    font-size: 36px;
    line-height: 56px;
    letter-spacing: -0.72px;
    color: var(--text-color);
    margin: 0 0 16px 0;
}

.saly-ps-slider-cta {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 10px 16px;
    background: var(--saly-ps-primary-color, #4B1195);
    color: white;
    font-family: 'Spartan', sans-serif;
    font-weight: 600;
    font-size: 12px;
    line-height: 20px;
    letter-spacing: -0.24px;
    border-radius: 4px;
    text-decoration: none;
    transition: background 0.3s ease;
    outline: none !important;
}

.saly-ps-slider-cta:hover,
.saly-ps-slider-cta:focus {
    background: var(--saly-ps-primary-color, #4B1195);
    outline: none !important;
}

/* ARROWS - Figma Design (Top Right) */
.saly-ps-slider-arrows {
    position: absolute;
    top: 32px;
    right: 32px;
    display: flex;
    gap: 16px;
    z-index: 10;
}

.saly-ps-slider-arrow {
    /* Style mirrors B05 Category Showcase arrows: transparent, white outline, white chevron */
    width: 42px;
    height: 40px;
    background: transparent;
    border: 1px solid #FFFFFF;
    color: #FFFFFF;
    padding: 11px 12px;
    cursor: pointer;
    border-radius: 4px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.saly-ps-slider-arrow:hover {
    /* Subtle dark wash for contrast on light banners (matches B05) */
    background: rgba(0, 0, 0, 0.2);
}

.saly-ps-slider-arrow:focus {
    outline: none;
}

.saly-ps-slider-arrow svg {
    stroke: currentColor;
    width: 18px;
    height: 18px;
}

.saly-ps-slider-indicators {
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: none; /* Hidden on desktop (tabs are visible) */
    gap: 8px;
    z-index: 10;
}

.saly-ps-slider-indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    border: 2px solid transparent;
    cursor: pointer;
    transition: all 0.3s;
    padding: 0;
    outline: none !important;
}

.saly-ps-slider-indicator--active,
.saly-ps-slider-indicator:hover,
.saly-ps-slider-indicator:focus {
    background: white;
    outline: none !important;
}

/* TABS - underline style (matches design system .tabs / .tab) */
.saly-ps-slider-tabs-wrapper {
    position: relative; /* White panel flush under the slider — one continuous card */
    margin-top: 0;
    margin-left: 0;
    margin-right: 0;
    display: flex;
    align-items: stretch;
    background: #ffffff;            /* white background under the tabs */
    border-radius: 0;              /* corners handled by the shared card frame */
    overflow: hidden;
    z-index: 100;
}

.saly-ps-slider-tabs {
    flex: 1;
    display: flex;
    justify-content: center; /* center the banner-name tabs within the strip */
    gap: 0.25rem;
    padding: 0 20px; /* side inset; harmless once centered */
    background: transparent; /* no purple segmented bar */
    border-bottom: 1px solid #EBEEF1; /* --gray-300 baseline (design system .tabs) */
    border-radius: 0;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
    scroll-behavior: smooth;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

.saly-ps-slider-tabs::-webkit-scrollbar {
    display: none; /* Chrome/Safari/Opera */
}

.saly-ps-slider-tab {
    flex: 0 0 auto; /* content-sized, left-aligned (not stretched) */
    min-width: 0;
    padding: 12px 16px; /* design system .tab: 0.75rem 1rem */
    background: transparent;
    border: none;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px; /* overlap the strip baseline */
    font-family: 'Spartan', sans-serif;
    font-weight: 600;
    font-size: 12px;
    line-height: 1.4;
    letter-spacing: -0.24px;
    color: #717175; /* --gray-800 inactive */
    cursor: pointer;
    transition: color 0.12s ease, border-color 0.12s ease;
    white-space: nowrap;
    text-align: center;
    outline: none !important;
}

.saly-ps-slider-tab:hover:not(.saly-ps-slider-tab--active),
.saly-ps-slider-tab:focus:not(.saly-ps-slider-tab--active) {
    background: transparent;
    color: var(--text-color); /* #333 on hover */
    outline: none !important;
}

.saly-ps-slider-tab--active {
    background: transparent;
    color: var(--saly-ps-primary-700, #3D10BE);
    border-bottom-color: var(--saly-ps-primary-color, #5E2CED);
}

/* Scroll arrows for tabs (only when >5 banners) — neutral ghost buttons */
.saly-ps-slider-tabs-scroll {
    flex-shrink: 0;
    width: 36px;
    align-self: stretch;
    background: transparent;
    border: none;
    border-bottom: 1px solid #EBEEF1;
    color: #717175;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: color 0.12s ease;
}

.saly-ps-slider-tabs-scroll--left {
    margin-right: 0;
}

.saly-ps-slider-tabs-scroll--right {
    margin-left: 0;
}

.saly-ps-slider-tabs-scroll:hover {
    background: transparent;
    color: var(--text-color);
}

.saly-ps-slider-tabs-scroll:focus {
    outline: none;
}

.saly-ps-slider-tabs-scroll svg {
    stroke: currentColor;
    width: 16px;
    height: 16px;
}

/* Responsive */
@media (max-width: 768px) {
    .saly-ps-slider-overlay {
        padding: 16px;
    }

    .saly-ps-slider-title {
        font-size: 24px;
        line-height: 32px;
        margin-bottom: 12px;
    }

    .saly-ps-slider-cta {
        font-size: 11px;
        padding: 8px 12px;
    }

    .saly-ps-slider-arrows {
        top: 16px;
        right: 16px;
        gap: 8px;
    }

    .saly-ps-slider-arrow {
        padding: 8px 9px;
    }

    .saly-ps-slider-arrow svg {
        width: 14px;
        height: 14px;
    }

    .saly-ps-slider-container {
        border-radius: 12px; /* tabs hidden on mobile — round all corners */
    }

    .saly-ps-slider-tabs-wrapper {
        display: none;
    }

    .saly-ps-slider-indicators {
        display: flex; /* Show indicators on mobile (tabs are hidden) */
        bottom: 10px;
    }
}

/* Mobile viewport simulation for test-runner environment */
.viewport-mobile .saly-ps-slider-indicators {
    display: flex !important;
    bottom: 10px;
}

.viewport-mobile .saly-ps-slider-container {
    border-radius: 12px !important;
}

.viewport-mobile .saly-ps-slider-tabs-wrapper {
    display: none !important;
}

.saly-ps-slider-html-content {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.saly-ps-slider-html-content iframe {
    width: 100%;
    height: 100%;
    border: none;
}
