/* ==========================================================================
   CONFIGURACIÓN GLOBAL Y VARIABLES (Modern White/Dark + Corporate Blue)
   ========================================================================== */
:root {
    /* Paleta Principal */
    --primary-blue: #7BC5E9;
    --primary-blue-hover: #5BA8D0;
    --secondary: #1a1a1a;

    /* Fondos */
    --bg-light: #FCFCFC;
    --bg-alt: #F3F4F6;
    --bg-dark: #111827;

    /* Textos */
    --text-main: #333333;
    --text-muted: #6B7280;
    --text-light: #F9FAFB;

    /* Efectos & Bordes */
    --glass-bg: rgba(255, 255, 255, 0.85);
    --glass-border: rgba(255, 255, 255, 0.2);
    --shadow-sm: 0 4px 6px rgba(0, 0, 0, 0.05);
    --shadow-md: 0 10px 15px rgba(0, 0, 0, 0.08);
    --shadow-lg: 0 20px 25px rgba(0, 0, 0, 0.1);

    /* Layout */
    --max-width: 1200px;
    --nav-height: 80px;
}

/* Base Reset */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    font-family: 'Inter', sans-serif;
    color: var(--text-main);
    background-color: var(--bg-light);
    line-height: 1.6;
}

/* ==========================================================================
   TIPOGRAFÍA Y UTILIDADES
   ========================================================================== */
h1,
h2,
h3,
h4,
.logo {
    font-weight: 700;
    letter-spacing: -0.03em;
    line-height: 1.2;
}

h2,
h3,
h4,
.logo {
    color: var(--secondary);
}

h1 {
    font-size: clamp(2.5rem, 5vw, 4rem);
}

h2 {
    font-size: clamp(2rem, 4vw, 3rem);
}

a {
    text-decoration: none;
    color: inherit;
    transition: all 0.3s ease;
}

.container {
    width: 90%;
    max-width: var(--max-width);
    margin: 0 auto;
}

.text-center {
    text-align: center;
}

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

.bg-light {
    background-color: var(--bg-alt);
}

.mt-4 {
    margin-top: 2rem;
}

/* Botones Premium */
.btn {
    display: inline-block;
    padding: 0.8rem 1.8rem;
    font-weight: 600;
    border-radius: 8px;
    cursor: pointer;
    transition: transform 0.2s, box-shadow 0.2s, background 0.3s;
    text-align: center;
}

.btn:hover {
    transform: translateY(-2px);
}

.btn-primary {
    background-color: var(--primary-blue);
    color: white;
    border: 2px solid var(--primary-blue);
    box-shadow: 0 4px 14px rgba(0, 86, 179, 0.3);
}

.btn-primary:hover {
    background-color: var(--primary-blue-hover);
    box-shadow: 0 6px 20px rgba(0, 86, 179, 0.4);
}

.btn-outline {
    background-color: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    color: white;
    border: 2px solid white;
}

.btn-outline:hover {
    background-color: white;
    color: var(--secondary);
}

.btn-lg {
    padding: 1rem 2rem;
    font-size: 1.1rem;
}

.btn-block {
    width: 100%;
    display: block;
    font-size: 1rem;
}

/* Efecto Glassmorphism Premium */
.glass-panel {
    background: var(--glass-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border: 1px solid var(--glass-border);
    box-shadow: var(--shadow-md);
    border-radius: 16px;
    padding: 2.5rem;
}

/* ==========================================================================
   NAVEGACIÓN (HEADER)
   ========================================================================== */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    height: var(--nav-height);
    background: transparent;
    transition: all 0.3s ease;
    z-index: 1000;
}

.navbar.scrolled {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    box-shadow: var(--shadow-sm);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 100%;
}

.logo {
    display: flex;
    align-items: center;
    gap: 12px;
    color: white;
    transition: color 0.3s;
}

.navbar.scrolled .logo {
    color: var(--secondary);
}

.logo-icon {
    width: 45px;
    height: auto;
    color: white;
    transition: color 0.3s;
}

.navbar.scrolled .logo-icon {
    color: var(--secondary);
}

.logo-text {
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 0.95rem;
    line-height: 1.1;
    letter-spacing: 0.5px;
    text-align: left;
}

.logo-text span {
    color: var(--primary-blue);
    font-size: 1.2rem;
    font-weight: 900;
}

.nav-links a {
    margin-left: 2rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.9);
}

