/* ============================================
   Popups Grupohosteleon — estilos base
   Los colores llegan por CSS dinámico, aquí solo estructura.
   ============================================ */

.hl-popup-background {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    justify-content: center;
    align-items: center;
    z-index: 999999;
    padding: 80px 12px 12px 12px;
    box-sizing: border-box;
    animation: hlPopupFadeIn 0.3s ease-out;
}

.hl-popup-background.is-open {
    display: flex;
}

@keyframes hlPopupFadeIn {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.hl-popup-container {
    max-width: 720px;
    width: 100%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    position: relative;
    overflow: hidden;
    animation: hlPopupSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes hlPopupSlideIn {
    from { transform: translateY(40px) scale(0.95); opacity: 0; }
    to   { transform: translateY(0) scale(1); opacity: 1; }
}

.hl-popup-close {
    position: absolute;
    top: 12px;
    right: 12px;
    border: none;
    border-radius: 50%;
    width: 36px;
    height: 36px;
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.hl-popup-close:hover {
    transform: rotate(90deg);
}

.hl-popup-content {
    display: flex;
    flex-direction: row;
    min-height: 0;
}

.hl-popup-media-section {
    width: 50%;
    position: relative;
    overflow: hidden;
    flex-shrink: 0;
}

.hl-popup-media-section img,
.hl-popup-media-section video {
    width: 100%;
    height: auto;
    object-fit: contain;
    display: block;
}

.hl-popup-media-section iframe {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
    border: none;
    display: block;
}

/* Slider */
.hl-popup-media-section.is-slider {
    display: grid;
}

.hl-popup-media-section.is-slider img {
    grid-area: 1 / 1;
    opacity: 0;
    transition: opacity 0.7s ease-in-out;
}

.hl-popup-media-section.is-slider img.active {
    opacity: 1;
}

/* Flechas del slider */
.hl-popup-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    font-size: 22px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    z-index: 5;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    -webkit-backdrop-filter: blur(4px);
    backdrop-filter: blur(4px);
    transition: background 0.25s ease;
}

.hl-popup-arrow-prev { left: 12px; }
.hl-popup-arrow-next { right: 12px; }

/* Sección texto */
.hl-popup-text-section {
    width: 50%;
    background-color: #ffffff;
    padding: 38px 30px;
    box-sizing: border-box;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
}

.hl-popup-tag {
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 3px;
    font-weight: 700;
    margin: 0 0 14px 0;
    line-height: 1.2;
}

.hl-popup-title {
    font-size: 34px;
    margin: 0 0 14px 0;
    text-transform: uppercase;
    line-height: 1.05;
}

.hl-popup-subtitle {
    font-size: 17px;
    margin: 0 0 8px 0;
    font-weight: 600;
    line-height: 1.4;
}

.hl-popup-info {
    font-size: 14px;
    margin: 0 0 24px 0;
    font-style: italic;
    line-height: 1.4;
}

.hl-popup-button-link {
    text-decoration: none;
    display: inline-block;
    margin: 0 auto;
}

.hl-popup-button {
    display: inline-block;
    padding: 14px 36px;
    margin: 0;
    font-size: 15px;
    font-weight: 900;
    text-transform: uppercase;
    text-align: center;
    border: none;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.2);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, background-color 0.25s ease;
    font-family: inherit;
}

.hl-popup-button:hover {
    transform: translateY(-2px);
}

/* ============================================
   AJUSTES POR TIPO DE MEDIA (escritorio)
   Cada tipo de contenido dimensiona el popup para verse bien:
   - Vídeo local: respeta aspect-ratio real
   - YouTube/FB vídeo: apilado 16:9
   - Instagram: apilado y estrecho (posts verticales)
   - Facebook post: apilado 4:5
   En móvil todo pasa por el bloque @media de abajo.
   ============================================ */

/* Vídeo local: object-fit contain para respetar el aspect-ratio del archivo */
.hl-media-type-video .hl-popup-media-section video {
    object-fit: contain;
    background: #000;
}

/* YouTube: apilado, 16:9, container más estrecho */
.hl-media-type-youtube .hl-popup-container {
    max-width: 640px;
}
.hl-media-type-youtube .hl-popup-content {
    flex-direction: column;
}
.hl-media-type-youtube .hl-popup-media-section {
    width: 100%;
    aspect-ratio: 16 / 9;
    position: relative;
}
.hl-media-type-youtube .hl-popup-media-section iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}
.hl-media-type-youtube .hl-popup-text-section {
    width: 100%;
    padding: 28px 30px;
}

