/* ==========================================================================
   VARIABLES CORPORATIVAS
   ========================================================================== */

:root {
    --azul-oscuro: #004170;
    --azul-brillante: #007CC2;
    --verde-accion: #00C897;
    --verde-oscuro: #009E77;
    --cian-brillante: #00E5FF;
    --blanco: #FAFCFF;
    --gris-claro: #F0F4F8;
    --texto: #333;
}


/* ==========================================================================
   RESET Y BASE
   ========================================================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

html {
    scroll-behavior: smooth;
}

body {
    background-color: var(--blanco);
    color: var(--texto);
    line-height: 1.6;
}

.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 20px;
}


/* ==========================================================================
   NAVEGACIÓN (Efecto Cristal Dinámico e i18n)
   ========================================================================== */

.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    background: transparent;
    z-index: 3000;
    padding: 15px 0;
    transition: all 0.4s ease;
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: bold;
    font-size: 1.2rem;
    text-transform: uppercase;
}

.logo span {
    color: var(--blanco);
    transition: color 0.4s ease;
}

.logo img {
    height: 70px;
    filter: brightness(0) invert(1);
    transition: filter 0.4s ease;
}

.nav-links {
    display: flex;
    list-style: none;
    gap: 20px;
    margin: 0;
    padding: 0;
    align-items: center;
}

.nav-links a {
    color: var(--blanco);
    font-weight: 600;
    text-decoration: none;
    transition: all 0.4s ease;
}


/* ScrollSpy Effect */

.nav-links a.active {
    color: var(--azul-brillante);
    border-bottom: 2px solid var(--azul-brillante);
    padding-bottom: 5px;
}

.hamburger {
    display: none;
    cursor: pointer;
    z-index: 3500;
}

.hamburger div {
    width: 25px;
    height: 3px;
    background-color: var(--blanco);
    margin: 5px;
    transition: all 0.4s ease;
}


/* --- Selector de Idiomas --- */

.lang-selector {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-left: 15px;
    background: rgba(255, 255, 255, 0.1);
    padding: 5px 12px;
    border-radius: 20px;
    backdrop-filter: blur(5px);
}

.lang-btn {
    background: none;
    border: none;
    color: var(--blanco);
    font-weight: 600;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.2s;
    font-size: 0.95rem;
    padding: 0;
}

.lang-btn:hover {
    transform: scale(1.1);
}

.lang-btn.active {
    color: var(--verde-accion);
    text-shadow: 0 0 8px rgba(0, 200, 151, 0.4);
}

.lang-sep {
    color: var(--blanco);
    opacity: 0.5;
    user-select: none;
}


/* Estado de navegación con scroll */

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.9);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 15px 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.navbar.scrolled .logo span,
.navbar.scrolled .nav-links a {
    color: var(--azul-oscuro);
}

.navbar.scrolled .logo img {
    filter: none;
}

.navbar.scrolled .hamburger div {
    background-color: var(--azul-oscuro);
}

.navbar.scrolled .nav-links a:hover,
.navbar.scrolled .nav-links a.active {
    color: var(--verde-accion);
    border-bottom: 3px solid var(--verde-accion);
    padding-bottom: 5px;
}

.navbar.scrolled .lang-selector {
    background: rgba(0, 65, 112, 0.05);
}

.navbar.scrolled .lang-btn,
.navbar.scrolled .lang-sep {
    color: var(--azul-oscuro);
}

.navbar.scrolled .lang-btn.active {
    color: var(--verde-accion);
    text-shadow: none;
}


/* ==========================================================================
   SECCIÓN 1: INICIO (Hero con efecto Ken Burns)
   ========================================================================== */

.hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: var(--blanco);
    padding-top: 60px;
    overflow: hidden;
}

.hero::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: url('https://images.unsplash.com/photo-1497366216548-37526070297c?auto=format&fit=crop&w=1920&q=80');
    background-size: cover;
    background-position: center;
    z-index: 0;
    animation: zoomHero 25s infinite alternate linear;
}

.hero::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(5, 15, 25, 0.85), rgba(0, 65, 112, 0.65));
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    padding: 0 20px;
}

@keyframes zoomHero {
    0% {
        transform: scale(1.0);
    }
    100% {
        transform: scale(1.1);
    }
}

