/* ============================================================
   SOLUCIONES SEGURAS v3 — Tema Claro / Identidad Logotipo
   Fondo: #F5EEE5 | Dorado: #B68C50 | Texto: #311E10
   ============================================================ */

/* ── Glass cards (claro) ──────────────────────────────────── */
.glass-light {
    background: rgba(253, 250, 246, 0.92);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid rgba(182, 140, 80, 0.18);
    box-shadow: 0 4px 32px rgba(49, 30, 16, 0.08);
}

/* ── Navbar scroll ────────────────────────────────────────── */
.nav-scrolled {
    background: rgba(245, 238, 229, 0.96);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    box-shadow: 0 2px 20px rgba(49, 30, 16, 0.10);
    border-bottom: 1px solid rgba(182, 140, 80, 0.15);
}

/* ── Hero ─────────────────────────────────────────────────── */
.hero-gradient {
    background: #F5EEE5;
    isolation: isolate;
}

.hero-slideshow,
.hero-slide,
.hero-slide img,
.hero-overlay {
    position: absolute;
    inset: 0;
}

.hero-slideshow {
    z-index: 0;
    overflow: hidden;
}

.hero-slide {
    opacity: 0;
    overflow: hidden;
    transition: opacity 1.4s ease-in-out;
    will-change: opacity;
}

.hero-slide.is-active {
    z-index: 1;
    opacity: 1;
}

.hero-slide.is-leaving {
    z-index: 2;
    opacity: 0;
}

.hero-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--hero-position, 72% center);
    transform: scale(1.035);
    backface-visibility: hidden;
    will-change: transform;
}

.hero-slide--familia {
    --hero-position: 72% center;
    --ken-burns-x: -1.2%;
    --ken-burns-y: -0.6%;
}

.hero-slide--negocio {
    --hero-position: 75% center;
    --ken-burns-x: 1.1%;
    --ken-burns-y: -0.4%;
}

.hero-slide--patrimonio {
    --hero-position: 73% center;
    --ken-burns-x: -1%;
    --ken-burns-y: 0.5%;
}

.hero-slideshow.is-ready .hero-slide.is-active img,
.hero-slideshow.is-ready .hero-slide.is-leaving img {
    animation: hero-ken-burns 8.4s ease-out both;
}

.hero-slideshow.is-paused .hero-slide img {
    animation-play-state: paused !important;
}

.hero-overlay {
    z-index: 1;
    pointer-events: none;
    background: linear-gradient(
        105deg,
        rgba(245, 238, 229, 0.98) 0%,
        rgba(245, 238, 229, 0.94) 43%,
        rgba(245, 238, 229, 0.66) 72%,
        rgba(245, 238, 229, 0.34) 100%
    );
}

@keyframes hero-ken-burns {
    from {
        transform: scale(1.035) translate3d(0, 0, 0);
    }
    to {
        transform: scale(1.14) translate3d(var(--ken-burns-x), var(--ken-burns-y), 0);
    }
}

@media (max-width: 767px) {
    .hero-slide img {
        object-position: var(--hero-position-mobile, 70% center);
    }

    .hero-slide--negocio {
        --hero-position-mobile: 73% center;
    }

    .hero-overlay {
        background: linear-gradient(
            180deg,
            rgba(245, 238, 229, 0.92) 0%,
            rgba(245, 238, 229, 0.84) 62%,
            rgba(245, 238, 229, 0.76) 100%
        );
    }
}

@media (prefers-reduced-motion: reduce) {
    .hero-slide {
        opacity: 0;
        transition: none;
    }

    .hero-slide:first-child {
        opacity: 1;
    }

    .hero-slide img,
    .hero-slideshow.is-ready .hero-slide.is-active img,
    .hero-slideshow.is-ready .hero-slide.is-leaving img {
        animation: none;
        transform: scale(1.035);
    }
}

/* ── Anclas: compensar la barra fija ──────────────────────── */
section[id],
#aviso {
    scroll-margin-top: 80px;
}

#hero-motion-toggle[hidden] { display: none; }

/* ── Scroll reveal (solo si hay JS; sin JS el contenido se ve) ── */
.js .reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.js .reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* ── Nav link underline ───────────────────────────────────── */
.nav-link {
    position: relative;
}
.nav-link::after {
    content: '';
    position: absolute;
    bottom: -3px;
    left: 0;
    width: 0;
    height: 2px;
    background: #B68C50;
    border-radius: 2px;
    transition: width 0.3s ease;
}
.nav-link:hover::after { width: 100%; }

/* ── Mobile Menu ──────────────────────────────────────────── */
#mobile-menu {
    transform: translateX(100%);
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
    pointer-events: none;
}
#mobile-menu.open {
    transform: translateX(0);
    pointer-events: auto;
}
#menu-overlay {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.35s ease;
}
#menu-overlay.open {
    opacity: 1;
    pointer-events: auto;
}
/* El botón del chat no debe tapar el menú móvil */
body.menu-open #chat-widget {
    visibility: hidden;
}

