:root {
    --azul-900: #0b335e;
    --azul-700: #1d4f86;
    --azul-500: #2d8fdd;
    --azul-claro: #e5f2ff;
    --acento: #25d366;
    --texto: #1f2933;
    --gris-100: #f5f7fb;
    --gris-200: #e9edf5;
    --sombra: 0 18px 45px rgba(0, 0, 0, 0.12);
    --radius-lg: 24px;
}

*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: "Segoe UI", system-ui, -apple-system, BlinkMacSystemFont, sans-serif;
    color: var(--texto);
    background: #f6f8fc;
    line-height: 1.7;
    min-height: 100vh;
}

body.menu-open {
    overflow: hidden;
}

section {
    scroll-margin-top: 110px;
}

.container {
    width: 100%;
    max-width: 1160px;
    margin: 0 auto;
    padding: 0 1.5rem;
}

h1, h2, h3 {
    font-weight: 700;
    color: var(--azul-900);
}

p {
    margin-bottom: 0.75rem;
}

/* HEADER */

.main-header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: var(--azul-900);
    box-shadow: 0 4px 18px rgba(0, 0, 0, 0.25);
}

.main-header.scrolled {
    background: var(--azul-900);
}

.nav-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.9rem 0;
    gap: 1rem;
}

.logo img {
    height: 62px;
    width: 62px;
    border-radius: 50%;
    border: 3px solid #fff;
    object-fit: cover;
    background: #fff;
    box-shadow: 0 10px 22px rgba(0, 0, 0, 0.25);
}

.nav-toggle {
    display: none;
    background: none;
    border: 1px solid rgba(255, 255, 255, 0.5);
    color: #fff;
    font-size: 1.2rem;
    cursor: pointer;
    padding: 0.5rem 0.75rem;
    border-radius: 12px;
}

.nav-overlay {
    display: flex;
    justify-content: flex-end;
    flex: 1;
}

.nav-overlay.active {
    background: rgba(11, 51, 94, 0.9);
}

.main-nav {
    display: flex;
    align-items: center;
    gap: 1.25rem;
}

.main-nav a {
    color: #f4f7fb;
    text-decoration: none;
    font-size: 0.97rem;
    font-weight: 600;
}

.main-nav a:hover {
    opacity: 0.85;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    padding: 0.75rem 1.5rem;
    border-radius: 999px;
    border: none;
    font-weight: 700;
    font-size: 0.97rem;
    cursor: pointer;
    text-decoration: none;
    transition: transform 0.15s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:active {
    transform: translateY(1px);
}

.btn-primary {
    background: linear-gradient(125deg, var(--azul-500), var(--azul-700));
    color: #fff;
    box-shadow: 0 16px 34px rgba(13, 68, 126, 0.35);
}

.btn-primary:hover {
    box-shadow: 0 20px 38px rgba(13, 68, 126, 0.45);
}

.btn-secondary {
    background: #fff;
    color: var(--azul-900);
    border: 1px solid rgba(15, 47, 87, 0.2);
    box-shadow: 0 14px 30px rgba(15, 47, 87, 0.12);
}

.btn-secondary:hover {
    background: #f5f7fb;
}

.btn-nav {
    border: 1px solid #fff;
    padding: 0.55rem 1.2rem;
}

/* HERO */

.hero {
    position: relative;
    overflow: hidden;
    background: linear-gradient(115deg, rgba(12, 33, 63, 0.95), rgba(14, 57, 104, 0.93)),
        url("../images/portada-consultorio.jpg.jpg") center/cover no-repeat;
    padding: 4.8rem 0 5.6rem;
    color: #fff;
}

.hero-bg {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.12), transparent 40%),
        radial-gradient(circle at 75% 70%, rgba(37, 211, 102, 0.18), transparent 32%);
    filter: blur(10px);
    opacity: 0.7;
    pointer-events: none;
}

.hero-content {
    position: relative;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.1rem;
    align-items: center;
}

.hero-text {
    max-width: 650px;
}

.hero h1,
.hero h2,
.hero p,
.hero a {
    color: #fff;
}

.hero .btn-secondary {
    color: var(--azul-900);
    background: #fff;
}

