/* =====================================================
   popup.css — Modal cotización + Transiciones de página
   ===================================================== */

/* ── Sección informativa Bupa ───────────────────────── */
#bupa-partner-strip {
    background: linear-gradient(135deg, #e8f2fa 0%, #dbeeff 100%);
    border-top: 3px solid #0077c8;
    border-bottom: 1px solid #bcd9f1;
    padding: 1.4rem 5%;
}
.bupa-strip__inner {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 1.5rem;
    flex-wrap: wrap;
}
.bupa-strip__logo-wrap {
    flex-shrink: 0;
    display: flex;
    align-items: center;
}
.bupa-strip__logo {
    height: 48px;
    width: auto;
    display: block;
}
@media (min-width: 1025px) {
    .bupa-strip__logo { height: 80px; }
}
.bupa-strip__text {
    flex: 1;
    min-width: 220px;
}
.bupa-strip__text p {
    margin: 0;
    font-size: 0.92rem;
    color: #1a365d;
    line-height: 1.6;
}
.bupa-strip__badges {
    display: flex;
    flex-wrap: wrap;
    gap: 0.5rem;
    flex-shrink: 0;
}
.bupa-strip__badges span {
    display: inline-flex;
    align-items: center;
    gap: 0.35rem;
    background: #0077c8;
    color: #fff;
    font-size: 0.75rem;
    font-weight: 700;
    padding: 0.35rem 0.8rem;
    border-radius: 50px;
    white-space: nowrap;
}
.bupa-strip__badges span i { font-size: 0.7rem; }
@media (max-width: 768px) {
    .bupa-strip__inner { flex-direction: column; align-items: flex-start; gap: 1rem; }
}

/* ── Logo Bupa en footer ────────────────────────────── */
.bupa-footer-logo {
    margin-top: 1.2rem;
    padding-top: 1.2rem;
    border-top: 1px solid rgba(255,255,255,0.12);
}
.bupa-footer-label {
    font-size: 0.72rem;
    color: #94a3b8;
    margin: 0 0 0.4rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.bupa-footer-logo img {
    height: 48px;
    width: auto;
    opacity: 0.9;
}

/* ── Logo Bupa en títulos de sección ────────────────── */
.section-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.9rem;
    margin-bottom: 0.6rem;
}
.section-title-row h2 {
    margin: 0 !important;
    text-align: left;
    min-width: 0;
    flex: 0 1 auto;
}
.section-bupa-logo {
    height: 64px;
    width: auto;
    flex-shrink: 0;
    opacity: 0.9;
}
@media (max-width: 768px) {
    .section-bupa-logo { height: 72px; }
}
@media (max-width: 480px) {
    .section-bupa-logo { height: 64px; }
}

/* ── Fila logo + título en heroes ───────────────────── */
.hero-title-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.1rem;
    margin-bottom: 0.9rem;
}
.hero-bupa-logo {
    height: 64px;
    width: auto;
    flex-shrink: 0;
    opacity: 0.92;
}
@media (max-width: 768px) {
    .hero-bupa-logo { height: 48px; }
}
@media (max-width: 480px) {
    .hero-bupa-logo { height: 40px; }
}
/* Títulos dentro del row: centrados y que no rompan el flex */
.hero-title-row .cob-hero__title,
.hero-title-row h1,
.hero-title-row h2 {
    margin-bottom: 0 !important;
    text-align: center;
    min-width: 0;
    flex: 0 1 auto;
}
/* Slider: texto blanco */
.slider .hero-title-row h2 {
    color: #fff;
    text-align: center;
}
/* Cat-hero: centrado */
.cat-hero__inner .hero-title-row h1 {
    text-align: center;
}
/* Cob-hero: título alineado a la izquierda del logo */
.cob-hero__content .hero-title-row .cob-hero__title {
    text-align: left;
}

/* ── Cat-hero: reordenar badge y chips al fondo ──────── */
.cat-hero__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}
.cat-hero__inner .hero-title-row { order: 1; }
.cat-hero__inner .cat-hero__desc { order: 2; }
.cat-hero__inner .cat-hero__badge{ order: 3; margin-top: 1.2rem; margin-bottom: 0; }
.cat-hero__inner .cat-hero__chips{ order: 4; margin-top: 0.5rem; }
.cat-hero__inner .bupa-hero-tag  { order: 5; margin-top: 0.7rem; margin-bottom: 0; }

