/* ============================================
   FRONT PAGE - ESTILO YOUTUBE CON TRAILER LIGERO
============================================ */

/* ============================================
   SECCIONES
============================================ */
.sp-posts-section {
    padding: 16px 0;
    max-width: 100%;
}

/* ============================================
   CABECERA DE SECCIÓN
============================================ */
.sp-section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding: 0 4px;
}

.sp-section-title-wrapper {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    cursor: pointer;
}

.sp-section-title-link {
    text-decoration: none !important;
    color: inherit !important;
    border: none !important;
    display: inline-block;
    box-shadow: none !important;
    outline: none !important;
}

.sp-section-title-link:active,
.sp-section-title-link:focus,
.sp-section-title-link:hover {
    text-decoration: none !important;
    color: inherit !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
}

.sp-section-title-link .sp-section-title {
    text-decoration: none !important;
    color: var(--sp-text-color) !important;
    border: none !important;
    transition: opacity 0.2s;
}

.sp-section-title-link:hover .sp-section-title {
    opacity: 0.8;
}

.sp-section-title {
    color: var(--sp-text-color);
    font-size: 20px;
    font-weight: 600;
    margin: 0;
    transition: opacity 0.2s;
    display: flex;
    align-items: center;
    gap: 10px;
    white-space: nowrap;
}

.sp-section-emoji {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    background-color: var(--sp-primary-color);
    border-radius: 50%;
    flex-shrink: 0;
    padding: 5px;
    box-sizing: border-box;
    min-width: 28px;
    min-height: 28px;
}

.sp-section-emoji .sp-btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    filter: brightness(0) invert(1);
}

.sp-section-emoji img {
    max-width: 18px;
    max-height: 18px;
    object-fit: contain;
}

.sp-section-title-text {
    position: relative;
    display: inline-block;
}

.sp-section-hover-text {
    display: none;
}

/* ============================================
   GRID DE POSTS - 3 COLUMNAS EN ORDENADOR / 1 EN MÓVIL
============================================ */
.sp-posts-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
    margin-top: 0;
    width: 100%;
    min-width: 0;
}

/* Cada artículo ocupa todo el espacio de su celda */
.sp-posts-grid article {
    width: 100%;
    min-width: 0;
}

/* Imágenes dentro del grid que ocupen todo el ancho */
.sp-posts-grid .sp-thumbnail-wrapper {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    position: relative;
}

.sp-posts-grid .sp-thumbnail-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* ============================================
   TARJETAS DE CONTENIDO
============================================ */
.sp-movie-item,
.sp-series-item,
.sp-anime-item,
.sp-dorama-item,
.sp-telenovela-item {
    background-color: transparent;
    border: none;
    border-radius: 0;
    overflow: hidden;
    transition: none;
    cursor: pointer;
    min-width: 0;
}

.sp-movie-item a,
.sp-series-item a,
.sp-anime-item a,
.sp-dorama-item a,
.sp-telenovela-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* ============================================
   THUMBNAIL WRAPPER - 16:9
============================================ */
.sp-thumbnail-wrapper {
    position: relative;
    overflow: hidden;
    padding-top: 56.25%;
    border-radius: 12px;
    background: linear-gradient(100deg, var(--sp-card-bg) 30%, #262626 50%, var(--sp-card-bg) 70%);
    background-size: 200% 100%;
    animation: sp-shimmer 1.6s ease-in-out infinite;
    transition: border-radius 0.3s ease, box-shadow 0.3s var(--sp-ease, ease);
}

/* La imagen (z-index superior) cubre el shimmer en cuanto termina de cargar;
   no requiere JS porque el fondo del wrapper queda debajo del <img>. */
@keyframes sp-shimmer {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

@media (prefers-reduced-motion: reduce) {
    .sp-thumbnail-wrapper {
        animation: none;
        background: var(--sp-card-bg);
    }
}

.sp-movie-item:hover .sp-thumbnail-wrapper,
.sp-series-item:hover .sp-thumbnail-wrapper,
.sp-anime-item:hover .sp-thumbnail-wrapper,
.sp-dorama-item:hover .sp-thumbnail-wrapper,
.sp-telenovela-item:hover .sp-thumbnail-wrapper {
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.55);
}

/* Imagen del poster */
.sp-thumbnail-image {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    transition: opacity 0.4s ease, transform 0.4s ease;
    border-radius: 12px;
    z-index: 1;
}

/* En hover, la imagen se oscurece */
.sp-movie-item:hover .sp-thumbnail-image,
.sp-series-item:hover .sp-thumbnail-image,
.sp-anime-item:hover .sp-thumbnail-image,
.sp-dorama-item:hover .sp-thumbnail-image,
.sp-telenovela-item:hover .sp-thumbnail-image {
    opacity: 0.4;
    transform: scale(1.05);
}

/* Solo los que tienen trailer: la imagen se oculta completamente */
.sp-movie-item[data-has-trailer="true"]:hover .sp-thumbnail-image,
.sp-series-item[data-has-trailer="true"]:hover .sp-thumbnail-image,
.sp-anime-item[data-has-trailer="true"]:hover .sp-thumbnail-image,
.sp-dorama-item[data-has-trailer="true"]:hover .sp-thumbnail-image,
.sp-telenovela-item[data-has-trailer="true"]:hover .sp-thumbnail-image {
    opacity: 0;
}

/* ============================================
   TRAILER CONTAINER - REPRODUCTOR LIGERO SIN CONTROLES
============================================ */
.sp-trailer-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.4s ease, visibility 0.4s ease;
    border-radius: 12px;
    overflow: hidden;
    background: #000;
}

