/* =====================================================
   MODAL GRATIS — SONICOVA
   Collage editorial + disco giratorio permanente
===================================================== */

.modal-gratis {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 10000;
    padding: 22px;
    align-items: center;
    justify-content: center;
    overflow-y: auto;
    background: rgba(12, 9, 8, .88);
    backdrop-filter: blur(5px);
}

.modal-gratis.activo {
    display: flex;
}

.modal-gratis__caja {
    --papel: #f4e8ce;
    --tinta: #211b17;
    --rojo: #b52b27;
    --amarillo: #f2d35c;

    position: relative;
    display: grid;
    grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
    width: 100%;
    max-width: 920px;
    max-height: calc(100vh - 44px);
    overflow-y: auto;
    border: 3px solid var(--tinta);
    border-radius: 2px;
    background: var(--papel);
    color: var(--tinta);
    box-shadow: 9px 9px 0 rgba(0, 0, 0, .45);
}

/* =====================================================
   BOTÓN CERRAR
===================================================== */

.modal-gratis__cerrar {
    position: absolute;
    top: 13px;
    right: 15px;
    z-index: 5;
    display: grid;
    place-items: center;
    width: 39px;
    height: 39px;
    border: 2px solid var(--tinta);
    border-radius: 0;
    background: var(--rojo);
    color: #fff;
    font-size: 26px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 3px 3px 0 var(--tinta);
}

.modal-gratis__cerrar:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 var(--tinta);
}

/* =====================================================
   COLUMNA IZQUIERDA — FONDO OSCURO
===================================================== */

.modal-gratis__reproductor {
    --fondo-reproductor: #211d1a;
    --texto-reproductor: #fff3dc;

    min-width: 0;
    padding: 35px 27px;
    display: flex;
    flex-direction: column;
    justify-content: center;

    background:
        radial-gradient(
            circle at 50% 20%,
            rgba(126, 68, 43, .24),
            transparent 55%
        ),
        repeating-linear-gradient(
            0deg,
            rgba(255, 243, 220, .025) 0px,
            rgba(255, 243, 220, .025) 1px,
            transparent 1px,
            transparent 5px
        ),
        var(--fondo-reproductor);

    border-right: 3px solid #100e0c;
    color: var(--texto-reproductor);
}

/* =====================================================
   PORTADA GRANDE — COLLAGE
===================================================== */

.modal-gratis__portada {
    position: relative;
    isolation: isolate;
    width: 100%;
    max-width: 340px;
    margin: 8px auto 25px;
    aspect-ratio: 1;
    overflow: visible;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

/* Papel rojo detrás de la portada */

.modal-gratis__portada::before {
    content: "";
    position: absolute;
    z-index: -2;
    inset: 3px;
    background: #b52b27;
    border: 2px solid #100e0c;
    transform: rotate(5deg) translate(5px, 4px);
}

/* Recorte de papel crema */

.modal-gratis__portada::after {
    content: "";
    position: absolute;
    z-index: -1;
    inset: 2px;
    background: #e9d9ba;
    border: 2px dashed #100e0c;
    transform: rotate(-3deg) translate(-3px, 2px);
}

/* Imagen original de la portada */

.modal-gratis__portada img {
    position: relative;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border: 3px solid #100e0c;
    box-shadow: 5px 5px 0 #100e0c;
}

/* Sello GRATIS */

.modal-gratis__etiqueta {
    position: absolute;
    top: 13px;
    left: -8px;
    z-index: 2;
    padding: 8px 13px;
    border: 2px solid #100e0c;
    border-radius: 0;
    background: #f2d35c;
    color: #211b17;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 1.5px;
    box-shadow: 3px 3px 0 #100e0c;
    transform: rotate(-4deg);
}

/* Ocultar las rayas decorativas debajo de la portada */

.modal-gratis__onda {
    display: none !important;
}

/* =====================================================
   CONTROLES DE AUDIO
===================================================== */

.modal-gratis__controles {
    width: 100%;
    max-width: 340px;
    margin: 0 auto;
}

/* Disco pequeño junto a la línea de tiempo */

.modal-gratis__linea-tiempo {
    display: flex;
    align-items: center;
    gap: 13px;
    width: 100%;
}

/* Marco circular */

.modal-gratis__disco-mini {
    position: relative;
    flex: 0 0 64px;
    width: 64px;
    height: 64px;
    padding: 3px;
    border: 2px solid #100e0c;
    border-radius: 50%;
    background: #100e0c;
    box-shadow:
        0 0 0 3px #b52b27,
        3px 4px 0 rgba(0, 0, 0, .4);
    overflow: hidden;
}

/* La misma imagen que la portada grande */

.modal-gratis__disco-mini img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    animation: girarDiscoGratis 8s linear infinite;
    transform-origin: center center;
    will-change: transform;
}

/* Centro del disco */

.modal-gratis__disco-mini::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 10px;
    height: 10px;
    border: 2px solid #fff3dc;
    border-radius: 50%;
    background: #100e0c;
    transform: translate(-50%, -50%);
    pointer-events: none;
}

/* Giro continuo mientras el modal está abierto */

