:root {
    --primary-color: #233d4d;
    --secondary-color: #fe7f2d;
    --white: #ffffff;
    --bg-color: #fdfdfd;
    --bg-section-light: #f9fbfd;
    --text-color: #333333;
    --text-muted: #666666;
    --grid-color: rgba(35, 61, 77, 0.03);
    --card-bg: rgba(255, 255, 255, 0.45);
    --input-bg: #fdfdfd;
    --nav-bg: rgba(255, 255, 255, 0.95);
    --footer-bg: var(--primary-color);
}

[data-theme="dark"] {
    --bg-color: #0f172a;
    --bg-section-light: #1e293b;
    --text-color: #f8fafc;
    --text-muted: #cbd5e1;
    --white: #1e293b;
    --grid-color: rgba(254, 127, 45, 0.05);
    --card-bg: rgba(30, 41, 59, 0.7);
    --input-bg: #1e293b;
    --nav-bg: rgba(15, 23, 42, 0.95);
    --footer-bg: #020617;
    --primary-color: #60a5fa;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 100px;
}

body {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    margin: 0;
    padding: 95px 0 0 0;
    /* Compensation for fixed header (approx 95px) */
    background-color: var(--bg-color);
    background-image:
        linear-gradient(var(--grid-color) 1px, transparent 1px),
        linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
    background-size: 40px 40px;
    color: var(--text-color);
    line-height: 1.6;
}

/* --- Scrollbar Personalizada --- */
::-webkit-scrollbar {
    width: 10px;
}

::-webkit-scrollbar-track {
    background: #f1f1f1;
}

::-webkit-scrollbar-thumb {
    background: var(--primary-color);
    border-radius: 10px;
    border: 2px solid #f1f1f1;
}

::-webkit-scrollbar-thumb:hover {
    background: var(--secondary-color);
}

h1,
h2,
h3,
h4,
.nav-links a {
    font-family: 'Montserrat', sans-serif;
    letter-spacing: -0.02em;
}

header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background-color: var(--nav-bg);
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
    transition: background-color 0.3s ease;
}

/* --- Progress Bar --- */
#progress-bar-container {
    width: 100%;
    height: 3.5px;
    background-color: transparent;
    position: absolute;
    top: 0;
    left: 0;
    z-index: 1001;
}

#progress-bar {
    height: 100%;
    width: 0%;
    background: linear-gradient(90deg, var(--secondary-color), #ff9f5e);
    border-radius: 0 2px 2px 0;
    box-shadow: 0 0 8px rgba(254, 127, 45, 0.3);
    transition: width 0.1s ease-out;
}

.navbar {
    background-color: transparent;
    padding: 1rem 5%;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 3rem;
}

.nav-logo {
    position: relative;
    width: 250px;
    /* Increased space for a larger logo */
    height: 50px;
    /* Matches intended navbar content height */
}

.nav-logo img {
    height: 180px;
    /* Even larger size */
    width: auto;
    position: absolute;
    top: 50%;
    left: 0;
    transform: translateY(-50%);
    z-index: 1001;
}

[data-theme="dark"] .nav-logo .header-logo {
    filter: brightness(0) invert(1);
}

.nav-links {
    list-style: none;
    display: flex;
    margin: 0;
    padding: 0;
    margin-left: auto;
    /* Empuja los enlaces a la derecha */
}

.nav-links li {
    margin-left: 2.5rem;
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.nav-links a {
    text-decoration: none;
    color: var(--primary-color);
    font-weight: 600;
    transition: color 0.3s ease;
    position: relative;
    padding: 0.5rem 0;
}

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

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

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

.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 2rem;
    text-align: center;
}

.hero {
    min-height: 80vh;
    display: flex;
    align-items: center;
    background: radial-gradient(circle at 70% 30%, rgba(254, 127, 45, 0.05) 0%, transparent 50%),
        radial-gradient(circle at 10% 80%, rgba(35, 61, 77, 0.05) 0%, transparent 50%);
    padding: 4rem 0;
    position: relative;
    overflow: hidden;
}

.hero-container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 6rem;
    text-align: left;
}

.hero-content {
    flex: 1;
}

.hero-content h1 {
    font-size: 3rem;
    color: var(--primary-color);
    line-height: 1.2;
    margin-bottom: 1.5rem;
}

.text-highlight {
    color: var(--secondary-color);
}