.hero h1 {
    font-size: 3.8rem;
    margin-bottom: 1rem;
    letter-spacing: 2px;
    text-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
}

.hero-description {
    max-width: 800px;
    margin: 0 auto 35px auto;
    font-size: 1.15rem;
    line-height: 1.8;
    color: #E2E8F0;
    text-shadow: 0 2px 5px rgba(0, 0, 0, 0.8);
}


/* ==========================================================================
   BOTONES
   ========================================================================== */

.btn-primary,
.btn-submit {
    display: inline-block;
    background: linear-gradient(135deg, var(--verde-oscuro), var(--verde-accion));
    color: #FAFCFF;
    padding: 15px 30px;
    text-decoration: none;
    border: none;
    border-radius: 50px;
    font-weight: bold;
    margin-top: 20px;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 200, 151, 0.4);
    transition: transform 0.3s, box-shadow 0.3s;
}

.btn-primary:hover,
.btn-submit:hover {
    transform: translateY(-3px) scale(1.02);
    box-shadow: 0 8px 25px rgba(0, 200, 151, 0.6);
}


/* ==========================================================================
   SECCIÓN: POR QUÉ ELEGIRNOS
   ========================================================================== */

.why-us {
    padding: 80px 0;
    background: var(--blanco) !important;
    position: relative;
    overflow: hidden;
}

.why-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 40px;
    text-align: center;
}

.why-card {
    padding: 30px 20px;
    background: #FFFFFF;
    border-radius: 12px;
    border: 1px solid rgba(0, 65, 112, 0.05);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    z-index: 2;
}

.why-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 15px 40px rgba(0, 65, 112, 0.08);
}

.why-icon {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.why-icon svg {
    width: 55px;
    height: 55px;
    color: var(--azul-brillante);
    filter: drop-shadow(0 4px 6px rgba(0, 124, 194, 0.25));
    transition: transform 0.4s ease, color 0.4s ease, filter 0.4s ease;
}

.why-card:hover .why-icon svg {
    transform: scale(1.15) translateY(-5px);
    color: var(--verde-accion);
    filter: drop-shadow(0 6px 10px rgba(0, 200, 151, 0.35));
}

.why-card h3 {
    color: var(--azul-oscuro);
    margin-bottom: 15px;
    font-size: 1.5rem;
}

.why-card p {
    color: var(--texto);
    font-size: 1.05rem;
}


/* ==========================================================================
   SECCIÓN: SERVICIOS
   ========================================================================== */

.services {
    padding: 80px 0;
    background: var(--gris-claro);
    overflow: hidden;
    position: relative;
}

.section-title {
    text-align: center;
    color: var(--azul-oscuro);
    margin-bottom: 70px;
    font-size: 2.5rem;
}

.services-vertical {
    display: flex;
    flex-direction: column;
    gap: 70px;
}

.service-item {
    display: flex;
    align-items: center;
    gap: 50px;
    padding: 30px;
    background: transparent;
    border: none;
    box-shadow: none;
}

.service-item:nth-child(even) {
    flex-direction: row-reverse;
}

.service-content {
    flex: 1;
    opacity: 0;
    transition: transform 1.2s ease-out, opacity 1.2s ease-out;
}

.service-item:nth-child(odd) .service-content {
    transform: translateX(-150px);
}

.service-item:nth-child(even) .service-content {
    transform: translateX(150px);
}

.service-content h3 {
    color: var(--azul-oscuro);
    margin-bottom: 15px;
    font-size: 1.8rem;
}

.service-content p {
    font-size: 1.1rem;
    color: var(--texto);
}

.service-image {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    opacity: 0;
    transition: transform 1.2s ease-out, opacity 1.2s ease-out;
}

.service-item:nth-child(odd) .service-image {
    transform: translateX(150px);
}

.service-item:nth-child(even) .service-image {
    transform: translateX(-150px);
}

.aesthetic-image {
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 0;
    background: none;
    overflow: hidden;
    width: 100%;
}

.photo-box {
    width: 100%;
    max-width: 500px;
    height: 320px;
    border-radius: 12px;
    border: none;
    background-size: cover;
    background-position: center;
    position: relative;
    filter: drop-shadow(0 15px 30px rgba(0, 124, 194, 0.15));
    transition: filter 0.5s ease;
    z-index: 1;
}

.photo-box::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    border-radius: 12px;
    background: rgba(0, 124, 194, 0.3);
}

