/* ============================================================================
   CMS.AR · Módulo «🎬 Anuncios» — estilos del visor cliente · F1 · v1.0
   Reusa las variables :root de informes.css (cargar después de esa hoja).
   Mobile-first. Sin dependencias.
   ============================================================================ */

/* El atributo hidden debe ocultar SIEMPRE (varias clases usan display: flex/grid) */
[hidden] { display: none !important; }

/* ===== Grilla de tarjetas ===== */

.anuncios-banner {
    background: linear-gradient(135deg, rgba(99, 102, 241, .12), rgba(6, 182, 212, .12));
    border: 1px solid rgba(99, 102, 241, .35);
    color: var(--primary);
    font-weight: 700;
    border-radius: 12px;
    padding: 14px 18px;
    margin: 0 0 18px;
    text-align: center;
}

.anuncios-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    margin-bottom: 30px;
}

@media (min-width: 640px)  { .anuncios-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1024px) { .anuncios-grid { grid-template-columns: repeat(3, 1fr); } }

.anuncio-card {
    background: var(--bg-primary);
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--shadow);
    cursor: pointer;
    transition: transform .16s ease, box-shadow .16s ease;
    border: 1px solid var(--border);
    outline: none;
}
.anuncio-card:hover { transform: translateY(-3px); box-shadow: 0 10px 24px -6px rgba(31, 41, 55, .18); }
.anuncio-card:focus-visible { outline: 3px solid rgba(99, 102, 241, .5); outline-offset: 2px; }

