/*
 * TDM — base, cabecera, pie y animaciones.
 *
 * Se carga en todas las páginas. Los estilos de las secciones de la landing
 * están en pages/home.css.
 *
 * Sale de home.html tal cual, con dos cambios:
 *   - el bloque del hero se movió a pages/home.css;
 *   - .footer-grid lleva aquí sus columnas de escritorio (en el diseño iban en
 *     un style="" del propio elemento).
 */

/* ========== CSS BASE ========== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html, body { overflow-x: hidden; max-width: 100vw; }
img, video, svg { max-width: 100%; height: auto; }
section, .slider, .carousel, [class*="container"] { max-width: 100%; }

:root {
    --color-primary: #002395;
    --color-secondary: #283269;
    --color-accent-1: #00A0DC;
    --color-accent-2: #00AFCD;
    --color-accent-3: #05A5C5;
    --color-accent-4: #00A1DE;
    --color-gray: #8B8D8E;
    --color-gray-light: #d1d2d3;
    --color-white: #ffffff;
    --color-dark: #0a0e2a;
    --color-bg-light: #f4f6fa;
    --font-main: 'SenticoSans', 'DM Sans', Arial, sans-serif;
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

html { scroll-behavior: smooth; }
body {
    font-family: var(--font-main);
    font-weight: 400;
    color: var(--color-dark);
    line-height: 1.6;
    background: var(--color-white);
}

.container {
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: clamp(1rem, 5vw, 3rem);
    width: 100%;
}

/* ========== HEADER ========== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    transition: var(--transition);
    background: transparent;
}

.header.scrolled {
    background: rgba(0, 35, 149, 0.97);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 2px 20px rgba(0, 14, 42, 0.25);
}

.header-inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-block: clamp(12px, 2vw, 20px);
}

.logo {
    text-decoration: none;
    display: flex;
    align-items: center;
    flex-shrink: 0;
    z-index: 1001;
}

.logo-img {
    max-height: clamp(40px, 5vw, 75px);
    width: auto;
    display: block;
}

.nav-desktop {
    display: flex;
    align-items: center;
    gap: clamp(20px, 3vw, 40px);
    list-style: none;
}

.nav-desktop a {
    text-decoration: none;
    color: var(--color-white);
    font-size: clamp(0.8rem, 0.9vw + 0.4rem, 0.95rem);
    font-weight: 500;
    letter-spacing: 0.03em;
    text-transform: uppercase;
    position: relative;
    padding: 6px 0;
    transition: var(--transition);
}

.nav-desktop a::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background: var(--color-accent-2);
    transition: width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-desktop a:hover::after,
.nav-desktop a.active::after {
    width: 100%;
}

.nav-desktop a:hover {
    color: var(--color-accent-2);
}

.nav-cta {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: var(--color-accent-1);
    color: var(--color-white) !important;
    padding: 10px 24px !important;
    border-radius: 999px;
    font-weight: 700 !important;
    text-transform: uppercase !important;
    font-size: clamp(0.75rem, 0.8vw + 0.35rem, 0.85rem) !important;
    letter-spacing: 0.05em !important;
    border: 2px solid transparent;
    transition: var(--transition);
}

.nav-cta::after { display: none !important; }

.nav-cta:hover {
    background: transparent !important;
    border-color: var(--color-accent-2);
    color: var(--color-accent-2) !important;
    transform: translateY(-1px);
}

/* Hamburger */
.hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    width: 32px;
    height: 32px;
    background: none;
    border: none;
    cursor: pointer;
    z-index: 1001;
    padding: 0;
}

.hamburger span {
    display: block;
    width: 100%;
    height: 2px;
    background: var(--color-white);
    border-radius: 2px;
    transition: var(--transition);
}