.navbar.scrolled .nav-links a {
    color: var(--text-main);
}

.navbar.scrolled .nav-links a.btn-primary {
    color: white;
}

.nav-links a:hover {
    color: var(--primary-blue);
}

/* Menu Movil Toggler */
.mobile-toggle {
    display: none;
    background: none;
    border: none;
    cursor: pointer;
    flex-direction: column;
    gap: 5px;
    position: relative;
    z-index: 1001;
}

.mobile-toggle span {
    width: 25px;
    height: 3px;
    background-color: white;
    transition: 0.3s;
}

.navbar.scrolled .mobile-toggle span {
    background-color: var(--secondary);
}

/* ==========================================================================
   HERO SECTION
   ========================================================================== */
.hero {
    position: relative;
    min-height: 100vh;
    /* fallback para Android antiguo */
    min-height: 100dvh;
    /* dvh = "dynamic viewport height" — descuenta la barra del navegador en Android */
    display: flex;
    align-items: center;
    color: white;
    padding-top: var(--nav-height);
    padding-bottom: 5rem;
    /* espacio extra en la parte inferior para Android */
}

/* Fondo oscuro elegante o imagen */
.hero-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    /* Overlay semi-oscuro para resaltar el texto blanco sobre la foto exterior de la casa */
    background: linear-gradient(135deg, rgba(15, 20, 30, 0.75) 0%, rgba(30, 45, 60, 0.65) 100%),
        url('https://images.unsplash.com/photo-1600585154340-be6161a56a0c?q=80&w=2000&auto=format&fit=crop') center/cover;
    z-index: -1;
}

.hero-content {
    max-width: 800px;
}

.badge {
    display: inline-block;
    padding: 0.4rem 1rem;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: white;
    border-radius: 30px;
    font-size: 0.9rem;
    font-weight: 500;
    margin-bottom: 1.5rem;
    backdrop-filter: blur(5px);
}

.gallery-filters {
    display: flex;
    justify-content: center;
    gap: 1rem;
    flex-wrap: wrap;
}

.gallery-filters .badge {
    cursor: pointer;
    transition: all 0.3s;
    background: transparent;
    color: var(--secondary);
    border: 1px solid var(--text-muted);
}

.gallery-filters .badge:hover,
.gallery-filters .badge.active {
    background: var(--primary-blue);
    color: white;
    border-color: var(--primary-blue);
}

@keyframes showItem {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 4/3;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s;
    animation: showItem 0.4s ease forwards;
}

.gallery-item.hide {
    display: none;
}

.hero h1 {
    color: #FFFFFF;
    text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}

.hero h1 span {
    color: var(--primary-blue);
    text-shadow: 0 0 15px rgba(123, 197, 233, 0.4);
}

.hero-subtitle {
    font-size: 1.2rem;
    color: #f3f4f6;
    margin: 1.5rem 0;
    max-width: 600px;
}

.value-props {
    display: flex;
    gap: 1.5rem;
    margin-bottom: 2.5rem;
    flex-wrap: wrap;
}

.prop {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    font-size: 1rem;
}

.hero-ctas {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* ==========================================================================
   SECCIONES COMUNES
   ========================================================================== */
.section {
    padding: 6rem 0;
}

.section-title {
    margin-bottom: 1rem;
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 4px;
    background-color: var(--primary-blue);
    border-radius: 2px;
}

.section-subtitle {
    color: var(--text-muted);
    font-size: 1.1rem;
    margin-bottom: 4rem;
}

/* ==========================================================================
   SERVICIOS
   ========================================================================== */
.grid-services {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
}

.service-card {
    transition: transform 0.3s;
}

.service-card:hover {
    transform: translateY(-10px);
}

.service-icon {
    font-size: 3rem;
    margin-bottom: 1.5rem;
}

.service-card h3 {
    margin-bottom: 1rem;
    font-size: 1.4rem;
}

.service-card p {
    color: var(--text-muted);
}

/* ==========================================================================
   PROYECTOS (GALERÍA CURADA)
   ========================================================================== */
.gallery-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 1.5rem;
}

.gallery-item {
    border-radius: 12px;
    overflow: hidden;
    position: relative;
    aspect-ratio: 4/3;
    box-shadow: var(--shadow-sm);
    transition: box-shadow 0.3s;
}

.gallery-item:hover {
    box-shadow: var(--shadow-lg);
}

.gallery-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    transition: transform 0.5s ease;
    display: block;
}