/* ── Service tabs ─────────────────────────────────────────── */
.tab-btn {
    transition: all 0.25s ease;
    border-radius: 0.65rem;
    white-space: nowrap;
    color: #685B51;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.35rem;
}
.tab-btn:hover:not(.active) {
    background: rgba(182, 140, 80, 0.1);
    color: #311E10;
}
.tab-btn.active {
    background: #B68C50;
    color: #311E10;
}
.tab-btn.active .tab-icon { color: #311E10; }
.tab-btn:focus-visible {
    outline: 2px solid #311E10;
    outline-offset: 2px;
}
.tab-panel:focus-visible {
    outline: 2px solid #B68C50;
    outline-offset: 6px;
    border-radius: 1rem;
}

.tab-panel { display: none; }
.tab-panel.active {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1.25rem;
}

/* ── Service card ─────────────────────────────────────────── */
.service-card {
    transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.service-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 32px rgba(49, 30, 16, 0.12);
    border-color: rgba(182, 140, 80, 0.4);
}

/* ── Insurer card ─────────────────────────────────────────── */
.insurer-card {
    transition: all 0.3s ease;
    border: 1px solid rgba(182, 140, 80, 0.15);
    min-height: 108px;
}
.insurer-card:hover {
    border-color: #B68C50;
    box-shadow: 0 4px 16px rgba(182, 140, 80, 0.15);
    transform: translateY(-3px);
}

/* Los logos oficiales llegan en proporciones muy distintas (MAPFRE es
   6.6:1, Best Doctors es 1:1), así que se acotan por alto y ancho a la
   vez para que ópticamente pesen lo mismo dentro de la tarjeta. */
.insurer-logo {
    max-height: 44px;
    max-width: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
}
/* Los de proporción casi cuadrada necesitan menos alto para no dominar. */
.insurer-logo--square {
    max-height: 56px;
}

/* Logos con isotipo alto y texto pequeño (La Latino). */
.insurer-logo--tall {
    max-height: 68px;
}

/* Wordmarks muy alargados (Chubb es 9:1): por alto quedarían diminutos. */
.insurer-logo--wide {
    width: 82%;
    max-height: none;
}

/* Aseguradoras sin logo oficial disponible: wordmark tipográfico. */
.insurer-wordmark {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    line-height: 1;
    text-align: center;
}
.insurer-wordmark .insurer-name {
    font-size: 1.2rem;
    font-weight: 700;
    letter-spacing: -0.02em;
    color: #311E10;
}
.insurer-wordmark .insurer-sub {
    font-size: 9px;
    font-weight: 700;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    color: #CAB9A4;
}

/* ── Chat Widget ──────────────────────────────────────────── */
/* El contenedor ocupa el tamaño de la ventana del chat aunque esté cerrada;
   sin esto, esa zona invisible bloquea los clics de lo que haya debajo. */
#chat-widget { pointer-events: none; }
#open-chat   { pointer-events: auto; }
#chat-window {
    transition: all 0.45s cubic-bezier(0.16, 1, 0.3, 1);
    transform: translateY(40px) scale(0.92);
    opacity: 0;
    pointer-events: none;
    box-shadow: 0 20px 60px rgba(49, 30, 16, 0.18);
}
#chat-window.open {
    transform: translateY(0) scale(1);
    opacity: 1;
    pointer-events: auto;
}

@keyframes fadeInUp {
    0%   { opacity: 0; transform: translateY(16px); }
    100% { opacity: 1; transform: translateY(0); }
}
.message-in { animation: fadeInUp 0.35s ease-out forwards; }

.option-btn {
    transition: all 0.25s ease;
    border: 1px solid rgba(182, 140, 80, 0.3);
}
.option-btn:hover {
    background: #B68C50;
    color: #311E10;
    border-color: #B68C50;
    transform: translateY(-2px);
}

/* ── Select arrow ─────────────────────────────────────────── */
.select-brand {
    appearance: none;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23B68C50'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' stroke-width='2' d='M19 9l-7 7-7-7'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    background-size: 1.2em;
}

/* ── Value pill ───────────────────────────────────────────── */
.value-pill {
    transition: all 0.25s ease;
}
.value-pill:hover {
    background: #B68C50;
    color: #311E10;
    transform: translateY(-3px);
    box-shadow: 0 6px 20px rgba(182, 140, 80, 0.25);
}

/* ── Scroll to top & float animation ─────────────────────── */
@keyframes float {
    0%, 100% { transform: translateY(0); }
    50%       { transform: translateY(-10px); }
}
@keyframes pulseGold {
    0%, 100% { box-shadow: 0 0 0 0 rgba(182,140,80,0.4); }
    70%       { box-shadow: 0 0 0 16px rgba(182,140,80,0); }
}
.animate-float      { animation: float 4s ease-in-out infinite; }
.animate-pulse-gold { animation: pulseGold 2.5s infinite; }

/* ── Movimiento reducido: sin animaciones decorativas ─────── */
@media (prefers-reduced-motion: reduce) {
    .animate-float,
    .animate-pulse-gold,
    .message-in,
    .animate-bounce {
        animation: none !important;
    }
    .js .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .service-card:hover,
    .insurer-card:hover,
    .value-pill:hover,
    .option-btn:hover {
        transform: none;
    }
}