/* ── Margen del tag bajo los botones (cob-hero) ──────── */
.cob-hero__content .bupa-hero-tag,
.cob-hero__content .cob-hero__badge {
    margin-top: 1.2rem;
}

/* ── Tag Bupa en heroes ─────────────────────────────── */
.bupa-hero-tag {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.35);
    color: #ffffff;
    font-size: 0.78rem;
    font-weight: 600;
    padding: 0.3rem 0.85rem;
    border-radius: 50px;
    margin-bottom: 0.75rem;
    letter-spacing: 0.02em;
    backdrop-filter: blur(4px);
}
.bupa-hero-tag i { font-size: 0.72rem; opacity: 0.9; }
.bupa-hero-tag strong { font-weight: 800; }

/* ── Nav: ocultar Inicio en escritorio ──────────────── */
.nav-item--inicio { display: none; }
.nav-menu { flex: 1; display: flex; justify-content: center; }
@media (max-width: 1024px) {
    .nav-item--inicio { display: list-item; }
    .nav-menu { flex: none; display: flex; justify-content: flex-start; }
}

/* ── Transiciones de página ─────────────────────────── */
body {
    padding-top: 90px;
    animation: pageEnter 0.35s ease backwards;
}
body.has-promo {
    padding-top: 136px;
}

/* ── Barra promocional ──────────────────────────────── */
#promo-bar {
    position: fixed;
    top: 90px;
    left: 0;
    right: 0;
    z-index: 999;
    height: 46px;
    background: linear-gradient(90deg, #92400e 0%, #b45309 35%, #d97706 70%, #f59e0b 100%);
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
    padding: 0 2.8rem;
    box-shadow: 0 2px 10px rgba(0,0,0,0.2);
    text-align: center;
}
#promo-bar i.fa-tag {
    font-size: 0.85rem;
    opacity: 0.9;
}
#promo-bar span {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
#promo-cta {
    flex-shrink: 0;
    color: #92400e;
    text-decoration: none;
    background: #fff;
    border-radius: 50px;
    padding: 0.2rem 0.9rem;
    font-size: 0.8rem;
    font-weight: 700;
    transition: background 0.2s, color 0.2s;
    white-space: nowrap;
}
#promo-cta:hover {
    background: #fef3c7;
    color: #78350f;
}
#promo-bar__close {
    position: absolute;
    right: 0.7rem;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: rgba(255,255,255,0.75);
    font-size: 1rem;
    cursor: pointer;
    padding: 0.2rem 0.4rem;
    line-height: 1;
    transition: color 0.2s;
}
#promo-bar__close:hover { color: #fff; }
@media (max-width: 540px) {
    #promo-bar { font-size: 0.63rem; gap: 0.3rem; padding: 0 2.2rem; }
    #promo-bar span { font-size: 0.63rem; white-space: normal; }
    #promo-cta { font-size: 0.63rem; padding: 0.15rem 0.55rem; }
}
@keyframes pageEnter {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; }
}
body.page-exit {
    animation: pageLeave 0.28s ease forwards !important;
}
@keyframes pageLeave {
    from { opacity: 1; }
    to   { opacity: 0; transform: translateY(-8px); }
}

/* ── Modal overlay ──────────────────────────────────── */
.modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(6, 20, 50, 0.72);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 9000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 1rem;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease, visibility 0.3s ease;
}
.modal-overlay.modal-visible {
    opacity: 1;
    visibility: visible;
}
.modal-overlay.modal-visible .modal-content {
    transform: translateY(0) scale(1);
    opacity: 1;
}

/* ── Modal contenedor ───────────────────────────────── */
.modal-content {
    background: #fff;
    border-radius: 1.2rem;
    width: 100%;
    max-width: 500px;
    max-height: 92vh;
    overflow-y: auto;
    position: relative;
    box-shadow: 0 30px 80px rgba(0,0,0,0.35);
    transform: translateY(24px) scale(0.97);
    opacity: 0;
    transition: transform 0.35s cubic-bezier(0.34,1.56,0.64,1), opacity 0.3s ease;
}