.hero .btn-secondary i {
    color: var(--azul-500);
}

.hero .btn-primary i {
    margin-right: 0.35rem;
}

.hero-tag {
    display: inline-flex;
    padding: 0.45rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    font-size: 0.92rem;
    margin-bottom: 1rem;
}

.hero h1 {
    font-size: 2.7rem;
    margin-bottom: 0.4rem;
}

.typewriter {
    font-size: 1.35rem;
    min-height: 1.5em;
    margin-bottom: 1rem;
    display: inline-block;
    white-space: nowrap;
    letter-spacing: 0.01em;
}

#typewriter-text {
    display: inline-block;
}

.typewriter-cursor {
    display: inline-block;
    vertical-align: bottom;
    width: 2px;
    height: 1.4em;
    background: #fff;
    animation: blink 0.8s steps(2, start) infinite;
}

.hero-schedule {
    font-weight: 600;
    opacity: 0.9;
}

.hero-cta {
    display: flex;
    flex-wrap: wrap;
    gap: 0.85rem;
    margin-bottom: 1.25rem;
}

.hero-media {
    position: relative;
}

.hero-media.no-video {
    display: none;
}

.audio-toggle {
    position: absolute;
    top: 16px;
    left: 16px;
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    background: rgba(3, 16, 31, 0.6);
    color: #fff;
    font-size: 0.85rem;
    font-weight: 700;
    cursor: pointer;
    backdrop-filter: blur(6px);
    transition: background 0.2s ease, transform 0.2s ease, opacity 0.2s ease;
}

.audio-toggle:hover {
    transform: translateY(-1px);
}

.audio-toggle.active {
    background: rgba(37, 211, 102, 0.9);
    border-color: rgba(255, 255, 255, 0.6);
}

.audio-toggle.hidden {
    opacity: 0;
    pointer-events: none;
    transform: translateY(-8px);
}

.audio-icon {
    display: inline-flex;
    align-items: center;
    gap: 0.15rem;
    position: relative;
}

.audio-toggle i {
    font-size: 1rem;
}

.audio-mute-line {
    position: absolute;
    width: 24px;
    height: 2px;
    background: #ff4b4b;
    top: 50%;
    left: 50%;
    translate: -50% -50%;
    transform: rotate(35deg);
    border-radius: 999px;
    box-shadow: 0 0 6px rgba(255, 75, 75, 0.6);
    animation: mutePulse 1.2s ease-in-out infinite;
}

.audio-toggle.active .audio-mute-line {
    opacity: 0;
    animation: none;
}

.audio-wave {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.7);
    animation: audioPulse 1.2s ease-in-out infinite;
}

.audio-wave.delay {
    animation-delay: 0.4s;
}

.audio-toggle.active .audio-wave {
    background: rgba(255, 255, 255, 0.95);
}

.hero-media .video-wrapper {
    border-radius: 26px;
    overflow: hidden;
    box-shadow: 0 32px 72px rgba(0, 0, 0, 0.35);
    background: rgba(0, 0, 0, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.12);
}

.hero-media iframe {
    width: 100%;
    min-height: 320px;
    border: none;
    display: block;
}

/* DOCTOR CARD */

.doctor-highlight {
    margin-top: -3.8rem;
    padding-bottom: 3.4rem;
}

.doctor-card {
    background: #fff;
    border-radius: var(--radius-lg);
    padding: 1.5rem 1.75rem;
    box-shadow: var(--sombra);
    display: flex;
    align-items: center;
    gap: 2rem;
    border: 1px solid var(--gris-200);
    max-width: 900px;
    margin: 0 auto;
}

.doctor-photo img {
    width: 160px;
    height: 160px;
    border-radius: 50%;
    object-fit: cover;
    border: 8px solid #fff;
    box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
}

.doctor-tag {
    font-size: 0.9rem;
    color: var(--azul-700);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 0.4rem;
}

.doctor-description {
    margin-bottom: 1rem;
}

.doctor-list {
    list-style: none;
    display: grid;
    gap: 0.4rem;
    margin-bottom: 1.25rem;
}

.doctor-list i {
    color: var(--acento);
    margin-right: 0.4rem;
}

