/**
 * 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;
    width: 100%;
    margin-bottom: calc(2rem + 26px); /* Extra space for tabs extending below */
    --primary-color: #4B1195;
    --primary-100: #FAF6FE;
    --primary-200: #F1E8FC;
    --text-color: #333333;
}

.saly-ps-slider-container {
    position: relative;
    width: 100%;
    overflow-x: hidden;
    overflow-y: visible; /* Allow tabs to extend below */
    border-radius: 8px;
}

.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(--primary-color);
    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: #3a0d73; /* Darker purple on hover/focus */
    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 {
    background: var(--primary-100);
    border: none;
    padding: 11px 12px;
    cursor: pointer;
    border-radius: 4px; /* Square with slight radius */
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    outline: none !important;
}

.saly-ps-slider-arrow:hover {
    background: var(--primary-200);
    transform: scale(1.05);
}

.saly-ps-slider-arrow:focus {
    outline: none !important;
    background: var(--primary-200);
}

.saly-ps-slider-arrow svg {
    stroke: var(--primary-color);
    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 - Figma Design (White/Purple) */
.saly-ps-slider-tabs-wrapper {
    position: relative; /* Position relative to block, not absolute inside container */
    margin-top: -26px; /* Overlap slider by 26px per Figma design */
    margin-left: 256px;
    margin-right: 200px;
    display: flex;
    align-items: center;
    z-index: 100; /* High z-index to ensure tabs are above slides and overlays */
}

.saly-ps-slider-tabs {
    flex: 1;
    display: flex;
    gap: 0;
    background: var(--primary-200);
    border-radius: 8px;
    height: 53px;
    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: 1 0 auto;
    min-width: 120px;
    padding: 0 24px;
    background: transparent;
    border: none;
    font-family: 'Spartan', sans-serif;
    font-weight: 600;
    font-size: 12px;
    line-height: 53px;
    letter-spacing: -0.24px;
    color: var(--text-color);
    cursor: pointer;
    transition: background 0.3s ease;
    white-space: nowrap;
    text-align: center;
    outline: none !important;
}

.saly-ps-slider-tab--active {
    background: white;
}

.saly-ps-slider-tab:hover:not(.saly-ps-slider-tab--active),
.saly-ps-slider-tab:focus:not(.saly-ps-slider-tab--active) {
    background: rgba(255, 255, 255, 0.5);
    outline: none !important;
}

/* Scroll arrows for tabs */
.saly-ps-slider-tabs-scroll {
    flex-shrink: 0;
    width: 40px;
    height: 53px;
    background: var(--primary-200);
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s ease;
    outline: none !important;
}

.saly-ps-slider-tabs-scroll--left {
    border-radius: 8px 0 0 8px;
    margin-right: -8px;
}

.saly-ps-slider-tabs-scroll--right {
    border-radius: 0 8px 8px 0;
    margin-left: -8px;
}

.saly-ps-slider-tabs-scroll:hover,
.saly-ps-slider-tabs-scroll:focus {
    background: var(--primary-color);
    outline: none !important;
}

.saly-ps-slider-tabs-scroll svg {
    stroke: var(--text-color);
    width: 18px;
    height: 18px;
}

.saly-ps-slider-tabs-scroll:hover svg,
.saly-ps-slider-tabs-scroll:focus svg {
    stroke: white;
}

/* 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-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-tabs-wrapper {
    display: none !important;
}