@keyframes girarDiscoGratis {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* Barra y tiempos */

.modal-gratis__progreso-contenedor {
    flex: 1;
    min-width: 0;
}

.modal-gratis__progreso {
    display: block;
    width: 100%;
    margin: 0 0 8px;
    accent-color: #f05a4f;
    cursor: pointer;
}

.modal-gratis__tiempos {
    display: flex;
    justify-content: space-between;
    gap: 10px;
    color: #fff3dc;
    font-size: 12px;
    font-weight: 800;
    font-variant-numeric: tabular-nums;
}

/* =====================================================
   BOTONES DE AUDIO
===================================================== */

.modal-gratis__botones-audio {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 18px;
    margin-top: 17px;
}

.modal-gratis__botones-audio button {
    display: grid;
    place-items: center;
    width: 43px;
    height: 43px;
    border: 2px solid #fff3dc;
    border-radius: 0;
    background: #302923;
    color: #fff3dc;
    font-size: 22px;
    cursor: pointer;
    box-shadow: 3px 3px 0 #100e0c;
}

.modal-gratis__botones-audio button:hover {
    transform: translate(2px, 2px);
    box-shadow: 1px 1px 0 #100e0c;
}

.modal-gratis__botones-audio .modal-gratis__play {
    width: 57px;
    height: 57px;
    border: 2px solid #fff3dc;
    border-radius: 0;
    background: #b52b27;
    color: #fff;
    font-size: 23px;
    box-shadow: 4px 4px 0 #100e0c;
}

/* Texto bajo los controles */

.modal-gratis__nota {
    text-align: center;
    color: #e4d5bf;
    font-size: 12px;
    line-height: 1.5;
    margin: 16px 0 0;
}

/* =====================================================
   COLUMNA DERECHA — PAPEL CREMA
===================================================== */

.modal-gratis__info {
    min-width: 0;
    padding: 48px 34px 30px;

    background:
        repeating-linear-gradient(
            0deg,
            rgba(33, 27, 23, .025) 0px,
            rgba(33, 27, 23, .025) 1px,
            transparent 1px,
            transparent 5px
        ),
        #f4e8ce;

    color: #211b17;
}

/* Subtítulo */

.modal-gratis__subtitulo {
    display: inline-block;
    padding: 7px 9px;
    background: #211b17;
    color: #fff3dc;
    font-size: 10px;
    font-weight: 900;
    letter-spacing: 1.5px;
    line-height: 1.5;
}

/* Título del archivo */

.modal-gratis__info h2 {
    margin: 15px 0 13px;
    padding-bottom: 12px;
    border-bottom: 4px solid #211b17;
    overflow-wrap: anywhere;
    color: #211b17;
    font-size: clamp(24px, 3vw, 33px);
    font-weight: 900;
    line-height: 1.15;
    text-transform: uppercase;
}

/* Descripción */

.modal-gratis__descripcion {
    margin: 0 0 25px;
    color: #403328;
    font-size: 14px;
    line-height: 1.7;
    overflow-wrap: anywhere;
    white-space: pre-line;
}

/* =====================================================
   DATOS DEL ARCHIVO
===================================================== */

.modal-gratis__dato {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin: 9px 0;
    padding: 12px;
    border: 1px solid #30251d;
    border-left: 5px solid #b52b27;
    background: #fff4dc;
    color: #211b17;
    font-size: 13px;
}

.modal-gratis__dato span {
    color: #514235;
    flex-shrink: 0;
    font-weight: 700;
}

.modal-gratis__dato strong {
    max-width: 60%;
    color: #211b17;
    text-align: right;
    overflow-wrap: anywhere;
}

/* =====================================================
   ACCIONES
===================================================== */

.modal-gratis__acciones {
    display: grid;
    gap: 12px;
    margin-top: 27px;
}

.modal-gratis__descargar {
    width: 100%;
    min-height: 51px;
    padding: 12px 18px;
    border: 2px solid #211b17;
    border-radius: 0;
    background: #b52b27;
    color: #fff;
    font-size: 15px;
    font-weight: 900;
    text-transform: uppercase;
    cursor: pointer;
    box-shadow: 4px 4px 0 #211b17;
    transition: transform .15s, box-shadow .15s;
}

.modal-gratis__descargar:hover {
    transform: translate(2px, 2px);
    box-shadow: 2px 2px 0 #211b17;
}

.modal-gratis__descargar:disabled {
    opacity: .6;
    cursor: wait;
    transform: none;
    box-shadow: 4px 4px 0 #211b17;
}

.modal-gratis__perfil {
    display: block;
    text-align: center;
    padding: 12px;
    border: 2px dashed #211b17;
    border-radius: 0;
    background: #f2d35c;
    color: #211b17;
    font-weight: 800;
    text-decoration: none;
    font-size: 13px;
}

/* Aviso final */

.modal-gratis__aviso {
    margin: 18px 0 0;
    padding-top: 12px;
    border-top: 2px dashed #665343;
    color: #514235;
    font-size: 11px;
    line-height: 1.6;
}

/* =====================================================
   MÓVIL
===================================================== */

@media (max-width: 650px) {
    .modal-gratis {
        padding: 10px;
        align-items: flex-start;
    }

    .modal-gratis__caja {
        grid-template-columns: minmax(0, 1fr);
        max-height: calc(100vh - 20px);
        border-radius: 0;
    }

    .modal-gratis__reproductor {
        padding: 45px 22px 23px;
        border-right: 0;
        border-bottom: 3px solid #100e0c;
    }

    .modal-gratis__portada {
        max-width: 235px;
    }

    .modal-gratis__info {
        padding: 25px 22px 26px;
    }

    .modal-gratis__info h2 {
        font-size: 25px;
        padding-right: 15px;
    }

    .modal-gratis__disco-mini {
        flex-basis: 54px;
        width: 54px;
        height: 54px;
    }

    .modal-gratis__linea-tiempo {
        gap: 10px;
    }
}

/* =====================================================
   MOVIMIENTO REDUCIDO
   El disco conserva el giro solicitado
===================================================== */

@media (prefers-reduced-motion: reduce) {
    .modal-gratis__cerrar,
    .modal-gratis__botones-audio button,
    .modal-gratis__descargar {
        transition: none;
    }
}