/* --- Scroll Highlighter Effect --- */
.scroll-highlighter {
    background-image: linear-gradient(var(--secondary-color), var(--secondary-color));
    background-size: 0% 100%;
    background-repeat: no-repeat;
    background-position: left;
    transition: background-size 1.2s cubic-bezier(0.16, 1, 0.3, 1), color 0.4s ease 0.6s;
    display: inline;
    padding: 2px 0;
    color: inherit;
    font-weight: 500;
}

.scroll-highlighter.active {
    background-size: 100% 100%;
    color: var(--white);
    /* Se activa con un pequeño retraso */
    padding: 2px 5px;
    border-radius: 4px;
}

.hero-subtitle {
    font-size: 1.2rem;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.btn-primary {
    display: inline-block;
    padding: 0.8rem 2rem;
    background-color: var(--secondary-color);
    color: var(--white);
    text-decoration: none;
    border-radius: 50px;
    font-weight: 600;
}

.btn-primary:hover {
    background-color: #e67226;
    /* Slightly darker orange */
}

.hero-image {
    flex: 1;
    display: flex;
    justify-content: center;
}

.hero-image img {
    max-width: 100%;
    height: auto;
    border-radius: 15px;
    /* Sutil aumento para mejor apariencia */
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.08);
    /* Sombra elegante */
}

.content-section {
    padding: 6rem 0;
    border-bottom: 1px solid #eee;
}

.content-section h2 {
    color: var(--primary-color);
    font-size: 2.5rem;
    margin-bottom: 3rem;
    position: relative;
    display: inline-block;
}

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

/* Services Grid */
.services-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2.5rem;
    margin-top: 2rem;
}

/* --- Refinamiento de Tarjetas Service (Glassmorphism) --- */
.service-card {
    background: var(--card-bg);
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    padding: 3.5rem 2.5rem;
    border-radius: 30px;
    border: 1px solid rgba(128, 128, 128, 0.1);
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.03);
    transition: all 0.5s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.service-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.4) 0%, transparent 100%);
    pointer-events: none;
}

.service-card:hover {
    transform: translateY(-12px) scale(1.02);
    box-shadow: 0 30px 60px rgba(35, 61, 77, 0.12);
    border-color: rgba(254, 127, 45, 0.4);
    background: rgba(255, 255, 255, 0.7);
}

.service-icon {
    width: 80px;
    height: 80px;
    background-color: rgba(254, 127, 45, 0.1);
    border-radius: 18px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 1.5rem;
    color: var(--secondary-color);
    transition: all 0.3s ease;
}

.service-card:hover .service-icon {
    background-color: var(--secondary-color);
    color: white;
    transform: rotateY(10deg);
}

.service-card h3 {
    font-size: 1.5rem;
    margin-bottom: 1rem;
    color: var(--primary-color);
}

.service-card p {
    font-size: 1rem;
    color: var(--text-muted);
    line-height: 1.6;
}

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

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

.reverse-layout {
    flex-direction: row-reverse;
}

.section-image,
.section-text {
    flex: 1;
}

.section-text p {
    font-size: 1.15rem;
    color: var(--text-color);
    line-height: 1.8;
}

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

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

.styled-img {
    width: 100%;
    max-height: 450px;
    object-fit: cover;
    /* Estilo Empresarial: Bordes Rectos Suavizados */
    border-radius: 20px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.1);
    transition: all 0.4s ease;
}

.styled-img:hover {
    transform: translateY(-8px);
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.15);
}

/* Scroll Reveal Animations */
.reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease-out, transform 0.8s ease-out;
}

.reveal.active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Reveal Animation for Images --- */
.reveal-img {
    opacity: 0;
    transform: scale(0.9);
    filter: blur(10px);
    transition: opacity 1s cubic-bezier(0.19, 1, 0.22, 1),
        transform 1s cubic-bezier(0.19, 1, 0.22, 1),
        filter 1s ease-out;
}

.reveal-img.active {
    opacity: 1;
    transform: scale(1);
    filter: blur(0);
}

/* Stagger delay for flex containers if needed */
.flex-container.reveal.active .section-text {
    transition-delay: 0.2s;
}

.flex-container.reveal.active .section-image {
    transition-delay: 0.4s;
}

/* --- Stats Section --- */
.stats-section {
    padding: 6rem 0;
    background-color: var(--primary-color);
    color: white;
    margin: 4rem 0;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 3rem;
}

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

.stat-number,
.stat-decimal,
.stat-suffix {
    font-size: 3.5rem;
    font-weight: 800;
    font-family: 'Montserrat', sans-serif;
    color: var(--secondary-color);
    line-height: 1;
}

.stat-decimal,
.stat-suffix {
    font-size: 2.2rem;
    margin-left: 2px;
}

