/* ==============================================
   وبوچی Hero Slider - Responsive + 3D Animations
   ============================================== */

/* --- Wrapper & Slider Container --- */
.wbs-slider-wrapper {
    position: relative;
    width: 100%;
    overflow: hidden;
    direction: rtl;
    font-family: inherit;
}

.wbs-slider {
    position: relative;
    width: 100%;
    height: 90vh;
    min-height: 400px;
    overflow: hidden;
    perspective: 1800px;
    perspective-origin: 50% 50%;
}

/* --- Track (default = simple slide effect) --- */
.wbs-track {
    display: flex;
    height: 100%;
    will-change: transform;
    transition: transform 0.7s cubic-bezier(0.77, 0, 0.175, 1);
}

.wbs-slide {
    flex: 0 0 100%;
    width: 100%;
    height: 100%;
    position: relative;
    overflow: hidden;
}

/* 3D inner stage every slide gets, used by depth/flip/cube effects */
.wbs-slide-3d {
    width: 100%;
    height: 100%;
    position: relative;
    transform-style: preserve-3d;
    transform-origin: center center;
    will-change: transform, opacity, filter;
}

/* =====================================================
   EFFECT: FADE
   ===================================================== */
.wbs-track.wbs-fade-mode {
    display: block;
    position: relative;
}
.wbs-track.wbs-fade-mode .wbs-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 0.7s ease;
    pointer-events: none;
}
.wbs-track.wbs-fade-mode .wbs-slide.active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
}

/* =====================================================
   EFFECT: DEPTH (Perspective Fly-in)
   ===================================================== */
.wbs-slider-wrapper[data-effect="depth"] .wbs-track {
    display: block;
    position: relative;
}
.wbs-slider-wrapper[data-effect="depth"] .wbs-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}
.wbs-slider-wrapper[data-effect="depth"] .wbs-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
    position: relative;
}
.wbs-slider-wrapper[data-effect="depth"] .wbs-slide.active .wbs-slide-3d {
    animation: wbs-depth-in var(--wbs-speed, 700ms) cubic-bezier(0.22, 1, 0.36, 1) both;
}
.wbs-slider-wrapper[data-effect="depth"] .wbs-slide.wbs-leaving .wbs-slide-3d {
    animation: wbs-depth-out var(--wbs-speed, 700ms) cubic-bezier(0.55, 0, 0.85, 0.35) both;
}
@keyframes wbs-depth-in {
    from { transform: translateZ(var(--wbs-depth-enter, -260px)) scale(0.92); opacity: 0; filter: blur(6px); }
    to   { transform: translateZ(0) scale(1); opacity: 1; filter: blur(0); }
}
@keyframes wbs-depth-out {
    from { transform: translateZ(0) scale(1); opacity: 1; filter: blur(0); }
    to   { transform: translateZ(var(--wbs-depth-exit, 200px)) scale(1.05); opacity: 0; filter: blur(4px); }
}

/* =====================================================
   EFFECT: FLIP (Card Flip 3D)
   ===================================================== */
.wbs-slider-wrapper[data-effect="flip"] .wbs-track {
    display: block;
    position: relative;
}
.wbs-slider-wrapper[data-effect="flip"] .wbs-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}
.wbs-slider-wrapper[data-effect="flip"] .wbs-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}
.wbs-slider-wrapper[data-effect="flip"] .wbs-slide-3d {
    backface-visibility: hidden;
}
.wbs-slider-wrapper[data-effect="flip"] .wbs-slide.active .wbs-slide-3d {
    animation: wbs-flip-in var(--wbs-speed, 700ms) cubic-bezier(0.34, 1.2, 0.4, 1) both;
}
.wbs-slider-wrapper[data-effect="flip"] .wbs-slide.wbs-leaving .wbs-slide-3d {
    animation: wbs-flip-out var(--wbs-speed, 700ms) cubic-bezier(0.6, 0, 0.8, 0.3) both;
}
@keyframes wbs-flip-in {
    from { transform: rotateY(var(--wbs-flip-deg, -100deg)); opacity: 0; }
    to   { transform: rotateY(0deg); opacity: 1; }
}
@keyframes wbs-flip-out {
    from { transform: rotateY(0deg); opacity: 1; }
    to   { transform: rotateY(calc(var(--wbs-flip-deg, -100deg) * -1)); opacity: 0; }
}