.hamburger.active span:nth-child(1) {
    transform: rotate(45deg) translate(5px, 5px);
}
.hamburger.active span:nth-child(2) {
    opacity: 0;
}
.hamburger.active span:nth-child(3) {
    transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav */
.nav-mobile {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100dvh;
    background: linear-gradient(180deg, var(--color-primary) 0%, var(--color-secondary) 100%);
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
    list-style: none;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transition: var(--transition);
}

.nav-mobile.open {
    opacity: 1;
    visibility: visible;
}

.nav-mobile li {
    transform: translateY(20px);
    opacity: 0;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-mobile.open li {
    transform: translateY(0);
    opacity: 1;
}

.nav-mobile a {
    text-decoration: none;
    color: var(--color-white);
    font-size: clamp(1.2rem, 3vw + 0.5rem, 1.8rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 16px 32px;
    display: block;
    transition: var(--transition);
}

.nav-mobile a:hover {
    color: var(--color-accent-2);
}

.nav-mobile .nav-cta-mobile {
    margin-top: 24px;
    background: var(--color-accent-1);
    border-radius: 999px;
    padding: 14px 40px;
    font-size: clamp(0.9rem, 1.5vw + 0.4rem, 1.1rem);
}


/* ========== FOOTER ========== */
.footer {
    background: var(--color-dark);
    color: rgba(255, 255, 255, 0.7);
    position: relative;
    overflow: hidden;
}

.footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(ellipse at 10% 90%, rgba(0, 35, 149, 0.2) 0%, transparent 50%);
    pointer-events: none;
}

.footer-main {
    position: relative;
    z-index: 1;
    padding: clamp(60px, 8vw, 100px) 0 clamp(40px, 5vw, 60px);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
    gap: clamp(32px, 4vw, 64px);
}

.footer-brand p {
    font-size: clamp(0.82rem, 0.8vw + 0.4rem, 0.95rem);
    line-height: 1.7;
    margin-top: 20px;
    color: rgba(255, 255, 255, 0.55);
    max-width: 300px;
}

.footer-brand .logo-img {
    max-height: clamp(35px, 4.5vw, 65px);
}

.footer-title {
    color: var(--color-white);
    font-size: clamp(0.8rem, 0.85vw + 0.4rem, 0.95rem);
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-bottom: clamp(16px, 2vw, 28px);
    position: relative;
    padding-bottom: 12px;
}

.footer-title::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 30px;
    height: 2px;
    background: var(--color-accent-1);
    border-radius: 2px;
}

.footer-links {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.footer-links a {
    color: rgba(255, 255, 255, 0.55);
    text-decoration: none;
    font-size: clamp(0.8rem, 0.8vw + 0.38rem, 0.92rem);
    transition: var(--transition);
    display: inline-flex;
    align-items: center;
    gap: 6px;
}

.footer-links a::before {
    content: '';
    width: 0;
    height: 1px;
    background: var(--color-accent-2);
    transition: width 0.3s ease;
}

.footer-links a:hover {
    color: var(--color-accent-2);
}

.footer-links a:hover::before {
    width: 12px;
}

.footer-contact-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    margin-bottom: 16px;
}

.footer-contact-item svg {
    width: 18px;
    height: 18px;
    flex-shrink: 0;
    margin-top: 3px;
    color: var(--color-accent-1);
}

.footer-contact-item span {
    font-size: clamp(0.8rem, 0.8vw + 0.38rem, 0.92rem);
    color: rgba(255, 255, 255, 0.55);
    line-height: 1.5;
}

.footer-bottom {
    position: relative;
    z-index: 1;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    padding: clamp(20px, 3vw, 32px) 0;
}

.footer-bottom-inner {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 16px;
}

.footer-copy {
    font-size: clamp(0.72rem, 0.7vw + 0.35rem, 0.82rem);
    color: rgba(255, 255, 255, 0.35);
}

.footer-legal {
    display: flex;
    gap: 24px;
    list-style: none;
}

.footer-legal a {
    color: rgba(255, 255, 255, 0.35);
    text-decoration: none;
    font-size: clamp(0.72rem, 0.7vw + 0.35rem, 0.82rem);
    transition: var(--transition);
}

.footer-legal a:hover {
    color: var(--color-accent-2);
}

/* ========== ANIMATIONS ========== */
.fade-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.7s cubic-bezier(0.4, 0, 0.2, 1), transform 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}

.fade-up.visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .fade-up {
        opacity: 1;
        transform: none;
        transition: none;
    }
    .hero-badge-dot { animation: none; }
}

/* ========== RESPONSIVE: TABLET ========== */
@media (max-width: 1024px) {
    .nav-desktop { display: none; }
    .hamburger { display: flex; }
    .nav-mobile { display: flex; }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: clamp(28px, 4vw, 48px);
    }
}


/* ========== RESPONSIVE: MOBILE ========== */
@media (max-width: 768px) {
    .footer-grid {
        grid-template-columns: 1fr;
        gap: clamp(32px, 5vw, 48px);
    }

    .footer-bottom-inner {
        flex-direction: column;
        align-items: flex-start;
    }
}

@media (max-width: 375px) {
    .footer-legal {
        flex-direction: column;
        gap: 10px;
    }
}

