:root {
    /* Paleta de Colores - Azul Eléctrico */
    --primary-50: #eff6ff;
    --primary-100: #dbeafe;
    --primary-200: #bfdbfe;
    --primary-300: #93c5fd;
    --primary-400: #60a5fa;
    --primary-500: #3b82f6;
    /* Color Principal */
    --primary-600: #2563eb;
    --primary-700: #1d4ed8;
    --primary-800: #1e40af;
    --primary-900: #1e3a8a;

    --bg-primary: #000000;
    --bg-secondary: #09090b;
    --bg-tertiary: #18181b;

    --text-primary: #ffffff;
    --text-secondary: #e4e4e7;
    --text-tertiary: #a1a1aa;

    /* Fuentes */
    --font-display: 'Plus Jakarta Sans', sans-serif;
    --font-body: 'Inter', sans-serif;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
}

body {
    background-color: var(--bg-primary);
    color: var(--text-primary);
    font-family: var(--font-body);
    overflow-x: hidden;
    line-height: 1.6;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-display);
    font-weight: 700;
    color: var(--text-primary);
}

/* --- Utilidades --- */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 24px;
}

.text-gradient {
    background: linear-gradient(135deg, var(--text-primary) 0%, var(--primary-300) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

.text-accent {
    color: var(--primary-400);
}

.section-padding {
    padding: 100px 0;
}

/* --- Botones --- */
.btn {
    display: inline-block;
    padding: 16px 32px;
    border-radius: 12px;
    font-weight: 600;
    text-decoration: none;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    font-family: var(--font-display);
}

.btn-primary {
    background: linear-gradient(135deg,
            var(--primary-600) 0%,
            var(--primary-500) 30%,
            var(--primary-400) 60%,
            var(--primary-500) 100%);
    background-size: 200% 200%;
    color: white;
    border: none;
    box-shadow:
        0 0 0 1px rgba(59, 130, 246, 0.5),
        0 4px 24px rgba(59, 130, 246, 0.4),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    animation: gradient-shift 4s ease infinite;
}

.btn-primary:hover {
    transform: translateY(-2px) scale(1.02);
    box-shadow:
        0 0 0 2px rgba(59, 130, 246, 0.8),
        0 8px 40px rgba(59, 130, 246, 0.6);
}

.btn-secondary {
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--text-secondary);
    backdrop-filter: blur(10px);
}

.btn-secondary:hover {
    background: rgba(255, 255, 255, 0.1);
    border-color: var(--text-primary);
    color: var(--text-primary);
}

/* --- Navbar --- */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 1000;
    padding: 24px 0;
    transition: all 0.3s ease;
    /* Efecto "frost" inicial si es deseado siempre, o solo al scroll */
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(10px);
}

.navbar.scrolled {
    background: rgba(0, 0, 0, 0.85);
    /* Más oscuro al scrollear */
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
    padding: 16px 0;
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.1);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* Oculto en desktop, visible solo en móvil via @media */
.hamburger {
    display: none;
}

.logo {
    font-size: 24px;
    font-weight: 800;
    font-family: var(--font-display);
    color: var(--text-primary);
    text-decoration: none;
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo span {
    color: var(--primary-500);
}

.nav-links {
    display: flex;
    gap: 32px;
}

.nav-link {
    color: var(--text-secondary);
    text-decoration: none;
    font-weight: 500;
    transition: color 0.3s ease;
    position: relative;
}

.nav-link:hover {
    color: var(--primary-400);
}

.nav-link::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -4px;
    left: 0;
    background-color: var(--primary-500);
    transition: width 0.3s ease;
}

.nav-link:hover::after {
    width: 100%;
}

/* --- Hero Section --- */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 160px;
    overflow: hidden;
    background: radial-gradient(circle at top right, rgba(59, 130, 246, 0.15) 0%, transparent 40%),
        radial-gradient(circle at bottom left, rgba(59, 130, 246, 0.1) 0%, transparent 40%);
}

.hero-content {
    flex: 1;
    position: relative;
    z-index: 2;
}

.hero-label {
    display: inline-block;
    padding: 8px 16px;
    background: rgba(59, 130, 246, 0.1);
    border: 1px solid rgba(59, 130, 246, 0.2);
    border-radius: 100px;
    color: var(--primary-400);
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 24px;
    letter-spacing: 0.05em;
    text-transform: uppercase;
}

