/* ============================================
   Slider Banner Widget
   All values overridable via Elementor.
============================================ */

/* ── Wrapper ── */
.sbw-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}

/* ── Slider container ── */
.sbw-slider {
    position: relative;
    width: 100%;
    overflow: hidden;
}

/* ── Track (slide mode) ── */
.sbw-track {
    display: flex;
    will-change: transform;
    transition: transform 650ms cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Slide ── */
.sbw-slide {
    min-width: 100%;
    position: relative;
    height: 580px;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    overflow: hidden;
    box-sizing: border-box;
    flex-shrink: 0;
}

/* ── Fade mode ── */
.sbw-wrapper--fade .sbw-track {
    display: block;
    transform: none !important;
    transition: none !important;
    position: relative;
}

.sbw-wrapper--fade .sbw-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    min-width: 100%;
    opacity: 0;
    z-index: 0;
    transition: opacity 650ms ease;
}

.sbw-wrapper--fade .sbw-slide--active {
    opacity: 1;
    z-index: 1;
    position: relative; /* maintains wrapper height */
}

/* ── Overlay ── */
.sbw-overlay {
    position: absolute;
    inset: 0;
    background-color: rgba(0, 0, 0, 0.45);
    z-index: 1;
    pointer-events: none;
}

/* ── Content ── */
.sbw-content {
    position: absolute;
    z-index: 2;
    bottom: 80px;
    left: 60px;
    max-width: 55%;
}

/* ── Heading ── */
.sbw-heading {
    color: #ffffff;
    font-size: 48px;
    font-weight: 700;
    line-height: 1.15;
    margin: 0 0 14px 0;
    padding: 0;
}

/* ── Subtitle ── */
.sbw-subtitle {
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    font-weight: 500;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    margin: 0 0 24px 0;
    padding: 0;
}

/* ── Button ── */
.sbw-btn {
    display: inline-block;
    background-color: transparent;
    border: 2px solid #ffffff;
    color: #ffffff;
    padding: 12px 30px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
    text-decoration: none;
    transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease;
    line-height: 1.4;
}

.sbw-btn:hover {
    background-color: #ffffff;
    color: #000000;
}

/* ── Navigation arrows ── */
.sbw-nav {
    position: absolute;
    bottom: 24px;
    right: 80px;
    z-index: 10;
    display: flex;
    align-items: center;
    gap: 8px;
}

.sbw-arrow {
    width: 38px;
    height: 38px;
    background-color: rgba(255, 255, 255, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.4);
    border-radius: 50%;
    color: #ffffff;
    font-size: 16px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    line-height: 1;
    transition: background-color 0.22s ease, color 0.22s ease, border-color 0.22s ease;
    outline: none;
    font-family: inherit;
}

.sbw-arrow:hover {
    background-color: rgba(255, 255, 255, 0.4);
}

/* ── Counter ── */
.sbw-counter-wrap {
    position: absolute;
    bottom: 24px;
    right: 24px;
    z-index: 10;
    pointer-events: none;
}

.sbw-counter {
    color: rgba(255, 255, 255, 0.85);
    font-size: 13px;
    font-weight: 500;
    letter-spacing: 0.05em;
    white-space: nowrap;
    font-variant-numeric: tabular-nums;
}

/* ── Video Background ── */
.sbw-video-bg {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    pointer-events: none;
}

/* Uploaded file: <video> tag */
.sbw-video-bg--file .sbw-video {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Cover trick: 16:9 video fills any slide aspect ratio */
    min-width: 177.78vh;   /* 100vh × (16/9) */
    min-height: 56.25vw;   /* 100vw × (9/16) */
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* iframe (YouTube / Vimeo) */
.sbw-video-bg--iframe .sbw-video-iframe {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    min-width: 177.78vh;
    min-height: 56.25vw;
    width: 100%;
    height: 100%;
    border: none;
    pointer-events: none;
}

/* Elementor editor placeholder */
.sbw-video-bg--preview {
    background: rgba(0,0,0,0.55);
    display: flex;
    align-items: center;
    justify-content: center;
}
.sbw-video-preview-label {
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.05em;
}

/* Mobile: hide video, show fallback image */
.sbw-video-fallback {
    display: none;
    position: absolute;
    inset: 0;
    background-size: cover;
    background-position: center center;
    z-index: 0;
}

@media (max-width: 767px) {
    .sbw-slide--video .sbw-video-bg { display: none; }
    .sbw-slide--video .sbw-video-fallback { display: block; }
}

/* ── Slide content entry animation ── */
.sbw-slide--active .sbw-heading,
.sbw-slide--active .sbw-subtitle,
.sbw-slide--active .sbw-btn {
    animation: sbw-content-in 0.5s ease both;
}

.sbw-slide--active .sbw-subtitle { animation-delay: 0.08s; }
.sbw-slide--active .sbw-btn      { animation-delay: 0.14s; }

@keyframes sbw-content-in {
    from { opacity: 0; transform: translateY(14px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ── Slide mode doesn't need the fade class to drive animation ── */
.sbw-wrapper--slide .sbw-heading,
.sbw-wrapper--slide .sbw-subtitle,
.sbw-wrapper--slide .sbw-btn {
    animation: none;
}

/* ============================================
   Responsive
============================================ */
@media (max-width: 1024px) {
    .sbw-slide      { height: 480px; }
    .sbw-heading    { font-size: 36px; }
    .sbw-content    { max-width: 70%; bottom: 70px; left: 40px; }
}

@media (max-width: 767px) {
    .sbw-slide      { height: 360px; }
    .sbw-heading    { font-size: 24px; line-height: 1.2; }
    .sbw-subtitle   { font-size: 11px; }
    .sbw-content    { left: 24px; bottom: 60px; max-width: calc(100% - 48px); }
    .sbw-nav        { right: 60px; bottom: 16px; }
    .sbw-arrow      { width: 30px; height: 30px; font-size: 13px; }
    .sbw-counter-wrap { right: 16px; bottom: 16px; }
    .sbw-counter    { font-size: 12px; }
    .sbw-btn        { padding: 10px 20px; font-size: 13px; }
}

@media (max-width: 480px) {
    .sbw-slide      { height: 300px; }
    .sbw-heading    { font-size: 20px; }
}
