/* Carousel Images Widget - Elementor */
/* Clases propias ci-* para evitar conflictos */

/* ─── Reset contenedor Elementor ────────────────────────────────────────── */
.elementor-widget-carousel_images,
.elementor-widget-carousel_images .elementor-widget-container {
    overflow: visible !important;
    padding: 0 !important;
}

/* ─── Wrapper principal ─────────────────────────────────────────────────── */
.ci-wrap {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    position: relative;
    font-family: var(--e-global-typography-text-font-family);
    overflow: hidden;
}

/* ─── Cabecera ──────────────────────────────────────────────────────────── */
.ci-header {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    margin-bottom: 2.2rem;
    position: relative;
    width: 100%;
}

.ci-header h2 {
    font-size: 2.7rem;
    font-weight: 800;
    color: var(--bn-color-heading-deep);
    text-align: left;
    position: relative;
    display: inline-block;
    margin: 0;
    padding-bottom: 18px;
    letter-spacing: -1px;
    line-height: 1.1;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
    font-family: var(--e-global-typography-text-font-family);
}

.ci-header h2::after {
    content: '';
    position: absolute;
    left: 0;
    bottom: 0;
    width: 80px;
    height: 6px;
    background: var(--e-global-color-secondary);
    border-radius: 3px;
    opacity: 0.7;
}

.ci-highlight {
    color: var(--e-global-color-secondary);
}

/* ─── Botón siguiente ───────────────────────────────────────────────────── */
.ci-next-btn {
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background-color: #e74f08;
    color: var(--bn-color-white);
    border: none;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    cursor: pointer;
    transition: background-color 0.3s ease, transform 0.3s ease, box-shadow 0.3s ease;
    box-shadow: 0 4px 10px color-mix(in srgb, var(--e-global-color-primary) 30%, transparent);
    z-index: 10;
    position: absolute;
    right: 20px;
    top: 180px;
    transform: translateY(-50%);
}

.ci-next-btn:hover {
    background-color: var(--e-global-color-accent);
    transform: scale(1.08) translateY(-50%);
    box-shadow: 0 6px 18px color-mix(in srgb, var(--e-global-color-primary) 40%, transparent);
}

/* ─── Carousel wrapper ──────────────────────────────────────────────────── */
.ci-carousel-wrapper {
    width: 100%;
    padding: 120px 0 60px 0;
    overflow: hidden;
}

/* ─── Track ─────────────────────────────────────────────────────────────── */
.ci-track {
    display: flex;
    gap: 30px;
    align-items: center;
    will-change: transform;
    /* La transición se aplica por JS, aquí no se define para evitar conflictos */
}

/* ─── Cards ─────────────────────────────────────────────────────────────── */
.ci-card {
    /* 3 cards visibles: (100% - 2 gaps de 30px) / 3 */
    width: calc((100% - 60px) / 3);
    flex: 0 0 calc((100% - 60px) / 3);
    display: block;
    text-decoration: none;
    aspect-ratio: 3.5 / 4;
    border-radius: var(--bn-radius-xl);
    overflow: hidden;
    position: relative;
    /* Animación suave de elevación */
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        box-shadow 0.6s cubic-bezier(0.4, 0, 0.2, 1),
        opacity 0.6s ease;
    transform: translateY(30px);
    opacity: 1;
    box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
}

.ci-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
    display: block;
}

.ci-card:hover img {
    transform: scale(1.04);
}

/* ─── Card activa (centro) ──────────────────────────────────────────────── */
.ci-card.ci-active {
    transform: translateY(-100px);
    opacity: 1;
    z-index: 10;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.2);
}

/* ─── Variación estática (1-3 items) ────────────────────────────────────── */
.ci-wrap.ci-static .ci-next-btn {
    display: none;
}

.ci-wrap.ci-static .ci-track {
    justify-content: center;
    transform: none !important;
}

.ci-wrap.ci-static .ci-card {
    transform: none !important;
    opacity: 1 !important;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.12);
}

.ci-wrap.ci-static .ci-carousel-wrapper {
    padding: 40px 0 60px 0;
}

/* ─── Info overlay ──────────────────────────────────────────────────────── */
.ci-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 100px 20px 20px 20px;
    background: linear-gradient(to top, rgba(0, 0, 0, 0.78), transparent);
    color: var(--bn-color-white);
    transition: opacity 0.4s ease;
}

.ci-info h3 {
    font-size: 2.5rem;
    margin-bottom: 5px;
    font-weight: 700;
    font-family: var(--e-global-typography-text-font-family);
    line-height: 1.1;
}