/* Facebook: apilado, 4:5 (aspecto habitual de posts con imagen) */
.hl-media-type-facebook .hl-popup-container {
    max-width: 560px;
}
.hl-media-type-facebook .hl-popup-content {
    flex-direction: column;
}
.hl-media-type-facebook .hl-popup-media-section {
    width: 100%;
    aspect-ratio: 4 / 5;
    background: #f0f2f5;
    position: relative;
}
.hl-media-type-facebook .hl-popup-media-section iframe {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    aspect-ratio: auto;
}
.hl-media-type-facebook .hl-popup-text-section {
    width: 100%;
    padding: 28px 30px;
}

/* Instagram: apilado y estrecho, respeta el alto del embed */
.hl-media-type-instagram .hl-popup-container {
    max-width: 540px;
}
.hl-media-type-instagram .hl-popup-content {
    flex-direction: column;
}
.hl-media-type-instagram .hl-popup-media-section {
    width: 100%;
    background: #000;
    max-height: 70vh;
    overflow-y: auto;
}
.hl-media-type-instagram .hl-popup-media-section blockquote.instagram-media,
.hl-media-type-instagram .hl-popup-media-section iframe[src*="instagram.com"] {
    position: static !important;
    width: 100% !important;
    max-width: 540px !important;
    margin: 0 auto !important;
    display: block !important;
    height: auto !important;
    aspect-ratio: auto !important;
}
.hl-media-type-instagram .hl-popup-text-section {
    width: 100%;
    padding: 24px 28px;
}

/* Responsive — móvil: imagen 100% + tarjeta de texto superpuesta.
   Estas reglas pisan las de tipos específicos para que en móvil todo
   funcione igual (imagen a pantalla completa con tarjeta abajo). */
@media (max-width: 680px) {
    /* Anular max-width específicos de tipos */
    .hl-media-type-youtube .hl-popup-container,
    .hl-media-type-facebook .hl-popup-container,
    .hl-media-type-instagram .hl-popup-container {
        max-width: none;
    }
    /* Anular aspect-ratio y overflow del media-section para tipos específicos */
    .hl-media-type-youtube .hl-popup-media-section,
    .hl-media-type-facebook .hl-popup-media-section,
    .hl-media-type-instagram .hl-popup-media-section {
        aspect-ratio: auto;
        max-height: none;
        overflow: hidden;
    }

    .hl-popup-container {
        width: 100%;
        max-width: none;
        height: calc(100vh - 92px);
        height: calc(100dvh - 92px);
        max-height: none;
    }

    .hl-popup-content {
        flex-direction: column;
        height: 100%;
        position: relative;
    }

    .hl-popup-media-section {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        z-index: 1;
    }

    .hl-popup-media-section img,
    .hl-popup-media-section video,
    .hl-popup-media-section iframe {
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        object-fit: cover;
        aspect-ratio: auto;
    }

    .hl-popup-media-section.is-slider {
        display: block;
    }

    .hl-popup-media-section.is-slider img {
        grid-area: auto;
        position: absolute;
    }

    .hl-popup-arrow {
        width: 36px;
        height: 36px;
        font-size: 18px;
        z-index: 6;
    }

    .hl-popup-arrow-prev { left: 8px; }
    .hl-popup-arrow-next { right: 8px; }

    .hl-popup-text-section {
        position: absolute;
        bottom: 14px;
        left: 14px;
        right: 14px;
        width: auto;
        padding: 22px 20px;
        border-radius: 14px;
        background-color: rgba(255, 255, 255, 0.88);
        -webkit-backdrop-filter: blur(10px) saturate(150%);
        backdrop-filter: blur(10px) saturate(150%);
        box-shadow: 0 12px 32px rgba(0, 0, 0, 0.3);
        max-height: 70%;
        overflow-y: auto;
        z-index: 4;
    }

    .hl-popup-title { font-size: 26px; }
    .hl-popup-subtitle { font-size: 15px; }
    .hl-popup-close { top: 10px; right: 10px; width: 32px; height: 32px; font-size: 20px; }
    .hl-popup-button { padding: 12px 28px; font-size: 13px; width: 100%; max-width: 280px; }
}

@media (max-width: 400px) {
    .hl-popup-title { font-size: 22px; }
    .hl-popup-text-section { padding: 18px 16px; bottom: 10px; left: 10px; right: 10px; }
}

/* ============================================
   FORMATO: BARRA SUPERIOR / INFERIOR (sticky bar)
   No usa .hl-popup-background ni .hl-popup-container.
   ============================================ */