/* ── Botón cerrar ───────────────────────────────────── */
.modal-close {
    position: absolute;
    top: 0.9rem;
    right: 1rem;
    background: none;
    border: none;
    font-size: 1.6rem;
    line-height: 1;
    color: #718096;
    cursor: pointer;
    transition: color 0.2s ease, transform 0.2s ease;
    z-index: 10;
    padding: 0.2rem 0.4rem;
}
.modal-close:hover { color: #1a365d; transform: rotate(90deg); }

/* ── Cuerpo del modal ───────────────────────────────── */
.modal-body {
    padding: 2rem 2rem 1.8rem;
}

/* ── Header del modal ───────────────────────────────── */
.modal-header {
    text-align: center;
    margin-bottom: 1.5rem;
    padding-bottom: 1.2rem;
    border-bottom: 1px solid #edf2f7;
}
.modal-badge {
    display: inline-block;
    background: #e8f2fa;
    color: #005b96;
    font-size: 0.7rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    padding: 0.25rem 0.9rem;
    border-radius: 50px;
    margin-bottom: 0.7rem;
}
.modal-header h2 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #1a365d;
    margin-bottom: 0.4rem;
    font-family: 'Poppins', sans-serif;
}
.modal-header p {
    font-size: 0.85rem;
    color: #718096;
    line-height: 1.5;
    font-family: 'Poppins', sans-serif;
}

/* ── Grupos de formulario ───────────────────────────── */
.modal-form-group {
    margin-bottom: 0.8rem;
}
.modal-form-group label {
    display: block;
    font-weight: 600;
    font-size: 0.82rem;
    color: #2d3748;
    margin-bottom: 0.28rem;
    font-family: 'Poppins', sans-serif;
}

/* ── Input wrapper ──────────────────────────────────── */
.modal-input-wrap {
    position: relative;
    display: flex;
    align-items: center;
}
.modal-input-wrap i {
    position: absolute;
    left: 0.9rem;
    color: #718096;
    font-size: 0.85rem;
    pointer-events: none;
    z-index: 1;
}
.modal-input-wrap input,
.modal-input-wrap select {
    width: 100%;
    padding: 0.6rem 1rem 0.6rem 2.5rem;
    border: 1.5px solid #cbd5e0;
    border-radius: 0.5rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.88rem;
    color: #2d3748;
    background: #fff;
    transition: border-color 0.25s ease, box-shadow 0.25s ease;
    appearance: none;
    -webkit-appearance: none;
}
.modal-input-wrap input:focus,
.modal-input-wrap select:focus {
    outline: none;
    border-color: #005b96;
    box-shadow: 0 0 0 3px rgba(0,91,150,0.12);
}
.modal-input-wrap.modal-input-select::after {
    content: '\f078';
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
    position: absolute;
    right: 1rem;
    color: #718096;
    font-size: 0.72rem;
    pointer-events: none;
}
.modal-input-error {
    border-color: #e53e3e !important;
    box-shadow: 0 0 0 3px rgba(229,62,62,0.1) !important;
}

/* ── Teléfono con prefijo en modal ──────────────────── */
.modal-input-phone {
    align-items: stretch;
    gap: 0;
}
.modal-input-phone .phone-prefix {
    flex-shrink: 0;
    background: #f1f5f9;
    border: 1.5px solid #cbd5e0;
    border-right: none;
    border-radius: 0.5rem 0 0 0.5rem;
    padding: 0 0.75rem;
    font-size: 0.85rem;
    font-weight: 700;
    color: #2d3748;
    white-space: nowrap;
    display: flex;
    align-items: center;
    align-self: stretch;
    line-height: 1;
    box-sizing: border-box;
}
.modal-input-phone input {
    border-radius: 0 0.5rem 0.5rem 0 !important;
    padding-left: 0.75rem !important;
    flex: 1;
    min-width: 0;
    align-self: stretch;
    height: auto;
}

/* ── Honeypot ───────────────────────────────────────── */
.hp-wrap {
    position: absolute;
    left: -9999px;
    top: -9999px;
    visibility: hidden;
    height: 0;
    overflow: hidden;
}