/* En hover, el trailer se muestra */
.sp-movie-item[data-has-trailer="true"]:hover .sp-trailer-container,
.sp-series-item[data-has-trailer="true"]:hover .sp-trailer-container,
.sp-anime-item[data-has-trailer="true"]:hover .sp-trailer-container,
.sp-dorama-item[data-has-trailer="true"]:hover .sp-trailer-container,
.sp-telenovela-item[data-has-trailer="true"]:hover .sp-trailer-container {
    opacity: 1;
    visibility: visible;
}

/* El iframe del trailer - SIN CONTROLES */
.sp-trailer-iframe {
    width: 100%;
    height: 100%;
    border: none;
    position: absolute;
    top: 0;
    left: 0;
    pointer-events: none;
}

/* Estilo para cuando el trailer está cargando */
.sp-trailer-container.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 40px;
    height: 40px;
    border: 3px solid rgba(255, 255, 255, 0.1);
    border-top-color: #fff;
    border-radius: 50%;
    animation: sp-spin 0.8s linear infinite;
    z-index: 5;
}

@keyframes sp-spin {
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

/* ============================================
   DURACIÓN BADGE (siempre visible)
============================================ */
.sp-duration-badge {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.85);
    color: #ffffff;
    font-weight: 500;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 4px;
    z-index: 10;
    pointer-events: none;
    font-family: 'Roboto', -apple-system, BlinkMacSystemFont, sans-serif;
    letter-spacing: 0.3px;
    backdrop-filter: blur(2px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

/* ============================================
   INFORMACIÓN DEL CONTENIDO
============================================ */
.sp-content-info {
    padding: 10px 4px 0 4px;
}

.sp-content-title {
    font-size: 14px;
    font-weight: 500;
    color: var(--sp-text-color);
    margin: 0 0 4px 0;
    line-height: 1.4;
    display: -webkit-box;
    display: box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    line-clamp: 2;
    overflow: hidden;
    text-overflow: ellipsis;
    max-height: 40px;
}

.sp-content-meta {
    margin-bottom: 3px;
}

.sp-content-original-title {
    font-size: 13px;
    color: var(--sp-text-dark);
    font-weight: 400;
    transition: color 0.2s;
}

.sp-movie-item:hover .sp-content-original-title,
.sp-series-item:hover .sp-content-original-title,
.sp-anime-item:hover .sp-content-original-title,
.sp-dorama-item:hover .sp-content-original-title,
.sp-telenovela-item:hover .sp-content-original-title {
    color: var(--sp-text-light);
}

.sp-content-stats {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--sp-text-dark);
    flex-wrap: wrap;
}

.sp-content-views,
.sp-content-rating,
.sp-content-year {
    font-size: 13px;
    color: var(--sp-text-dark);
}

.sp-content-rating {
    color: #ffd700;
    font-weight: 500;
}

.sp-content-year {
    color: var(--sp-text-dark);
}

/* ============================================
   SEPARADOR
============================================ */
.sp-hr {
    border: none;
    height: 1px;
    width: 100%;
    margin: 8px 0 16px 0;
    background: var(--sp-border-color);
    border-radius: 0;
}

/* ============================================
   MENSAJE DE SIN CONTENIDO
============================================ */
.sp-no-content-message {
    color: var(--sp-text-dark);
    font-style: italic;
    text-align: center;
    padding: 40px 20px;
    font-size: 14px;
}

/* ============================================
   RESPONSIVE
============================================ */

/* TABLET - 2 columnas */
@media screen and (min-width: 769px) and (max-width: 1024px) {
    .sp-posts-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 16px;
    }
}