.service-item:hover .photo-box {
    filter: drop-shadow(0 15px 40px rgba(0, 124, 194, 0.2));
}

.photo-community {
    background-image: url('https://images.unsplash.com/photo-1464082354059-27db6ce50048?auto=format&fit=crop&w=400&q=80');
}

.photo-office {
    background-image: url('https://images.unsplash.com/photo-1497366811353-6870744d04b2?auto=format&fit=crop&w=400&q=80');
}

.photo-home {
    background-image: url('https://images.unsplash.com/photo-1556912173-3bb406ef7e77?auto=format&fit=crop&w=300&q=80');
}

.photo-sociedad {
    background-image: url('../media/sociedad.jpeg');
}

.service-item.is-active .service-content,
.service-item.is-active .service-image {
    opacity: 1;
    transform: translateX(0);
}


/* ==========================================================================
   SECCIÓN: CONTACTO
   ========================================================================== */

.contact {
    padding: 80px 0;
    background-color: var(--blanco) !important;
    position: relative;
    overflow: hidden;
}

.contact-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 50px;
}

.contact-info {
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.contact-form {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.input-group {
    display: flex;
    flex-direction: column;
    margin-bottom: 5px;
}

.contact-form input,
.contact-form select,
.contact-form textarea {
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 5px;
    outline: none;
    transition: border-color 0.3s;
    width: 100%;
}

.error-text {
    color: #e74c3c;
    font-size: 0.85rem;
    margin-top: 5px;
    display: none;
    padding-left: 5px;
}

.input-error {
    border-color: #e74c3c !important;
    background-color: #fdf5f5;
}


/* ==========================================================================
   ELEMENTOS GLOBALES Y EFECTOS
   ========================================================================== */

footer {
    background: var(--azul-oscuro);
    color: white;
    text-align: center;
    padding: 20px 0;
}

.custom-alert {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 65, 112, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
    opacity: 1;
    transition: opacity 0.3s ease;
}

.custom-alert.hidden {
    opacity: 0;
    pointer-events: none;
}

.alert-content {
    background: var(--blanco);
    padding: 40px;
    border-radius: 10px;
    text-align: center;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
    max-width: 450px;
    width: 90%;
    transform: translateY(0) scale(1);
    transition: transform 0.3s ease;
}

.custom-alert.hidden .alert-content {
    transform: translateY(50px) scale(0.9);
}

.alert-icon {
    font-size: 4rem;
    margin-bottom: 15px;
}

.alert-content h3 {
    color: var(--azul-oscuro);
    font-size: 1.8rem;
    margin-bottom: 10px;
}

.alert-content p {
    color: var(--texto);
    font-size: 1.1rem;
}

.whatsapp-float {
    position: fixed;
    width: 60px;
    height: 60px;
    bottom: 30px;
    right: 30px;
    background-color: #25D366;
    border-radius: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.2);
    z-index: 1000;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.whatsapp-float img {
    width: 35px;
    height: 35px;
}

.whatsapp-float:hover {
    transform: scale(1.1) translateY(-5px);
    box-shadow: 2px 5px 20px rgba(0, 0, 0, 0.3);
}

.bubbles {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    overflow: hidden;
    pointer-events: none;
}

.bubble {
    position: absolute;
    border-radius: 50%;
    background-color: rgba(0, 124, 194, 0.1);
    border: 1px solid rgba(0, 124, 194, 0.15);
    animation: floatBubbles 15s infinite ease-in-out;
    opacity: 0;
}

.bubble::after {
    content: '';
    position: absolute;
    top: 20%;
    left: 20%;
    width: 30%;
    height: 30%;
    background: rgba(255, 255, 255, 0.3);
    border-radius: 50%;
}

@keyframes floatBubbles {
    0% {
        transform: translateY(0) translateX(0);
        opacity: 0;
    }
    10% {
        opacity: 1;
    }
    80% {
        opacity: 1;
    }
    100% {
        transform: translateY(-120vh) translateX(50px);
        opacity: 0;
    }
}

#por-que-elegirnos .bubble:nth-child(1) {
    width: 50px;
    height: 50px;
    left: 15%;
    animation-delay: 0s;
}

#por-que-elegirnos .bubble:nth-child(2) {
    width: 30px;
    height: 30px;
    left: 45%;
    animation-delay: 3s;
    animation-duration: 12s;
}

