/* ===== RESET & VARIABLES ===== */
:root {
    --bg: #0a0a0a;
    --bg-card: #1a1a1a;
    --text: #ffffff;
    --text-secondary: #b3b3b3;
    --accent: #e50914;
    --accent-glow: 0 0 15px rgba(229, 9, 20, 0.4);
    --border-radius: 8px;
    --border-radius-sm: 6px;
    --transition: 0.3s ease;
    --font: 'Inter', sans-serif;
    --header-height: 64px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    line-height: 1.5;
    -webkit-font-smoothing: subpixel-antialiased;
    overflow-y: auto;
    overflow-x: hidden;
    position: relative;
}

a { color: inherit; text-decoration: none; }

img { max-width: 100%; height: auto; display: block; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: #111; }
::-webkit-scrollbar-thumb { background: var(--accent); border-radius: 4px; }

/* ===== HEADER ===== */
.header {
    position: fixed;
    top: 0; left: 0; width: 100%;
    height: var(--header-height);
    background: rgba(10,10,10,0.95);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1000;
    border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: background 0.3s;
}
.header.scrolled { background: rgba(10,10,10,1); }

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
}

@media (max-width: 768px) {
    .header-left {
        justify-content: space-between;
    }
    .logo {
        margin: 0 auto;
    }
}

.logo {
    font-size: 1.8rem;
    font-weight: 800;
    letter-spacing: -1px;
}
@media (max-width: 576px) {
    .logo { font-size: 1.5rem; }
}

/* ===== LOGO BICOLOR ===== */
.logo-neo {
    color: #ffffff;
    font-weight: 800;
}
.logo-cinema {
    color: var(--accent);
    font-weight: 800;
}

/* ===== ICONO DE BÚSQUEDA (MÓVIL) ===== */
.search-toggle-icon {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.3rem;
    cursor: pointer;
}
@media (max-width: 768px) {
    .search-toggle-icon {
        display: block;
    }
}

/* ===== MENÚ HAMBURGUESA ===== */
.menu-toggle {
    display: none;
    background: none;
    border: none;
    color: #fff;
    font-size: 1.5rem;
    cursor: pointer;
    position: relative;
    z-index: 10001;
}
@media (max-width: 768px) {
    .menu-toggle {
        display: block;
    }
}

/* ===== MENÚ DE NAVEGACIÓN (ESCRITORIO) ===== */
.header-nav {
    display: flex;
    gap: 20px;
    align-items: center;
    flex: 0 0 auto;
}
.header-nav a {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: color var(--transition);
}
.header-nav a:hover,
.header-nav a.active { color: var(--accent); }

@media (max-width: 768px) {
    .header-nav {
        display: none;
    }
}

/* ===== HEADER RIGHT (BUSCADOR DE ESCRITORIO) ===== */
.header-right {
    display: flex;
    align-items: center;
    gap: 15px;
    flex: 1;
    justify-content: flex-end;
}

.search-box {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    border-radius: 20px;
    padding: 5px 10px;
}
.search-box input {
    background: none;
    border: none;
    color: #fff;
    padding: 6px;
    outline: none;
    width: 180px;
}
.search-box button {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    font-size: 1rem;
}

@media (max-width: 768px) {
    .header-right {
        display: none;
    }
}

/* ===== LAYOUT ===== */
.layout {
    display: flex;
    margin-top: var(--header-height);
    min-height: calc(100vh - var(--header-height));
    overflow: visible;
    overflow-x: hidden;
}
.layout .main-content {
    flex: 1;
    padding: 0 20px;
    overflow: visible;
    padding-bottom: 40px;
    overflow-x: hidden;
}

.main-content > .hero:first-child {
    margin-top: 0;
}

body > .main-content,
body > .search-page,
body > .series-page,
body > .history-page {
    margin-top: var(--header-height);
    padding: 20px;
    min-height: calc(100vh - var(--header-height));
    overflow: visible;
    padding-bottom: 40px;
    overflow-x: hidden;
}

/* ===== PÁGINA DE DETALLE (movie.html) ===== */
html body .movie-detail-page,
html body > .movie-detail-page {
    margin-top: var(--header-height);
    padding: 0 !important;
    min-height: calc(100vh - var(--header-height));
    overflow-x: hidden;
}

.detail-wrapper {
    padding: 0;
    margin: 0;
    border-radius: 0;
    background: none;
}

.movie-detail-page .detail-hero {
    width: calc(100% + 40px);
    margin: 0 -20px;
}

