/* =========================================================================
   Base Variables & Resets
   ========================================================================= */

:root {
    /* Color Palette */
    --primary: #102A43; /* Deep Corporate Blue */
    --primary-light: #243B53;
    --secondary: #87CEFA; /* Topomed Light Sky Blue */
    --secondary-hover: #5DBAF2;
    
    --bg-white: #FFFFFF;
    --bg-light: #F8FAFC; /* Light gray for section separation */
    
    --text-main: #334155;
    --text-light: #64748B;
    --text-white: #F8FAFC;
    
    /* Typography */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Metrics */
    --padding-section: 6rem 2rem;
    --border-radius: 12px;
    --transition: all 0.3s ease-in-out;
    --shadow-sm: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
    --shadow-lg: 0 10px 15px -3px rgb(0 0 0 / 0.1), 0 4px 6px -4px rgb(0 0 0 / 0.1);
}

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

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    color: var(--text-main);
    background-color: var(--bg-white);
    line-height: 1.6;
    overflow-x: hidden;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-heading);
    color: var(--primary);
    line-height: 1.2;
}

a {
    text-decoration: none;
    color: inherit;
    transition: var(--transition);
}

ul {
    list-style: none;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    width: 100%;
}

.section-padding {
    padding: var(--padding-section);
}

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

/* =========================================================================
   Typography & Utilities
   ========================================================================= */
.section-title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
}

.section-title span {
    color: var(--secondary);
}

.section-subtitle {
    font-size: 1.125rem;
    color: var(--text-light);
    max-width: 700px;
    margin: 0 auto 3rem auto;
}

.lead {
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--primary);
    margin-bottom: 1.5rem;
}

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

.w-100 {
    width: 100%;
}

/* =========================================================================
   Buttons
   ========================================================================= */
.btn {
    display: inline-block;
    padding: 0.8rem 2rem;
    border-radius: 30px;
    font-weight: 600;
    font-family: var(--font-heading);
    cursor: pointer;
    border: none;
    transition: var(--transition);
    text-align: center;
}

.btn-primary {
    background-color: var(--secondary);
    color: var(--text-white);
}

.btn-primary:hover {
    background-color: var(--secondary-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(135, 206, 250, 0.4);
}

.btn-secondary {
    background-color: transparent;
    color: var(--text-white);
    border: 2px solid var(--text-white);
}

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

/* =========================================================================
   Navbar
   ========================================================================= */
.navbar {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    padding: 1.25rem 2rem;
    z-index: 1000;
    transition: var(--transition);
    background: var(--bg-white);
    box-shadow: var(--shadow-sm);
}

.navbar.scrolled {
    padding: 1rem 2rem;
}

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

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--primary);
    letter-spacing: 1px;
}

.logo-footer {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-heading);
    font-size: 1.5rem;
    font-weight: 800;
    color: var(--text-white);
    letter-spacing: 1px;
}

.nav-logo-img {
    height: 40px;
    width: auto;
    object-fit: contain;
}

.logo-footer .nav-logo-img {
    filter: brightness(0) invert(1);
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 2rem;
}

.nav-links a {
    color: var(--text-main);
    font-weight: 500;
    position: relative;
}

.nav-links a::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--secondary);
    transition: width 0.3s ease;
}

.nav-links a:hover::after {
    width: 100%;
}

.btn-contact-nav {
    background-color: var(--secondary);
    padding: 0.5rem 1.25rem;
    border-radius: 20px;
}

.btn-contact-nav::after {
    display: none;
}
.btn-contact-nav:hover {
    background-color: var(--secondary-hover);
    transform: scale(1.05);
}

.mobile-menu-btn {
    display: none;
    color: var(--primary);
    font-size: 2rem;
    cursor: pointer;
}

/* =========================================================================
   Hero Section
   ========================================================================= */
.hero {
    position: relative;
    height: 100vh;
    min-height: 600px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-align: center;
    background-image: url('../images/hero_bg.png');
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
    color: var(--text-white);
    padding: 0 2rem;
}

.hero-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(15,23,42,0.9) 0%, rgba(15,23,42,0.6) 100%);
    z-index: 1;
}

.hero-content {
    position: relative;
    z-index: 2;
    max-width: 800px;
}

.hero h1 {
    color: var(--text-white);
    font-size: 3.5rem;
    font-weight: 800;
    margin-bottom: 1.5rem;
    text-shadow: 0 2px 10px rgba(0,0,0,0.3);
}

.hero p {
    font-size: 1.25rem;
    margin-bottom: 2.5rem;
    color: #E2E8F0;
}

.hero-buttons {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

/* =========================================================================
   Sobre Nosotros
   ========================================================================= */
.about-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
}

.about-text p {
    margin-bottom: 1rem;
    color: var(--text-light);
}

.about-image-container {
    position: relative;
    height: 100%;
    min-height: 400px;
    background: linear-gradient(135deg, var(--primary) 0%, var(--primary-light) 100%);
    border-radius: var(--border-radius);
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    overflow: hidden;
}

