/* =========================================================
   1. CARRUSEL DE HISTORIAS (Track & Wrapper)
   ========================================================= */

   .cle-carousel-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    padding: 0;
}

.cle-stories-bar {
    display: flex;
    gap: 15px; /* Espaciado entre tarjetas */
    scroll-behavior: smooth;
    overflow-x: auto;
    width: 100%;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.cle-stories-bar::-webkit-scrollbar {
    display: none;
}

/* =========================================================
   2. DISEÑO DE TARJETAS (ESTILO BARÇA STORIES)
   ========================================================= */

.cle-story-thumb {
    width: 155px; /* Ajuste para que quepan varias en pantalla */
    flex: 0 0 auto;
    cursor: pointer;
    transition: transform 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.cle-story-card {
    position: relative;
    width: 100%;
    aspect-ratio: 9 / 14; /* Proporción vertical tipo móvil */
    border-radius: 10px;
    overflow: hidden;
    background: #1a1a1a;
    box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

.cle-story-cover {
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: transform 0.6s ease;
}

/* Efectos al pasar el ratón */
.cle-story-thumb:hover .cle-story-cover {
    transform: scale(1.05);
}

/* Etiqueta NEW */
.cle-story-badge {
    position: absolute;
    top: 8px;
    left: 8px;
    background: #FFD700; /* Amarillo vibrante */
    color: #000;
    font-size: 11px;
    font-weight: 900;
    padding: 2px 6px;
    border-radius: 4px;
    z-index: 5;
    text-transform: uppercase;
    font-family: sans-serif;
}

/* Contenedor de información (Texto sobre la imagen) */
.cle-story-info {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 30px 10px 12px;
    /* Degradado de negro a transparente para legibilidad */
    background: linear-gradient(to top, rgba(0,0,0,0.9) 0%, rgba(0,0,0,0.5) 60%, transparent 100%);
    z-index: 3;
}

.cle-story-title {
    color: #ffffff;
    font-size: 12px;
    font-weight: 700;
    line-height: 1.3;
    margin: 0;
    text-align: left;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* Permite hasta 3 líneas como en la imagen */
    -webkit-box-orient: vertical;
    overflow: hidden;
    white-space: normal;
    text-shadow: 0 1px 2px rgba(0,0,0,0.5);
}

/* =========================================================
   3. FLECHAS DE NAVEGACIÓN (CARRUSEL)
   ========================================================= */

.cle-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 50;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #fff;
    border: none;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    color: #333;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.cle-arrow:hover {
    background: #f1f1f1;
    transform: translateY(-50%) scale(1.1);
}

.cle-arrow-prev { left: -20px; }
.cle-arrow-next { right: -20px; }

/* Ocultar flechas si no son necesarias */
.cle-arrow[style*="display: none"] {
    display: none !important;
}

/* =========================================================
   4. VISOR / MODAL (EL MODAL NO CAMBIA SU LÓGICA)
   ========================================================= */

.cle-stories-overlay {
    position: fixed;
    inset: 0;
    background: transparent;
    z-index: 99999;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.cle-stories-overlay[hidden] { display: none; }

.cle-ambient-bg {
    position: absolute;
    top: -10%; left: -10%; width: 120%; height: 120%;
    background-size: cover;
    background-position: center;
    background-color: #000;
    filter: blur(40px) saturate(180%) brightness(0.6);
    z-index: 1;
    opacity: 0;
    transition: opacity 0.5s ease;
}

.cle-ambient-bg.active { opacity: 1; z-index: 2; }

.cle-ambient-overlay {
    position: absolute;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 3;
}

.cle-stories-modal {
    position: relative;
    width: 100%;
    max-width: 420px;
    aspect-ratio: 9 / 16;
    max-height: 92vh;
    background: #000;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: 0 30px 60px rgba(0, 0, 0, 0.7);
    z-index: 10;
}

/* Barra de progreso segmentada */
.cle-progress {
    position: absolute;
    top: 15px;
    left: 12px;
    right: 12px;
    height: 2px;
    z-index: 20;
    display: flex;
    gap: 4px;
}

.cle-story-segment {
    flex: 1;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.cle-story-segment-fill {
    background: #fff;
    width: 0%;
    height: 100%;
}

.cle-slide-container {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    background: #000;
}

.cle-slide-container img,
.cle-slide-container video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* Controles del visor */
.cle-nav, .cle-close {
    position: absolute;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    border-radius: 50%;
    cursor: pointer;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: center;
    backdrop-filter: blur(8px);
}

.cle-nav { top: 50%; transform: translateY(-50%); width: 45px; height: 45px; font-size: 30px; }
.cle-nav.prev { left: 15px; }
.cle-nav.next { right: 15px; }
.cle-close { top: 25px; right: 15px; width: 35px; height: 35px; font-size: 22px; }