.movie-detail-page .episodes-section,
.movie-detail-page .recommendations-section {
    padding: 20px;
}

/* ===== FAVORITOS ===== */
.favorites-page {
    display: flex;
    flex-direction: column;
    margin-top: var(--header-height);
    padding: 20px;
    height: calc(100vh - var(--header-height));
    overflow: visible;
}
.favorites-page .section-title { flex-shrink: 0; }
.favorites-page .empty-favorites {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 15px;
    text-align: center;
    color: var(--text-secondary);
    width: 100%;
}
.favorites-page .empty-favorites .empty-icon {
    font-size: 4rem;
    color: #555;
    margin-bottom: 10px;
}
.favorites-page .empty-favorites .empty-text {
    font-size: 1.2rem;
    font-weight: 500;
}

/* ===== HERO FULL WIDTH – ASPECT RATIO ===== */
.hero {
    position: relative;
    width: 100%;
    margin: 0 -20px;
    width: calc(100% + 40px);
    height: 0;
    padding-bottom: 56%;
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
    overflow: hidden;
    border-radius: 0;
    margin-bottom: 0;
}
@media (min-width: 1200px) {
    .hero { padding-bottom: 35%; }
}
@media (max-width: 992px) {
    .hero { padding-bottom: 50%; }
}
@media (max-width: 768px) {
    .hero { padding-bottom: 75%; }
}
@media (max-width: 576px) {
    .hero { padding-bottom: 100%; }
}

.hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,10,10,1) 0%, transparent 25%);
    z-index: 1;
}

.hero-content {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 2;
    padding: 40px;
    max-width: 600px;
    animation: fadeUp 0.8s ease;
}
@keyframes fadeUp { from { opacity: 0; transform: translateY(20px); } to { opacity: 1; transform: translateY(0); } }
.hero-title { font-size: 3rem; font-weight: 800; margin-bottom: 10px; }
.hero-desc { color: rgba(255,255,255,0.8); margin-bottom: 20px; line-height: 1.4; }
.hero-buttons {
    display: flex;
    gap: 15px;
    flex-wrap: nowrap;
}

/* Skeleton */
.skeleton-card {
    background: linear-gradient(90deg, #1a1a1a 25%, #2a2a2a 50%, #1a1a1a 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
    border-radius: var(--border-radius);
    height: 270px;
}
.skeleton-hero { background: #1a1a1a; animation: shimmer 1.5s infinite; }

/* ===== BOTONES ===== */
.btn {
    padding: 12px 24px;
    border: none;
    border-radius: 30px;
    font-weight: 600;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all var(--transition);
    font-size: 0.9rem;
    white-space: nowrap;
}
.btn-play { background: var(--accent); color: #fff; }
.btn-play:hover { box-shadow: var(--accent-glow); transform: translateY(-2px); }
.btn-info { background: rgba(255,255,255,0.15); color: #fff; border: 1px solid rgba(255,255,255,0.2); }
.btn-info:hover { background: rgba(255,255,255,0.25); }
.btn-sm { padding: 8px 16px; font-size: 0.8rem; }

/* ===== SECTION ===== */
.section { margin-bottom: 40px; }
.section-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; }
.section-title { font-size: 1.5rem; font-weight: 700; display: flex; align-items: center; gap: 10px; }
.section-title i { color: var(--accent); }
.view-all { color: var(--text-secondary); font-size: 0.9rem; display: flex; align-items: center; gap: 5px; }
.view-all:hover { color: var(--accent); }

/* ===== ICONOS DE SECCIÓN PREMIUM (LUCIDE) ===== */
.section-icon {
    width: 24px;
    height: 24px;
    color: var(--accent);
    stroke: currentColor;
    stroke-width: 2;
    flex-shrink: 0;
}

/* ===== CARRUSEL CON FLECHA DERECHA ===== */
.carousel-wrapper {
    position: relative;
    display: flex;
    align-items: center;
    overflow: hidden;
}
.carousel-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    font-size: 1.5rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.3s, transform 0.3s;
}
.carousel-btn:hover {
    background: var(--accent);
    transform: translateY(-50%) scale(1.1);
}
.carousel-next { right: 5px; }

/* ===== SLIDER (ESTRENOS) ===== */
.slider {
    display: flex;
    overflow-x: auto;
    gap: 15px;
    padding: 10px 50px 20px 20px;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    width: 100%;
    box-sizing: border-box;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.slider::-webkit-scrollbar { display: none; }
.slider .movie-card {
    scroll-snap-align: start;
    flex-shrink: 0;
    width: 160px;
}

/* ===== GRID ===== */
.movie-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 20px;
    max-width: 100%;
}

/* ===== CARD ===== */
.movie-card {
    background: var(--bg-card);
    border-radius: var(--border-radius);
    overflow: hidden;
    transition: transform 0.3s, box-shadow 0.3s;
    cursor: pointer;
    position: relative;
    z-index: 1;
    border: 1px solid transparent;
    width: 100%;
    max-width: 160px;
    margin: 0 auto;
}
.movie-grid .movie-card { width: 100%; max-width: 160px; }

.movie-card:hover {
    transform: translateY(-8px) scale(1.08);
    box-shadow: 0 15px 35px rgba(0,0,0,0.6), 0 0 20px rgba(229,9,20,0.3);
    border-color: var(--accent);
    z-index: 10;
}
.movie-card img {
    width: 100%;
    height: 200px;
    object-fit: cover;
    transition: transform 0.5s;
}
.movie-card:hover img { transform: scale(1.05); }
.movie-card-info { padding: 10px; }
.movie-card-title {
    font-weight: 600;
    font-size: 0.85rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 3px;
}
.movie-card-meta {
    display: flex;
    justify-content: space-between;
    font-size: 0.7rem;
    color: var(--text-secondary);
}
.movie-card-rating { color: var(--accent); }
.movie-card .play-overlay {
    position: absolute;
    top: 50%; left: 50%;
    transform: translate(-50%, -50%);
    background: var(--accent);
    width: 40px; height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s;
    font-size: 1rem;
}
.movie-card:hover .play-overlay { opacity: 1; }

/* ===== DETALLE FULL‑WIDTH ===== */
.detail-view {
    padding: 0;
}

.detail-hero {
    position: relative;
    width: calc(100% + 40px);
    margin: 0 -20px;
    min-height: 65vh;
    background-size: cover;
    background-position: center 20%;
    background-repeat: no-repeat;
    display: flex;
    align-items: flex-end;
    margin-bottom: 30px;
}

.detail-hero::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(10,10,10,1) 0%, transparent 25%);
    z-index: 1;
}