/* MÓVIL - 1 columna */
@media screen and (max-width: 768px) {
    .sp-posts-grid {
        grid-template-columns: 1fr;
        gap: 14px;
    }
    
    .sp-section-title {
        font-size: 17px;
    }
    
    .sp-section-emoji {
        width: 24px;
        height: 24px;
        min-width: 24px;
        min-height: 24px;
        padding: 4px;
    }
    
    .sp-section-emoji img {
        max-width: 14px;
        max-height: 14px;
    }
    
    .sp-thumbnail-wrapper {
        border-radius: 8px;
    }
    
    .sp-thumbnail-image {
        border-radius: 8px;
    }
    
    .sp-content-title {
        font-size: 13px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        max-height: 36px;
    }
    
    .sp-content-original-title,
    .sp-content-views,
    .sp-content-rating,
    .sp-content-year {
        font-size: 12px;
    }
    
    .sp-duration-badge {
        font-size: 11px;
        padding: 1px 6px;
        bottom: 6px;
        right: 6px;
    }
}

/* En dispositivos táctiles, desactivar el hover del trailer */
@media (hover: none) {
    .sp-trailer-container {
        display: none !important;
    }
    
    .sp-thumbnail-image {
        opacity: 1 !important;
        transform: none !important;
    }
}

/* MÓVIL PEQUEÑO - 1 columna */
@media screen and (max-width: 480px) {
    .sp-posts-grid {
        grid-template-columns: 1fr;
        gap: 12px;
    }
    
    .sp-posts-section {
        padding: 12px 0;
    }
    
    .sp-section-title {
        font-size: 15px;
        gap: 6px;
    }
    
    .sp-section-emoji {
        width: 22px;
        height: 22px;
        min-width: 22px;
        min-height: 22px;
        padding: 3px;
    }
    
    .sp-section-emoji img {
        max-width: 12px;
        max-height: 12px;
    }
    
    .sp-content-info {
        padding: 8px 2px 0 2px;
    }
    
    .sp-content-title {
        font-size: 12px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        max-height: 34px;
    }
    
    .sp-content-original-title {
        font-size: 11px;
    }
    
    .sp-content-stats {
        font-size: 11px;
        gap: 4px;
    }
    
    .sp-content-views,
    .sp-content-rating,
    .sp-content-year {
        font-size: 11px;
    }
    
    .sp-duration-badge {
        font-size: 10px;
        padding: 1px 5px;
        bottom: 4px;
        right: 4px;
        border-radius: 3px;
    }
}

/* MÓVIL MUY PEQUEÑO - 1 columna */
@media screen and (max-width: 360px) {
    .sp-posts-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }
    
    .sp-content-title {
        font-size: 11px;
        -webkit-line-clamp: 2;
        line-clamp: 2;
        max-height: 30px;
    }
    
    .sp-content-original-title,
    .sp-content-views,
    .sp-content-rating,
    .sp-content-year {
        font-size: 10px;
    }
}

/* ============================================
   ANIMACIONES
============================================ */
.sp-movie-item,
.sp-series-item,
.sp-anime-item,
.sp-dorama-item,
.sp-telenovela-item {
    animation: fadeInUp 0.5s ease forwards;
    opacity: 0;
}