/* =====================================================
   EFFECT: CUBE (Cube Rotate)
   ===================================================== */
.wbs-slider-wrapper[data-effect="cube"] .wbs-track {
    display: block;
    position: relative;
    transform-style: preserve-3d;
}
.wbs-slider-wrapper[data-effect="cube"] .wbs-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
    z-index: 1;
}
.wbs-slider-wrapper[data-effect="cube"] .wbs-slide.active {
    opacity: 1;
    pointer-events: auto;
    z-index: 2;
}
.wbs-slider-wrapper[data-effect="cube"] .wbs-slide-3d {
    transform-origin: var(--wbs-cube-origin, left center);
}
.wbs-slider-wrapper[data-effect="cube"] .wbs-slide.active .wbs-slide-3d {
    animation: wbs-cube-in var(--wbs-speed, 700ms) cubic-bezier(0.65, 0, 0.35, 1) both;
}
.wbs-slider-wrapper[data-effect="cube"] .wbs-slide.wbs-leaving .wbs-slide-3d {
    animation: wbs-cube-out var(--wbs-speed, 700ms) cubic-bezier(0.65, 0, 0.35, 1) both;
}
@keyframes wbs-cube-in {
    from { transform: rotateY(var(--wbs-cube-deg, 90deg)); opacity: 0.4; }
    to   { transform: rotateY(0deg); opacity: 1; }
}
@keyframes wbs-cube-out {
    from { transform: rotateY(0deg); opacity: 1; }
    to   { transform: rotateY(calc(var(--wbs-cube-deg, 90deg) * -1)); opacity: 0.4; }
}

/* =====================================================
   Intensity Variants (apply to depth / flip / cube)
   ===================================================== */
.wbs-slider-wrapper[data-intensity="subtle"] { --wbs-depth-enter: -120px; --wbs-depth-exit: 90px;  --wbs-flip-deg: -55deg;  --wbs-cube-deg: 45deg; }
.wbs-slider-wrapper[data-intensity="medium"] { --wbs-depth-enter: -260px; --wbs-depth-exit: 200px; --wbs-flip-deg: -100deg; --wbs-cube-deg: 90deg; }
.wbs-slider-wrapper[data-intensity="strong"] { --wbs-depth-enter: -440px; --wbs-depth-exit: 340px; --wbs-flip-deg: -150deg; --wbs-cube-deg: 130deg; }

/* =====================================================
   Content Stagger (entrance with depth + delay)
   ===================================================== */
.wbs-stagger {
    opacity: 0;
    transform: translateY(24px) translateZ(-60px);
    will-change: transform, opacity;
}
.wbs-slide.wbs-slide-visible .wbs-stagger {
    animation: wbs-stagger-in 0.7s cubic-bezier(0.22, 1, 0.36, 1) both;
}
.wbs-slide.wbs-slide-visible .wbs-stagger[data-stagger-order="1"] { animation-delay: 0.05s; }
.wbs-slide.wbs-slide-visible .wbs-stagger[data-stagger-order="2"] { animation-delay: 0.15s; }
.wbs-slide.wbs-slide-visible .wbs-stagger[data-stagger-order="3"] { animation-delay: 0.25s; }
.wbs-slide.wbs-slide-visible .wbs-stagger[data-stagger-order="4"] { animation-delay: 0.35s; }
.wbs-slide.wbs-slide-visible .wbs-stagger[data-stagger-order="5"] { animation-delay: 0.2s; }

@keyframes wbs-stagger-in {
    from { opacity: 0; transform: translateY(24px) translateZ(-60px); }
    to   { opacity: 1; transform: translateY(0) translateZ(0); }
}

/* =====================================================
   Image Tilt (mouse-driven 3D card hover)
   ===================================================== */
.wbs-image-container[data-tilt="true"] {
    transform-style: preserve-3d;
    transition: transform 0.15s ease-out;
    will-change: transform;
}
.wbs-image-container[data-tilt="true"] .wbs-slide-image {
    transition: transform 0.15s ease-out, filter 0.3s ease;
    transform-style: preserve-3d;
}