.detail-hero-content {
    position: relative;
    z-index: 2;
    width: 100%;
    display: flex;
    align-items: center;
    gap: 25px;
    padding: 40px;
    flex-wrap: wrap;
}

.detail-poster {
    width: 160px;
    max-width: 100%;
    height: auto;
    max-height: 250px;
    object-fit: contain;
    border-radius: var(--border-radius);
    flex-shrink: 0;
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.detail-text {
    flex: 1;
    color: #fff;
    min-width: 250px;
}

.detail-hero-title {
    font-size: 2.5rem;
    font-weight: 800;
    margin-bottom: 10px;
}

.detail-meta {
    display: flex;
    gap: 20px;
    margin: 10px 0;
    color: var(--text-secondary);
    flex-wrap: wrap;
}

.detail-overview {
    color: rgba(255,255,255,0.8);
    line-height: 1.5;
    margin: 15px 0;
    font-size: 0.95rem;
}

.actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
    margin-top: 20px;
}

.genre-tag {
    background: rgba(229,9,20,0.2);
    border: 1px solid var(--accent);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 0.8rem;
    display: inline-block;
    margin-right: 5px;
}

.genres {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    margin: 10px 0;
}

/* ===== RECOMENDACIONES ===== */
.recommendations-section {
    margin-top: 40px;
    padding: 0 20px;
}
.recommendations-section .section-title {
    display: block;
    margin-bottom: 16px;
    padding-bottom: 15px;
}
.recommendations-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 20px;
    clear: both;
    margin-top: 10px;
}
.recommendations-grid .movie-card img { height: 200px; object-fit: cover; }

/* ===== REPRODUCTOR INLINE ===== */
.player-view { padding: 15px; }

.player-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
    margin-bottom: 20px;
    background: transparent;
    padding: 0;
    border-radius: 0;
}

.player-poster img {
    width: 100%;
    height: auto;
    object-fit: contain;
    max-height: 220px;
    border-radius: var(--border-radius);
    box-shadow: 0 10px 20px rgba(0,0,0,0.5);
}

