/* ============================================================
   TulBrand CMS – Block Carousel – Frontend Styles
   ============================================================ */

/* ── Wrapper principal ─────────────────────────────────────── */
.tbl-carousel-wrapper {
    position: relative;
    overflow: hidden;
    width: 100%;
    box-sizing: border-box;
}

/* ── Contenedor del track ──────────────────────────────────── */
.tbl-carousel-track-container {
    overflow: hidden;
    width: 100%;
}

/* ── Track (la tira de slides) ─────────────────────────────── */
.tbl-carousel-track {
    display: flex;
    will-change: transform;
}

/* Transición base para animaciones "slide" */
.tbl-carousel-track[data-animation="slide"],
.tbl-carousel-track[data-animation="coverflow"],
.tbl-carousel-track[data-animation="zoom"] {
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ── Slides ────────────────────────────────────────────────── */
.tbl-carousel-slide {
    flex: 0 0 auto;
    box-sizing: border-box;
    min-width: 0;
}

/* ── Animación FADE ─────────────────────────────────────────── */
.tbl-carousel-track[data-animation="fade"] {
    transition: none !important;
}

.tbl-carousel-track[data-animation="fade"] .tbl-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    opacity: 0;
    transition: opacity 0.55s ease;
    pointer-events: none;
}

.tbl-carousel-track[data-animation="fade"] .tbl-carousel-slide.tbl-active {
    opacity: 1;
    pointer-events: auto;
    position: relative;
}

/* ── Animación FLIP ─────────────────────────────────────────── */
.tbl-carousel-track[data-animation="flip"] {
    perspective: 1200px;
    transition: none !important;
}

.tbl-carousel-track[data-animation="flip"] .tbl-carousel-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    backface-visibility: hidden;
    transform-style: preserve-3d;
    transition: transform 0.6s ease, opacity 0.6s ease;
    opacity: 0;
    transform: rotateY(90deg);
}

.tbl-carousel-track[data-animation="flip"] .tbl-carousel-slide.tbl-active {
    opacity: 1;
    transform: rotateY(0deg);
    position: relative;
}

/* ── Animación CUBE ─────────────────────────────────────────── */
.tbl-carousel-wrapper[data-anim="cube"] {
    perspective: 1000px;
    overflow: visible;
}

.tbl-carousel-track[data-animation="cube"] {
    transform-style: preserve-3d;
    transition: transform 0.6s cubic-bezier(0.42, 0, 0.58, 1);
}

/* ── Animación ZOOM ─────────────────────────────────────────── */
.tbl-carousel-track[data-animation="zoom"] .tbl-carousel-slide {
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.tbl-carousel-track[data-animation="zoom"] .tbl-carousel-slide:not(.tbl-active) {
    transform: scale(0.85);
    opacity: 0.6;
}

.tbl-carousel-track[data-animation="zoom"] .tbl-carousel-slide.tbl-active {
    transform: scale(1);
    opacity: 1;
}

/* ── Animación COVERFLOW ─────────────────────────────────────── */
.tbl-carousel-track[data-animation="coverflow"] .tbl-carousel-slide {
    transition: transform 0.5s ease, opacity 0.5s ease;
}

.tbl-carousel-track[data-animation="coverflow"] .tbl-carousel-slide:not(.tbl-active) {
    transform: rotateY(35deg) scale(0.9);
    opacity: 0.65;
}

.tbl-carousel-track[data-animation="coverflow"] .tbl-carousel-slide.tbl-active {
    transform: rotateY(0deg) scale(1);
    opacity: 1;
}

/* ── Flechas de navegación ─────────────────────────────────── */
.tbl-carousel-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.55);
    backdrop-filter: blur(6px);
    color: #fff;
    border: none;
    border-radius: 50%;
    width: 44px;
    height: 44px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    transition: background 0.25s ease, transform 0.25s ease;
    outline: none;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.25);
}

.tbl-carousel-arrow:hover {
    background: rgba(0, 0, 0, 0.85);
    transform: translateY(-50%) scale(1.08);
}

.tbl-carousel-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

.tbl-carousel-prev {
    left: 12px;
}

.tbl-carousel-next {
    right: 12px;
}

.tbl-carousel-arrow svg {
    width: 22px;
    height: 22px;
    display: block;
    pointer-events: none;
}

/* ── Dots / indicadores ────────────────────────────────────── */
.tbl-carousel-dots {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 8px;
    padding: 14px 0 2px;
    flex-wrap: wrap;
}

.tbl-carousel-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.25);
    border: none;
    padding: 0;
    cursor: pointer;
    transition: background 0.3s ease, transform 0.3s ease, width 0.3s ease;
    outline: none;
}

.tbl-carousel-dot.active {
    background: currentColor;
    transform: scale(1.25);
    width: 24px;
    border-radius: 5px;
}

/* ── Drag / swipe visual ────────────────────────────────────── */
.tbl-carousel-wrapper.is-dragging {
    cursor: grabbing;
    user-select: none;
}

.tbl-carousel-wrapper.is-dragging .tbl-carousel-track {
    transition: none !important;
}

/* ── Responsive ─────────────────────────────────────────────── */
@media (max-width: 480px) {
    .tbl-carousel-arrow {
        width: 36px;
        height: 36px;
    }

    .tbl-carousel-arrow svg {
        width: 18px;
        height: 18px;
    }
}