/* 3D Curved Carousel Section — Exact Reference Design + Dynamic Admin Controls */
/* Mouse wheel is active only on the image/carousel stage area, not on title/description area. */

.curved3d-section {
    position: relative;
    width: 100%;
    min-height: var(--curved3d-height, 720px);
    height: var(--curved3d-height, 720px);
    overflow: hidden;
    isolation: isolate;
    color: var(--curved3d-text, #ffffff);
    background: var(--curved3d-bg, #f59d20);
}

.curved3d-section,
.curved3d-section * {
    box-sizing: border-box;
}

/*
   Abstract pattern overlay.
   Admin controls:
   - Background Color / Main Theme Color = --curved3d-bg
   - Show Abstract Pattern = curved3d-no-pattern class
   - Pattern Opacity = --curved3d-pattern-opacity
   - Red Ribbon Opacity = --curved3d-red-opacity
   - Yellow Glow Opacity = --curved3d-yellow-opacity
   - Blue Accent Opacity = --curved3d-blue-opacity
*/
.curved3d-section::before {
    content: "";
    position: absolute;
    inset: -16%;
    z-index: 0;
    pointer-events: none;
    opacity: var(--curved3d-pattern-opacity, 1);
    background:
        radial-gradient(ellipse at 86% -4%, rgba(86,170,221,var(--curved3d-blue-opacity, .95)) 0%, rgba(86,170,221,var(--curved3d-blue-opacity, .95)) 11%, transparent 12%),
        radial-gradient(ellipse at 4% 100%, rgba(75,181,229,var(--curved3d-blue-opacity, .95)) 0%, rgba(75,181,229,var(--curved3d-blue-opacity, .95)) 12%, transparent 13%),
        radial-gradient(ellipse at 8% 9%, rgba(255,239,76,var(--curved3d-yellow-opacity, .72)) 0%, rgba(255,239,76,var(--curved3d-yellow-opacity, .72)) 18%, transparent 19%),
        radial-gradient(ellipse at 102% 57%, rgba(255,210,46,calc(var(--curved3d-yellow-opacity, .72) * .81)) 0%, rgba(255,210,46,calc(var(--curved3d-yellow-opacity, .72) * .81)) 23%, transparent 24%),
        linear-gradient(130deg, transparent 0 43%, rgba(221,27,23,var(--curved3d-red-opacity, .48)) 43% 55%, transparent 55%),
        linear-gradient(46deg, transparent 0 62%, rgba(238,38,27,calc(var(--curved3d-red-opacity, .48) * .92)) 62% 72%, transparent 72%),
        radial-gradient(ellipse at 40% 43%, rgba(255,193,68,.52) 0%, rgba(252,163,38,.38) 35%, rgba(245,116,31,.26) 63%, rgba(239,62,32,.18) 100%),
        var(--curved3d-bg, #f59d20);
    filter: saturate(1.08);
    transform: rotate(-2deg) scale(1.08);
}

.curved3d-section.curved3d-no-pattern::before {
    display: none;
}

.curved3d-section::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(ellipse at 50% 43%, rgba(255,255,255,.08), transparent 30%),
        linear-gradient(90deg, rgba(0,0,0,.06), transparent 16%, transparent 84%, rgba(0,0,0,.07));
}

.curved3d-section.curved3d-no-pattern::after {
    background: linear-gradient(90deg, rgba(0,0,0,.04), transparent 18%, transparent 82%, rgba(0,0,0,.04));
}

/* Title and description are visible, but they do not capture carousel wheel/drag. */
.curved3d-header {
    position: absolute;
    z-index: 4;
    top: clamp(28px, 4vw, 54px);
    left: clamp(22px, 5vw, 72px);
    right: clamp(22px, 5vw, 72px);
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(260px, 430px);
    gap: 28px;
    align-items: start;
    pointer-events: none;
}

.curved3d-header h2 {
    margin: 0;
    color: var(--curved3d-text, #ffffff);
    font-family: Inter, "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(36px, 5.1vw, 78px);
    line-height: .92;
    font-weight: 780;
    letter-spacing: -0.065em;
    text-shadow: 0 18px 44px rgba(0,0,0,.18);
}

.curved3d-header p {
    margin: 9px 0 0;
    color: var(--curved3d-subtitle, rgba(255,255,255,.78));
    font-family: Inter, "Helvetica Neue", Arial, sans-serif;
    font-size: clamp(14px, 1.2vw, 16px);
    line-height: 1.42;
    font-weight: 450;
    text-shadow: 0 12px 32px rgba(0,0,0,.16);
}

/*
   IMPORTANT:
   The stage is limited to the image/carousel zone.
   Wheel and drag listeners are attached only to this area.
*/
.curved3d-stage {
    position: absolute;
    z-index: 2;
    left: 0;
    right: 0;
    bottom: 0;
    top: clamp(130px, 18vh, 185px);
    min-height: 420px;
    cursor: grab;
    touch-action: pan-y;
    overflow: hidden;
}

.curved3d-stage.is-dragging {
    cursor: grabbing;
}

.curved3d-canvas {
    position: absolute;
    inset: 0;
    display: block;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: auto;
}

.curved3d-fallback {
    position: absolute;
    inset: 0;
    z-index: 3;
    display: none;
    align-items: center;
    justify-content: center;
    gap: clamp(42px, 6vw, 98px);
    overflow: hidden;
    padding: 0 5vw;
}

.curved3d-fallback img,
.curved3d-fallback video {
    width: min(20vw, 290px);
    height: min(48vh, 380px);
    border-radius: 18px;
    object-fit: cover;
    display: block;
    box-shadow: 0 28px 58px rgba(0,0,0,.28);
}

.curved3d-fallback img:nth-child(1),
.curved3d-fallback video:nth-child(1) {
    transform: rotate(-13deg) translateY(32px);
}
.curved3d-fallback img:nth-child(2),
.curved3d-fallback video:nth-child(2) {
    transform: rotate(-8deg) translateY(6px);
}
.curved3d-fallback img:nth-child(3),
.curved3d-fallback video:nth-child(3) {
    transform: rotate(0deg) translateY(-8px);
}
.curved3d-fallback img:nth-child(4),
.curved3d-fallback video:nth-child(4) {
    transform: rotate(8deg) translateY(8px);
}
.curved3d-fallback img:nth-child(5),
.curved3d-fallback video:nth-child(5) {
    transform: rotate(13deg) translateY(38px);
}

.curved3d-section.is-webgl-fallback .curved3d-canvas {
    display: none;
}

.curved3d-section.is-webgl-fallback .curved3d-fallback {
    display: flex;
}

.curved3d-section:not(.is-webgl-fallback) .curved3d-fallback {
    visibility: hidden;
}

@media (max-width: 980px) {
    .curved3d-section {
        min-height: min(var(--curved3d-height, 650px), 680px);
        height: min(var(--curved3d-height, 650px), 680px);
    }

    .curved3d-header {
        grid-template-columns: 1fr;
        gap: 8px;
        top: 30px;
    }

    .curved3d-header h2 {
        max-width: 650px;
    }

    .curved3d-header p {
        max-width: 520px;
    }

    .curved3d-stage {
        top: clamp(150px, 24vh, 205px);
    }
}

@media (max-width: 640px) {
    .curved3d-section {
        min-height: 560px;
        height: 560px;
    }

    .curved3d-header {
        left: 18px;
        right: 18px;
        top: 24px;
    }

    .curved3d-header h2 {
        font-size: clamp(32px, 11vw, 52px);
    }

    .curved3d-header p {
        font-size: 13px;
        max-width: 340px;
    }

    .curved3d-stage {
        top: 170px;
        min-height: 360px;
    }

    .curved3d-fallback {
        gap: 28px;
        padding: 0 20px;
    }

    .curved3d-fallback img,
    .curved3d-fallback video {
        width: 44vw;
        height: 330px;
    }
}


/* =========================================================
   Mobile Responsive Fix — larger carousel media on mobile
   ========================================================= */
@media (max-width: 980px) {
    .curved3d-section {
        min-height: 680px;
        height: 680px;
    }

    .curved3d-header {
        top: 30px;
        left: 22px;
        right: 22px;
        grid-template-columns: 1fr;
        gap: 8px;
    }

    .curved3d-header h2 {
        max-width: 620px;
        font-size: clamp(42px, 9vw, 70px);
        line-height: .92;
    }

    .curved3d-header p {
        max-width: 560px;
        font-size: 15px;
    }

    .curved3d-stage {
        top: 210px;
        min-height: calc(100% - 210px);
    }
}

@media (max-width: 640px) {
    .curved3d-section {
        min-height: 620px;
        height: 620px;
    }

    .curved3d-header {
        left: 16px;
        right: 16px;
        top: 24px;
        gap: 10px;
    }

    .curved3d-header h2 {
        font-size: clamp(42px, 13vw, 58px);
        max-width: 360px;
        letter-spacing: -0.06em;
    }

    .curved3d-header p {
        font-size: 14px;
        line-height: 1.35;
        max-width: 360px;
    }

    .curved3d-stage {
        top: 245px;
        min-height: calc(100% - 245px);
    }

    .curved3d-fallback {
        gap: 34px;
        padding: 0 18px;
    }

    .curved3d-fallback img,
    .curved3d-fallback video {
        width: 42vw;
        max-width: 180px;
        min-width: 145px;
        height: 230px;
        border-radius: 16px;
    }
}

@media (max-width: 420px) {
    .curved3d-section {
        min-height: 610px;
        height: 610px;
    }

    .curved3d-header h2 {
        font-size: clamp(40px, 14vw, 54px);
    }

    .curved3d-header p {
        font-size: 13.5px;
        max-width: 330px;
    }

    .curved3d-stage {
        top: 250px;
        min-height: calc(100% - 250px);
    }
}

