/**
 * Canon Slider Pasos - Stylesheet
 * Responsive step cards slider with built-in modal
 */

.cstep__wrap *,.cstep__wrap *::before,.cstep__wrap *::after,
.cstep__modal__overlay *,.cstep__modal__overlay *::before,.cstep__modal__overlay *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

.cstep__wrap {
    font-family: inherit;
    width: 100%;
    position: relative;
    user-select: none;
    -webkit-user-select: none;
    --cstep-slides: 3;
    --cstep-gap: 16px;
}

/* ── VIEWPORT ── */
.cstep__viewport {
    width: 100%;
    overflow: hidden;
    position: relative;
    cursor: grab;
    touch-action: pan-y;
}

.cstep__viewport.is-dragging {
    cursor: grabbing;
}

/* ── TRACK ── */
.cstep__track {
    display: flex;
    gap: var(--cstep-gap, 16px);
    transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
    will-change: transform;
    padding: 4px 2px 8px;
}

/* ── CARD: imagen como fondo completo ── */
.cstep__card {
    flex: 0 0 calc((100% - (var(--cstep-slides, 3) - 1) * var(--cstep-gap, 16px)) / var(--cstep-slides, 3));
    width: calc((100% - (var(--cstep-slides, 3) - 1) * var(--cstep-gap, 16px)) / var(--cstep-slides, 3));
    height: 515px;
    background-color: #1a1a1a;
    border-radius: 10px;
    overflow: hidden;
    cursor: default;
    position: relative;
    transition: transform 0.25s ease, box-shadow 0.25s ease;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    text-decoration: none !important;
    display: block;
}

a.cstep__card,
.cstep__card[data-action-type="modal"] {
    cursor: pointer;
}

.cstep__card:hover {
    transform: scale(1.02);
}

/* Overlay oscuro encima de la imagen para legibilidad del texto */
.cstep__card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        var(--cstep-overlay-start, rgba(0, 0, 0, 0.25)) 0%,
        var(--cstep-overlay-mid, rgba(0, 0, 0, 0.45)) 55%,
        var(--cstep-overlay-end, rgba(0, 0, 0, 0.75)) 100%
    );
    z-index: 1;
    pointer-events: none;
    transition: background 0.3s ease;
}

.cstep__card:hover::before {
    background: linear-gradient(
        to bottom,
        var(--cstep-overlay-hover-start, rgba(0, 0, 0, 0.30)) 0%,
        var(--cstep-overlay-hover-mid, rgba(0, 0, 0, 0.50)) 55%,
        var(--cstep-overlay-hover-end, rgba(0, 0, 0, 0.80)) 100%
    );
}

/* Body: anclado abajo, encima del overlay */
.cstep__card__body {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 30px 60px;
    color: #ffffff;
    display: flex;
    flex-direction: column;
    gap: 8px;
    z-index: 2;
    pointer-events: none;
}

/* Texto 1 — SLIDE X */
.cstep__card__step {
    font-size: 28px;
    font-weight: 700;
    color: #ffffff;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
    line-height: 1.2;
}