/* =====================================================
   Floating Particles (ambient depth)
   ===================================================== */
.wbs-particles {
    position: absolute;
    inset: 0;
    overflow: hidden;
    pointer-events: none;
    z-index: 1;
}
.wbs-particle {
    position: absolute;
    bottom: -5%;
    left: var(--left, 50%);
    width: var(--size, 8px);
    height: var(--size, 8px);
    border-radius: 50%;
    background: rgba(255,255,255,0.35);
    box-shadow: 0 0 8px rgba(255,255,255,0.25);
    animation: wbs-particle-float var(--dur, 12s) ease-in-out var(--delay, 0s) infinite;
}
@keyframes wbs-particle-float {
    0%   { transform: translateY(0) translateX(0) scale(0.8); opacity: 0; }
    10%  { opacity: 0.7; }
    50%  { transform: translateY(-45vh) translateX(12px) scale(1.1); opacity: 0.5; }
    90%  { opacity: 0.2; }
    100% { transform: translateY(-95vh) translateX(-8px) scale(0.7); opacity: 0; }
}

/* --- Slide Inner Layout --- */
.wbs-slide-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 0 6vw;
    gap: clamp(20px, 4vw, 60px);
    position: relative;
    z-index: 2;
    padding-bottom: 60px; /* space for wave */
}

/* Content position variants */
.wbs-slider-wrapper[data-content-position="right"] .wbs-slide-inner {
    flex-direction: row;
}
.wbs-slider-wrapper[data-content-position="left"] .wbs-slide-inner {
    flex-direction: row-reverse;
}
.wbs-slider-wrapper[data-content-position="center"] .wbs-slide-inner {
    flex-direction: column;
    justify-content: center;
    text-align: center;
}
.wbs-slider-wrapper[data-content-position="center"] .wbs-buttons {
    justify-content: center;
}
.wbs-slider-wrapper[data-content-position="center"] .wbs-image-side {
    display: none;
}

/* --- Content Area --- */
.wbs-content {
    flex: 1 1 50%;
    max-width: 55%;
    z-index: 2;
}

/* --- Badge --- */
.wbs-badge {
    display: inline-block;
    border: 1.5px solid #c9a84c;
    color: #c9a84c;
    border-radius: 50px;
    padding: clamp(4px, 0.5vw, 8px) clamp(12px, 1.5vw, 20px);
    font-size: clamp(11px, 1.1vw, 14px);
    font-weight: 500;
    margin-bottom: clamp(12px, 2vw, 20px);
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
}

/* --- Heading --- */
.wbs-heading {
    color: #ffffff;
    font-size: clamp(22px, 3.5vw, 52px);
    font-weight: 700;
    line-height: 1.4;
    margin: 0 0 clamp(12px, 2vw, 24px) 0;
    text-shadow: 0 2px 12px rgba(0,0,0,0.15);
}

.wbs-heading-highlight {
    color: #c9a84c;
}

/* --- Description --- */
.wbs-description {
    color: rgba(255,255,255,0.85);
    font-size: clamp(13px, 1.2vw, 16px);
    line-height: 1.9;
    margin: 0 0 clamp(16px, 2.5vw, 32px) 0;
    max-width: 520px;
}

/* --- Buttons --- */
.wbs-buttons {
    display: flex;
    align-items: center;
    gap: clamp(8px, 1vw, 16px);
    flex-wrap: wrap;
}

.wbs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: clamp(10px, 1.2vw, 16px) clamp(20px, 2.5vw, 36px);
    border-radius: 8px;
    font-size: clamp(12px, 1.1vw, 15px);
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    transition: all 0.25s ease;
    border: 2px solid transparent;
    white-space: nowrap;
}

.wbs-btn-primary {
    background-color: #c9a84c;
    color: #fff;
    border-color: #c9a84c;
    box-shadow: 0 4px 16px rgba(201,168,76,0.4);
}
.wbs-btn-primary:hover {
    background-color: #b8963a;
    border-color: #b8963a;
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(201,168,76,0.5);
}

