/* =========================================================
   SP POPUP CORE - OVERLAY (SOLO PARA POPUP DEL TEMA)
========================================================= */
#fq-guardia-popup-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 999998;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
    backdrop-filter: blur(2px);
}

#fq-guardia-popup-overlay.fq-guardia-popup-overlay--visible {
    display: flex;
}


/* =========================================================
   SP POPUP CORE - POPUP CAJA PRINCIPAL (SOLO PARA POPUP DEL TEMA)
========================================================= */
#fq-guardia-popup-overlay .fq-guardia-popup {
    background: #fff !important;
    border-radius: 12px !important;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.07), 0 16px 48px -4px rgba(0,0,0,0.14) !important;
    width: 95vw !important;
    max-width: 900px !important;
    height: 85vh !important;
    max-height: 85vh !important;
    overflow: hidden !important;
    display: flex !important;
    flex-direction: column !important;
    z-index: 999999 !important;
    opacity: 0 !important;
    transform: translateY(12px) scale(0.985) !important;
    transition: opacity 0.2s ease, transform 0.2s ease !important;
    box-sizing: border-box !important;
}

#fq-guardia-popup-overlay .fq-guardia-popup--visible {
    opacity: 1 !important;
    transform: translateY(0) scale(1) !important;
}

.fq-guardia-popup__head {
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: 12px 18px !important;
    border-bottom: 1px solid #f3f4f6 !important;
    flex-shrink: 0 !important;
}

.fq-guardia-popup__title {
    margin: 0;
    font-size: 1rem;
    font-weight: 600;
    color: #111827;
    line-height: 1.3;
    letter-spacing: -0.01em;
}

.fq-guardia-popup__close {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    background: none;
    border: none;
    font-size: 1.25rem;
    line-height: 1;
    cursor: pointer;
    color: #9ca3af;
    border-radius: 6px;
    padding: 0;
    transition: color 0.15s, background 0.15s;
}

.fq-guardia-popup__close:hover {
    color: #111827;
    background: #f3f4f6;
}

.fq-guardia-popup__body {
    padding: 0 !important;
    transition: opacity 0.15s ease !important;
    flex: 1 !important;
    overflow: hidden !important;
    display: flex !important;
}

.fq-guardia-popup__body iframe {
    width: 100% !important;
    height: 100% !important;
    border: none !important;
    flex: 1 !important;
}

/* =========================================================
   SP POPUP CORE - ESTADO LOADING
========================================================= */
.sp-popup.sp_loading .sp-popup__body {
    opacity: 0.45;
    pointer-events: none;
}

/* =========================================================
   SP POPUP CORE - BANNER DE ERROR INLINE
========================================================= */
.fq-guardia-popup-error-banner {
    display: none;
    align-items: flex-start;
    gap: 8px;
    margin: 0 22px;
    padding: 10px 14px;
    background: #fef2f2;
    border: 1px solid #fecaca;
    border-radius: 7px;
    font-size: 13px;
    color: #b91c1c;
    line-height: 1.45;
    opacity: 0;
    transform: translateY(-4px);
    transition: opacity 0.25s ease, transform 0.25s ease;
    margin-bottom: 0;
}

.fq-guardia-popup-error-banner + .fq-guardia-popup__body {
    padding-top: 14px;
}

.fq-guardia-popup-error-banner svg {
    flex-shrink: 0;
    margin-top: 1px;
    color: #ef4444;
}

.fq-guardia-popup-error-banner--visible {
    opacity: 1;
    transform: translateY(0);
    display: flex !important;
}

/* =========================================================
   SP POPUP CORE - FOOTER GENÉRICO (Contenedor de botones)
========================================================= */
.sp-popup-footer {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    flex-wrap: wrap;
    margin-top: 16px;
}

/* =========================================================
   RESPONSIVE
========================================================= */
@media screen and (max-width: 600px) {
    .sp-popup {
        max-height: 95vh;
        border-radius: 10px;
    }

    .sp-popup-footer {
        flex-direction: column;
        gap: 8px;
    }

    .sp-popup-footer button {
        width: 100%;
        justify-content: center;
    }
}

/* =========================================================
   DARK THEME
========================================================= */
body.sp-wsv-theme-dark #fq-guardia-popup-overlay {
    background: rgba(0, 0, 0, 0.6);
}