.stat-label {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.7);
    margin-top: 1rem;
    text-transform: uppercase;
    letter-spacing: 2px;
}

/* Glassmorphism en Formulario (Refuerzo) */
.contact-form-container {
    flex: 1;
    background: var(--white);
    /* Cambiado a variable */
    padding: 2.5rem;
    border-radius: 25px;
    box-shadow: 0 15px 40px rgba(0, 0, 0, 0.06);
    border: 1px solid rgba(128, 128, 128, 0.1);
}

.modern-form {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    padding: 1rem 1.2rem;
    border: 1px solid rgba(128, 128, 128, 0.2);
    border-radius: 12px;
    font-family: inherit;
    font-size: 1rem;
    transition: all 0.3s ease;
    background-color: var(--input-bg);
    /* Cambiado a variable */
    color: var(--text-color);
    /* Para asegurar visibilidad */
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--secondary-color);
    box-shadow: 0 0 0 4px rgba(254, 127, 45, 0.1);
    background-color: white;
}

/* --- Responsive Footer --- */
.footer {
    background-color: var(--footer-bg);
    color: white;
    padding: 5rem 0 2rem 0;
    margin-top: 4rem;
}

.footer-grid {
    display: grid;
    grid-template-columns: 2fr 1fr 1fr 1fr;
    gap: 4rem;
    text-align: left;
}

.brand-col .footer-logo {
    height: 200px;
    width: auto;
    margin-bottom: 1rem;
    filter: brightness(0) invert(1);
    margin-left: -30px;
    display: block;
    transition: transform 0.3s ease;
}

.brand-col .footer-logo:hover {
    transform: scale(1.02);
}

.footer-col h4 {
    margin-bottom: 1.5rem;
    font-size: 1.2rem;
    position: relative;
}

.footer-col h4::after {
    content: '';
    position: absolute;
    bottom: -8px;
    left: 0;
    width: 30px;
    height: 2px;
    background-color: var(--secondary-color);
}

.footer-col ul {
    list-style: none;
    padding: 0;
}

.footer-col ul li {
    margin-bottom: 0.8rem;
}

.footer-col ul a {
    color: rgba(255, 255, 255, 0.7);
    text-decoration: none;
    transition: color 0.3s ease;
}

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

.social-links {
    display: flex;
    gap: 1.5rem;
}

.social-links a {
    color: white;
    transition: transform 0.3s ease;
}

.social-links a:hover {
    transform: translateY(-3px);
    color: var(--secondary-color);
}

.footer-bottom {
    margin-top: 5rem;
    padding-top: 2rem;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    text-align: center;
    color: rgba(255, 255, 255, 0.5);
    font-size: 0.9rem;
}

/* --- Mobile Menu Styles --- */
.menu-toggle {
    display: none;
    cursor: pointer;
    font-size: 1.5rem;
    color: var(--primary-color);
}

@media (max-width: 992px) {
    .menu-toggle {
        display: block;
        order: 2;
    }

    .nav-logo {
        width: 180px;
    }

    .nav-links {
        position: fixed;
        top: 95px;
        left: -100%;
        width: 100%;
        height: calc(100vh - 95px);
        background-color: var(--nav-bg);
        flex-direction: column;
        align-items: center;
        padding-top: 3rem;
        transition: left 0.4s cubic-bezier(0.77, 0, 0.175, 1);
        z-index: 999;
        box-shadow: 0 10px 20px rgba(0, 0, 0, 0.1);
    }

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

    .nav-links li {
        margin: 1.5rem 0;
    }

    .flex-container,
    .reverse-layout {
        flex-direction: column;
        text-align: center !important;
        gap: 3rem;
    }

    .text-left,
    .text-right {
        text-align: center;
    }

    .hero-container {
        flex-direction: column;
        text-align: center;
        gap: 3rem;
    }

    .hero-content h1 {
        font-size: 2.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr 1fr;
        gap: 3rem;
    }
}

@media (max-width: 600px) {
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .nav-logo {
        width: 150px;
    }
}

/* --- Estilos para el Toggle de Modo Oscuro --- */
.theme-toggle {
    background: transparent;
    border: none;
    color: var(--primary-color);
    cursor: pointer;
    font-size: 1.2rem;
    padding: 0.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s ease;
}

.theme-toggle:hover {
    transform: rotate(15deg) scale(1.1);
    color: var(--secondary-color);
}

[data-theme="dark"] .nav-links a {
    color: var(--text-color);
}

[data-theme="dark"] .navbar {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] header {
    border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

[data-theme="dark"] .stats-section {
    background-color: #020617;
}