/*
 * VOD Catalog — Estilo Netflix
 * Archivo: vod-netflix.css
 *
 * INSTALACIÓN:
 *  Opción A (recomendada): Encola este archivo desde functions.php de tu tema:
 *
 *      wp_enqueue_style(
 *          'vod-netflix',
 *          get_stylesheet_directory_uri() . '/vod-netflix.css',
 *          [],
 *          '1.3.0'
 *      );
 *
 *  Opción B: Pega el contenido en Apariencia → Personalizar → CSS adicional
 *
 *  Asegúrate de que el <body> no tenga padding lateral excesivo para el hero.
 *  Si tu tema tiene un wrapper con max-width, añade la clase .full-width al
 *  elemento <main> o ajusta .vod-hero con margin de compensación negativo.
 */

/* ────────────────────────────────────────────
   RESET ZONA CATÁLOGO
──────────────────────────────────────────── */
.vod-catalog *,
.vod-catalog *::before,
.vod-catalog *::after {
    box-sizing: border-box;
}

.vod-catalog {
    background: #141414;
    color: #fff;
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    min-height: 100vh;
    padding-bottom: 60px;
    /* Romper el max-width del tema si fuera necesario */
    margin-left: calc(-50vw + 50%);
    margin-right: calc(-50vw + 50%);
    width: 100vw;
}

/* ────────────────────────────────────────────
   HERO
──────────────────────────────────────────── */
.vod-hero {
    position: relative;
    height: 520px;
    overflow: hidden;
    margin-bottom: 2rem;
}

@media (max-width: 768px) {
    .vod-hero { height: 320px; }
}

.vod-hero__gradient {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(to top,  #141414 0%, transparent 55%),
        linear-gradient(to right, rgba(0,0,0,.85) 0%, transparent 65%);
}

.vod-hero__content {
    position: absolute;
    bottom: 3rem;
    left: 4rem;
    max-width: 520px;
    z-index: 2;
}

@media (max-width: 768px) {
    .vod-hero__content { left: 1.5rem; bottom: 1.5rem; }
}

.vod-hero__badge {
    display: inline-block;
    background: #E50914;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: .14em;
    text-transform: uppercase;
    padding: 4px 12px;
    border-radius: 3px;
    margin-bottom: .85rem;
}

.vod-hero__title {
    font-size: clamp(2rem, 4vw, 3.25rem);
    font-weight: 800;
    line-height: 1.05;
    letter-spacing: -.01em;
    margin: 0 0 .6rem;
    text-shadow: 0 2px 24px rgba(0,0,0,.75);
    color: #fff;
}

.vod-hero__meta {
    display: flex;
    gap: .75rem;
    align-items: center;
    margin-bottom: 1rem;
}

.vod-hero__dur {
    background: rgba(255,255,255,.12);
    color: #ccc;
    font-size: .72rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 3px;
}

.vod-hero__desc {
    font-size: .9rem;
    color: #c8c8c8;
    line-height: 1.6;
    margin-bottom: 1.5rem;
}

.vod-hero__btns {
    display: flex;
    gap: .75rem;
    flex-wrap: wrap;
}

/* Botones del hero */
.vod-btn-primary {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: #fff;
    color: #000;
    text-decoration: none;
    padding: .7rem 1.75rem;
    border-radius: 4px;
    font-size: .95rem;
    font-weight: 700;
    transition: background .18s;
}

.vod-btn-primary:hover {
    background: rgba(255,255,255,.8);
    color: #000;
}

.vod-btn-secondary {
    display: inline-flex;
    align-items: center;
    gap: .5rem;
    background: rgba(109,109,110,.65);
    color: #fff;
    text-decoration: none;
    padding: .7rem 1.5rem;
    border-radius: 4px;
    font-size: .95rem;
    font-weight: 600;
    backdrop-filter: blur(6px);
    transition: background .18s;
}

.vod-btn-secondary:hover {
    background: rgba(109,109,110,.9);
    color: #fff;
}

/* ────────────────────────────────────────────
   BARRA DE BÚSQUEDA
──────────────────────────────────────────── */
.vod-searchbar {
    display: flex;
    align-items: center;
    gap: .6rem;
    margin: 0 4rem 1.75rem;
    background: rgba(255,255,255,.08);
    border: 1px solid rgba(255,255,255,.15);
    border-radius: 4px;
    padding: .5rem 1rem;
    max-width: 320px;
    transition: background .2s, border-color .2s;
}

.vod-searchbar:focus-within {
    background: rgba(255,255,255,.13);
    border-color: rgba(255,255,255,.45);
}

.vod-searchbar input {
    background: transparent;
    border: none;
    outline: none;
    color: #fff;
    font-size: .875rem;
    width: 100%;
    font-family: inherit;
}

.vod-searchbar input::placeholder { color: #666; }

@media (max-width: 768px) {
    .vod-searchbar { margin: 0 1.5rem 1.5rem; }
}

/* ────────────────────────────────────────────
   FILAS (ROWS)
──────────────────────────────────────────── */
.vod-row {
    padding: 0 4rem;
    margin-bottom: 3rem;
}

@media (max-width: 768px) {
    .vod-row { padding: 0 1.5rem; }
}

.vod-row__header {
    display: flex;
    align-items: baseline;
    gap: 1rem;
    margin-bottom: 1rem;
}

.vod-row__title {
    font-size: 1.2rem;
    font-weight: 700;
    color: #e5e5e5;
    margin: 0;
    letter-spacing: .01em;
}

.vod-row__see-all {
    font-size: .8rem;
    color: #54b3d6;
    text-decoration: none;
    font-weight: 500;
    opacity: 0;
    transition: opacity .2s;
}

.vod-row__header:hover .vod-row__see-all { opacity: 1; }

.vod-row__count {
    font-size: .8rem;
    color: #777;
    margin-left: auto;
}

/* ────────────────────────────────────────────
   GRID — 16:9
──────────────────────────────────────────── */
.vod-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 6px;
}

/* ────────────────────────────────────────────
   TARJETA
──────────────────────────────────────────── */
.vod-card {
    position: relative;
    border-radius: 6px;
    overflow: visible;
    cursor: pointer;
    transition: transform .22s cubic-bezier(.4,0,.2,1);
    z-index: 1;
}

.vod-card:hover {
    transform: scale(1.085);
    z-index: 20;
}

/* Primera tarjeta ancha en su fila */
.vod-card--wide {
    grid-column: span 2;
}

@media (max-width: 600px) {
    .vod-card--wide { grid-column: span 1; }
}

/* Link invisible cubre toda la tarjeta */
.vod-card__link {
    position: absolute;
    inset: 0;
    z-index: 1;
}

/* Thumbnail */
.vod-card__thumb {
    width: 100%;
    aspect-ratio: 16 / 9;
    overflow: hidden;
    border-radius: 6px;
    background: #1c1c1c;
    position: relative;
    transition: border-radius .22s;
}

.vod-card:hover .vod-card__thumb {
    border-radius: 6px 6px 0 0;
}

.vod-card__thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter .22s;
}