/* ── Mensaje de error ───────────────────────────────── */
.modal-error {
    display: block;
    color: #e53e3e;
    font-size: 0.76rem;
    margin-top: 0.22rem;
    min-height: 0.9rem;
    font-weight: 500;
    font-family: 'Poppins', sans-serif;
}

/* ── Grupo de botones submit ────────────────────────── */
.modal-btns-group {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 0.5rem;
}
.modal-wa-wrap {
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}
.modal-atencion-label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.35rem;
    font-size: 0.75rem;
    font-weight: 700;
    color: #16a34a;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}
.modal-atencion-label i { font-size: 0.7rem; }

/* ── Botón submit base ──────────────────────────────── */
.modal-submit-btn {
    width: 100%;
    padding: 0.85rem;
    border: none;
    border-radius: 0.5rem;
    font-family: 'Poppins', sans-serif;
    font-size: 1rem;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.6rem;
}
.modal-btn-email {
    background: linear-gradient(135deg, #005b96, #0077c8);
    color: #fff;
    box-shadow: 0 4px 14px rgba(0,91,150,0.35);
}
.modal-btn-email:hover {
    background: linear-gradient(135deg, #004a7c, #005ea8);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(0,91,150,0.45);
}
.modal-btn-wa {
    background: linear-gradient(135deg, #16a34a, #22c55e);
    color: #fff;
    box-shadow: 0 4px 14px rgba(22,163,74,0.35);
}
.modal-btn-wa:hover {
    background: linear-gradient(135deg, #15803d, #16a34a);
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(22,163,74,0.45);
}
.modal-submit-btn:disabled {
    opacity: 0.7;
    cursor: not-allowed;
    transform: none;
}

/* ── Éxito en modal ─────────────────────────────────── */
.modal-success-wrap {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    padding: 2.5rem 1.5rem;
}
.modal-success-wrap.modal-success-visible {
    display: flex;
    animation: fadeInUp 0.5s ease both;
}
.modal-success-icon {
    font-size: 4rem;
    color: #276749;
    margin-bottom: 1rem;
    animation: latido 1.5s infinite ease-in-out;
}
.modal-success-wrap h3 {
    font-size: 1.4rem;
    font-weight: 800;
    color: #276749;
    margin-bottom: 0.5rem;
    font-family: 'Poppins', sans-serif;
}
.modal-success-wrap p {
    color: #718096;
    font-size: 0.9rem;
    line-height: 1.6;
    margin-bottom: 1.5rem;
    font-family: 'Poppins', sans-serif;
}
.modal-close-success {
    background: #005b96;
    color: #fff;
    border: none;
    border-radius: 50px;
    padding: 0.65rem 2rem;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background 0.3s ease;
}
.modal-close-success:hover { background: #004a7c; }

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}
@keyframes latido {
    0%, 100% { transform: scale(1); }
    50%       { transform: scale(1.1); }
}

/* ── Botón flotante WhatsApp ────────────────────────── */
#wa-float {
    position: fixed;
    bottom: 1.6rem;
    right: 1.6rem;
    width: 58px;
    height: 58px;
    background: #25d366;
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.9rem;
    box-shadow: 0 4px 22px rgba(37, 211, 102, 0.45);
    z-index: 8000;
    text-decoration: none;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
}
#wa-float:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(37, 211, 102, 0.6);
}

/* ── Botón flotante Cotizar ─────────────────────────── */
#cotizar-float {
    position: fixed;
    bottom: calc(1.6rem + 58px + 1rem);
    right: 1.6rem;
    height: 44px;
    padding: 0 1.1rem 0 0.9rem;
    background: linear-gradient(135deg, #005b96, #0077c8);
    color: #fff;
    border: none;
    border-radius: 50px;
    display: flex;
    align-items: center;
    gap: 0.55rem;
    font-family: 'Poppins', sans-serif;
    font-size: 0.82rem;
    font-weight: 700;
    letter-spacing: 0.01em;
    cursor: pointer;
    box-shadow: 0 4px 18px rgba(0, 91, 150, 0.38);
    z-index: 7999;
    transition: transform 0.22s ease, box-shadow 0.22s ease;
    white-space: nowrap;
}
#cotizar-float i {
    font-size: 1rem;
    flex-shrink: 0;
}
#cotizar-float:hover {
    transform: scale(1.06) translateY(-2px);
    box-shadow: 0 6px 26px rgba(0, 91, 150, 0.55);
}
@media (max-width: 480px) {
    #cotizar-float {
        font-size: 0.76rem;
        height: 40px;
        padding: 0 0.85rem 0 0.7rem;
    }
}