.sp-movie-item:nth-child(1),
.sp-series-item:nth-child(1),
.sp-anime-item:nth-child(1),
.sp-dorama-item:nth-child(1),
.sp-telenovela-item:nth-child(1) { animation-delay: 0.02s; }
.sp-movie-item:nth-child(2),
.sp-series-item:nth-child(2),
.sp-anime-item:nth-child(2),
.sp-dorama-item:nth-child(2),
.sp-telenovela-item:nth-child(2) { animation-delay: 0.04s; }
.sp-movie-item:nth-child(3),
.sp-series-item:nth-child(3),
.sp-anime-item:nth-child(3),
.sp-dorama-item:nth-child(3),
.sp-telenovela-item:nth-child(3) { animation-delay: 0.06s; }
.sp-movie-item:nth-child(4),
.sp-series-item:nth-child(4),
.sp-anime-item:nth-child(4),
.sp-dorama-item:nth-child(4),
.sp-telenovela-item:nth-child(4) { animation-delay: 0.08s; }
.sp-movie-item:nth-child(5),
.sp-series-item:nth-child(5),
.sp-anime-item:nth-child(5),
.sp-dorama-item:nth-child(5),
.sp-telenovela-item:nth-child(5) { animation-delay: 0.10s; }
.sp-movie-item:nth-child(6),
.sp-series-item:nth-child(6),
.sp-anime-item:nth-child(6),
.sp-dorama-item:nth-child(6),
.sp-telenovela-item:nth-child(6) { animation-delay: 0.12s; }

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(16px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ============================================================
   BANNER DESTACADO (HERO) - Estilo Netflix
   Carrusel con autoplay, controles y overlay de texto
============================================================ */
.sp-hero-banner {
    position: relative;
    width: 100%;
    height: 62vh;
    min-height: 380px;
    max-height: 640px;
    margin-bottom: 24px;
    overflow: hidden;
    background: var(--sp-card-bg);
    border-radius: 0;
}

.sp-hero-slides {
    position: relative;
    width: 100%;
    height: 100%;
}

.sp-hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.7s var(--sp-ease, ease), visibility 0.7s;
    z-index: 1;
}

.sp-hero-slide.active {
    opacity: 1;
    visibility: visible;
    z-index: 2;
}

.sp-hero-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
}

.sp-hero-bg-image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 20%;
    transform: scale(1.02);
}

.sp-hero-gradient {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top, var(--sp-dark-bg) 0%, rgba(15, 15, 15, 0.55) 35%, rgba(15, 15, 15, 0.05) 65%, transparent 100%),
        linear-gradient(to right, rgba(15, 15, 15, 0.85) 0%, rgba(15, 15, 15, 0.35) 45%, transparent 75%);
}

.sp-hero-content {
    position: absolute;
    left: 0;
    bottom: 0;
    z-index: 3;
    width: 100%;
    max-width: 620px;
    padding: 0 48px 56px;
    box-sizing: border-box;
}

.sp-hero-badge {
    display: inline-block;
    background: var(--sp-primary-color);
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 4px 12px;
    border-radius: 4px;
    margin-bottom: 14px;
}

.sp-hero-title {
    font-size: 40px;
    font-weight: 700;
    color: #fff;
    line-height: 1.15;
    margin: 0 0 14px;
    text-shadow: 0 2px 12px rgba(0, 0, 0, 0.5);

    display: -webkit-box;
    -webkit-box-orient: vertical;

    line-clamp: 2;          /* Estándar */
    -webkit-line-clamp: 2;  /* Chrome, Edge, Safari */

    overflow: hidden;
}

.sp-hero-meta {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 14px;
    font-size: 14px;
    color: var(--sp-text-light);
    font-weight: 500;
}

.sp-hero-rating {
    color: #ffd700;
    font-weight: 600;
}

.sp-hero-description {
    font-size: 15px;
    line-height: 1.6;
    color: var(--sp-text-light);
    margin: 0 0 24px;
    display: -webkit-box;
    -webkit-box-orient: vertical;

    line-clamp: 3;
    -webkit-line-clamp: 3;

    overflow: hidden;
    text-shadow: 0 1px 8px rgba(0, 0, 0, 0.4);
}

.sp-hero-actions {
    display: flex;
    align-items: center;
    gap: 12px;
}

.sp-hero-btn {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 24px;
    border-radius: 8px;
    font-size: 15px;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    border: none;
    transition: transform 0.15s var(--sp-ease), background 0.15s var(--sp-ease);
    font-family: inherit;
}

.sp-hero-btn:active {
    transform: scale(0.97);
}

.sp-hero-btn-primary {
    background: #fff;
    color: #0f0f0f;
}

.sp-hero-btn-primary:hover {
    background: #e2e2e2;
    color: #0f0f0f;
}

.sp-hero-btn-secondary {
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    backdrop-filter: blur(4px);
}

.sp-hero-btn-secondary:hover {
    background: rgba(255, 255, 255, 0.22);
}

.sp-hero-btn-secondary.active {
    background: var(--sp-primary-color);
}

.sp-hero-btn-secondary.active:hover {
    background: var(--sp-primary-hover);
}