.doctor-card .btn {
    padding: 0.65rem 1.1rem;
    font-size: 0.95rem;
}

/* BENEFICIOS */

.beneficios {
    padding: 3.6rem 0;
    text-align: center;
}

.section-intro {
    max-width: 640px;
    margin: 0.6rem auto 2rem;
}

.beneficios-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.beneficio-card {
    background: #fff;
    padding: 1.75rem 1.6rem;
    border-radius: 18px;
    box-shadow: var(--sombra);
    text-align: left;
    border: 1px solid var(--gris-200);
}

/* SERVICIOS */

.servicios {
    padding: 3.8rem 0;
    background: #f7f9fd;
}

.servicios-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 2rem;
    align-items: stretch;
}

.servicio-card {
    background: #fff;
    border-radius: 18px;
    padding: 2rem;
    box-shadow: var(--sombra);
    display: flex;
    flex-direction: column;
    gap: 0.9rem;
    border: 1px solid var(--gris-200);
    position: relative;
    overflow: hidden;
    min-height: 100%;
}

.servicio-card::before {
    content: "";
    position: absolute;
    inset: -40% -20% auto auto;
    height: 120px;
    width: 120px;
    background: radial-gradient(circle, rgba(45, 143, 221, 0.18), transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.servicio-card:hover::before {
    opacity: 1;
}

.servicio-badge {
    display: none;
}

.servicio-precio {
    font-size: 2rem;
    font-weight: 700;
    color: var(--azul-900);
}

.servicio-descripcion {
    text-align: left;
}

.servicio-precio span {
    display: block;
    font-size: 0.95rem;
    font-weight: 600;
    color: #6b7280;
}

.servicio-lista {
    list-style: none;
    display: grid;
    gap: 0.35rem;
    color: #4b5563;
    text-align: left;
}

.btn-full {
    width: 100%;
    align-self: stretch;
    margin-top: auto;
}

.horarios {
    background: var(--azul-claro);
    border-radius: 18px;
    padding: 1.75rem;
    border: 1px solid rgba(29, 79, 134, 0.18);
}

.horarios ul {
    margin-top: 1rem;
    list-style: disc;
    padding-left: 1.2rem;
}

/* GALERIA / CASOS */
.galeria {
    padding: 3.5rem 0;
    background: #eef3fb;
}

.galeria-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 1.25rem;
}

.galeria-card {
    background: #fff;
    border-radius: 16px;
    overflow: hidden;
    box-shadow: var(--sombra);
    display: flex;
    flex-direction: column;
}

.galeria-imagen img {
    width: 100%;
    height: 180px;
    object-fit: cover;
    display: block;
}

.galeria-info {
    padding: 1rem 1.25rem;
}

.galeria-info h4 {
    margin-bottom: 0.4rem;
}

/* SOBRE LAFESANA */

.sobre {
    padding: 3.8rem 0;
}

.sobre-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.1rem;
    align-items: center;
}

.sobre-texto {
    text-align: justify;
    max-width: 620px;
}

.sobre-imagen {
    display: flex;
    justify-content: center;
}

.sobre-imagen img {
    width: 240px;
    height: 240px;
    border-radius: 50%;
    border: 8px solid #fff;
    box-shadow: 0 25px 45px rgba(0, 0, 0, 0.2);
    object-fit: cover;
    background: #fff;
}

/* TESTIMONIOS */

.testimonios {
    padding: 3.8rem 0;
}

.testimonios-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    margin-bottom: 1.5rem;
    flex-wrap: wrap;
}

.testimonios-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
    gap: 1.25rem;
}

.testimonio-card {
    background: #fff;
    border-radius: 18px;
    padding: 1.4rem 1.3rem;
    box-shadow: var(--sombra);
    border: 1px solid var(--gris-200);
}

.testimonio-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    margin-bottom: 0.6rem;
}

.testimonio-rol {
    color: #617081;
    font-size: 0.95rem;
}

.stars {
    color: #f7c948;
    display: inline-flex;
    gap: 2px;
}

/* CTA GUIA */

.cta-guia {
    padding: 3.4rem 0;
}