/* ── Fix: iOS auto-detección de teléfonos en footer ─── */
a[x-apple-data-detectors] {
    color: inherit !important;
    text-decoration: none !important;
}

/* ── Wrapper de botones en hero de coberturas ───────── */
.cob-hero__actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    width: 100%;
}

/* ── Sin subrayado en botones del hero (todos los dispositivos) ── */
.cob-hero__cta,
.cob-hero__secondary {
    text-decoration: none;
}

/* ── Botón secundario "Ver coberturas" ──────────────── */
.cob-hero__secondary {
    display: inline-flex;
    align-items: center;
    gap: 0.4rem;
    padding: 0.75rem 1.8rem;
    border: 2px solid rgba(255, 255, 255, 0.75);
    border-radius: 50px;
    color: #fff;
    font-family: 'Poppins', sans-serif;
    font-weight: 600;
    font-size: 0.95rem;
    text-decoration: none;
    cursor: pointer;
    background: transparent;
    transition: background 0.2s ease, border-color 0.2s ease;
}
.cob-hero__secondary:hover {
    background: rgba(255, 255, 255, 0.15);
    border-color: #fff;
    color: #fff;
}

/* ── Nombre del seguro en header del modal ──────────── */
.modal-seguro-label {
    font-size: 1rem;
    font-weight: 700;
    color: #005b96;
    margin: 0.2rem 0 0.4rem;
    min-height: 1.3em;
    line-height: 1.3;
}

/* ── Error global de envío ──────────────────────────── */
.modal-send-error {
    color: #e53e3e;
    font-size: 0.8rem;
    font-weight: 500;
    text-align: center;
    min-height: 1.1em;
    margin-bottom: 0.3rem;
    font-family: 'Poppins', sans-serif;
}

/* ── Hint WhatsApp en pantalla de éxito ─────────────── */
.modal-wa-hint {
    color: #276749 !important;
    font-weight: 600 !important;
    font-size: 0.85rem !important;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.4rem;
}
.modal-wa-hint .fa-whatsapp { font-size: 1.1rem; }

/* ── Responsive ─────────────────────────────────────── */
@media (max-width: 540px) {
    .modal-body { padding: 1.5rem 1.2rem 1.5rem; }
    .modal-content { border-radius: 1rem; }
    .modal-header h2 { font-size: 1.2rem; }
}

/* ── Heroes más bajos en móvil ──────────────────────── */
@media (max-width: 768px) {
    /* Hero de páginas de categoría */
    .cat-hero {
        min-height: 0 !important;
        padding: 2rem 1.2rem !important;
    }
    .cat-hero__inner { padding: 0; }
    .cat-hero h1 { font-size: clamp(1.4rem, 5vw, 2rem) !important; margin-bottom: 0.5rem; }
    .cat-hero__desc { font-size: 0.88rem !important; margin-bottom: 0.8rem !important; }
    .cat-hero__chips { gap: 0.4rem !important; margin-bottom: 0 !important; }
    .cat-hero__chip { font-size: 0.75rem !important; padding: 0.3rem 0.7rem !important; }

    /* Hero de páginas de cobertura */
    .cob-hero { padding: 2rem 1.2rem 1.8rem !important; }
    .cob-hero__title { font-size: clamp(1.5rem, 5vw, 2.2rem) !important; margin-bottom: 0.6rem !important; }
    .cob-hero__subtitle { font-size: 0.9rem !important; margin-bottom: 1rem !important; }
    .cob-hero__stats { padding: 0.9rem !important; margin-bottom: 1.2rem !important; gap: 0.5rem !important; }
    .cob-hero__stat-num { font-size: 1.4rem !important; }
    .cob-hero__badge { margin-bottom: 0.7rem !important; }
}