.wbs-btn-secondary {
    background-color: rgba(255,255,255,0.15);
    color: #fff;
    border-color: rgba(255,255,255,0.5);
    backdrop-filter: blur(8px);
}
.wbs-btn-secondary:hover {
    background-color: rgba(255,255,255,0.25);
    border-color: #fff;
    transform: translateY(-2px);
}

.wbs-btn-separator {
    color: rgba(255,255,255,0.6);
    font-size: clamp(12px, 1vw, 14px);
    padding: 0 4px;
}

/* --- Image Side --- */
.wbs-image-side {
    flex: 0 1 45%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    height: 100%;
    position: relative;
    padding-top: clamp(20px, 4vw, 60px);
}

.wbs-image-container {
    position: relative;
    width: 100%;
    max-width: clamp(220px, 35vw, 500px);
    height: 100%;
    display: flex;
    align-items: flex-end;
    justify-content: center;
}

.wbs-slide-image {
    width: 100%;
    height: auto;
    max-height: 88%;
    object-fit: contain;
    object-position: bottom;
    display: block;
    filter: drop-shadow(0 20px 40px rgba(0,0,0,0.25));
}

/* Image Label */
.wbs-image-label {
    position: absolute;
    top: clamp(12px, 2vw, 24px);
    right: clamp(-10px, -1vw, -20px);
    background: rgba(255,255,255,0.95);
    color: #333;
    border-radius: 50px;
    padding: clamp(6px, 0.6vw, 10px) clamp(14px, 1.5vw, 22px);
    font-size: clamp(11px, 1vw, 13px);
    font-weight: 600;
    box-shadow: 0 4px 20px rgba(0,0,0,0.12);
    z-index: 10;
    white-space: nowrap;
}

.wbs-image-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 70%;
    border: 2px dashed rgba(255,255,255,0.2);
    border-radius: 16px;
}

/* --- Wave Bottom --- */
.wbs-wave-bottom {
    position: absolute;
    bottom: -1px;
    left: 0;
    right: 0;
    z-index: 3;
    line-height: 0;
    pointer-events: none;
}

.wbs-wave-bottom svg {
    width: 100%;
    height: clamp(40px, 5vw, 80px);
    display: block;
}

/* --- Progress Bar --- */
.wbs-progress {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3px;
    background: rgba(255,255,255,0.2);
    z-index: 10;
}

.wbs-progress-bar {
    height: 100%;
    width: 0%;
    background: #c9a84c;
    transition: width linear;
}

/* --- Arrows --- */
.wbs-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 20;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.3);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
    transition: all 0.2s ease;
    padding: 0;
    outline: none;
}

.wbs-arrow:hover {
    background: rgba(255,255,255,0.3);
    border-color: rgba(255,255,255,0.6);
    transform: translateY(-50%) scale(1.08);
}

.wbs-arrow:focus-visible {
    outline: 2px solid #c9a84c;
    outline-offset: 3px;
}

.wbs-arrow svg {
    stroke: #ffffff;
    flex-shrink: 0;
}

/* RTL: prev = right side, next = left side */
.wbs-arrow-prev { right: clamp(10px, 2vw, 28px); }
.wbs-arrow-next { left: clamp(10px, 2vw, 28px); }

/* --- Dots --- */
.wbs-dots {
    position: absolute;
    bottom: clamp(50px, 6vw, 70px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
    display: flex;
    gap: 8px;
    align-items: center;
}

.wbs-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255,255,255,0.4);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: all 0.3s ease;
    outline: none;
}

.wbs-dot:hover {
    background: rgba(255,255,255,0.7);
}

.wbs-dot.active {
    background: #c9a84c;
    width: 24px;
    border-radius: 4px;
}