/* Texto 2 — Título */
.cstep__card__titulo {
    color: #ffffff;
    font-size: 24px;
    font-style: normal;
    font-weight: 600;
    line-height: 32px;
    letter-spacing: 0.112px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Texto 3 — Subtítulo */
.cstep__card__sub {
    color: #ffffff;
    font-size: 22px;
    font-style: normal;
    font-weight: 400;
    line-height: 28px;
    text-shadow: 0 1px 3px rgba(0, 0, 0, 0.4);
}

/* Botón + */
.cstep__card__plus {
    position: absolute;
    bottom: 14px;
    right: 14px;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #ffffff;
    color: #000000;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    font-weight: 300;
    font-family: Arial, sans-serif;
    pointer-events: none;
    line-height: 1;
    z-index: 3;
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.cstep__card:hover .cstep__card__plus {
    transform: scale(1.1);
}

/* ── NAVEGACIÓN ── */
.cstep__nav {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    margin-top: 16px;
    padding-right: 16px;
}

.cstep__nav__btn {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: none !important;
    background: rgba(0, 0, 0, 0.1) !important;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease, opacity 0.2s ease;
    padding: 0;
    outline: none !important;
    box-shadow: none !important;
}

.cstep__nav__btn:hover {
    background: rgba(0, 0, 0, 0.22) !important;
}

.cstep__nav__btn:focus,
.cstep__nav__btn:active {
    outline: none !important;
    box-shadow: none !important;
}

.cstep__nav__btn.cstep__disabled {
    opacity: 0.3 !important;
    pointer-events: none !important;
    cursor: default !important;
}

.cstep__nav__btn svg {
    display: block;
    width: 20px;
    height: 20px;
}

/* ══════════════════════════════════════════════════════════════
   MODAL
 ══════════════════════════════════════════════════════════════ */
.cstep__modal__overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.65);
    z-index: 99999999;
    align-items: center;
    justify-content: center;
    padding: 20px;
    opacity: 0;
    transition: opacity 0.25s ease;
}

.cstep__modal__overlay.cstep__open {
    display: flex;
    opacity: 1;
}

.cstep__modal__box {
    display: flex;
    padding: 32px 36px 36px 36px;
    flex-direction: column;
    align-items: flex-start;
    gap: 24px;
    border-radius: 16px;
    background: #ffffff;
    box-shadow: 0 4px 50px 0 rgba(33, 33, 33, 0.15), 0 4px 6px 0 rgba(33, 33, 33, 0.06);
    max-width: 840px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: cstep__pop 0.22s ease-out;
}

@keyframes cstep__pop {
    from {
        opacity: 0;
        transform: scale(0.96) translateY(10px);
    }
    to {
        opacity: 1;
        transform: scale(1) translateY(0);
    }
}

.cstep__modal__close {
    position: absolute !important;
    top: 18px !important;
    right: 20px !important;
    background: none !important;
    border: none !important;
    font-size: 28px !important;
    cursor: pointer !important;
    color: #555555 !important;
    padding: 0 !important;
    line-height: 1 !important;
    box-shadow: none !important;
    z-index: 10;
    transition: color 0.2s ease, transform 0.2s ease;
}

.cstep__modal__close:hover {
    color: #cc0000 !important;
    transform: scale(1.15);
}

/* Bloque de encabezado del modal */
.cstep__modal__head {
    display: flex;
    flex-direction: column;
    gap: 10px;
    width: 100%;
    padding-right: 30px;
}

.cstep__modal__titulo {
    color: #121212;
    font-size: 28px;
    font-weight: 700;
    line-height: 1.25;
    letter-spacing: -0.2px;
    margin: 0;
}

.cstep__modal__sub {
    color: #333333;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.4;
    margin: 0;
    white-space: normal;
}

/* Imagen del modal */
.cstep__modal__img {
    width: 100%;
    max-width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
    border: none !important;
    box-shadow: none !important;
    background: transparent;
}

/* Texto descriptivo del modal */
.cstep__modal__texto {
    color: #2b2b2b;
    font-size: 16px;
    font-weight: 400;
    line-height: 1.65;
    margin: 0;
    width: 100%;
    white-space: normal;
}

/* ── RESPONSIVE FALLBACKS ── */
@media (max-width: 1024px) {
    .cstep__wrap {
        --cstep-slides: 2;
    }
}

@media (max-width: 767px) {
    .cstep__wrap {
        --cstep-slides: 1.15;
    }
    .cstep__card {
        height: 460px;
    }
    .cstep__card__body {
        padding: 20px 20px 50px;
    }
    .cstep__card__titulo {
        font-size: 22px !important;
        line-height: 28px !important;
    }
    .cstep__card__sub {
        font-size: 18px !important;
    }
    .cstep__modal__box {
        padding: 24px 20px 24px 20px;
        gap: 18px;
    }
    .cstep__modal__titulo {
        font-size: 22px;
    }
    .cstep__modal__sub {
        font-size: 14px;
    }
    .cstep__modal__texto {
        font-size: 14px;
    }
}