.hero-title {
    font-size: 4rem;
    line-height: 1.1;
    margin-bottom: 24px;
    letter-spacing: -0.02em;
}

.hero-subtitle {
    font-size: 1.25rem;
    color: var(--text-secondary);
    margin-bottom: 40px;
    max-width: 600px;
}

.hero-visual {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    z-index: 1;
}

/* --- Hero Image Update --- */
.hero-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 600px;
    /* Ajusta según el tamaño de tu imagen */
    animation: float 6s ease-in-out infinite;
}

.hero-img {
    width: 100%;
    height: auto;
    display: block;
    position: relative;
    z-index: 2;
    filter: drop-shadow(0 20px 40px rgba(59, 130, 246, 0.3));
}

.hero-glow {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 80%;
    height: 80%;
    background: radial-gradient(circle, rgba(59, 130, 246, 0.4) 0%, transparent 70%);
    filter: blur(60px);
    z-index: 1;
}

/* --- Services Section (Flip Cards) --- */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 32px;
    margin-top: 60px;
}

.flip-card {
    background-color: transparent;
    height: 400px;
    perspective: 1000px;
    cursor: pointer;
    position: relative;
    /* Necesario para z-index */
    z-index: 1;
}

.flip-card:hover {
    z-index: 50 !important;
    /* Forzar elevación máxima */
}

.flip-card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    text-align: center;
    transition: transform 0.8s cubic-bezier(0.175, 0.885, 0.32, 1.275);
    transform-style: preserve-3d;
}

/* Fix z-index stacking during animation */
.flip-card:hover .flip-card-inner {
    transform: rotateY(180deg) scale(1.05);
}

.flip-card-front,
.flip-card-back {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    border-radius: 24px;
    overflow: hidden;
}

/* Updated Front Card for Images */
.flip-card-front {
    background-color: var(--bg-tertiary);
    /* Fallback */
    background-size: cover;
    background-position: center;
    border: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: 32px;
    position: relative;
}

/* Overlay para legibilidad sobre la imagen */
.flip-card-front::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.1) 0%,
            rgba(0, 0, 0, 0.6) 50%,
            rgba(0, 0, 0, 0.9) 100%);
    z-index: 1;
    transition: background 0.3s ease;
}

.flip-card:hover .flip-card-front::before {
    background: linear-gradient(to bottom,
            rgba(0, 0, 0, 0.3) 0%,
            rgba(0, 0, 0, 0.8) 100%);
}

.service-title-front {
    font-size: 1.5rem;
    text-align: left;
    margin: 0;
    position: relative;
    z-index: 2;
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.service-icon-front {
    font-size: 2rem;
    color: var(--primary-400);
    margin-bottom: auto;
    /* Push to top */
    align-self: flex-start;
    position: relative;
    z-index: 2;
    background: rgba(0, 0, 0, 0.5);
    padding: 12px;
    border-radius: 12px;
    backdrop-filter: blur(4px);
    border: 1px solid rgba(255, 255, 255, 0.1);
}


.flip-card-back {
    background: rgba(24, 24, 27, 0.95);
    border: 1px solid rgba(59, 130, 246, 0.3);
    transform: rotateY(180deg);
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 32px;
    text-align: left;
    box-shadow:
        0 0 30px rgba(59, 130, 246, 0.15),
        inset 0 0 20px rgba(59, 130, 246, 0.05);
}

.service-icon {
    font-size: 2rem;
    color: var(--primary-500);
    margin-bottom: 16px;
}

.service-desc {
    color: var(--text-secondary);
    font-size: 0.95rem;
    margin-bottom: 24px;
}

.feature-tag {
    display: inline-block;
    padding: 4px 12px;
    background: rgba(59, 130, 246, 0.15);
    color: var(--primary-300);
    border-radius: 100px;
    font-size: 0.75rem;
    font-weight: 600;
    margin-right: 8px;
    margin-bottom: 8px;
}

/* --- About Section --- */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: center;
}

.about-image-container {
    position: relative;
    border-radius: 24px;
    overflow: hidden;
    aspect-ratio: 4/5;
    background: var(--bg-tertiary);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(59, 130, 246, 0.2);
}