.gallery-item:hover .gallery-img {
    transform: scale(1.05);
}



/* ==========================================================================
   TESTIMONIOS
   ========================================================================== */
#testimonios {
    background: linear-gradient(135deg, var(--bg-alt) 0%, white 100%);
    position: relative;
    overflow: hidden;
}

#testimonios::before {
    content: '';
    position: absolute;
    top: -50px;
    right: -50px;
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--primary-blue) 0%, transparent 70%);
    opacity: 0.05;
    border-radius: 50%;
}

.testimonials-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: 2.5rem;
    position: relative;
    z-index: 1;
}

.testimonial-card {
    background: white;
    border-radius: 20px;
    padding: 3rem 2rem 2rem;
    position: relative;
    text-align: left;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    border: 1px solid rgba(0, 0, 0, 0.03);
    transition: transform 0.4s ease, box-shadow 0.4s ease;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.testimonial-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.quote-icon {
    position: absolute;
    top: 15px;
    right: 25px;
    font-size: 5rem;
    font-family: Georgia, serif;
    color: var(--primary-blue);
    opacity: 0.15;
    line-height: 1;
}

.testimonial-card .stars {
    font-size: 1.1rem;
    margin-bottom: 1.2rem;
    letter-spacing: 2px;
}

.testimonial-card .review {
    font-style: italic;
    color: var(--text-muted);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 2rem;
    flex-grow: 1;
}

.author-info {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: auto;
    border-top: 1px solid var(--bg-alt);
    padding-top: 1.5rem;
}

.author-avatar {
    width: 50px;
    height: 50px;
    background: var(--bg-dark);
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Orbitron', sans-serif;
    font-weight: 700;
    font-size: 1.2rem;
    background: linear-gradient(135deg, var(--primary-blue), var(--primary-blue-hover));
}

.author-details {
    display: flex;
    flex-direction: column;
}

.author-details strong {
    color: var(--secondary);
    font-size: 1rem;
}

.author-details span {
    font-size: 0.85rem;
    color: var(--text-muted);
}

/* ==========================================================================
   CONTACTO
   ========================================================================== */
.contact-section {
    background: linear-gradient(to right, white, var(--bg-alt));
}

.contact-header {
    text-align: left;
    margin-bottom: 2rem;
}

.contact-header h2 {
    margin-bottom: 0.75rem;
}

.contact-header p {
    color: var(--text-muted);
    font-size: 1.05rem;
}

.flex-box {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.contact-info h2 {
    margin-bottom: 1rem;
}

.contact-info p {
    color: var(--text-muted);
    margin-bottom: 2rem;
}

.contact-details p {
    color: var(--text-main);
    margin-bottom: 0.5rem;
    font-size: 1.1rem;
}

.form-group {
    margin-bottom: 1.5rem;
}

.form-group label {
    display: block;
    margin-bottom: 0.5rem;
    font-weight: 600;
    color: var(--secondary);
}

.form-group input:not([type="checkbox"]),
.form-group textarea {
    width: 100%;
    padding: 0.8rem 1rem;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    font-family: inherit;
    font-size: 1rem;
    transition: border-color 0.3s;
    background: white;
}

.checkbox-group {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    text-align: left;
    margin-bottom: 1.5rem;
}

.checkbox-group input[type="checkbox"] {
    width: 18px;
    height: 18px;
    min-width: 18px;
    margin-top: 2px;
    accent-color: var(--primary-blue);
    cursor: pointer;
}

.checkbox-group label {
    font-size: 0.9rem;
    font-weight: 400;
    color: var(--text-muted);
    margin-bottom: 0;
    cursor: pointer;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--primary-blue);
    box-shadow: 0 0 0 3px rgba(0, 86, 179, 0.1);
}

/* ==========================================================================
   FOOTER
   ========================================================================== */
footer {
    background-color: var(--bg-dark);
    color: var(--text-light);
    padding: 4rem 0 2rem;
}

.footer-logo {
    font-family: 'Orbitron', sans-serif;
    color: white;
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.footer-logo span {
    color: var(--primary-blue);
}

.footer-links {
    margin: 2rem 0;
}

.footer-links a {
    color: var(--text-muted);
    margin: 0 1rem;
}

.footer-links a:hover {
    color: white;
}

.copyright {
    color: var(--text-muted);
    font-size: 0.9rem;
    margin-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    padding-top: 2rem;
}

/* ==========================================================================
   BOTÓN WHATSAPP FLOTANTE
   ========================================================================== */
.whatsapp-float {
    position: fixed;
    width: 55px;
    height: 55px;
    bottom: 70px;
    right: 30px;
    background-color: #25d366;
    border-radius: 50px;
    box-shadow: var(--shadow-md);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
}

.whatsapp-float:hover {
    transform: scale(1.1);
    box-shadow: var(--shadow-lg);
}

.wa-icon {
    width: 35px;
    height: 35px;
}

/* ==========================================================================
   ANIMACIONES SCROLL
   ========================================================================== */
.fade-in {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

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

/* ==========================================================================
   RESPONSIVO / MOBILE
   ========================================================================== */
@media (max-width: 992px) {
    .flex-box {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    /* Catálogo: una columna en tablet */
    #catalogos .grid-services {
        flex-direction: column !important;
        align-items: center;
    }

    #catalogos .service-card {
        max-width: 100% !important;
        width: 100%;
    }
}

@media (max-width: 768px) {
    h1 {
        font-size: 2.5rem;
    }

    h2 {
        font-size: 2rem;
    }

    /* Evitar scroll horizontal sin romper IntersectionObserver */
    /* NOTA: header excluido — backdrop-filter en navbar.scrolled crea un containing block
       que atrapa los hijos position:fixed (nav-links), rompiendo el menú móvil */
    main,
    footer,
    section {
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* Fallback: mostrar secciones aunque el observer no dispare (iOS Safari) */
    .fade-in {
        opacity: 1;
        transform: none;
    }

    /* Botones cookie banner: no ancho completo en móvil */
    .cookie-buttons .btn {
        width: auto;
        padding: 0.5rem 1rem;
        font-size: 0.85rem;
    }

    .cookie-content p {
        font-size: 0.8rem;
        min-width: unset;
    }

    .value-props {
        flex-direction: column;
        gap: 1rem;
    }

    .hero-ctas {
        flex-direction: column;
        width: 100%;
    }

    .btn {
        width: 100%;
    }

    .testimonials-grid {
        grid-template-columns: 1fr;
    }

    /* Contacto: formulario primero en móvil */
    .contact-form {
        order: -1;
    }

    /* Menú inferior y botones */
    .whatsapp-float {
        width: 50px;
        height: 50px;
        bottom: 40px;
        right: 15px;
    }

    .wa-icon {
        width: 100%;
        height: 100%;
    }

    /* Catálogo: ancho completo en móvil */
    #catalogos .grid-services {
        flex-direction: column !important;
        align-items: stretch;
    }

    #catalogos .service-card {
        max-width: 100% !important;
        width: 100%;
    }

    /* Mobile Menu */
    .mobile-toggle {
        display: flex;
        z-index: 1001;
    }

    .nav-links {
        display: flex;
        position: fixed;
        top: 0;
        right: -100%;
        width: 80%;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transition: right 0.4s ease;
        box-shadow: -10px 0 20px rgba(0, 0, 0, 0.1);
        padding: 2rem;
        z-index: 1000;
    }

    .nav-links.active {
        right: 0;
    }

    .nav-links a {
        color: var(--text-main) !important;
        margin: 1.5rem 0;
        font-size: 1.2rem;
    }

    /* X siempre visible aunque no haya scroll: oscurecer barras cuando el menú está abierto */
    .nav-links.active~* .mobile-toggle span,
    .mobile-toggle.open span {
        background-color: var(--secondary) !important;
    }
}

/* --- Cookie Banner --- */
.cookie-banner {
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    background: var(--bg-dark);
    color: var(--white);
    padding: 1.5rem;
    z-index: 9999;
    display: none;
    box-shadow: 0 -5px 15px rgba(0, 0, 0, 0.1);
}

.cookie-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.cookie-content p {
    flex: 1;
    min-width: 300px;
    margin: 0;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.cookie-buttons {
    display: flex;
    gap: 0.5rem;
    flex-wrap: wrap;
}

@media (max-width: 768px) {
    .cookie-banner {
        padding: 1rem;
    }

    .cookie-content {
        flex-direction: column;
        align-items: flex-start;
        gap: 0.75rem;
    }

    .cookie-content p {
        font-size: 0.78rem;
        min-width: unset;
        margin: 0;
    }

    .cookie-buttons .btn {
        width: auto !important;
        padding: 0.45rem 0.9rem;
        font-size: 0.82rem;
    }
}