/* Puntos indicadores */
.sp-hero-dots {
    position: absolute;
    right: 48px;
    bottom: 24px;
    z-index: 4;
    display: flex;
    gap: 8px;
}

.sp-hero-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.35);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background 0.2s, width 0.2s var(--sp-ease);
}

.sp-hero-dot:hover {
    background: rgba(255, 255, 255, 0.6);
}

.sp-hero-dot.active {
    background: var(--sp-primary-color);
    width: 22px;
    border-radius: 4px;
}

/* Flechas prev/next */
.sp-hero-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 4;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(15, 15, 15, 0.5);
    border: none;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
}

.sp-hero-banner:hover .sp-hero-nav-btn {
    opacity: 1;
}

.sp-hero-nav-btn:hover {
    background: rgba(15, 15, 15, 0.8);
}

.sp-hero-prev {
    left: 16px;
}

.sp-hero-next {
    right: 16px;
}

@media (prefers-reduced-motion: reduce) {
    .sp-hero-slide {
        transition: opacity 0.01s linear;
    }
}

@media screen and (max-width: 1024px) {
    .sp-hero-banner {
        height: 52vh;
        min-height: 340px;
    }
    .sp-hero-content {
        padding: 0 32px 40px;
        max-width: 90%;
    }
    .sp-hero-title {
        font-size: 30px;
    }
    .sp-hero-dots {
        right: 32px;
    }
}

@media screen and (max-width: 768px) {
    .sp-hero-banner {
        height: 44vh;
        min-height: 300px;
        margin-bottom: 16px;
    }
    .sp-hero-content {
        padding: 0 16px 28px;
        max-width: 100%;
    }
    .sp-hero-badge {
        font-size: 10px;
        padding: 3px 10px;
        margin-bottom: 10px;
    }
    .sp-hero-title {
        font-size: 22px;
        margin-bottom: 8px;
    }
    .sp-hero-description {
        font-size: 13px;
        line-clamp: 2;
        -webkit-line-clamp: 2;
        margin-bottom: 16px;
    }
    .sp-hero-btn {
        padding: 10px 16px;
        font-size: 13px;
    }
    .sp-hero-nav-btn {
        display: none;
    }
    .sp-hero-dots {
        right: 16px;
        bottom: 14px;
    }
}

@media screen and (max-width: 480px) {
    .sp-hero-banner {
        height: 38vh;
        min-height: 260px;
    }
    .sp-hero-title {
        font-size: 18px;
    }
    .sp-hero-actions {
        gap: 8px;
    }
    .sp-hero-btn-text {
        display: none;
    }
    .sp-hero-btn {
        padding: 10px 14px;
    }
}

/* ============================================================
   BOTÓN DE FAVORITO (corazón) - overlay sobre cada tarjeta
   Se inyecta vía JS en cualquier .sp-movie-item / .sp-series-item / etc.
============================================================ */
.sp-movie-item,
.sp-series-item,
.sp-anime-item,
.sp-dorama-item,
.sp-telenovela-item,
.sp-list-card {
    position: relative;
}

.sp-fav-btn {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 15;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 15, 15, 0.6);
    backdrop-filter: blur(2px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transform: scale(0.9);
    transition: opacity 0.2s var(--sp-ease), transform 0.15s var(--sp-ease), background 0.15s;
}

.sp-movie-item:hover .sp-fav-btn,
.sp-series-item:hover .sp-fav-btn,
.sp-anime-item:hover .sp-fav-btn,
.sp-dorama-item:hover .sp-fav-btn,
.sp-telenovela-item:hover .sp-fav-btn,
.sp-list-card:hover .sp-fav-btn,
.sp-fav-btn.active {
    opacity: 1;
}

.sp-fav-btn:hover {
    background: rgba(15, 15, 15, 0.85);
    transform: scale(1.08);
}

.sp-fav-btn.active {
    color: var(--sp-primary-color);
}

/* En táctil no hay hover: siempre visible pero discreto */
@media (hover: none) {
    .sp-fav-btn {
        opacity: 1;
        background: rgba(15, 15, 15, 0.5);
    }
}

/* Botón de quitar (X) - usado en Continuar viendo */
.sp-remove-btn {
    position: absolute;
    top: 8px;
    left: 8px;
    z-index: 15;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 15, 15, 0.6);
    backdrop-filter: blur(2px);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    opacity: 0;
    transition: opacity 0.2s var(--sp-ease), background 0.15s;
}