.anuncio-cover {
    position: relative;
    aspect-ratio: 4 / 5;
    background: linear-gradient(140deg, #1e293b, #0f172a);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.anuncio-cover.no-thumb { background: linear-gradient(140deg, #312e81, #0e7490); }
.anuncio-typeicon { font-size: 3rem; opacity: .85; }
.anuncio-thumb {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    -webkit-user-drag: none;
    user-select: none;
}

.anuncio-badge-type {
    position: absolute;
    top: 10px;
    left: 10px;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    font-size: .74rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    letter-spacing: .2px;
    backdrop-filter: blur(2px);
}

.anuncio-badge-status {
    position: absolute;
    bottom: 10px;
    left: 10px;
    right: 10px;
    text-align: center;
    color: #fff;
    font-size: .78rem;
    font-weight: 700;
    padding: 6px 10px;
    border-radius: 10px;
}
.anuncio-badge-status.st-testeado  { background: rgba(13, 148, 136, .92); }  /* teal  */
.anuncio-badge-status.st-listo     { background: rgba(16, 185, 129, .94); }  /* verde */
.anuncio-badge-status.st-publicado { background: rgba(59, 130, 246, .94); }  /* azul  */

.anuncio-info { padding: 14px 16px 16px; }
.anuncio-title { font-size: 1.02rem; margin-bottom: 5px; color: var(--text-primary); }
.anuncio-campaign { font-size: .86rem; color: var(--text-secondary); }

/* Skeleton de carga */
.anuncio-skel {
    border-radius: 16px;
    min-height: 280px;
    background: linear-gradient(100deg, #e5e7eb 40%, #f3f4f6 50%, #e5e7eb 60%);
    background-size: 200% 100%;
    animation: skelSlide 1.2s infinite linear;
}
@keyframes skelSlide { from { background-position: 120% 0; } to { background-position: -80% 0; } }

/* ===== Visor modal ===== */

body.viewer-open { overflow: hidden; }

.viewer-root {
    position: fixed;
    inset: 0;
    z-index: 1200;
    background: rgba(8, 11, 20, .95);
    display: flex;
    align-items: center;
    justify-content: center;
}
.viewer-shell {
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    background: #0b1220;
    color: #e5e9f2;
    overflow-y: auto;
    overflow-x: hidden;
}

@media (min-width: 768px) {
    .viewer-root { padding: 22px; }
    .viewer-shell {
        max-width: 1020px;
        height: auto;
        max-height: min(93vh, 920px);
        border-radius: 18px;
        box-shadow: 0 32px 90px rgba(0, 0, 0, .55);
    }
}

.viewer-head {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 14px 16px;
    border-bottom: 1px solid #1c2740;
    background: rgba(11, 18, 32, .96);
    position: sticky;
    top: 0;
    z-index: 5;
}
.viewer-titles { flex: 1; min-width: 0; }
.viewer-title { font-size: 1.05rem; line-height: 1.3; color: #f1f5f9; overflow-wrap: anywhere; }
.viewer-meta { font-size: .84rem; color: #94a3b8; margin-top: 3px; }
.viewer-chip {
    display: inline-block;
    margin-top: 8px;
    font-size: .76rem;
    font-weight: 700;
    padding: 4px 10px;
    border-radius: 999px;
    color: #fff;
}
.viewer-chip.st-testeado  { background: rgba(13, 148, 136, .9); }
.viewer-chip.st-listo     { background: rgba(16, 185, 129, .92); }
.viewer-chip.st-publicado { background: rgba(59, 130, 246, .92); }

.viewer-close {
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 1px solid #2a3a5c;
    background: rgba(148, 163, 184, .12);
    color: #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}
.viewer-close svg { width: 20px; height: 20px; fill: currentColor; }
.viewer-close:hover { background: rgba(148, 163, 184, .25); }

.viewer-stage {
    flex: 1 0 auto;   /* hotfix 11-oct: no encoger por debajo del contenido (evita solapamiento con copys en videos verticales) */
    min-height: 300px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #060910;
    position: relative;
    padding: 10px;
}

.viewer-spinner { display: flex; align-items: center; justify-content: center; padding: 40px; }
.spin {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: 4px solid rgba(148, 163, 184, .25);
    border-top-color: #818cf8;
    animation: spinRot 0.9s linear infinite;
    display: inline-block;
}
@keyframes spinRot { to { transform: rotate(360deg); } }

.viewer-stageerror { text-align: center; padding: 34px 20px; }
.viewer-stageerror p { color: #94a3b8; margin-bottom: 6px; }

.viewer-foot {
    padding: 10px 16px 14px;
    font-size: .78rem;
    color: #7c8aa5;
    text-align: center;
    border-top: 1px solid #141d33;
}

/* ===== Player de video custom (.vp) ===== */

.vp {
    position: relative;
    width: 100%;
    max-width: 100%;
    margin: 0 auto;
    background: #000;
    border-radius: 10px;
    overflow: hidden;
    user-select: none;
    -webkit-user-select: none;
}
.vp.vp-vertical   { max-width: min(100%, 400px); }
.vp.vp-horizontal { max-width: min(100%, 900px); }

.vp-video {
    display: block;
    width: 100%;
    height: auto;
    max-height: min(74vh, 720px);
    object-fit: contain;
    background: #000;
    cursor: pointer;
    -webkit-user-drag: none;
}

.vp-compact .vp-video { max-height: min(56vh, 480px); }

.vp-wm {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 3;
    overflow: hidden;
}
.vp-wm-diag {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%) rotate(-28deg);
    font-size: clamp(16px, 3.6vw, 32px);
    font-weight: 800;
    letter-spacing: 3px;
    color: rgba(255, 255, 255, .13);
    white-space: nowrap;
    text-transform: uppercase;
}
.vp-wm-chip {
    position: absolute;
    top: 10px;
    right: 10px;
    font-size: .68rem;
    letter-spacing: .6px;
    color: rgba(255, 255, 255, .72);
    background: rgba(0, 0, 0, .38);
    border: 1px solid rgba(255, 255, 255, .14);
    padding: 3px 9px;
    border-radius: 999px;
    text-transform: uppercase;
}

.vp-spin {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 4;
    pointer-events: none;
}
.vp-spin .spin { width: 46px; height: 46px; }

.vp-big {
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    width: 68px;
    height: 68px;
    border-radius: 50%;
    border: none;
    background: rgba(15, 23, 42, .72);
    color: #fff;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .4);
    transition: transform .15s, opacity .2s;
}
.vp-big:hover { transform: translate(-50%, -50%) scale(1.07); }
.vp-big svg { width: 30px; height: 30px; fill: #fff; margin-left: 3px; }

.vp-fail {
    position: absolute;
    inset: 0;
    z-index: 6;
    background: rgba(8, 11, 20, .88);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 20px;
    text-align: center;
}
.vp-fail p { color: #cbd5e1; }

.vp-ctrl {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 26px 10px 8px;
    background: linear-gradient(to top, rgba(0, 0, 0, .78), rgba(0, 0, 0, 0));
    transition: opacity .25s;
}
.vp.ui-hidden .vp-ctrl,
.vp.ui-hidden .vp-big { opacity: 0; pointer-events: none; }

.vp-btn {
    flex: 0 0 auto;
    width: 36px;
    height: 36px;
    border: none;
    background: transparent;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}
.vp-btn:hover { background: rgba(255, 255, 255, .12); }
.vp-btn svg { width: 20px; height: 20px; fill: #fff; }

.vp-prog {
    flex: 1;
    height: 30px;
    display: flex;
    align-items: center;
    cursor: pointer;
    touch-action: none;
    min-width: 60px;
}
.vp-prog-track {
    position: relative;
    width: 100%;
    height: 5px;
    border-radius: 999px;
    background: rgba(255, 255, 255, .22);
    overflow: visible;
}
.vp-prog-buf {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: rgba(255, 255, 255, .32);
    border-radius: 999px;
}
.vp-prog-fill {
    position: absolute;
    left: 0;
    top: 0;
    bottom: 0;
    width: 0%;
    background: #818cf8;
    border-radius: 999px;
}
.vp-prog-knob {
    position: absolute;
    right: -7px;
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 1px 4px rgba(0, 0, 0, .4);
    transition: transform .12s;
}
.vp-prog:hover .vp-prog-knob { transform: translateY(-50%) scale(1); }

.vp-time { flex: 0 0 auto; font-size: .78rem; color: #e2e8f0; font-variant-numeric: tabular-nums; white-space: nowrap; }

.vp-vol { display: flex; align-items: center; gap: 2px; }
.vp-vol-range { width: 64px; accent-color: #818cf8; }

.vp:fullscreen, .vp:-webkit-full-screen {
    width: 100%;
    height: 100%;
    max-width: none;
    border-radius: 0;
    display: flex;
    align-items: center;
    justify-content: center;
}
.vp:fullscreen .vp-video, .vp:-webkit-full-screen .vp-video { max-height: 100%; height: 100%; }

/* ===== Carrusel ===== */

.carousel { position: relative; width: 100%; }
.carousel-track {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-x pan-y;
}
.carousel-track::-webkit-scrollbar { display: none; }

.carousel-slide {
    flex: 0 0 100%;
    scroll-snap-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 280px;
    position: relative;
}

.carousel-img {
    max-width: 100%;
    max-height: min(68vh, 620px);
    object-fit: contain;
    border-radius: 10px;
    cursor: zoom-in;
    -webkit-user-drag: none;
    user-select: none;
}

.carousel-vholder { width: 100%; max-width: 560px; }
.carousel-vcover {
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 1px dashed rgba(148, 163, 184, .4);
    border-radius: 12px;
    background: linear-gradient(150deg, #101a30, #0a1222);
    color: #cbd5e1;
    font-family: inherit;
    font-size: .95rem;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 10px;
}
.carousel-vcover:hover { border-color: #818cf8; color: #e2e8f0; }
.carousel-vplay {
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: rgba(99, 102, 241, .85);
    display: flex;
    align-items: center;
    justify-content: center;
}
.carousel-vplay svg { width: 26px; height: 26px; fill: #fff; margin-left: 3px; }

.carousel-arrow {
    display: none;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, .35);
    background: rgba(15, 23, 42, .7);
    color: #e2e8f0;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    z-index: 4;
}
.carousel-arrow svg { width: 26px; height: 26px; fill: currentColor; }
.carousel-arrow:disabled { opacity: .3; cursor: default; }
.carousel-arrow:hover:not(:disabled) { background: rgba(99, 102, 241, .55); }
.carousel-prev { left: 8px; }
.carousel-next { right: 8px; }
@media (min-width: 768px) { .carousel-arrow { display: flex; } }

.carousel-dots {
    display: flex;
    justify-content: center;
    gap: 8px;
    padding: 12px 0 4px;
}
.carousel-dot {
    width: 8px;
    height: 8px;
    padding: 0;
    border: none;
    border-radius: 999px;
    background: rgba(148, 163, 184, .45);
    cursor: pointer;
    transition: all .18s;
}
.carousel-dot.active { width: 22px; background: #818cf8; }

.carousel-wm {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: .62rem;
    letter-spacing: .5px;
    color: rgba(255, 255, 255, .6);
    background: rgba(0, 0, 0, .35);
    padding: 3px 8px;
    border-radius: 999px;
    pointer-events: none;
    text-transform: uppercase;
    z-index: 3;
}

/* ===== Slide de imagen + zoom ===== */

.imgslide { position: relative; width: 100%; display: flex; justify-content: center; }
.img-wm {
    position: absolute;
    top: 8px;
    right: 10px;
    font-size: .62rem;
    letter-spacing: .5px;
    color: rgba(255, 255, 255, .6);
    background: rgba(0, 0, 0, .35);
    padding: 3px 8px;
    border-radius: 999px;
    pointer-events: none;
    text-transform: uppercase;
    z-index: 3;
}

.zoom-root-inline { width: 100%; }
.zoom-root-inline .zoom-stage { min-height: 260px; }
.zoom-stage {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
    cursor: zoom-in;
}
.zoom-root.zoomed .zoom-stage { cursor: grab; }
.zoom-root.zoomed .zoom-stage:active { cursor: grabbing; }

.zoom-img {
    max-width: 100%;
    max-height: min(68vh, 640px);
    object-fit: contain;
    transform-origin: center center;
    will-change: transform;
    user-select: none;
    -webkit-user-drag: none;
    pointer-events: none; /* los gestos los maneja el stage */
}

/* Overlay (lightbox sobre el visor) */
.zoom-root-overlay {
    position: fixed;
    inset: 0;
    z-index: 1300;
    background: rgba(4, 6, 11, .97);
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity .16s ease;
}
.zoom-root-overlay.open { opacity: 1; }
.zoom-root-overlay .zoom-stage { width: 100%; height: 100%; padding: 46px 10px; }
.zoom-root-overlay .zoom-img { max-width: 100%; max-height: 100%; }

.zoom-close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: 1px solid rgba(148, 163, 184, .4);
    background: rgba(15, 23, 42, .75);
    color: #e2e8f0;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 3;
}
.zoom-close svg { width: 20px; height: 20px; fill: currentColor; }

.zoom-wm {
    position: absolute;
    bottom: 14px;
    right: 14px;
    font-size: .66rem;
    letter-spacing: .6px;
    color: rgba(255, 255, 255, .65);
    background: rgba(0, 0, 0, .4);
    padding: 4px 10px;
    border-radius: 999px;
    pointer-events: none;
    text-transform: uppercase;
}

/* ===== Copys ===== */

.viewer-copies {
    padding: 6px 16px 14px;
    background: #0e1628;
}
.copy-row { border-top: 1px solid #1c2740; padding: 12px 0 10px; }
.copy-row:first-child { border-top: none; }
.copy-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.copy-label {
    font-size: .72rem;
    font-weight: 700;
    letter-spacing: .8px;
    text-transform: uppercase;
    color: #7c8aa5;
}
.copy-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    border: 1px solid #2a3a5c;
    background: rgba(148, 163, 184, .1);
    color: #cbd5e1;
    font-family: inherit;
    font-size: .78rem;
    font-weight: 600;
    padding: 6px 12px;
    border-radius: 8px;
    cursor: pointer;
    transition: all .15s;
}
.copy-btn:hover { background: rgba(129, 140, 248, .22); border-color: #818cf8; }
.copy-btn svg { width: 14px; height: 14px; fill: currentColor; }
.copy-btn.copied { background: rgba(16, 185, 129, .2); border-color: #10b981; color: #6ee7b7; }
.copy-value {
    color: #e2e8f0;
    font-size: .93rem;
    line-height: 1.55;
    white-space: pre-wrap;
    overflow-wrap: anywhere;
    max-height: 150px;
    overflow-y: auto;
}
.copy-note { margin-top: 10px; font-size: .76rem; color: #7c8aa5; text-align: center; }

@media (min-width: 768px) {
    .viewer-stage { min-height: 420px; }
    .viewer-title { font-size: 1.22rem; }
    .copy-value { max-height: 180px; }
}