/* ========== FOOTER: COLUMNAS DE ESCRITORIO ========== */
.footer-grid {
    grid-template-columns: 1.5fr 1fr 0.8fr 1.2fr;
}

/* ========== FOOTER SOCIAL ========== */
    .footer-social {
        display: flex;
        align-items: center;
        gap: 16px;
    }

    .footer-social__link {
        display: flex;
        align-items: center;
        justify-content: center;
        width: 42px;
        height: 42px;
        border-radius: 50%;
        border: 1px solid rgba(255, 255, 255, 0.12);
        background: rgba(255, 255, 255, 0.04);
        color: rgba(255, 255, 255, 0.55);
        text-decoration: none;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    }

    .footer-social__link svg {
        width: 18px;
        height: 18px;
    }

    .footer-social__link:hover {
        background: var(--color-accent-1);
        border-color: var(--color-accent-1);
        color: var(--color-white);
        transform: translateY(-3px);
        box-shadow: 0 4px 16px rgba(0, 160, 220, 0.3);
    }

    /* ========== FOOTER RESPONSIVE ADJUSTMENTS ========== */
    @media (max-width: 1024px) {
        .footer-grid {
            grid-template-columns: 1fr 1fr !important;
        }
    }

    @media (max-width: 768px) {
        .footer-grid {
            grid-template-columns: 1fr !important;
        }
    }

    /* ========== FLOATING WHATSAPP BUTTON ========== */
    .whatsapp-float {
        position: fixed;
        bottom: 28px;
        right: 28px;
        z-index: 9999;
        display: flex;
        align-items: center;
        gap: 0;
        background: #25D366;
        color: var(--color-white);
        width: 60px;
        height: 60px;
        border-radius: 50%;
        text-decoration: none;
        box-shadow: 0 4px 14px rgba(37, 211, 102, 0.4), 0 2px 6px rgba(0, 0, 0, 0.15);
        transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        overflow: visible;
    }

    .whatsapp-float:hover {
        background: #1ebe5d;
        transform: scale(1.08) translateY(-2px);
        box-shadow: 0 6px 24px rgba(37, 211, 102, 0.5), 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .whatsapp-float__icon {
        width: 34px;
        height: 34px;
        margin: auto;
        flex-shrink: 0;
        color: var(--color-white);
    }

    /* Tooltip */
    .whatsapp-float__tooltip {
        position: absolute;
        right: calc(100% + 12px);
        top: 50%;
        transform: translateY(-50%);
        background: var(--color-dark);
        color: var(--color-white);
        font-family: var(--font-main);
        font-size: 0.82rem;
        font-weight: 500;
        white-space: nowrap;
        padding: 8px 16px;
        border-radius: 8px;
        opacity: 0;
        visibility: hidden;
        pointer-events: none;
        transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    }

    .whatsapp-float__tooltip::after {
        content: '';
        position: absolute;
        right: -6px;
        top: 50%;
        transform: translateY(-50%);
        width: 0;
        height: 0;
        border-top: 6px solid transparent;
        border-bottom: 6px solid transparent;
        border-left: 6px solid var(--color-dark);
    }

    .whatsapp-float:hover .whatsapp-float__tooltip {
        opacity: 1;
        visibility: visible;
    }

    /* Pulse animation */
    .whatsapp-float::before {
        content: '';
        position: absolute;
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        border-radius: 50%;
        background: #25D366;
        z-index: -1;
        animation: whatsappPulse 2.5s ease-in-out infinite;
    }

    @keyframes whatsappPulse {
        0% {
            transform: scale(1);
            opacity: 0.5;
        }
        50% {
            transform: scale(1.4);
            opacity: 0;
        }
        100% {
            transform: scale(1);
            opacity: 0;
        }
    }

    /* Responsive adjustments */
    @media (max-width: 768px) {
        .whatsapp-float {
            bottom: 20px;
            right: 20px;
            width: 54px;
            height: 54px;
        }

        .whatsapp-float__icon {
            width: 30px;
            height: 30px;
        }

        .whatsapp-float__tooltip {
            display: none;
        }
    }

    @media (max-width: 375px) {
        .whatsapp-float {
            bottom: 16px;
            right: 16px;
            width: 50px;
            height: 50px;
        }

        .whatsapp-float__icon {
            width: 28px;
            height: 28px;
        }
    }

    @media (prefers-reduced-motion: reduce) {
        .whatsapp-float::before {
            animation: none;
        }
    }