#por-que-elegirnos .bubble:nth-child(3) {
    width: 45px;
    height: 45px;
    left: 80%;
    animation-delay: 6s;
}

#servicios .bubble:nth-child(1) {
    width: 60px;
    height: 60px;
    left: 10%;
    animation-delay: 1s;
    animation-duration: 18s;
}

#servicios .bubble:nth-child(2) {
    width: 25px;
    height: 25px;
    left: 30%;
    animation-delay: 4s;
}

#servicios .bubble:nth-child(3) {
    width: 40px;
    height: 40px;
    left: 60%;
    animation-delay: 2s;
    animation-duration: 13s;
}

#servicios .bubble:nth-child(4) {
    width: 35px;
    height: 35px;
    left: 85%;
    animation-delay: 7s;
}

#contacto .bubble:nth-child(1) {
    width: 55px;
    height: 55px;
    left: 20%;
    animation-delay: 0.5s;
}

#contacto .bubble:nth-child(2) {
    width: 30px;
    height: 30px;
    left: 70%;
    animation-delay: 5s;
    animation-duration: 14s;
}

.relative-z {
    position: relative;
    z-index: 2;
}

.with-pattern {
    position: relative;
    background-color: #FAFCFF;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='4' height='4' viewBox='0 0 4 4'%3E%3Cpath fill='%23007cc2' fill-opacity='0.03' d='M1 3h1v1H1V3zm2-2h1v1H3V1z'%3E%3C/path%3E%3C/svg%3E");
    background-repeat: repeat;
}

.separator {
    position: relative;
    width: 100%;
    line-height: 0;
    z-index: 10;
}

.separator-top {
    top: 1px;
}

.separator-bottom {
    bottom: 1px;
}

.separator svg {
    position: relative;
    display: block;
    width: calc(100% + 1.3px);
    height: 100px;
}

.separator-top .shape-fill {
    fill: var(--gris-claro);
}

.separator-bottom .shape-fill {
    fill: var(--blanco);
}

.why-us::before,
.contact::before {
    content: '';
    position: absolute;
    top: -100px;
    left: -100px;
    width: 400px;
    height: 400px;
    background: radial-gradient(circle, rgba(0, 229, 255, 0.05) 0%, rgba(250, 252, 255, 0) 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}

.why-us::after,
.contact::after {
    content: '';
    position: absolute;
    bottom: -150px;
    right: -100px;
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, rgba(0, 65, 112, 0.03) 0%, rgba(250, 252, 255, 0) 70%);
    border-radius: 50%;
    z-index: 0;
    pointer-events: none;
}


/* ==========================================================================
   MEDIA QUERIES (Móviles y Tablets)
   ========================================================================== */