.ci-link {
    color: var(--bn-color-yellow);
    text-decoration: none;
    font-weight: 100;
    font-size: 1.5rem;
    display: flex;
    align-items: center;
    gap: 5px;
    font-family: var(--e-global-typography-text-font-family);
    transition: gap 0.3s ease;
}

.ci-link i {
    font-size: 1.5rem;
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.ci-card:hover .ci-link i {
    transform: translateX(4px);
}

/* ─── Responsive ≤1024px ────────────────────────────────────────────────── */
@media (max-width: 1024px) {
    .ci-header {
        justify-content: center;
    }

    .ci-header h2 {
        font-size: 2.2rem;
        text-align: center;
        display: block;
        margin: 0 auto;
        padding-bottom: 12px;
    }

    .ci-header h2::after {
        left: 50%;
        transform: translateX(-50%);
        width: 50px;
        height: 4px;
    }

    .ci-carousel-wrapper {
        padding: 0;
        margin: 0 auto;
        overflow-x: auto;
        scrollbar-width: none;
        -webkit-overflow-scrolling: touch;
    }

    .ci-carousel-wrapper::-webkit-scrollbar {
        display: none;
    }

    .ci-track {
        gap: 12px;
        padding: 0 0 12px 0;
        align-items: stretch;
        min-height: 320px;
    }

    .ci-card {
        width: 45%;
        min-width: 45%;
        flex: 0 0 45%;
        aspect-ratio: 3/4;
        border-radius: 18px;
        scroll-snap-align: center;
        transform: none !important;
        opacity: 1 !important;
        box-shadow: 0 6px 18px rgba(0, 0, 0, 0.10);
    }

    .ci-card.ci-active {
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
    }

    .ci-info {
        padding: 32px 16px 24px 16px;
        background: linear-gradient(to top, rgba(0, 0, 0, 0.7) 60%, transparent 100%);
        min-height: 120px;
    }

    .ci-info h3 {
        font-size: 1.8rem;
        margin-bottom: 8px;
    }

    .ci-link {
        font-size: 1rem;
    }

    .ci-next-btn {
        display: none;
    }
}

/* ─── Responsive ≤700px ─────────────────────────────────────────────────── */
@media (max-width: 700px) {
    .ci-header h2 {
        font-size: 1.4rem;
        padding-bottom: 8px;
    }

    .ci-header h2::after {
        width: 32px;
        height: 3px;
    }

    .ci-track {
        gap: 6px;
        padding-bottom: 6px;
        min-height: 220px;
    }

    .ci-card {
        width: 75%;
        min-width: 75%;
        flex: 0 0 75%;
        aspect-ratio: 3/4;
        border-radius: 12px;
    }

    .ci-info {
        padding: 18px 12px 14px 12px;
        min-height: 80px;
    }

    .ci-info h3 {
        font-size: 1.1rem;
    }

    .ci-link {
        font-size: 0.85rem;
    }
}

/* Compact variant: minimal carousel for fichas — fuerza 3 tarjetas visibles y tamaño uniforme */
.ci-wrap.ci-compact {
    --ci-compact-gap: 12px;
    max-width: 100%;
    padding: 0;
    overflow: hidden;
}
.ci-wrap.ci-compact .ci-carousel-wrapper {
    padding: 8px 0;
}
.ci-wrap.ci-compact .ci-track {
    gap: var(--ci-compact-gap);
    align-items: stretch;
    padding: 0;
    flex-wrap: nowrap;
}
.ci-wrap.ci-compact .ci-card {
    width: calc((100% - 2 * var(--ci-compact-gap)) / 3);
    flex: 0 0 calc((100% - 2 * var(--ci-compact-gap)) / 3);
    aspect-ratio: 4 / 3;
    border-radius: 12px;
    overflow: hidden;
    transform: none !important;
    box-shadow: none;
}
.ci-wrap.ci-compact .ci-card img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block;
}
.ci-wrap.ci-compact .ci-info {
    display: none;
}
.ci-wrap.ci-compact .ci-next-btn {
    width: 40px;
    height: 40px;
    right: 12px;
    top: 50%;
    transform: translateY(-50%);
    box-shadow: none;
}

@media (max-width: 1024px) {
    /* En tablet/desktop pequeño mostramos 1 tarjeta visible para buena lectura táctil */
    .ci-wrap.ci-compact .ci-card {
        width: calc(100% - var(--ci-compact-gap));
        flex: 0 0 calc(100% - var(--ci-compact-gap));
    }
    .ci-wrap.ci-compact .ci-next-btn {
        display: none;
    }
}

@media (max-width: 700px) {
    .ci-wrap.ci-compact .ci-card {
        width: calc(100% - var(--ci-compact-gap));
        flex: 0 0 calc(100% - var(--ci-compact-gap));
    }
}