.sp-list-card:hover .sp-remove-btn {
    opacity: 1;
}

.sp-remove-btn:hover {
    background: rgba(220, 30, 30, 0.85);
}

@media (hover: none) {
    .sp-remove-btn {
        opacity: 1;
    }
}

/* Barra de progreso (Continuar viendo) */
.sp-progress-track {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 3px;
    background: rgba(255, 255, 255, 0.25);
    z-index: 12;
}

.sp-progress-fill {
    height: 100%;
    background: var(--sp-primary-color);
}

/* ============================================================
   SECCIONES DINÁMICAS (Continuar viendo / Mi Lista)
============================================================ */
.sp-clear-continue-btn {
    background: none;
    border: none;
    color: var(--sp-text-dark);
    font-size: 12px;
    font-weight: 500;
    cursor: pointer;
    padding: 6px 10px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.sp-clear-continue-btn:hover {
    background: var(--sp-sidebar-hover);
    color: var(--sp-text-color);
}

.sp-empty-list-message {
    color: var(--sp-text-dark);
    font-size: 13px;
    padding: 20px 4px;
}

/* ============================================================
   TOAST - Notificación breve ("Añadido a Mi Lista", etc.)
============================================================ */
.sp-toast {
    position: fixed;
    left: 50%;
    bottom: 28px;
    transform: translate(-50%, 16px);
    background: #fff;
    color: #0f0f0f;
    padding: 12px 20px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s var(--sp-ease), transform 0.2s var(--sp-ease);
    display: flex;
    align-items: center;
    gap: 8px;
}

.sp-toast.show {
    opacity: 1;
    transform: translate(-50%, 0);
}

@media (max-width: 768px) {
    .sp-toast {
        bottom: 16px;
        font-size: 13px;
        padding: 10px 16px;
        max-width: 90%;
        text-align: center;
    }
}

/* ============================================
   SECCIÓN "CONTINUAR VIENDO" (usuarios logueados)
============================================ */
.sp-recent-item {
    position: relative;
}

.sp-recent-item a {
    text-decoration: none;
    color: inherit;
    display: block;
}

.sp-recent-item .sp-thumbnail-wrapper {
    position: relative;
}

/* Grid propio: más columnas y tarjetas más chicas para que quepan 4-5 en fila */
#sp-recientes-grid {
    grid-template-columns: repeat(5, 1fr);
    gap: 14px;
}

#sp-recientes-grid .sp-content-info {
    padding: 8px 3px 0 3px;
}

#sp-recientes-grid .sp-content-title {
    font-size: 13px;
    max-height: 36px;
}

#sp-recientes-grid .sp-content-meta {
    margin-bottom: 2px;
}

#sp-recientes-grid .sp-content-original-title,
#sp-recientes-grid .sp-content-rating,
#sp-recientes-grid .sp-content-year {
    font-size: 11px;
}

@media screen and (min-width: 769px) and (max-width: 1024px) {
    #sp-recientes-grid {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
}

@media screen and (max-width: 768px) {
    #sp-recientes-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }

    #sp-recientes-grid .sp-content-title {
        font-size: 12px;
        max-height: 32px;
    }

    #sp-recientes-grid .sp-content-original-title,
    #sp-recientes-grid .sp-content-rating,
    #sp-recientes-grid .sp-content-year {
        font-size: 10px;
    }
}

@media screen and (max-width: 480px) {
    #sp-recientes-grid {
        gap: 8px;
    }

    #sp-recientes-grid .sp-content-info {
        padding: 6px 2px 0 2px;
    }
}

.sp-recent-delete {
    position: absolute;
    top: 8px;
    right: 8px;
    z-index: 5;
    width: 28px;
    height: 28px;
    line-height: 26px;
    text-align: center;
    padding: 0;
    border: none;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.65);
    color: #fff;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.2s ease, transform 0.2s ease, background 0.2s ease;
}

.sp-recent-item:hover .sp-recent-delete,
.sp-recent-item:focus-within .sp-recent-delete {
    opacity: 1;
    transform: translateY(0);
}

.sp-recent-delete:hover {
    background: var(--sp-primary-color);
}

/* En móvil no hay hover, así que el botón siempre es visible */
@media (max-width: 768px) {
    .sp-recent-delete {
        opacity: 1;
        transform: none;
        width: 26px;
        height: 26px;
        line-height: 24px;
        font-size: 16px;
    }
}