/* Topographic line decoration */
.about-image-container::before {
    content: '';
    position: absolute;
    width: 200%;
    height: 200%;
    background-image: radial-gradient(circle, transparent 20%, rgba(135, 206, 250, 0.1) 21%, transparent 22%);
    background-size: 40px 40px;
    animation: drift 60s linear infinite;
}

.glass-box {
    position: relative;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: var(--border-radius);
    padding: 2rem;
    width: 100%;
    z-index: 2;
}

.glass-stats {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.stat {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    color: var(--text-white);
}

.stat i {
    font-size: 2rem;
    color: var(--secondary);
    margin-bottom: 0.5rem;
}

.stat h3 {
    color: var(--text-white);
    font-size: 1.25rem;
    margin-bottom: 0.2rem;
}

.stat span {
    font-size: 0.875rem;
    color: #CBD5E1;
}

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

.service-card {
    background: var(--bg-white);
    padding: 2.5rem 2rem;
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    transition: var(--transition);
    border-top: 4px solid transparent;
}

.service-card:hover {
    transform: translateY(-10px);
    box-shadow: var(--shadow-lg);
    border-top-color: var(--secondary);
}

.service-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background-color: rgba(135, 206, 250, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
}

.service-icon i {
    font-size: 2rem;
    color: var(--secondary);
}

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

.service-card ul {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.service-card ul li {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    color: var(--text-light);
    font-size: 0.95rem;
}

.service-card ul li i {
    color: var(--secondary);
    margin-top: 0.2rem;
}

/* =========================================================================
   Contacto Section
   ========================================================================= */
.contact-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    background: var(--bg-white);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

.contact-info {
    padding: 3rem;
    background-color: var(--primary);
    color: var(--text-white);
}

.contact-info .section-title {
    color: var(--text-white);
}

.contact-info p {
    color: #CBD5E1;
    margin-bottom: 2rem;
}

.contact-details {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

.contact-item {
    display: flex;
    align-items: center;
    gap: 1rem;
}

.icon-circle {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255,255,255,0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary);
    font-size: 1.25rem;
    flex-shrink: 0;
}

.contact-item h4 {
    color: var(--text-white);
    font-size: 1rem;
    margin-bottom: 0.2rem;
}

.contact-item p, .contact-item a {
    color: #CBD5E1;
    font-size: 0.9rem;
}

.contact-item a:hover {
    color: var(--secondary);
}

.contact-form {
    padding: 3rem;
}

.contact-form h3 {
    margin-bottom: 1.5rem;
}

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

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

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 0.75rem;
    border: 1px solid #E2E8F0;
    border-radius: 8px;
    font-family: inherit;
    transition: var(--transition);
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary);
    box-shadow: 0 0 0 3px rgba(135, 206, 250, 0.3);
}

/* =========================================================================
   Footer
   ========================================================================= */
footer {
    background-color: var(--primary-light);
    color: var(--text-white);
    padding-top: 4rem;
}

.footer-content {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    padding: 0 2rem 3rem 2rem;
}

.footer-col p {
    color: #CBD5E1;
    margin-top: 1rem;
    max-width: 400px;
}

.footer-col h4 {
    color: var(--text-white);
    margin-bottom: 1rem;
    font-size: 1.25rem;
}

.footer-col ul {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.footer-col ul a {
    color: #CBD5E1;
}

.footer-col ul a:hover {
    color: var(--secondary);
    padding-left: 5px;
}

.footer-bottom {
    background-color: var(--primary);
    text-align: center;
    padding: 1.5rem;
    color: #94A3B8;
    font-size: 0.9rem;
}

/* =========================================================================
   Animations Classes (Triggered by JS IntersectionObserver)
   ========================================================================= */
.fade-in-up {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-in-left {
    opacity: 0;
    transform: translateX(-50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.slide-in-right {
    opacity: 0;
    transform: translateX(50px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

/* Start animations when class is added */
.in-view {
    opacity: 1;
    transform: translate(0);
}

.delay-1 { transition-delay: 0.2s; }
.delay-2 { transition-delay: 0.4s; }
.delay-3 { transition-delay: 0.6s; }

@keyframes drift {
    0% { transform: translate(0, 0) rotate(0deg); }
    100% { transform: translate(-50px, -50px) rotate(5deg); }
}

/* =========================================================================
   Responsive Design
   ========================================================================= */
@media (max-width: 991px) {
    .about-grid, 
    .contact-wrapper {
        grid-template-columns: 1fr;
    }
    
    .hero h1 {
        font-size: 2.5rem;
    }
}

@media (max-width: 768px) {
    .nav-links {
        position: fixed;
        top: 0;
        right: -100%;
        width: 70%;
        height: 100vh;
        background-color: var(--primary);
        flex-direction: column;
        justify-content: center;
        transition: 0.4s;
        box-shadow: -5px 0 15px rgba(0,0,0,0.1);
    }
    
    .nav-links.active {
        right: 0;
    }
    
    .mobile-menu-btn {
        display: block;
        z-index: 1001;
    }
    
    .hero-buttons {
        flex-direction: column;
    }
    
    .footer-content {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
}