.vod-card:hover .vod-card__thumb img {
    filter: brightness(.65);
}

.vod-card__thumb-placeholder {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #1f1c2c 0%, #1a1a2e 50%, #0d0d1a 100%);
}

/* Badges sobre el thumbnail */
.vod-card__badge {
    position: absolute;
    top: 8px;
    right: 8px;
    font-size: .65rem;
    font-weight: 700;
    padding: 3px 8px;
    border-radius: 3px;
    z-index: 2;
    letter-spacing: .04em;
}

.vod-card__badge--price {
    background: #E50914;
    color: #fff;
}

.vod-card__badge--owned {
    background: #46d369;
    color: #000;
}

/* Barra de progreso */
.vod-card__progress {
    height: 3px;
    background: rgba(255,255,255,.18);
    margin-top: -3px;
    position: relative;
    z-index: 3;
}

.vod-card__progress-fill {
    height: 100%;
    background: #E50914;
}

/* ────────────────────────────────────────────
   PANEL HOVER
──────────────────────────────────────────── */
.vod-card__panel {
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    width: calc(100% + 40px);
    background: #242424;
    border-radius: 0 0 8px 8px;
    padding: 12px 14px;
    opacity: 0;
    pointer-events: none;
    transition: opacity .2s ease;
    box-shadow: 0 14px 48px rgba(0,0,0,.85);
    z-index: 15;
}

.vod-card:hover .vod-card__panel {
    opacity: 1;
    pointer-events: all;
}

.vod-panel__actions {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 10px;
}

.vod-panel__btn-play {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    text-decoration: none;
    transition: background .15s;
}

.vod-panel__btn-play:hover { background: #e0e0e0; }

.vod-panel__btn-circle {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: transparent;
    border: 2px solid rgba(255,255,255,.45);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 18px;
    line-height: 1;
    transition: border-color .15s;
}

.vod-panel__btn-circle:hover { border-color: #fff; }

.vod-panel__meta-right {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-left: auto;
}

.vod-panel__dur,
.vod-panel__hd {
    font-size: .7rem;
    color: #aaa;
    border: 1px solid rgba(255,255,255,.3);
    padding: 1px 5px;
    border-radius: 2px;
}

.vod-panel__title {
    font-size: .82rem;
    font-weight: 600;
    margin-bottom: 5px;
    line-height: 1.35;
}

.vod-panel__title a {
    color: #fff;
    text-decoration: none;
}

.vod-panel__title a:hover { text-decoration: underline; }

.vod-panel__desc {
    font-size: .72rem;
    color: #999;
    line-height: 1.5;
}

/* ────────────────────────────────────────────
   PAGINACIÓN
──────────────────────────────────────────── */
.vod-pagination {
    display: flex;
    justify-content: center;
    gap: .5rem;
    padding: 2rem 4rem;
    flex-wrap: wrap;
}

.vod-pagination .page-numbers {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    background: rgba(255,255,255,.08);
    color: #ccc;
    text-decoration: none;
    border-radius: 4px;
    font-size: .875rem;
    transition: background .18s, color .18s;
}

.vod-pagination .page-numbers:hover,
.vod-pagination .page-numbers.current {
    background: #E50914;
    color: #fff;
}

/* ────────────────────────────────────────────
   RESPONSIVE
──────────────────────────────────────────── */
@media (max-width: 1024px) {
    .vod-grid {
        grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    }
}

@media (max-width: 600px) {
    .vod-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 4px;
    }
    .vod-card:hover {
        transform: scale(1); /* Desactivar hover expand en móvil */
    }
    .vod-card__panel { display: none; }
    .vod-hero__title { font-size: 1.75rem; }
}

/* ────────────────────────────────────────────
   COMPATIBILIDAD CON TEMAS POPULARES
──────────────────────────────────────────── */

/* Astra / GeneratePress: remover max-width de .site-content */
.vod-catalog ~ .site-footer,
.page-template-vod .site-content { max-width: 100% !important; padding: 0 !important; }

/* OceanWP */
.vod-catalog { position: relative; }
