/* hc_popups — popup modal del frontend (sin marcos, solo imagen) */

.hc-popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 100000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    background: rgba(18, 20, 28, 0.40);
    -webkit-backdrop-filter: blur(8px) saturate(115%);
    backdrop-filter: blur(8px) saturate(115%);
    opacity: 0;
    transition: opacity 0.25s ease;
}

.hc-popup-overlay.hc-popup-visible {
    opacity: 1;
}

.hc-popup-box {
    position: relative;
    display: inline-block;
    line-height: 0;
    max-width: 100%;
    max-height: 100%;
}

.hc-popup-link,
.hc-popup-imgholder {
    display: inline-block;
    line-height: 0;
    max-width: 100%;
}

/* Desktop: tope 640px y nunca por encima del tamaño original (width:auto no escala).
   Móvil: se maximiza dejando 20px de margen a cada lado (100vw - 40px).
   Siempre se mantiene la relación de aspecto (height:auto) y no desborda en alto. */
.hc-popup-img {
    display: block;
    width: auto;
    height: auto;
    max-width: min(640px, calc(100vw - 40px));
    max-height: calc(100vh - 40px);
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.35);
}

.hc-popup-close {
    position: absolute;
    top: 8px;
    right: 8px;
    width: 34px;
    height: 34px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.32);
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    color: #fff;
    font-size: 22px;
    line-height: 1;
    cursor: pointer;
    z-index: 2;
    /* Centrado real de la × (line-height no centra bien ese glifo). */
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s ease, transform 0.15s ease;
}

.hc-popup-close:hover {
    background: rgba(0, 0, 0, 0.5);
    transform: scale(1.05);
}

@media (prefers-reduced-motion: reduce) {
    .hc-popup-overlay {
        transition: none;
    }
}