.about-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.5s ease;
}

.about-image-container:hover .about-photo {
    transform: scale(1.05);
}


/* --- Stats --- */
.stats-container {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 24px;
    margin-top: 40px;
    padding: 40px;
    background: rgba(255, 255, 255, 0.02);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.stat-item {
    text-align: center;
}

.stat-number {
    font-size: 3rem;
    font-weight: 800;
    color: var(--primary-500);
    display: block;
    margin-bottom: 8px;
}

.stat-label {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

/* --- Footer --- */
footer {
    background: var(--bg-secondary);
    padding: 80px 0 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 40px;
    margin-bottom: 60px;
}

.footer-brand p {
    color: var(--text-tertiary);
    margin-top: 16px;
    max-width: 300px;
}

.footer-col h4 {
    color: var(--text-primary);
    margin-bottom: 24px;
    font-size: 1.1rem;
}

.footer-col ul {
    list-style: none;
}

.footer-col ul li {
    margin-bottom: 12px;
}

.footer-col ul li a {
    color: var(--text-tertiary);
    text-decoration: none;
    transition: color 0.3s;
}

.footer-col ul li a:hover {
    color: var(--primary-400);
}

.copyright {
    text-align: center;
    color: var(--text-tertiary);
    font-size: 0.9rem;
    padding-top: 32px;
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* --- Animations --- */
@keyframes float {

    0%,
    100% {
        transform: translateY(0) rotate(0deg);
    }

    50% {
        transform: translateY(-20px) rotate(2deg);
    }
}

@keyframes gradient-shift {

    0%,
    100% {
        background-position: 0% 50%;
    }

    50% {
        background-position: 100% 50%;
    }
}

@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.animate-in {
    animation: fade-in-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

/* --- Contact Form --- */
.contact-wrapper {
    padding: 60px;
}

.contact-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.contact-info {
    padding-right: 40px;
}

.contact-details {
    margin-top: 40px;
    display: flex;
    flex-direction: column;
    gap: 24px;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 16px;
    background: rgba(255, 255, 255, 0.03);
    border-radius: 12px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.contact-form-container {
    background: rgba(255, 255, 255, 0.02);
    padding: 40px;
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.05);
}

.form-group {
    margin-bottom: 24px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: var(--text-secondary);
    font-size: 0.9rem;
    font-weight: 500;
}

.form-group input,
.form-group textarea,
.form-group select {
    width: 100%;
    padding: 12px 16px;
    background: rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    color: var(--text-primary);
    font-family: var(--font-body);
    font-size: 1rem;
    transition: all 0.3s ease;
    appearance: none;
    /* Eliminar estilo nativo del select */
}

/* Custom Select Arrow */
.form-group select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%23a1a1aa' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 16px center;
    background-size: 16px;
}

.form-group input:focus,
.form-group textarea:focus,
.form-group select:focus {
    outline: none;
    border-color: var(--primary-500);
    box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.2);
    background: rgba(0, 0, 0, 0.4);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
    color: var(--text-tertiary);
    opacity: 0.7;
}

/* Form Layout Utility */
.form-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 24px;
}

/* Responsive adjustment for form row */
@media (max-width: 576px) {
    .form-row {
        grid-template-columns: 1fr;
        gap: 0;
    }
}

/* Glass Card Utility (Reused) */
.glass-card {
    background: linear-gradient(135deg,
            rgba(255, 255, 255, 0.03) 0%,
            rgba(255, 255, 255, 0.01) 100%);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.05);
    border-radius: 32px;
}