.player-info { display: flex; flex-direction: column; justify-content: center; }
.player-title { font-size: 1.5rem; font-weight: 700; margin-bottom: 8px; }
.player-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
    font-size: 0.85rem;
}
.player-meta span i { margin-right: 5px; color: var(--accent); }
.player-overview {
    color: rgba(255,255,255,0.8);
    line-height: 1.4;
    font-size: 0.85rem;
}

/* --- Panel de controles con efecto glass --- */
.player-controls {
    display: flex;
    align-items: flex-end;
    gap: 16px;
    flex-wrap: wrap;
    margin-bottom: 20px;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(15px);
    -webkit-backdrop-filter: blur(15px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 14px;
    padding: 15px 20px;
    justify-content: space-between;
}

.control-group { display: flex; flex-direction: column; gap: 5px; }
.control-group label {
    font-size: 0.78rem;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 5px;
    font-weight: 500;
}
.control-group select {
    padding: 6px 32px 6px 10px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 8px;
    color: #fff;
    font-size: 0.85rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M1.41.59L6%205.17%2010.59.59%2012%202%206%208%200%202z%22%20fill%3D%22%23b3b3b3%22/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    min-width: 140px;
    transition: border-color 0.2s, background-color 0.2s;
}
.control-group select:hover,
.control-group select:focus {
    border-color: var(--accent);
    background-color: #333;
    outline: none;
}

.control-trailer { margin-left: auto; }
.control-trailer .btn { padding: 8px 18px; font-size: 0.85rem; }

.player-iframe-container {
    position: relative;
    width: 100%;
    padding-top: 56.25%;
    background: #000;
    border-radius: var(--border-radius);
    overflow: hidden;
    margin-top: 12px;
}
.player-iframe-container iframe {
    position: absolute;
    top: 0; left: 0;
    width: 100%; height: 100%;
    border: none;
}

.player-view-title { font-size: 1.2rem; font-weight: 600; margin-bottom: 12px; }

/* ===== BÚSQUEDA EN LISTADO ===== */
.search-input-wrapper {
    display: flex;
    align-items: center;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 50px;
    padding: 4px 16px;
    margin-bottom: 30px;
    transition: border-color 0.3s, box-shadow 0.3s;
}
.search-input-wrapper:focus-within {
    border-color: var(--accent);
    box-shadow: 0 0 10px rgba(229,9,20,0.3);
}
.search-input-icon {
    color: var(--text-secondary);
    font-size: 1.1rem;
    margin-right: 10px;
    cursor: pointer;
    transition: color 0.2s;
}
.search-input-icon:hover { color: var(--accent); }
.search-input-wrapper input {
    flex: 1;
    background: none;
    border: none;
    color: #fff;
    padding: 8px 0;
    font-size: 1rem;
    outline: none;
}
.search-submit-btn { display: none; }

/* ===== PAGINACIÓN ===== */
.pagination { margin-top: 40px; display: flex; justify-content: center; }
.pagination-container { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center; }
.page-btn {
    background: #1a1a1a;
    border: 1px solid #333;
    color: #fff;
    min-width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    font-size: 0.9rem;
    padding: 0 6px;
}
.page-btn:hover:not(:disabled) { background: #333; border-color: var(--accent); }
.page-btn.active { background: var(--accent); border-color: var(--accent); font-weight: 700; box-shadow: 0 0 8px rgba(229,9,20,0.6); }
.page-btn:disabled { opacity: 0.4; cursor: not-allowed; }
.page-ellipsis { color: #888; padding: 0 4px; font-size: 1.2rem; }

/* ===== EPISODIOS ===== */
.episodes-section {
    margin-top: 30px;
    background: transparent;
}
.season-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px;
    background: #1a1a1a;
    border-radius: 10px;
    padding: 15px 20px;
}
.season-selector label { font-weight: 600; color: var(--text-secondary); white-space: nowrap; }
.season-selector select {
    padding: 10px 40px 10px 15px;
    background: #2a2a2a;
    border: 1px solid #444;
    border-radius: 10px;
    color: #fff;
    font-size: 0.95rem;
    cursor: pointer;
    appearance: none;
    background-image: url("data:image/svg+xml;charset=US-ASCII,%3Csvg%20width%3D%2212%22%20height%3D%228%22%20xmlns%3D%22http%3A//www.w3.org/2000/svg%22%3E%3Cpath%20d%3D%22M1.41.59L6%205.17%2010.59.59%2012%202%206%208%200%202z%22%20fill%3D%22%23b3b3b3%22/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 15px center;
    min-width: 200px;
    transition: border-color 0.2s, background-color 0.2s;
}
.season-selector select:hover,
.season-selector select:focus { border-color: var(--accent); background-color: #333; outline: none; }

.episodes-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 10px;
}
.episode-grid-card {
    background: #1a1a1a;
    border: 1px solid rgba(255,255,255,0.08);
    border-radius: var(--border-radius-sm);
    padding: 15px 10px;
    text-align: center;
    cursor: pointer;
    transition: all 0.2s;
}
.episode-grid-card:hover { background: #2a2a2a; border-color: var(--accent); transform: translateY(-3px); }
.episode-grid-number { font-size: 1.8rem; font-weight: 800; color: var(--accent); margin-bottom: 6px; }
.episode-grid-title { font-size: 0.85rem; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===== FOOTER ===== */
.site-footer {
    background: #0f0f0f;
    border-top: 1px solid rgba(255,255,255,0.08);
    padding: 20px;
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.9rem;
    margin-top: auto;
}

.search-box--hidden { visibility: hidden; pointer-events: none; }

/* ===== BARRA DE BÚSQUEDA MÓVIL ===== */
.mobile-search-bar {
    display: none;
    position: fixed;
    top: var(--header-height);
    left: 0;
    width: 100%;
    height: 48px;
    background: #0a0a0a;
    border-bottom: 1px solid rgba(255,255,255,0.08);
    z-index: 999;
    align-items: center;
    padding: 0 15px;
}

.mobile-search-bar input {
    width: 100%;
    height: 36px;
    background: #1a1a1a;
    border: 1px solid #333;
    border-radius: 20px;
    padding: 6px 15px;
    color: #fff;
    font-size: 0.9rem;
    outline: none;
}

/* Mostrar barra cuando el body tiene la clase mobile-search-open */
@media (max-width: 768px) {
    body.mobile-search-open .mobile-search-bar {
        display: flex;
        align-items: center;
        height: 52px;
    }

    body.mobile-search-open .mobile-search-bar input {
        height: 42px;
        font-size: 1rem;
        padding: 8px 15px;
    }

    body.mobile-search-open .layout,
    body.mobile-search-open > .main-content,
    body.mobile-search-open .search-page,
    body.mobile-search-open .series-page,
    body.mobile-search-open .movie-detail-page,
    body.mobile-search-open .history-page,
    body.mobile-search-open .favorites-page {
        margin-top: calc(var(--header-height) + 52px) !important;
    }

    body.mobile-search-open .hero {
        margin-top: 12px;
    }
}

@media (max-width: 576px) {
    body.mobile-search-open .mobile-search-bar {
        height: 48px;
        padding: 0 10px;
    }

    body.mobile-search-open .mobile-search-bar input {
        height: 40px;
        font-size: 0.9rem;
        padding: 8px 12px;
    }

    body.mobile-search-open .layout,
    body.mobile-search-open > .main-content,
    body.mobile-search-open .search-page,
    body.mobile-search-open .series-page,
    body.mobile-search-open .movie-detail-page,
    body.mobile-search-open .history-page,
    body.mobile-search-open .favorites-page {
        margin-top: calc(var(--header-height) + 48px) !important;
    }

    body.mobile-search-open .hero {
        margin-top: 10px;
    }
}

/* ===== AJUSTES PARA MÓVILES ===== */
@media (max-width: 768px) {
    .layout .main-content {
        padding: 0 10px;
    }

    .movie-grid {
        gap: 12px;
    }

    .slider {
        padding: 10px 45px 20px 10px;
    }

    .section {
        margin-bottom: 30px;
    }

    .hero {
        margin: 0 -10px;
        width: calc(100% + 20px);
    }

    .detail-hero {
        margin: 0 -10px;
        width: calc(100% + 20px);
        min-height: 60vh;
    }

    html body .movie-detail-page .detail-hero {
        margin: 0 -10px;
        width: calc(100% + 20px);
    }

    .detail-hero-content {
        flex-direction: column;
        text-align: center;
        padding: 20px;
    }

    .detail-poster {
        width: 140px;
        max-height: 200px;
        margin-bottom: 15px;
    }

    .detail-hero-title {
        font-size: 2rem;
    }

    .detail-meta {
        justify-content: center;
    }

    .actions {
        justify-content: center;
    }

    .recommendations-section {
        padding: 0 10px;
    }
}

@media (max-width: 576px) {
    .layout .main-content {
        padding: 0 8px;
    }

    .movie-grid {
        gap: 10px;
    }

    .slider {
        padding: 10px 40px 20px 8px;
    }

    .hero {
        margin: 0 -8px;
        width: calc(100% + 16px);
    }

    .detail-hero {
        margin: 0 -8px;
        width: calc(100% + 16px);
        min-height: 70vh;
    }

    html body .movie-detail-page .detail-hero {
        margin: 0 -8px;
        width: calc(100% + 16px);
    }

    .detail-hero-content {
        padding: 15px;
    }

    .detail-poster {
        width: 120px;
        max-height: 180px;
    }

    .detail-hero-title {
        font-size: 1.8rem;
    }

    .detail-overview {
        font-size: 0.85rem;
    }

    .recommendations-section {
        padding: 0 8px;
    }
}

/* ===== RESPONSIVE GENERAL ===== */
@media (max-width: 992px) {
    .layout { flex-direction: column; }
    .main-content { max-width: 100%; padding: 0 15px; }
    body > .main-content,
    body > .search-page,
    body > .series-page,
    body > .history-page { padding: 15px; }
    .favorites-page { padding: 15px; }
}

@media (max-width: 768px) {
    .hero-content { padding: 25px; max-width: 100%; }
    .hero-title { font-size: 2.2rem; }
    .hero-desc { font-size: 0.95rem; }
    .hero-buttons { flex-wrap: nowrap; }
    .btn { padding: 10px 18px; font-size: 0.85rem; }
    .btn-sm { padding: 6px 12px; font-size: 0.75rem; }

    .movie-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 12px; }
    .movie-card img { height: auto; }
    .movie-card { max-width: 100%; }

    .slider .movie-card { width: 140px; }
    .carousel-btn { width: 32px; height: 32px; font-size: 1.2rem; }

    .detail-poster { width: 140px; max-height: 200px; }
    .detail-title { font-size: 2rem; }
    .detail-meta { gap: 15px; font-size: 0.9rem; }

    .recommendations-section .section-title { margin-bottom: 10px; }

    .player-view { padding: 10px; }
    .player-layout { grid-template-columns: 1fr; text-align: center; padding: 0; gap: 15px; }
    .player-poster img { max-width: 160px; max-height: 220px; margin: 0 auto; }
    .player-title { font-size: 1.4rem; }
    .player-meta { gap: 10px; font-size: 0.8rem; }
    .player-overview { font-size: 0.85rem; }
    .player-controls { flex-direction: column; align-items: stretch; gap: 12px; padding: 12px 16px; }
    .control-group select { min-width: 100%; padding: 8px 35px 8px 12px; }
    .control-trailer { margin-left: 0; }
    .control-trailer .btn { width: 100%; justify-content: center; }

    .page-btn { min-width: 35px; height: 35px; font-size: 0.8rem; }
    .episodes-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); }
    .episode-grid-number { font-size: 1.5rem; }
    .episode-grid-title { font-size: 0.75rem; }
    .movie-detail { padding: 20px; }
    .season-selector { flex-direction: column; align-items: flex-start; }
    .season-selector select { min-width: 100%; }
}

@media (max-width: 576px) {
    .header { padding: 0 15px; }
    .logo { font-size: 1.5rem; }
    .hero-content { padding: 20px; }
    .hero-title { font-size: 1.9rem; }
    .hero-desc { font-size: 0.9rem; }
    .hero-buttons { flex-wrap: nowrap; }
    .btn { padding: 8px 14px; font-size: 0.8rem; gap: 5px; }

    .movie-grid { grid-template-columns: repeat(3, 1fr) !important; gap: 10px; }
    .movie-card img { height: auto; }
    .movie-card-title { font-size: 0.75rem; }
    .movie-card-meta { font-size: 0.6rem; }

    .slider .movie-card { width: 120px; }
    .carousel-btn { width: 28px; height: 28px; font-size: 1rem; }

    .detail-poster { width: 120px; max-height: 180px; }
    .detail-title { font-size: 1.6rem; }
    .section-title { font-size: 1.3rem; }

    .player-view { padding: 8px; }
    .player-poster img { max-height: 180px; }
    .player-title { font-size: 1.3rem; }
    .player-meta { gap: 8px; font-size: 0.75rem; }
    .player-overview { font-size: 0.8rem; }
    .player-controls { padding: 10px 14px; background: rgba(255,255,255,0.12); }
}