/* =========================================
   ESTILOS ESPECÍFICOS DEL HOME (SLIDERS Y GRID)
   ========================================= */

/* 1. FORZAR ANCHO COMPLETO (SOLO HOME) */
body.home #main,
body.home #content,
body.blog #main,
body.blog #content {
    max-width: 100% !important;
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: none !important;
    box-shadow: none !important;
    background: transparent !important;
}

/* 2. VARIABLES */
:root {
    --card-width: 160px; 
    --card-gap: 16px;
    --primary-hover: #d12222;
    --arrow-width: 45px; 
}

.storefront-component {
    width: 100%;
    position: relative;
    overflow: hidden;
    margin-bottom: 20px;
}

/* 3. FLECHAS */
.arrow-container {
    position: absolute;
    top: 0; bottom: 0;
    width: var(--arrow-width);
    background: rgba(0, 0, 0, 0.5); 
    color: white;
    border: none;
    cursor: pointer;
    z-index: 100;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
    height: 100%;
    opacity: 0;
    transition: all 0.3s ease;
}

.storefront-component:hover .arrow-container:not(.arrow-hidden) { opacity: 1; }
.arrow-container:hover { background: rgba(0, 0, 0, 0.9); color: var(--primary-hover); }
.left-arrow { left: 0; }
.right-arrow { right: 0; }
.arrow-hidden { opacity: 0 !important; visibility: hidden; pointer-events: none; }

/* 4. CABECERA */
.block-header, .plus-carousel-header {
    display: flex; justify-content: space-between; align-items: center; 
    padding-right: 70px; margin-bottom: 12px;
    padding-left: var(--arrow-width); 
}

.plus-carousel-header h2, .block-header h2 { 
    font-size: 24px; font-weight: 700; margin: 0; color: #fff;
}

/* Enlace Estático */
.angle-link, .angle-link:hover, .angle-link:active {
    font-size: 16px; font-weight: 700; color: #fff !important; text-decoration: none !important;
    display: flex; align-items: center; background: transparent !important;
    border: none !important; text-shadow: none !important; transform: none !important; cursor: pointer;
}
.angle-link span { font-size: 22px; margin-left: 5px; line-height: 1; font-weight: 400; }

/* 5. TARJETAS */
.plus-card {
    min-width: var(--card-width);
    max-width: var(--card-width);
    aspect-ratio: 7 / 10;
    position: relative;
    cursor: pointer;
    border-radius: 4px;
    border: 2px solid transparent;
    transition: transform 0.2s ease, border-color 0.2s;
    flex-shrink: 0;
    z-index: 1;
}

.plus-card a {
    display: block; width: 100%; height: 100%; text-decoration: none;
    position: relative; overflow: hidden; border-radius: 4px;
}

.plus-card-img { width: 100%; height: 100%; background: #1a1a1a; position: relative; }
.plus-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; position: relative; z-index: 1; }

/* Dimming */
.plus-card a::before {
    content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 100%;
    background: rgba(0, 0, 0, 0.5); opacity: 0; transition: opacity 0.3s ease;
    z-index: 20; pointer-events: none;
}

/* Play */
.plus-card a::after {
    content: '▶'; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%) scale(0.8);
    width: 50px; height: 50px; background: rgba(255, 0, 51, 0.95); border-radius: 50%; color: #fff;
    font-size: 24px; line-height: 50px; text-align: center; padding-left: 4px; box-shadow: 0 0 20px #ff0033;
    opacity: 0; transition: all 0.3s ease; z-index: 50; pointer-events: none;
}

.plus-card:hover a::before { opacity: 1; }
.plus-card:hover a::after { opacity: 1; transform: translate(-50%, -50%) scale(1); }

@media (hover: hover) {
    .plus-card:hover { transform: scale(1.05); border-color: rgba(255, 255, 255, 0.5); z-index: 90; }
}

/* 6. BADGES */
.poster-badges { position: absolute; z-index: 60; display: flex; flex-direction: column; gap: 3px; pointer-events: none; }
.badges-top { top: 6px; left: 6px; }
.badges-top-right { top: 6px; right: 6px; align-items: flex-end; }
.badges-bottom { 
    bottom: 6px; left: 0; width: 100%; flex-direction: row; justify-content: center; gap: 5px;
    opacity: 0; transform: translateY(10px); transition: all 0.3s ease;
}
.plus-card:hover .poster-badges.badges-bottom { opacity: 1; transform: translateY(0); }

.p-badge {
    font-size: 10px; font-weight: 800; padding: 2px 6px; border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.8); color: #fff;
}
.badge-latino, .badge-castellano { background: transparent !important; padding: 0 !important; box-shadow: none !important; }
.badge-latino::before { content: ""; display: inline-block; width: 24px; height: 16px; background-image: url('https://flagcdn.com/w40/mx.png'); background-size: cover; border-radius: 2px; }
.badge-castellano::before { content: ""; display: inline-block; width: 24px; height: 16px; background-image: url('https://flagcdn.com/w40/es.png'); background-size: cover; border-radius: 2px; }

/* 7. GRILLA */
.plus-grid-container {
    padding: 0 var(--arrow-width); 
    width: 100%; box-sizing: border-box;
}
.plus-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(var(--card-width), 1fr));
    gap: var(--card-gap);
    width: 100%;
}
.plus-grid .plus-card { width: 100%; max-width: 100%; aspect-ratio: 7 / 10; }

/* 8. SLIDER */
.plus-carousel-container { position: relative; display: flex; align-items: center; }
.plus-carousel-slider {
    display: flex; gap: var(--card-gap); overflow-x: auto; scroll-behavior: smooth;
    padding: 10px var(--arrow-width);
    scrollbar-width: none; -ms-overflow-style: none; width: 100%;
}
.plus-carousel-slider::-webkit-scrollbar { display: none; }

/* 9. RESPONSIVE */
@media (max-width: 768px) {
    :root { --card-width: 105px; --card-gap: 8px; }
    .arrow-container { display: none !important; }
    .plus-carousel-header, .block-header { padding-left: 10px; padding-right: 10px; }
    .plus-carousel-slider { padding: 10px 10px; -webkit-overflow-scrolling: touch; }
    .plus-grid-container { padding: 0 10px; }
}
@media (min-width: 769px) and (max-width: 1024px) {
    :root { --card-width: 140px; }
}