/* ============================================
   HERO — carrusel 3D / 4D con foto o video
   ============================================ */

.impact-carousel--hero-3d {
    position: relative;
    min-height: 380px;
}

.impact-carousel--hero-3d .impact-carousel-stage {
    perspective: 1600px;
    perspective-origin: 50% 40%;
    padding: 0.5rem 0 1rem;
}

.impact-carousel--hero-3d .impact-carousel-track {
    position: relative;
    min-height: 340px;
    transform-style: preserve-3d;
}

/* Slide 3D */
.impact-carousel--hero-3d .impact-slide--3d {
    position: absolute;
    inset: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    opacity: 0;
    pointer-events: none;
    transform-style: preserve-3d;
    transition:
        transform 0.75s cubic-bezier(0.23, 1, 0.32, 1),
        opacity 0.65s ease,
        filter 0.65s ease;
    filter: brightness(0.65) blur(1px);
}

.impact-carousel--hero-3d .impact-slide--3d.is-active {
    opacity: 1;
    pointer-events: auto;
    z-index: 4;
    transform: translateX(0) translateZ(80px) rotateY(0deg) scale(1);
    filter: brightness(1) blur(0);
    position: relative;
    animation: impactSlideFloat 7s ease-in-out infinite;
}

@keyframes impactSlideFloat {
    0%, 100% { transform: translateX(0) translateZ(80px) rotateY(0deg) scale(1) translateY(0); }
    50% { transform: translateX(0) translateZ(90px) rotateY(0deg) scale(1) translateY(-6px); }
}

.impact-carousel--hero-3d .impact-slide--3d.is-prev {
    opacity: 0.45;
    z-index: 2;
    transform: translateX(-52%) translateZ(-100px) rotateY(32deg) scale(0.82);
}

.impact-carousel--hero-3d .impact-slide--3d.is-next {
    opacity: 0.45;
    z-index: 2;
    transform: translateX(52%) translateZ(-100px) rotateY(-32deg) scale(0.82);
}

.impact-carousel--hero-3d .impact-slide--3d.is-far {
    opacity: 0;
    z-index: 1;
    transform: translateZ(-200px) scale(0.7);
}

.impact-slide-3d-inner {
    position: relative;
    border-radius: 22px;
    overflow: hidden;
    transform-style: preserve-3d;
    border: 1px solid rgba(183, 142, 72, 0.45);
    box-shadow:
        0 4px 0 rgba(183, 142, 72, 0.15),
        0 28px 64px rgba(0, 0, 0, 0.55),
        0 0 0 1px rgba(255, 255, 255, 0.06) inset;
    transition: transform 0.12s ease-out;
    min-height: 320px;
    will-change: transform;
}

/* Plano de profundidad (efecto 4D) */
.impact-slide-3d-inner::before {
    content: "";
    position: absolute;
    inset: 8px;
    border-radius: 16px;
    border: 1px solid rgba(183, 142, 72, 0.2);
    transform: translateZ(-24px);
    pointer-events: none;
    z-index: 1;
    opacity: 0.6;
}

.impact-slide-3d-inner::after {
    content: "";
    position: absolute;
    inset: -2px;
    border-radius: 24px;
    background: linear-gradient(135deg, rgba(183, 142, 72, 0.35), transparent 40%, rgba(255, 255, 255, 0.08));
    transform: translateZ(-12px);
    pointer-events: none;
    z-index: 0;
    opacity: 0.5;
}

/* Capa media (foto / video) */
.impact-slide-media {
    position: absolute;
    inset: 0;
    z-index: 0;
    overflow: hidden;
}

.impact-slide-photo,
.impact-slide-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transform: scale(1.08);
    transition: transform 8s ease-out;
}

.impact-slide--3d.is-active .impact-slide-photo,
.impact-slide--3d.is-active .impact-slide-video {
    transform: scale(1.02);
    animation: impactKenBurns 14s ease-in-out infinite alternate;
}