.cta-guia-card {
    background: linear-gradient(120deg, rgba(15, 47, 87, 0.95), rgba(29, 79, 134, 0.9));
    color: #fff;
    border-radius: var(--radius-lg);
    padding: 2.1rem;
    display: grid;
    grid-template-columns: 1fr;
    align-items: center;
    gap: 1.5rem;
    box-shadow: 0 26px 60px rgba(10, 44, 92, 0.35);
    border: 1px solid rgba(255, 255, 255, 0.1);
}

.cta-guia-card h2 {
    color: #fff;
}

.cta-guia-card p {
    color: rgba(232, 243, 255, 0.95);
}

.guia-badge {
    display: none;
}

/* CONTACTO */

.contacto {
    padding: 3.8rem 0;
}

.contacto-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.25rem;
}

.contacto-info,
.contacto-redes {
    margin-top: 1.75rem;
}

.contacto-info h3,
.contacto-redes h3 {
    margin-bottom: 0.75rem;
}

.link-mapa {
    color: var(--azul-700);
    text-decoration: none;
    font-weight: 700;
}

.link-mapa i {
    margin-right: 0.35rem;
}

.contacto-redes ul {
    list-style: none;
    display: grid;
    gap: 0.5rem;
}

.contacto-redes a {
    color: var(--azul-900);
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 700;
}

.contacto-redes a:hover {
    color: var(--azul-500);
}

/* FOOTER */

.footer {
    background: rgba(11, 51, 94, 0.97);
    color: #cbd4e2;
    padding: 1.25rem 0;
    text-align: center;
}

/* WHATSAPP FLOAT */

.whatsapp-floating {
    position: fixed;
    bottom: 18px;
    right: 18px;
    width: 58px;
    height: 58px;
    border-radius: 50%;
    background: var(--acento);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.7rem;
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
    z-index: 100;
    text-decoration: none;
    animation: pulse 2.8s ease-in-out infinite;
}

.whatsapp-floating:hover {
    transform: translateY(-2px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.35);
}

/* ANIMATIONS */

.reveal-up {
    opacity: 0;
    transform: translateY(30px);
}

.reveal-up.in-view {
    animation: reveal 0.85s ease forwards;
    animation-delay: var(--delay, 0s);
}

@keyframes reveal {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes blink {
    0%, 100% {
        opacity: 0;
    }
    50% {
        opacity: 1;
    }
}

@keyframes audioPulse {
    0% {
        transform: scale(0.6);
        opacity: 0.4;
    }
    50% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(0.6);
        opacity: 0.4;
    }
}

@keyframes mutePulse {
    0%, 100% {
        transform: translate(-50%, -50%) rotate(35deg) scale(1);
    }
    50% {
        transform: translate(-50%, -50%) rotate(35deg) scale(1.15);
    }
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.05); }
}

/* RESPONSIVE */

@media (max-width: 900px) {
    .nav-toggle {
        display: block;
    }

    .nav-overlay {
        position: fixed;
        inset: 0;
        background: rgba(4, 17, 34, 0.92);
        display: none;
        justify-content: center;
        align-items: center;
        z-index: 55;
        transition: opacity 0.25s ease;
    }

    .nav-overlay.active {
        display: flex;
    }

    .main-nav {
        flex-direction: column;
        gap: 1.2rem;
        text-align: center;
        font-size: 1.1rem;
    }

    .beneficios-grid,
    .servicios-grid,
    .sobre-grid,
    .contacto-grid {
        grid-template-columns: 1fr;
    }

    .doctor-card {
        flex-direction: column;
        text-align: center;
    }

    .doctor-list {
        text-align: left;
    }

    .cta-guia-card {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 600px) {
    .hero {
        padding: 3.8rem 0 4.3rem;
    }

    .hero h1 {
        font-size: 2.05rem;
    }

    .hero-cta {
        flex-direction: column;
    }

    .hero-media iframe {
        min-height: 260px;
    }

    .beneficios-grid,
    .servicios-grid {
        gap: 1rem;
    }

    .doctor-photo img {
        width: 150px;
        height: 150px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
    }
    html {
        scroll-behavior: auto;
    }
    .reveal-up {
        opacity: 1;
        transform: none;
    }
}