body.sp-wsv-theme-dark .fq-guardia-popup {
    background: #1f2937;
    box-shadow: 0 4px 6px -1px rgba(0,0,0,0.3), 0 16px 48px -4px rgba(0,0,0,0.5);
}

body.sp-wsv-theme-dark .fq-guardia-popup__head {
    border-bottom-color: #374151;
}

body.sp-wsv-theme-dark .fq-guardia-popup__title {
    color: #f9fafb;
}

body.sp-wsv-theme-dark .fq-guardia-popup__close {
    color: #9ca3af;
}

body.sp-wsv-theme-dark .fq-guardia-popup__close:hover {
    color: #f9fafb;
    background: #374151;
}

body.sp-wsv-theme-dark .fq-guardia-popup-error-banner {
    background: #450a0a;
    border-color: #7f1d1d;
    color: #fca5a5;
}

/* =========================================================
   BOTÓN FARMACIAS DE GUARDIA - TIPOGRAFÍA
========================================================= */
a[data-open-guardia-popup="true"].preheader-cta {
    font-size: 12px !important;
    font-weight: 600 !important;
    letter-spacing: 0.18em !important;
    text-decoration: none !important;
    display: inline-flex !important;
    align-items: center !important;
    gap: 6px !important;
}

/* =========================================================
   SEPARADOR VERTICAL EN PREHEADER
========================================================= */
.site-preheader__right {
    display: flex !important;
    align-items: center !important;
    justify-content: flex-end !important;
    gap: 0 !important;
    flex-wrap: nowrap !important;
    position: relative !important;
}

.preheader-cta-desktop {
    display: flex !important;
    align-items: center !important;
    gap: 0 !important;
}

.preheader-separator {
    width: 1px !important;
    height: 18px !important;
    background-color: rgba(255, 255, 255, 0.4) !important;
    margin: 0 12px !important;
    display: inline-block !important;
    flex-shrink: 0 !important;
}

a.preheader-cta {
    white-space: nowrap !important;
    flex-shrink: 0 !important;
}

/* Mobile dropdown button */
.preheader-cta-mobile-toggle {
    display: none !important;
    font-family: 'Poppins';
    background: none !important;
    border: none !important;
    color: #fff !important;
    cursor: pointer !important;
    padding: 4px 8px !important;
    margin: 0 8px !important;
    font-size: 12px !important;
    font-weight: 600 !important;
    line-height: 1 !important;
    align-items: center !important;
    justify-content: center !important;
    gap: 4px !important;
    display: inline-flex !important;
    letter-spacing: 0.1em !important;
    transition: opacity 0.2s ease !important;
}

.preheader-cta-mobile-toggle:hover {
    opacity: 0.8 !important;
}

.preheader-cta-mobile-toggle .material-symbols-outlined {
    font-size: 18px !important;
    transition: transform 0.2s ease !important;
}

.preheader-cta-mobile-toggle.active .material-symbols-outlined {
    transform: rotate(180deg) !important;
}

/* Mobile dropdown menu */
.preheader-cta-mobile-dropdown {
    display: none !important;
    position: absolute !important;
    top: 100% !important;
    right: 0 !important;
    background: var(--text-dark) !important;
    border-radius: 4px !important;
    padding: 8px 0 !important;
    margin-top: 4px !important;
    min-width: 200px !important;
    z-index: 1000 !important;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2) !important;
    border: 1px solid rgba(255, 255, 255, 0.1) !important;
}

.preheader-cta-mobile-dropdown.active {
    display: block !important;
}

.preheader-cta-mobile-item {
    display: flex !important;
    padding: 10px 16px !important;
    color: #fff !important;
    text-decoration: none !important;
    font-size: 13px !important;
    font-weight: 500 !important;
    white-space: nowrap !important;
    transition: background 0.15s ease !important;
}

.preheader-cta-mobile-item:hover {
    background: rgba(255, 255, 255, 0.1) !important;
}
 
/* Desktop responsive */
@media screen and (min-width: 1282px) {
    .preheader-cta-mobile-toggle {
        display: none !important;
    }

    .preheader-cta-mobile-dropdown {
        display: none !important;
    }
}

/* Mobile responsive */
@media screen and (max-width: 1282px) {
    .preheader-cta-desktop {
        display: none !important;
    }

    .preheader-cta-mobile-toggle {
        display: inline-flex !important;
    }
}