/* Responsive */
@media (max-width: 991px) {
    .header-content {
        flex-direction: column-reverse;
        text-align: center;
    }

    .hero {
        flex-direction: column;
        text-align: center;
        padding-top: 120px;
    }

    .hero-subtitle {
        margin-left: auto;
        margin-right: auto;
    }

    .hero-visual {
        margin-top: 40px;
        width: 100%;
        height: 300px;
    }

    .sphere-container {
        width: 300px;
        height: 300px;
    }

    /* ---- SIDEBAR ---- */
    .nav-links {
        position: fixed;
        top: 0;
        right: -320px;
        width: 300px;
        height: 100vh;
        background: #0a0a0f;
        border-left: 1px solid rgba(255, 255, 255, 0.08);
        display: flex;
        flex-direction: column;
        z-index: 1000;
        overflow-y: auto;
        padding: 90px 28px 40px;
        transition: right 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        box-shadow: -8px 0 40px rgba(0, 0, 0, 0.6);
        gap: 0;
    }

    .nav-links.open {
        right: 0;
    }

    .nav-links .nav-link {
        display: block;
        font-size: 1.05rem;
        font-weight: 600;
        padding: 14px 0;
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
        color: #e4e4e7;
    }

    .nav-links .nav-link::after {
        display: none;
    }

    /* Dropdown Recursos — acordeón */
    .nav-links .dropdown {
        border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    }

    .nav-links .dropdown>.nav-link {
        border-bottom: none;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .nav-links .dropdown>.nav-link .fa-chevron-down {
        font-size: 0.7rem;
        transition: transform 0.25s ease;
    }

    .nav-links .dropdown.open>.nav-link .fa-chevron-down {
        transform: rotate(180deg);
    }

    /* Submenú cerrado por defecto */
    .nav-links .dropdown-menu {
        position: static !important;
        display: none !important;
        opacity: 1 !important;
        visibility: visible !important;
        transform: none !important;
        flex-direction: column;
        gap: 0;
        padding: 8px 0 12px 12px;
        background: transparent;
        box-shadow: none;
        border: none;
        min-width: unset;
        border-left: 2px solid rgba(59, 130, 246, 0.3);
        margin: 4px 0 8px 4px;
    }

    .nav-links .dropdown.open .dropdown-menu {
        display: flex !important;
    }

    .nav-links .dropdown-item {
        font-size: 0.88rem;
        padding: 9px 12px;
        border-radius: 8px;
        color: #a1a1aa;
        transform: none !important;
    }

    .nav-links .dropdown-item:hover {
        color: var(--primary-300);
        background: rgba(59, 130, 246, 0.08);
    }

    /* Overlay oscuro detrás del sidebar */
    .sidebar-overlay {
        display: none;
        position: fixed;
        inset: 0;
        background: rgba(0, 0, 0, 0.55);
        z-index: 999;
        backdrop-filter: blur(2px);
        cursor: pointer;
    }

    .sidebar-overlay.open {
        display: block;
    }

    .nav-cta-desktop {
        display: none;
    }

    /* Hamburger */
    .hamburger {
        display: flex;
        flex-direction: column;
        justify-content: center;
        gap: 5px;
        width: 40px;
        height: 40px;
        background: transparent;
        border: none;
        cursor: pointer;
        z-index: 1001;
        padding: 4px;
    }

    .hamburger span {
        display: block;
        width: 100%;
        height: 2px;
        background: #ffffff;
        border-radius: 2px;
        transition: all 0.3s ease;
    }

    .hamburger.active span:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }

    .hamburger.active span:nth-child(2) {
        opacity: 0;
    }

    .hamburger.active span:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    .about-grid {
        grid-template-columns: 1fr;
    }

    .footer-grid {
        grid-template-columns: 1fr;
    }

    .hero-title {
        font-size: 3rem;
    }
}


/* Responsive Form */
@media (max-width: 768px) {
    .contact-grid {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .contact-wrapper {
        padding: 32px 24px;
    }

    .contact-info {
        padding-right: 0;
        text-align: center;
    }

    .contact-item {
        justify-content: center;
        text-align: left;
    }
}

/* --- Hero Slider --- */
.hero-slider {
    position: relative;
    width: 100%;
    height: 100%;
    /* Si el padre tiene altura */
    min-height: 600px;
    /* Forzar altura mínima para evitar colapso */
    border-radius: 32px;
    overflow: hidden;
}

.hero-slide {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    /* Centrar para mejor encuadre */
    opacity: 0;
    transition: opacity 2s ease-in-out, transform 8s ease-out;
    transform: scale(1.05);
    /* Zoom inicial reducido para ver más contexto */
    z-index: 1;
}

/* Tooltip Custom Style for Barrios */
.barrio-label-style {
    background: transparent !important;
    border: none !important;
    box-shadow: none !important;
    color: white;
}

.hero-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 2;
}