@media (max-width: 768px) {
    body {
        overflow-x: hidden;
    }
    /* 1. FORZAMOS QUE LA BARRA TENGA FONDO DESDE EL PRINCIPIO EN MÓVIL */
    .navbar {
        background: rgba(255, 255, 255, 0.95) !important;
        backdrop-filter: blur(10px);
        padding: 10px 0 !important;
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
    }
    /* 2. HACEMOS QUE EL LOGO Y EL BOTÓN HAMBURGUESA SEAN SIEMPRE OSCUROS */
    .navbar .logo span {
        color: var(--azul-oscuro) !important;
    }
    .navbar .logo img {
        filter: none !important;
        height: 50px;
    }
    .navbar .hamburger div {
        background-color: var(--azul-oscuro) !important;
    }
    /* 3. MENU DESPLEGABLE Y SUS ENLACES */
    .nav-links {
        position: fixed;
        right: -100%;
        top: 0;
        height: 100vh;
        width: 70%;
        background-color: var(--blanco) !important;
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 40px;
        box-shadow: -5px 0 15px rgba(0, 0, 0, 0.1);
        transition: right 0.2s ease;
        z-index: 1500;
    }
    .navbar .nav-links a {
        color: var(--azul-oscuro) !important;
        font-weight: bold;
        opacity: 1 !important;
        visibility: visible !important;
    }
    .nav-links.nav-active {
        right: 0;
    }
    /* 4. SELECTOR DE IDIOMAS */
    .navbar .lang-selector {
        background: rgba(0, 65, 112, 0.05) !important;
        margin-left: 0;
        margin-top: -20px;
        padding: 10px 20px;
    }
    .navbar .lang-sep,
    .navbar .lang-btn {
        color: var(--azul-oscuro) !important;
    }
    .navbar .lang-btn.active {
        color: var(--verde-accion) !important;
        text-shadow: none !important;
    }
    .hamburger {
        display: block;
    }
    .toggle .line1 {
        transform: rotate(-45deg) translate(-5px, 6px);
    }
    .toggle .line2 {
        opacity: 0;
    }
    .toggle .line3 {
        transform: rotate(45deg) translate(-5px, -6px);
    }
    .hero h1 {
        font-size: 2.5rem;
    }
    .contact-container {
        grid-template-columns: 1fr;
    }
    .separator svg {
        height: 50px;
    }
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 20px;
        right: 20px;
    }
    .whatsapp-float img {
        width: 30px;
        height: 30px;
    }
    .service-item,
    .service-item:nth-child(even) {
        flex-direction: column;
        text-align: center;
        gap: 20px;
    }
    .service-item:nth-child(odd) .service-content,
    .service-item:nth-child(even) .service-content {
        transform: translateY(100px);
    }
    .service-item:nth-child(odd) .service-image,
    .service-item:nth-child(even) .service-image {
        transform: translateY(-100px);
    }
    .service-item.is-active .service-content,
    .service-item.is-active .service-image {
        transform: translateY(0);
    }
    .photo-box {
        height: 240px;
        border: 5px solid var(--blanco);
    }
    .faq-grid {
        grid-template-columns: 1fr;
    }
    .scroll-top-btn {
        width: 45px;
        height: 45px;
        bottom: 85px;
        right: 20px;
    }
}


/* --- ESTILOS SECCIÓN FAQS --- */

.faqs {
    padding: 80px 0;
    background-color: var(--gris-claro);
}

.faq-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 30px;
    margin-top: 40px;
}

.faq-card {
    background: var(--blanco);
    padding: 25px;
    border-radius: 12px;
    box-shadow: 0 4px 15px rgba(0, 65, 112, 0.05);
    transition: transform 0.3s ease;
    border-top: 4px solid var(--azul-brillante);
}

.faq-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 65, 112, 0.1);
}

.faq-question {
    margin-bottom: 12px;
    display: flex;
    align-items: flex-start;
}

.faq-question span {
    font-weight: bold;
    color: var(--azul-oscuro);
    display: block;
    margin-bottom: 10px;
    font-size: 1.15rem;
}

.faq-answer p {
    color: var(--texto);
    font-size: 1rem;
    line-height: 1.5;
}


/* --- ESTILOS CHECKBOX PRIVACIDAD --- */

.checkbox-group {
    margin-top: 10px;
    margin-bottom: 20px;
}

.privacy-label {
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 0.95rem;
    color: var(--texto);
    cursor: pointer;
}

.privacy-label input[type="checkbox"] {
    width: 20px;
    height: 20px;
    cursor: pointer;
    margin: 0;
    flex-shrink: 0;
}


/* ==========================================================================
   BOTÓN SCROLL TO TOP
   ========================================================================== */

.scroll-top-btn {
    position: fixed;
    bottom: 110px;
    right: 30px;
    width: 50px;
    height: 50px;
    background-color: var(--azul-oscuro);
    color: var(--blanco);
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 2px 2px 15px rgba(0, 0, 0, 0.2);
    cursor: pointer;
    z-index: 999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: all 0.3s ease;
}

.scroll-top-btn svg {
    width: 24px;
    height: 24px;
}

.scroll-top-btn:hover {
    background-color: var(--azul-brillante);
    transform: translateY(-5px);
    box-shadow: 2px 5px 20px rgba(0, 0, 0, 0.3);
}

.scroll-top-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}