/* --- Scroll Indicator --- */
.wbs-scroll-indicator {
    position: absolute;
    bottom: clamp(14px, 2vw, 22px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 20;
}

.wbs-scroll-btn {
    width: clamp(36px, 4vw, 48px);
    height: clamp(36px, 4vw, 48px);
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    border: 1.5px solid rgba(255,255,255,0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #fff;
    animation: wbs-bounce 2s ease infinite;
    backdrop-filter: blur(6px);
}

@keyframes wbs-bounce {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(6px); }
}

/* === RESPONSIVE BREAKPOINTS === */

/* Tablet (768px - 1024px) */
@media (max-width: 1024px) {
    .wbs-content {
        max-width: 60%;
    }

    .wbs-image-side {
        flex-basis: 40%;
    }

    .wbs-image-label {
        right: 0;
    }
}

/* Mobile (max 767px) */
@media (max-width: 767px) {
    .wbs-slider {
        height: 85vh;
        min-height: 520px;
    }

    .wbs-slide-inner {
        flex-direction: column !important;
        justify-content: flex-end;
        align-items: center;
        padding: clamp(16px, 5vw, 28px);
        padding-bottom: clamp(70px, 10vw, 90px);
        gap: 0;
    }

    /* On mobile: image at top, content at bottom */
    .wbs-image-side {
        flex-basis: auto;
        order: 1;
        width: 100%;
        height: 45%;
        padding-top: clamp(16px, 4vw, 32px);
        justify-content: center;
    }

    .wbs-content {
        order: 2;
        max-width: 100%;
        flex: 0 0 auto;
        text-align: right;
    }

    .wbs-image-container {
        max-width: 200px;
        height: 100%;
    }

    .wbs-slide-image {
        max-height: 100%;
        filter: drop-shadow(0 10px 20px rgba(0,0,0,0.2));
    }

    .wbs-image-label {
        top: 8px;
        right: 0;
        font-size: 11px;
        padding: 5px 12px;
    }

    .wbs-heading {
        font-size: clamp(20px, 5.5vw, 28px);
        margin-bottom: 10px;
    }

    .wbs-description {
        font-size: 13px;
        line-height: 1.8;
        margin-bottom: 14px;
        display: -webkit-box;
        -webkit-line-clamp: 3;
        -webkit-box-orient: vertical;
        overflow: hidden;
    }

    .wbs-btn {
        padding: 10px 20px;
        font-size: 13px;
    }

    .wbs-arrow {
        width: 36px;
        height: 36px;
    }

    .wbs-arrow svg {
        width: 18px;
        height: 18px;
    }

    .wbs-arrow-prev { right: 8px; }
    .wbs-arrow-next { left: 8px; }

    .wbs-wave-bottom svg {
        height: 35px;
    }

    .wbs-badge {
        font-size: 11px;
        padding: 4px 12px;
        margin-bottom: 10px;
    }

    /* Reduce 3D intensity on mobile automatically for perf/comfort */
    .wbs-slider-wrapper { --wbs-depth-enter: -100px !important; --wbs-depth-exit: 80px !important; --wbs-flip-deg: -45deg !important; --wbs-cube-deg: 40deg !important; }

    /* Disable mouse parallax & tilt entirely on touch devices via JS too, this is a CSS fallback */
    .wbs-image-container[data-tilt="true"] { transform: none !important; }
}

/* Small Mobile (max 480px) */
@media (max-width: 480px) {
    .wbs-slider {
        min-height: 480px;
    }

    .wbs-image-container {
        max-width: 160px;
    }

    .wbs-buttons {
        gap: 8px;
    }

    .wbs-btn {
        padding: 9px 16px;
        font-size: 12px;
    }

    .wbs-dots {
        bottom: 48px;
    }
}

/* Large screens (1400px+) */
@media (min-width: 1400px) {
    .wbs-slide-inner {
        padding: 0 8vw;
    }

    .wbs-content {
        max-width: 50%;
    }
}

/* Reduced motion: disable all custom animation/transition layers */
@media (prefers-reduced-motion: reduce) {
    .wbs-track,
    .wbs-slide-3d,
    .wbs-btn,
    .wbs-arrow,
    .wbs-progress-bar,
    .wbs-stagger,
    .wbs-image-container,
    .wbs-slide-image,
    .wbs-particle,
    .wbs-scroll-btn {
        transition: none !important;
        animation: none !important;
    }
    .wbs-slide.active .wbs-slide-3d,
    .wbs-slide.wbs-slide-visible .wbs-stagger {
        opacity: 1 !important;
        transform: none !important;
        filter: none !important;
    }
    .wbs-particles { display: none; }
}