.hl-popup.hl-format-bar_top,
.hl-popup.hl-format-bar_bottom {
    position: fixed;
    left: 0;
    right: 0;
    width: 100%;
    z-index: 999999;
    display: none;
    animation: hlBarSlideIn 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

.hl-popup.hl-format-bar_top.is-open,
.hl-popup.hl-format-bar_bottom.is-open {
    display: block;
}

.hl-popup.hl-format-bar_top    { top: 0; }
.hl-popup.hl-format-bar_bottom { bottom: 0; }

@keyframes hlBarSlideIn {
    from { transform: translateY(-100%); opacity: 0.5; }
    to   { transform: translateY(0);      opacity: 1; }
}

.hl-popup.hl-format-bar_bottom { animation-name: hlBarSlideInBottom; }
@keyframes hlBarSlideInBottom {
    from { transform: translateY(100%); opacity: 0.5; }
    to   { transform: translateY(0);     opacity: 1; }
}

.hl-bar-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 14px 24px;
    max-width: 1400px;
    margin: 0 auto;
}

.hl-bar-text {
    display: flex;
    align-items: center;
    gap: 12px;
    flex: 1;
    min-width: 0;
    flex-wrap: wrap;
}

.hl-bar-tag {
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: 700;
    padding: 3px 8px;
    background: rgba(255, 255, 255, 0.2);
    border-radius: 3px;
    white-space: nowrap;
}

.hl-bar-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.2;
}

.hl-bar-subtitle {
    font-size: 14px;
    opacity: 0.85;
    line-height: 1.3;
}

.hl-bar-actions {
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}

.hl-bar-button {
    padding: 8px 20px;
    font-size: 13px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, background 0.2s ease;
    font-family: inherit;
}

.hl-bar-button:hover {
    transform: translateY(-1px);
}

.hl-bar-close {
    background: transparent;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s ease;
}

.hl-bar-close:hover {
    background: rgba(0, 0, 0, 0.1);
}

/* Responsive barra */
@media (max-width: 680px) {
    .hl-bar-inner {
        padding: 12px 14px;
        gap: 10px;
    }
    .hl-bar-text {
        gap: 8px;
    }
    .hl-bar-tag {
        display: none; /* Ocultamos el tag en móvil para ganar espacio */
    }
    .hl-bar-title {
        font-size: 14px;
    }
    .hl-bar-subtitle {
        font-size: 12px;
    }
    .hl-bar-button {
        padding: 6px 12px;
        font-size: 11px;
    }
}

/* ============================================
   FORMATO: TARJETA EN ESQUINA (corner card)
   ============================================ */

.hl-popup.hl-format-corner {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 999999;
    display: none;
    animation: hlCornerSlideIn 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    max-width: 360px;
    width: calc(100% - 40px);
}

.hl-popup.hl-format-corner.is-open {
    display: block;
}

@keyframes hlCornerSlideIn {
    from { transform: translateX(30px) translateY(20px); opacity: 0; }
    to   { transform: translateX(0)    translateY(0);    opacity: 1; }
}

.hl-corner-card {
    position: relative;
    display: flex;
    align-items: stretch;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.25), 0 4px 8px rgba(0, 0, 0, 0.1);
    min-height: 110px;
}

.hl-corner-close {
    position: absolute;
    top: 6px;
    right: 6px;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    border: none;
    font-size: 15px;
    font-weight: bold;
    line-height: 1;
    cursor: pointer;
    z-index: 3;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
    transition: transform 0.2s ease;
}

.hl-corner-close:hover {
    transform: scale(1.1);
}

.hl-corner-media {
    width: 110px;
    flex-shrink: 0;
    overflow: hidden;
}

.hl-corner-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.hl-corner-text {
    flex: 1;
    padding: 14px 16px 14px 14px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    min-width: 0;
}

.hl-corner-tag {
    font-size: 10px;
    text-transform: uppercase;
    letter-spacing: 1.5px;
    font-weight: 700;
    margin: 0 0 4px 0;
    line-height: 1;
}

.hl-corner-title {
    font-size: 15px;
    font-weight: 700;
    line-height: 1.2;
    margin: 0 0 4px 0;
    text-transform: uppercase;
}

.hl-corner-subtitle {
    font-size: 12px;
    line-height: 1.35;
    margin: 0 0 8px 0;
    overflow: hidden;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
}

.hl-corner-button {
    display: inline-block;
    padding: 6px 14px;
    font-size: 11px;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.8px;
    border: none;
    cursor: pointer;
    align-self: flex-start;
    transition: transform 0.2s ease, background 0.2s ease;
    font-family: inherit;
}

.hl-corner-button:hover {
    transform: translateY(-1px);
}

/* Responsive corner card */
@media (max-width: 680px) {
    .hl-popup.hl-format-corner {
        bottom: 12px;
        right: 12px;
        left: 12px;
        max-width: none;
        width: auto;
    }
}
