:root {
    /* Fondos - escalera oscura */
    --bg-base: #ffffff; /* Hero + Contacto */
    --bg-soft: #f4f4f6; /* Servicios */
    --bg-mid: #1e2240; /* Zona */
    --bg-dark: #131629; /* Urgencias */
    --bg-footer: #0d1020; /* Footer primary */
    --bg-footer-sub: #080a14; /* Footer secondary */ 

    /* Marca */
    --color-principal: #f3fb26; /* Amarillo - zona oscuras */
    --color-secondary: #6586f2; /* Azul vibrante */
    --color-blue-deep: #3a57c5; /* Azul osuro - hover claro */

    /* Verde checks e icons */
    --color-verde: #22c97a; /* Fondo claro/gris */
    --color-verde-dark: #17a362; /* Blanco puro */
    --color-verde-neon: #39ff9a; /* Checks fondo oscuro */

    /* Texto */
    --color-negro: #1a1a1a;
    --color-blanco: #ffffff;
    --text-muted-light: #5a6480; /* Texto secundario sober blanco */
    --text-muted-dark: rgba(255, 255, 255, 0.65); /* Sobre oscuro */

    /* Alertas */
    --color-alerta: #ff4b2b;

    /* Glassmorphism (header scroll) */
    --glass-bg: rgba(13, 16, 32, 0.75);
    --glass-border: rgba(101, 134, 242, 0.25);
    --glass-bg-hero: rgba(255, 255, 255, 0.08);

    /* Sombras y elevación */
    --shadow-card: 0 4px 24px rgba(0, 0, 0, 0.8);
    --shadow-card-hover: 0 12px 40px rgba(0, 0, 0, 0.15);
    --shadow-dark-card: 0 4px 24px rgba(0, 0, 0, 0.4);
    --shadow-dark-hover: 0 12px 40px rgba(101, 134, 242, 0.25);
    --shadow-yellow-glow: 0 0 20px rgba(243, 251, 38, 0.35);

    /* Gradientes */
    --grad-dark-top: linear-gradient(180deg, #0d1020 0%, #121629 100%);
    --grad-hero-overlay: linear-gradient(135deg, rgba(13, 16, 32, 0.85) 0%, rgba(30, 34, 64, 0.6) 100%);
    --grad-blue-accent: linear-gradient(135deg, #6586f2 0%, #3a57c5 100%);
    --grad-section-fade: linear-gradient(180deg, #f4f4f6 0%, #ffffff 100%);
}   

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Poppins', sans-serif;
}

body {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    background-color: var(--bg-base);
    color: var(--color-negro);
    font-family: 'Poppins', sans-serif;
}

.main-content {
    flex: 1;
}

/* ==== HEADER (Espacio exterior) ====
.header-wrapper {
    position: sticky;
    top: 0; 
    z-index: 1000;

    display: flex;
    justify-content: space-between;
    align-items: center;

    background-color: var(--bg-mid);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--glass-border);
    padding: 1rem 5%;
} */

/* ==== HEADER ==== */
.header-wrapper {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 20px 5%;
    background-color: var(--bg-mid);
    border-bottom: 1px solid var(--glass-border);
    transition: all 0.5s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 9999;
    display: flex;
    align-items: center;
    height: 90px;
}

.logo-img {
    height: 90px;
    width: auto;
    display: block;
    transition: height 0.4s ease;
}

/* Efecto hacer Scroll */
.header-wrapper.scrolled {
    height: 70px;
    padding: 0 5%;
    background: var(--glass-bg);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
    border-bottom: 1px solid var(--glass-border);
}

.header-wrapper.scrolled .logo-img{
    height: 70px;
}

.main-header {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header-urgencia {
    order: 2;
}

.header-actions {
    order: 1;
}

/* Navegación y Efecto Línea desde centro */
.nav-menu {
    display: flex;
    gap: 50px;
}

.nav-link {
    text-decoration: none;
    color: var(--color-blanco);
    font-weight: 600;
    font-size: 0.85rem;
    position: relative;
    padding: 8px 0;
    transition: color 0.3s ease;
}

.nav-link:hover,
.nav-link.active {
    color: var(--color-principal);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: 0;
    left: 50%;
    background-color: var(--color-principal);
    transition: width 0.3s ease, left 0.3s ease;
    transform: translateX(-50%);
}

.nav-link:hover::after,
.nav-link.active::after {
    width: 100%;
}

/* Botón Urgencias */
.btn-urgencias {
    background-color: var(--color-principal);
    color: var(--color-negro);
    border: none;
    box-shadow: var(--shadow-yellow-glow);
    padding: 10px 22px;
    border-radius: 50px;
    text-decoration: none;
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all 0.3s ease;
    cursor: pointer;
    overflow: hidden;
}

.btn-urgencias i {
    font-size: 0.9rem;
    display: flex;
    transition: transform 0.4s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.btn-text {
    display: inline-block;
    transition: transform 0.3s ease;
}

.btn-urgencias:hover {
    background-color: var(--color-blanco);
    color: var(--color-negro);
    transform: translateY(-2px);
    /* border-color: var(--color-principal); */
}

.btn-urgencias:hover i {
    transform: rotate(-15deg) scale(1.2);
    color: var(--color-negro);
}

.btn-urgencias:hover .btn-text {
    transform: scale(1.1);
}

/* Mobile Toggle */
.menu-toggle {
    background: transparent;
    border: none;
    cursor: pointer;
    display: none;
    flex-direction: column;
    gap: 6px;
    padding: 5px;
}

.menu-toggle span {
    width: 28px;
    height: 3px;
    background-color: var(--color-principal);
    border-radius: 10px;
    transition: all 0.3s ease;
}

.menu-toggle.active span:nth-child(1) {
    transform: translateY(9px) rotate(45deg);
    background-color: var(--color-alerta);
}

.menu-toggle.active span:nth-child(2) {
    opacity: 0;
    transform: translateX(-10px);
}

.menu-toggle.active span:nth-child(3) {
    transform: translateY(-9px) rotate(-45deg);
    background-color: var(--color-alerta);
}

/* ==== FOOTER (Primary) ==== */
.footer-primary {
    background-color: var(--bg-footer);
    border-top: 2px solid var(--color-secondary);
    /* color: var(--color-blanco); */
    padding: 50px 5%;
}

.footer-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 40px;
}

.branding p {
    width: 200px;
    margin: 15px auto 0 auto;
    text-align: center;
    font-size: 0.9rem;
    line-height: 1.4;
    color: rgba(255, 255, 255, 0.8);
}

.footer-col {
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.links .footer-items,
.contact .footer-items {
    align-items: flex-start;
    text-align: left;
    width: fit-content;
}

.footer-title {
    font-size: 1.2rem;
    color: var(--color-principal);
    margin-bottom: 25px;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    display: inline-block;
}

.footer-title::after {
    content: '';
    position: absolute;
    width: 80%;
    height: 1px;
    background: var(--color-principal);
    bottom: -8px;
    left: 50%;
    transform: translateX(-50%)
}

.footer-logo {
    height: 80px;
    width: auto;
    margin-bottom: 15px;
    display: block;
    /* filter: brightness(0) invert(1); Invertir logo color */
}

.footer-items {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
}

.footer-items p, .footer-items a {
    font-size: 0.95rem;
    color: var(--color-blanco);
    text-decoration: none;
    display: flex;
    align-items: center;
    justify-content: center;
    max-width: 250px;
    gap: 10px;
    transition: 0.3s ease;
}

.footer-items i {
    color: var(--color-principal);
    font-size: 1.1rem;
    filter: drop-shadow(0 0 5px rgba(243, 251, 38, 0.4));
}

.footer-items a:hover {
    color: var(--color-principal);
    transform: translateX(5px);
}

/* ==== FOOTER (Secondary) ==== */
.footer-secondary {
    background-color: var(--bg-footer-sub);
    color: var(--text-muted-dark);
    padding: 6px 2%;
    font-size: 0.70rem;
}

.footer-secondary-container {
    margin: 0 auto;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
}

.glowup-link {
    color: var(--color-secondary);
    text-decoration: none;
    font-weight: 600;
    transition: 0.3s;
}

.glowup-link:hover {
    color: var(--color-principal)
}

.legal-links {
    display: flex;
    gap: 15px;
    justify-content: flex-end;
}

.legal-links a {
    color: inherit;
    text-decoration: none;
    transition: 0.3s;
}

.legal-links a:hover {
    color: var(--color-blanco);
}

/* Botón WhatsApp */
.floating-whatsapp {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 1000;
}

.floating-whatsapp a {
    width: 60px;
    height: 60px;
    background-color: var(--color-verde-neon);
    animation: pulse-whatsapp 2s infinite;
    display: flex;
    justify-content: center;
    align-items: center;
    border-radius: 50%;
    /* box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2); */
    text-decoration: none;
    transition: all 0.3s ease-in-out;
}

.floating-whatsapp a i {
    color: var(--bg-dark);
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-whatsapp a:hover {
    background-color: var(--color-verde-dark);
    transform: scale(1.1) rotate(10deg);
}

/* Legal pages */
.title-legal {
    font-size: 2.6rem;
    font-weight: 600;
    text-align: center;
    margin-bottom: 2.5rem;
    color: var(--color-blue-deep);
}

.title-legal:after {
    content: "";
    display: block;
    width: 60px;
    height: 3px;
    margin: 1.5rem auto 0;
    background-color: var(--color-blue-deep);
    opacity: 0.4;
}

.subtitle-legal {
    font-size: 1rem;
    line-height: 1.75;
    margin-bottom: 1.4rem;
    text-align: justify;
    color: var(--text-muted-light);
}

.legal-content {
    flex: 1;
    background-color: #ffffff;
    max-width: 900px;
    margin: 5rem auto;
    border-radius: 0 0 20px 20px;
    padding: 100px 5%;
}

/* COOKIES */
.cookie-bar {
    position: fixed;
    bottom: -100px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--bg-dark);
    color: var(--color-blanco);
    padding: 15px 25px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    gap: 30px;
    z-index: 10000;
    border: 1px solid var(--color-secondary);
    box-shadow: var(--shadow-dark-card);
    width: 90%;
    max-width: 600px;
    transition: bottom 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    font-size: 0.85rem;
}

.cookie-bar.show {
    bottom: 30px;
}

.cookie-content {
    display: flex;
    align-items: center;
    gap: 15px;
}

.cookie-content i {
    color: var(--color-principal);
    font-size: 1.2rem;
}

.cookie-content p {
    font-size: 0.85rem;
    line-height: 1.4;
    margin: 0;
}

.btn-cookie {
    background: var(--color-principal);
    color: var(--bg-dark);
    border: none;
    padding: 10px 20px;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 800;
    font-size: 0.75rem;
    transition: all 0.3s ease;
    flex-shrink: 0;
}

.btn-cookie:hover {
    background: var(--color-blanco);
    box-shadow: 0 0 15px var(--color-principal);
}

@keyframes pulse-whatsapp {
    0% { box-shadow: 0 0 0 0 rgba(57, 255, 154, 0.7); }
    70% { box-shadow: 0 0 0 20px rgba(57, 255, 154, 0); }
    100% { box-shadow: 0 0 0 0 rgba(57, 255, 154, 0); }
}

/* ==== TABLET ==== */
@media (max-width: 1024px) {
    .main-header {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 20px;
        /* position: relative; */
    }

    .logo, .header-actions {
        flex: 1;
    }

    .header-urgencia {
        flex: 2;
        display: flex;
        justify-content: center;
        margin: 0;
        order: 1;
    }

    .header-actions {
        order: 2;
        display: flex;
        justify-content: flex-end;
        align-items: center;
        gap: 15px;
    }

    .btn-urgencias {
        order: 1;
        padding: 10px 18px;
        font-size: 0.8rem;
        width: auto;
        min-width: 120px;
    }

    .menu-toggle {
        display: flex;
        order: 2;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        left: 0;
        width: 100%;
        background: var(--bg-mid);
        flex-direction: column;
        gap: 0;
        max-height: 0;
        visibility: hidden;
        opacity: 0;
        overflow: hidden;
        transition: all 0.4s ease-in-out;
        box-shadow: 0 15px 30px rgba(0, 0, 0, 0.1);
        border-top: 2px solid var(--color-principal);
    }

    .nav-menu.active {
        max-height: 450px;
        visibility: visible;
        opacity: 1;
        padding: 10px 0;
    }

    .nav-link {
        width: 100%;
        text-align: center;
        padding: 18px;
        color: var(--color-blanco);
        border-bottom: 1px solid rgba(255, 255, 255, 0.05);
        font-size: 1rem;
    }
}

/* ==== MÓVIL ==== */
@media (max-width: 780px) {
    .logo { 
        flex: 1;
        display: flex;
        justify-content: flex-start;
    }
    .logo-img { height: 70px; }

    .footer-container {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 50px;
    }

    .footer-col {
        width: 100%;
        align-items: center;
    }

    .footer-items {
        align-items: flex-start;
        margin: 0 auto;
        min-width: 200px;
    }

    .footer-title {
        font-size: 1.1rem;
        margin-bottom: 20px;
    }

    .footer-primary {
        padding: 50px 10%;
    }

    .footer-secondary-container {
        flex-direction: row;
        justify-content: space-between;
        gap: 6px;
    }

    .credits {
        order: 2;
        width: 100%;
        text-align: left;
    }

    .legal-links {
        order: 1;
        width: 100%;
        justify-content: flex-end;
        border-bottom: 1px solid rgba(255, 255, 255, 0.1);
        padding-bottom: 5px;
    }

    .floating-whatsapp {
        bottom: 20px;
        right: 20px;
    }

    .floating-whatsapp a {
        width: 50px;
        height: 50px;
    }

    .floating-whatsapp i {
        font-size: 28px;
    }

    .cookie-bar {
        padding: 10px 15px;
        gap: 15px;
        border-radius: 12px;
        width: 95%;
        bottom: -120px;
    }

    .cookie-bar.show {
        bottom: 15px;
    }

    .cookie-content i {
        font-size: 1rem;
    }

    .cookie-content p {
        font-size: 0.75rem;
        line-height: 1.3;
    }

    .btn-cookie {
        padding: 8px 12px;
        font-size: 0.7rem;
        letter-spacing: 0;
    }
}