@keyframes impactKenBurns {
    0% { transform: scale(1.02) translate(0, 0); }
    100% { transform: scale(1.12) translate(-1.5%, -1%); }
}

.impact-slide-media-fallback {
    width: 100%;
    height: 100%;
    background:
        linear-gradient(135deg, #0f1824 0%, #1f2a3a 50%, #152030 100%);
}

.impact-slide-media-fallback--chalkboard {
    background: linear-gradient(145deg, #0f1824, #2a3548);
}

.impact-slide-media-fallback--layers {
    background: linear-gradient(145deg, #152030, #1f2a3a);
}

.impact-slide-media-fallback--shield {
    background: linear-gradient(145deg, #1a2030, #2a2035);
}

.impact-slide-media-fallback--presentation,
.impact-slide-media-fallback--briefcase {
    background: linear-gradient(145deg, #152030, #1a2838);
}

.impact-slide-media-shine {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        115deg,
        transparent 30%,
        rgba(255, 255, 255, 0.08) 45%,
        transparent 60%
    );
    transform: translateX(-100%);
    animation: impactShine 6s ease-in-out infinite;
    pointer-events: none;
}

.impact-slide--3d.is-active .impact-slide-media-shine {
    animation-play-state: running;
}

@keyframes impactShine {
    0%, 100% { transform: translateX(-100%); }
    50% { transform: translateX(100%); }
}

.impact-slide-media-vignette {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, rgba(15, 24, 36, 0.92) 0%, rgba(15, 24, 36, 0.35) 45%, rgba(15, 24, 36, 0.15) 100%),
        linear-gradient(to right, rgba(15, 24, 36, 0.4) 0%, transparent 40%, rgba(15, 24, 36, 0.4) 100%);
    pointer-events: none;
}

/* Contenido flotante (capa 4D) */
.impact-slide-glass {
    position: relative;
    z-index: 2;
    padding: 1.75rem 1.85rem 1.65rem;
    transform: translateZ(48px);
    transform-style: preserve-3d;
}

.impact-carousel--hero-3d .impact-slide-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    border-radius: 50px;
    background: rgba(183, 142, 72, 0.18);
    border: 1px solid rgba(183, 142, 72, 0.35);
    margin-bottom: 0.85rem;
}

.impact-carousel--hero-3d .impact-slide-metric {
    font-size: clamp(2.75rem, 6vw, 4rem);
    text-shadow: 0 4px 24px rgba(0, 0, 0, 0.45);
}

.impact-carousel--hero-3d .impact-slide-label {
    font-size: 1rem;
    margin-bottom: 0.65rem;
}

.impact-carousel--hero-3d .impact-slide-copy {
    font-size: 0.88rem;
    max-width: none;
    line-height: 1.55;
}

/* Profundidad decorativa */
.impact-carousel--hero-3d::before {
    content: "";
    position: absolute;
    width: 120%;
    height: 60%;
    left: -10%;
    bottom: -15%;
    background: radial-gradient(ellipse, rgba(183, 142, 72, 0.12), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

.impact-carousel--hero-3d .impact-carousel-controls {
    position: relative;
    z-index: 5;
}

@media (max-width: 992px) {
    .impact-carousel--hero-3d .impact-slide--3d.is-prev,
    .impact-carousel--hero-3d .impact-slide--3d.is-next {
        opacity: 0;
        transform: translateZ(-150px) scale(0.8);
    }

    .impact-carousel--hero-3d .impact-slide-3d-inner {
        min-height: 280px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .impact-slide-media-shine,
    .impact-slide--3d.is-active .impact-slide-photo,
    .impact-slide--3d.is-active .impact-slide-video,
    .impact-carousel--hero-3d .impact-slide--3d.is-active {
        animation: none;
    }

    .impact-carousel--hero-3d .impact-slide--3d {
        transition-duration: 0.01ms;
    }
}
