:root, [data-theme="light"] {
    --text-xs: clamp(.75rem, .7rem + .2vw, .875rem);
    --text-sm: clamp(.875rem, .82rem + .25vw, 1rem);
    --text-base: clamp(1rem, .97rem + .2vw, 1.125rem);
    --text-lg: clamp(1.125rem, 1.04rem + .45vw, 1.35rem);
    --text-xl: clamp(1.55rem, 1.2rem + 1vw, 2.2rem);
    --text-2xl: clamp(1.8rem, 1.3rem + 1.4vw, 2.8rem);
    --text-3xl: clamp(2.5rem, 2rem + 3.8vw, 5.6rem);
    --space-2: .5rem;
    --space-3: .75rem;
    --space-4: 1rem;
    --space-5: 1.25rem;
    --space-6: 1.5rem;
    --space-8: 2rem;
    --space-10: 2.5rem;
    --space-12: 3rem;
    --space-16: 4rem;
    --space-20: 5rem;
    --space-24: 6rem;
    --color-bg: #f7f6f2;
    --color-surface: #fbfaf7;
    --color-surface-2: #f2efe8;
    --color-surface-offset: #ddd8cf;
    --color-border: #ddd8cf;
    --color-divider: #e7e2da;
    --color-text: #231f1a;
    --color-text-muted: #666056;
    --color-text-faint: #989287;
    --color-text-inverse: #f8f6f1;
    --color-primary: #0a666c;
    --color-primary-hover: #075258;
    --color-primary-highlight: #d6e5e3;
    --color-gold: #9e7237;
    --backgrey: #f6f7f9;
    --font-body: 'Inter', sans-serif;
    --font-display: 'Chivo', sans-serif;
    --content: 1240px;
    --transition: 180ms cubic-bezier(.16, 1, .3, 1);
}

[data-theme="dark"] {
    --color-bg: #151412;
    --color-surface: #1b1a17;
    --color-surface-2: #23211d;
    --color-surface-offset: #2d2924;
    --color-border: #3d3933;
    --color-divider: #322f2a;
    --color-text: #eee6da;
    --color-text-muted: #b7ae9f;
    --color-text-faint: #7d776e;
    --color-text-inverse: #171614;
    --color-primary: #5fa6aa;
    --color-primary-hover: #86bec1;
    --color-primary-highlight: #2b3c3c;
    --color-gold: #c89f69;
    --backgrey: #1b1a17;
}

@media (prefers-color-scheme: dark) {
    :root:not([data-theme]) {
        --color-bg: #151412;
        --color-surface: #1b1a17;
        --color-surface-2: #23211d;
        --color-surface-offset: #2d2924;
        --color-border: #3d3933;
        --color-divider: #322f2a;
        --color-text: #eee6da;
        --color-text-muted: #b7ae9f;
        --color-text-faint: #7d776e;
        --color-text-inverse: #171614;
        --color-primary: #5fa6aa;
        --color-primary-hover: #86bec1;
        --color-primary-highlight: #2b3c3c;
        --color-gold: #c89f69;
        --backgrey: #1b1a17;
    }
}

/* =========================================
   RESETEO BASE Y ESTILOS GLOBALES
   ========================================= */
*, :before, :after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html, body {
    overflow-x: clip;
    width: 100%;
}

html {
    -webkit-text-size-adjust: none;
    text-size-adjust: none;
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: var(--font-body);
    font-size: var(--text-base);
    line-height: 1.65;
    background: var(--color-bg);
    color: var(--color-text);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    display: flex;
    flex-direction: column;
}

::selection {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
}
::-moz-selection {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
}

body::before {
    content: "";
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100vw; 
    height: 100vh;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
    opacity: 0.04;
    pointer-events: none;
    z-index: 9999;
}
[data-theme="light"] body::before { opacity: 0.025; }

::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--color-bg); }
::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--color-text-muted) 30%, transparent);
    border-radius: 10px;
}
::-webkit-scrollbar-thumb:hover { background: var(--color-primary); }

img, video, svg {
    display: block;
    max-width: 100%;
    height: auto;
}

a {
    color: inherit;
    text-decoration: none;
}

button, input, textarea, select {
    font: inherit;
    color: inherit;
}

button {
    cursor: pointer;
    border: none;
    background: none;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 3px;
}

.skip-link {
    position: absolute;
    left: 1rem;
    top: -60px;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    padding: .8rem 1rem;
    z-index: 1000;
}
.skip-link:focus { top: 1rem; }

.container {
    width: min(calc(100% - 2rem), var(--content));
    margin-inline: auto;
}
.narrow {
    width: min(calc(100% - 2rem), var(--content));
    margin-inline: auto;
}
.section {
    padding-block: clamp(var(--space-12), 8vw, var(--space-24));
}
.section + .section {
    padding-top: 1rem;
}

/* =========================================
   HEADER Y LOGO CONTROLADO
   ========================================= */
.header {
    position: sticky;
    top: 0;
    z-index: 60;
    background: color-mix(in srgb, var(--color-bg) 88%, transparent);
    backdrop-filter: blur(18px);
    -webkit-backdrop-filter: blur(18px);
    border-bottom: 1px solid color-mix(in srgb, var(--color-text) 8%, transparent);
    box-shadow: 0 4px 30px rgba(0, 0, 0, 0.03);
}

.navbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 0.5rem 0;
    width: 100%;
    max-width: 1200px; 
    margin: 0 auto;
}

.brand {
    display: flex;
    align-items: center;
    gap: .9rem;
    z-index: 101; 
}

.brand-text {
    position: relative;
    display: inline-flex;
    align-items: center;
}

.logo-light,
.logo-dark {
    height: 55px; 
    width: auto;
    object-fit: contain;
    display: none;
}

[data-theme="light"] .logo-light { display: block; }
[data-theme="light"] .logo-dark { display: none; }
[data-theme="dark"] .logo-light { display: none; }
[data-theme="dark"] .logo-dark { display: block; }

/* =========================================
   IMAGEN BOLSA DE TRABAJO
   ========================================= */
.career-hero-img {
    /* Toma el 100% del ancho menos 2rem de margen, pero nunca pasa de 800px */
    width: min(calc(100% - 2rem), 800px);
    height: auto;
    display: block;
    margin: 2rem auto 0 auto;
    border-radius: 12px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.06);
    object-fit: cover;
}

@media (min-width: 1025px) {
    .nav-menu-wrapper {
        display: contents; 
    }
}

.nav-links > a {
    position: relative;
    padding-bottom: 2px;
}
.nav-links > a::after {
    content: '';
    position: absolute;
    width: 0;
    height: 2px;
    bottom: -2px;
    left: 0;
    background-color: var(--color-primary);
    transition: width 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-links > a:hover::after { width: 100%; }

.nav-links {
    display: flex;
    gap: 1.25rem;
    align-items: center;
    flex-wrap: wrap;
    position: relative;
}

.nav-links a {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.nav-actions {
    display: flex;
    align-items: center;
    gap: .7rem;
}

.toggle {
    min-width: 44px;
    height: 44px;
    border: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
    display: grid;
    place-items: center;
    background: var(--color-surface);
    border-radius: 12px;
}

/* Modificadores de la bandera de idioma */
.lang-toggle {
    padding: 0 !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    overflow: hidden; 
}

.lang-toggle img {
    display: block !important;
    width: 28px !important;
    height: 28px !important;
}

#lang-flag {
    display: block;
    pointer-events: none; 
}

/* Menú Desplegable */
.nav-dropdown {
    position: relative;
    display: flex;
    align-items: center;
}

.nav-link-btn {
    background: none;
    border: 0;
    color: inherit;
    font: inherit;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    gap: .35rem;
    transition: opacity var(--transition), transform var(--transition);
}

.nav-link-btn::after {
    content: '';
    width: .45rem;
    height: .45rem;
    border-right: 1.5px solid currentColor;
    border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translateY(-2px);
    opacity: .7;
}

.nav-dropdown::after {
    content: '';
    position: absolute;
    top: 100%;
    left: 0;
    right: -20px;
    height: 25px;
    z-index: 10;
}

.nav-dropdown-menu {
    position: absolute;
    top: calc(100% + 0.9rem);
    left: 0; 
    transform: translateY(-10px);
    min-width: 280px;
    padding: 0.75rem;
    border: 1px solid var(--color-border);
    border-radius: 18px;
    background: color-mix(in srgb, var(--color-surface) 92%, transparent);
    backdrop-filter: blur(18px);
    box-shadow: 0 18px 40px rgba(0, 0, 0, .14);
    display: grid;
    gap: 0.25rem;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s ease;
    z-index: 20;
}

.nav-dropdown-menu a {
    display: block;
    padding: 0.85rem 1rem;
    border-radius: 12px;
    text-decoration: none;
    transition: background 0.3s ease, transform 0.3s ease, color 0.3s ease;
}

.nav-dropdown-menu a:hover {
    background: var(--color-surface-2);
    transform: translateX(4px); 
}

.nav-dropdown:hover .nav-dropdown-menu, 
.nav-dropdown:focus-within .nav-dropdown-menu {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(0);
}

/* =========================================
   HERO CENTRADO Y CAPTIONS
   ========================================= */
.hero-media {
    position: relative;
    background: #000;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    height: 500px; 
    overflow: hidden;
}

.hero-media video, .hero-media img {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    opacity: 0.82;
    transform: translateZ(0); 
    z-index: 0;
}

.hero-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.18) 0%, rgba(0, 0, 0, 0.75) 100%);
    z-index: 1;
}

/* 1. Hero Caption Original (Centrado y Ajustado) */
.hero-caption {
    position: relative; 
    width: min(calc(100% - 2rem), 700px);
    color: #fff;
    z-index: 5;
    display: flex;
    flex-direction: column;
    align-items: center; 
    text-align: center;     
}

.hero-caption h1 {
    font-family: var(--font-display);
    font-size: clamp(1.75rem, 5vw, 3.4rem);
    line-height: 1.05;
    letter-spacing: -.03em;
    margin-bottom: 1rem;
    width: 100%;
    max-width: none !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    background: linear-gradient(110deg, #ffffff 30%, rgba(255, 255, 255, 0.5) 50%, #ffffff 70%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmerText 7s infinite linear;
}

.hero-caption p {
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    max-width: 65ch;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}
.hero-caption p + p {
    opacity: .92;
    margin-top: 1rem;
}

/* 2. Hero Caption 2 (Alineado a la Izquierda en PC) */
.hero-caption2 {
    position: absolute; 
    left: 5%;
    top: 20%;
    transform: translateY(-50%);
    width: 90%;
    max-width: 850px; 
    color: #fff;
    z-index: 5;
    display: flex;
    flex-direction: column;
    text-align: left;
    padding: 1rem;
}

.hero-caption2 h1 {
    font-family: var(--font-display);
    font-size: clamp(2rem, 5vw, 4rem); 
    line-height: 1.05;
    letter-spacing: -.03em;
    margin-bottom: 1rem;
    width: 100%;
    max-width: none !important;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
    word-break: break-word !important;
    background: linear-gradient(110deg, #ffffff 30%, rgba(255, 255, 255, 0.5) 50%, #ffffff 70%);
    background-size: 200% 100%;
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    animation: shimmerText 7s infinite linear;
}

.hero-caption2 p {
    font-size: clamp(0.95rem, 1.2vw, 1.1rem);
    max-width: 65ch;
    white-space: normal !important;
    word-wrap: break-word !important;
    overflow-wrap: break-word !important;
}
.hero-caption2 p + p {
    opacity: .92;
    margin-top: 1rem;
}

@keyframes shimmerText {
    0% { background-position: 200% 0; }
    100% { background-position: -200% 0; }
}

/* =========================================
   CARRUSELES (LOGOS Y CLIENTES)
   ========================================= */
.logo-strip, .client-strip {
    width: 100%;
    overflow: hidden;
    position: relative;
    z-index: 10;
    display: flex; 
}

.logo-strip {
    background: #FFFFFF;
    border-top: 1px solid var(--color-divider);
    border-bottom: 1px solid var(--color-divider);
}

.client-strip {
    background: transparent;
    padding: 2rem 0;
    border-top: 1px solid var(--color-divider);
    border-bottom: 1px solid var(--color-divider);
}

.logo-strip-inner, .client-strip-inner {
    display: flex;
    flex-shrink: 0;
    animation: scrollMarquee 35s linear infinite;
    will-change: transform;
}

.logo-strip:hover .logo-strip-inner,
.client-strip:hover .client-strip-inner {
    animation-play-state: paused;
}

.logo-item {
    min-width: 200px; 
    padding: 1.5rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-right: 1px solid var(--color-divider);
}

.client-logo {
    min-width: 220px;
    padding: 0 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.logo-item img {
    max-height: 50px; 
    width: auto;
    object-fit: contain;
    transition: filter 0.3s ease, transform 0.3s ease;
}

.client-logo img {
    max-height: 70px;
    width: auto;
    object-fit: contain;
    filter: grayscale(100%) opacity(60%);
    transition: filter 0.4s ease, transform 0.4s ease;
}

.logo-item:hover img {
    transform: scale(1.05);
}

.client-logo:hover img {
    filter: grayscale(0%) opacity(100%);
    transform: scale(1.1);
}

@keyframes scrollMarquee {
    0% { transform: translateX(0); }
    100% { transform: translateX(-100%); } 
}

/* =========================================
   SISTEMA DE DIFERENCIACIÓN DE FONDOS
   ========================================= */
.alt-bg { background-color: var(--color-bg); }
#contacto { background-color: var(--color-bg); }

/* =========================================
   LAYOUT ADOSADO (TEXTO + IMAGEN COHERENTE)
   ========================================= */
.layout-split-visual {
    padding-block: clamp(var(--space-12), 6vw, var(--space-24));
    width: 100%;
}

.split-wrapper {
    display: grid;
    grid-template-columns: 1.15fr 0.85fr;
    gap: 4rem;
    align-items: center;
    max-width: 1200px;
    margin: 0 auto;
}

.split-text {
    width: 100%;
}

.split-image-container {
    width: 100%;
    overflow: hidden;
    border-radius: 16px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.04);
    border: 1px solid var(--color-border);
    height: 100%;
    min-height: 320px;
}

.side-image {
    width: 100%;
    height: 100%;
    min-height: 320px;
    object-fit: cover;
}

/* =========================================
   ESTRUCTURA DE SECCIONES (GRID)
   ========================================= */
.hero-copy {
    padding-block: 5rem 2rem;
}

.hero-copy h2, .section-heading h2 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    line-height: 1.2;
    letter-spacing: -.03em;
    margin-bottom: 1rem;
}

.hero-copy p, .section-heading p {
    color: var(--color-text-muted);
    max-width: 72ch;
}
.hero-copy p + p { margin-top: 1rem; }

.stats-row {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 2rem;
    margin-top: 2.4rem;
    border-top: 1px solid var(--color-divider);
    padding-top: 1.5rem;
}

.stat-block {
    padding-top: 0.5rem;
}

.stat-block strong {
    display: block;
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    line-height: 1;
    margin-bottom: .4rem;
    color: var(--color-primary);
}

.stat-block span {
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    display: block;
}

.section-heading { margin-bottom: 2rem; }

.eyebrow {
    display: inline-block;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: .18em;
    color: var(--color-text-faint);
    margin-bottom: .8rem;
}

.grid-4-layout {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.5rem;
    margin-top: 2.5rem;
}

.card-img-box {
    width: 100%;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: flex-start;
    margin-bottom: 1.5rem;
}

.card-img-box img {
    max-height: 100%;
    width: auto;
    object-fit: contain;
}

.grid-3 {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    border-radius: 12px;
    overflow: hidden;
}

.metrics-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border-radius: 12px;
    overflow: hidden;
}

.divisions-grid, .values-grid, .news-grid, .metrics-grid, .grid-3 {
    display: grid;
    gap: 1px;
    background: var(--color-border);
}

.divisions-cards:hover .division-card:not(:hover),
.news-grid:hover .news-card:not(:hover) {
    opacity: 0.4;
    filter: grayscale(30%);
    transform: scale(0.98);
}

.division-card, .news-card, .metric-card, .grid-card {
    background: var(--color-surface);
    padding: 2rem;
}

.division-card {
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
    border: 1px solid var(--color-border);
    border-radius: 16px;
    display: flex;
    flex-direction: column;
}

.division-card:hover {
    transform: translateY(-8px);
    border-color: var(--color-primary);
    box-shadow: 0 12px 30px rgba(0, 0, 0, 0.08);
}

.division-card a::after {
    content: ' →';
    transition: margin-left 0.2s ease;
}

.division-card a:hover::after {
    margin-left: 8px;
}

.division-card .index {
    font-size: var(--text-xs);
    letter-spacing: .16em;
    text-transform: uppercase;
    color: var(--color-text-faint);
    margin-bottom: 1rem;
}

.division-card h3, .grid-card h3 {
    font-family: var(--font-body);
    font-size: 1.3rem;
    line-height: 1.1;
    margin-bottom: 1rem;
}

.division-card p, .grid-card p, .news-card p, .metric-card p, .value-card p {
    color: var(--color-text-muted);
    flex: 1; 
}

.division-card a {
    margin-top: 1.3rem;
    color: var(--color-primary);
    font-weight: 600;
}

.division-card img {
    justify-content: center;
    margin-left: auto;
    margin-right: auto;
}

.values-grid {
    grid-template-columns: repeat(5, minmax(0, 1fr));
    border: 1px solid var(--color-border);
    border-radius: 12px;
    overflow: hidden;
    perspective: 1000px; 
}

.value-card {
    min-height: 240px;
    background: var(--color-surface);
    padding: 2rem;
    transition: transform 0.5s cubic-bezier(0.16, 1, 0.3, 1), background 0.4s ease, box-shadow 0.4s ease;
    position: relative;
    border-bottom: 3px solid transparent; 
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
}

.value-card:hover {
    background: var(--color-surface-2);
    border-bottom-color: var(--color-primary);
    transform: translateY(-12px) rotateX(8deg) rotateY(-4deg);
    box-shadow: -10px 25px 50px rgba(0, 0, 0, 0.12);
    z-index: 2; 
}

.value-card h3 {
    font-size: var(--text-lg);
    transition: color 0.3s ease;
    margin-bottom: 0.5rem;
}

.value-card:hover h3 { color: var(--color-primary); }

.value-card p {
    color: var(--color-text-muted);
    transition: color 0.3s ease;
}

.value-card:hover p { color: var(--color-text); }

.value-card strong { color: var(--color-text); }

/* =========================================
   HISTORIA (TIMELINE CORPORATIVO)
   ========================================= */
.history-list {
    max-width: 860px;
    margin: 0 auto;
    position: relative;
    padding-left: 2.5rem;
}

.history-list::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 2px;
    background: var(--color-divider);
}

.history-item {
    position: relative;
    display: grid;
    grid-template-columns: 120px 1fr;
    gap: 2rem;
    padding: 2.5rem 0;
    border-bottom: 1px solid var(--color-divider);
    transition: transform 0.3s ease;
}

.history-item::before {
    content: 'G';
    position: absolute;
    left: -49px; 
    top: 2.4rem;
    width: 24px;
    height: 24px;
    border-radius: 50%;
    background: var(--color-bg);
    border: 2px solid var(--color-gold);
    z-index: 2;
    color: var(--color-gold);
    font-size: 0.65rem;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-body);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.history-item:hover::before {
    transform: scale(1.25);
    background: var(--color-gold);
    color: #fff;
    box-shadow: 0 0 15px color-mix(in srgb, var(--color-gold) 40%, transparent);
}

.history-item:hover { transform: translateX(8px); }

.history-item time {
    font-family: var(--font-display);
    font-size: 2.2rem;
    color: var(--color-gold);
    line-height: 1;
}

.history-item h3 {
    font-size: var(--text-lg);
    margin-bottom: 0.5rem;
}

.history-item p { color: var(--color-text-muted); }

/* =========================================
   FORMULARIOS Y CONTACTO
   ========================================= */
.contact-strip {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
}

.contact-card {
    border: 1px solid color-mix(in srgb, var(--color-text) 10%, transparent);
    background: var(--color-surface);
    padding: 2rem;
    border-radius: 14px;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1rem;
}

.field {
    display: grid;
    gap: .4rem;
}

.field label {
    font-size: var(--text-sm);
    font-weight: 600;
}

.field input, .field textarea, .field select {
    padding: .95rem 1rem;
    border: 1px solid color-mix(in srgb, var(--color-text) 12%, transparent);
    background: var(--color-bg);
    border-radius: 8px;
}

.field textarea {
    min-height: 140px;
    resize: vertical;
}

.field.full { grid-column: 1/-1; }

.btn-primary {
    position: relative;
    overflow: hidden;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 1.5rem;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    font-weight: 600;
    z-index: 1;
    transition: color 0.3s ease;
    border-radius: 8px;
}

.btn-primary::before {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    height: 0%;
    background: var(--color-primary-hover);
    transition: height 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}

.btn-primary:hover::before { height: 100%; }

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

/* =========================================
   NOTICIAS
   ========================================= */
.news-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    border: none;
    background: transparent;
    gap: 1.5rem;
}

.news-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: 12px;
    min-height: 250px;
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
}

.news-card h3 {
    font-family: var(--font-body);
    font-weight: 600;
    font-size: 1.08rem;
    line-height: 1.3;
    margin-bottom: .85rem;
}

.news-card span {
    margin-top: auto;
    font-size: var(--text-xs);
    text-transform: uppercase;
    letter-spacing: .12em;
    color: var(--color-text-faint);
    padding-top: 1rem;
}

/* =========================================
   PORTAFOLIO DE PROYECTOS (FILTROS Y CARDS)
   ========================================= */
.project-filters {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center; 
    gap: 1rem;
    margin: 0 auto 3rem auto;
    width: 100%;
    max-width: 900px;
}

.filter-btn {
    padding: 0.6rem 1.5rem;
    border-radius: 30px;
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-size: var(--text-sm);
    font-weight: 600;
    transition: all 0.3s ease;
    cursor: pointer;
}

.filter-btn:hover {
    border-color: var(--color-primary);
    color: var(--color-primary);
}

.filter-btn.active {
    background: var(--color-primary);
    border-color: var(--color-primary);
    color: var(--color-text-inverse);
    box-shadow: 0 4px 15px color-mix(in srgb, var(--color-primary) 30%, transparent);
}

.project-grid {
    display: grid;
    /* Ajustado a 280px para garantizar que quepa bien en todos los celulares antes del breakpoint */
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 2rem;
    align-items: stretch;
}

.project-card {
    background: var(--color-surface);
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid var(--color-border);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.03);
    transition: transform 0.4s ease, opacity 0.4s ease;
    display: flex;
    flex-direction: column;
    cursor: pointer;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.08);
}

.project-img-wrapper {
    position: relative;
    width: 100%;
    height: 250px;
    overflow: hidden;
}

.project-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.project-card:hover .project-img-wrapper img {
    transform: scale(1.08);
}

.project-card:hover .project-img-wrapper::after {
    content: 'Ver Galería';
    position: absolute;
    inset: 0;
    background: rgba(10, 102, 108, 0.7);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    font-weight: 600;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: 3;
}

.project-card:hover .project-img-wrapper::after {
    opacity: 1;
}

.project-tag {
    position: absolute;
    top: 1rem;
    left: 1rem;
    background: var(--color-primary);
    color: var(--color-text-inverse);
    padding: 0.3rem 0.8rem;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    z-index: 2;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
}

.project-info {
    padding: 1.5rem;
    flex: 1;
    display: flex;
    flex-direction: column;
}

.project-info h3 {
    font-size: 1.2rem;
    font-family: var(--font-display);
    margin-bottom: 0.5rem;
    line-height: 1.2;
}

.project-location {
    font-size: var(--text-sm);
    color: var(--color-text-faint);
    margin-bottom: 1.5rem;
}

.project-metric {
    margin-top: auto;
    display: flex;
    align-items: center;
    gap: 0.5rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-divider);
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.project-metric svg {
    width: 18px;
    height: 18px;
    color: var(--color-primary);
    flex-shrink: 0;
}

.project-metric strong {
    color: var(--color-text);
}

/* =========================================
   MODAL GALERÍA (LIGHTBOX)
   ========================================= */
.project-modal {
    position: fixed;
    top: 0; left: 0; width: 100%; height: 100%;
    z-index: 9999;
    display: none;
    align-items: center;
    justify-content: center;
}
.project-modal.active { display: flex; }

.modal-overlay {
    position: absolute; inset: 0;
    background: rgba(0,0,0,0.9);
    backdrop-filter: blur(5px);
}

.modal-container {
    position: relative;
    width: 95vw;
    max-width: 1100px; /* <--- Agregado para que no se estire demasiado en horizontal */
    height: 90vh;
    background: var(--color-bg); 
    display: flex;
    flex-direction: column;
    padding: 30px;
    border-radius: 16px;
    z-index: 10;
}

#modalTitle {
    color: var(--color-text);
    font-family: var(--font-display);
    margin-bottom: 15px;
    font-size: clamp(1.2rem, 3vw, 2.2rem); /* <--- Tipografía fluida para que no ocupe tanto espacio vertical */
    line-height: 1.2;
    padding-right: 50px; /* <--- Evita que un título largo choque con el botón de cerrar */
}

.modal-viewer {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    position: relative;
    overflow: hidden;
    background: #000; 
    border-radius: 8px;
    min-height: 300px; /* <--- Evita que la caja de la foto se aplaste */
}

#mainViewer {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
}

.nav-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.6); 
    border: 2px solid rgba(255, 255, 255, 0.2);
    color: white;
    width: 50px;
    height: 50px;
    border-radius: 50%; 
    cursor: pointer;
    font-size: 1.2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 20;
    transition: all 0.3s ease;
}

.nav-arrow:hover {
    background: var(--color-primary);
    border-color: var(--color-primary);
}

.nav-arrow.left { left: 20px; }
.nav-arrow.right { right: 20px; }

.modal-thumbnails {
    display: flex;
    justify-content: center;
    gap: 10px;
    padding-top: 15px;
    overflow-x: auto;
    scrollbar-width: thin; /* Hace la barra de scroll más fina si hay muchas fotos */
}

.modal-thumbnails img {
    height: 70px;
    width: 70px;
    min-width: 70px; /* <--- Garantiza que el thumbnail no se deforme */
    object-fit: cover;
    cursor: pointer;
    border: 2px solid transparent;
    border-radius: 4px;
    transition: border-color 0.3s ease;
}

.modal-thumbnails img:hover {
    border-color: var(--color-primary);
}

.modal-close {
    position: absolute; 
    top: 20px; 
    right: 20px;
    background: var(--color-primary); 
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    z-index: 25;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    color: #ffffff; 
    transition: all 0.3s ease;
    box-shadow: 0 4px 10px rgba(0,0,0,0.2);
}

.modal-close:hover {
    background: #d32f2f; /* Un rojo elegante para indicar cierre al pasar el mouse */
    transform: scale(1.1);
}

/* =========================================
   FOOTER (LOGOS Y REDES SOCIALES)
   ========================================= */
main {
    background: var(--color-bg);
    z-index: 2;
    position: relative;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.05); 
}

.footer {
    padding: 4rem 0 0rem;
    border-top: 1px solid var(--color-divider);
    background: var(--color-surface);
}

.footer-grid {
    display: grid;
    grid-template-columns: 1.2fr .8fr .8fr;
    gap: 1.5rem;
}

.footer ul {
    list-style: none;
    display: grid;
    gap: .4rem;
}

.footer p, .footer li, .footer a {
    font-size: var(--text-sm);
    color: var(--color-text-muted);
}

.footer-logo {
    height: auto !important; 
    width: 100%;
    max-width: 220px; 
    object-fit: contain;
}

.footer-socials {
    margin-top: 1.5rem;
    display: flex;
    gap: 1rem;
}

.footer-socials a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--color-surface-offset);
    color: var(--color-text);
    font-size: 1.1rem;
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    text-decoration: none;
}

.footer-socials a:hover {
    background-color: var(--color-primary);
    color: var(--color-text-inverse);
    transform: translateY(-4px);
    box-shadow: 0 8px 20px color-mix(in srgb, var(--color-primary) 40%, transparent);
}

.footer-bottom {
    background: var(--color-bg);
}

.reveal {
    opacity: 0;
    transform: translateY(24px);
    transition: opacity .7s ease, transform .7s ease;
}
.reveal.is-visible {
    opacity: 1;
    transform: none;
}

/* =========================================
   MENÚ HAMBURGUESA (BASE)
   ========================================= */
.hamburger {
    display: none; /* Oculto en PC, se activa en los @media */
    flex-direction: column;
    justify-content: space-between;
    width: 30px;
    height: 20px;
    background: transparent;
    border: none;
    cursor: pointer;
    z-index: 100;
}

.hamburger .bar {
    width: 100%;
    height: 2px;
    background: var(--color-text);
    transition: all 0.3s ease;
    border-radius: 2px;
}

/* =========================================
   RESPONSIVE (TABLETS Y MÓVILES)
   ========================================= */
@media (max-width:1024px) {
    .grid-4-layout, .metrics-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .grid-3 { grid-template-columns: 1fr; } 
    .news-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .values-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
    .split-wrapper { gap: 2rem; }

    .navbar {
        flex-direction: row; 
        align-items: center; 
        justify-content: space-between;
        width: 100%;
    }

    .hamburger { display: flex; }

    .nav-menu-wrapper {
        position: fixed;
        top: 0;
        right: -100%; 
        width: 85%;
        max-width: 350px;
        height: 100vh;
        background: var(--color-surface);
        flex-direction: column;
        align-items: flex-start;
        padding: 6rem 2rem 2rem;
        transition: right 0.4s cubic-bezier(0.16, 1, 0.3, 1);
        box-shadow: -10px 0 30px rgba(0,0,0,0.1);
        z-index: 90;
        overflow-y: auto;
        display: flex;
    }

    .nav-menu-wrapper.active { right: 0; }

    .hamburger.active .bar:nth-child(1) { transform: translateY(9px) rotate(45deg); }
    .hamburger.active .bar:nth-child(2) { opacity: 0; }
    .hamburger.active .bar:nth-child(3) { transform: translateY(-9px) rotate(-45deg); }

    .nav-links {
        flex-direction: column;
        align-items: flex-start;
        width: 100%;
        gap: 1.5rem;
    }

    .nav-actions {
        margin-top: 2rem;
        width: 100%;
        justify-content: flex-start;
    }

    .nav-dropdown-menu {
        position: static;
        transform: none !important;
        opacity: 1;
        visibility: visible;
        box-shadow: none;
        background: transparent;
        border: none;
        padding: 0.5rem 0 0 1rem;
        margin-left: 0.5rem;
        border-left: 2px solid var(--color-border);
        pointer-events: auto;
        display: none;
        width: 100%;
    }

    .nav-dropdown:focus-within .nav-dropdown-menu,
    .nav-dropdown.active .nav-dropdown-menu {
        display: grid; 
    }
}

@media (max-width:760px) {

    /* Ajustes específicos del modal para celular */
    .modal-container {
        width: 100%;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
        padding: 20px 15px;
    }
    
    .modal-close {
        top: 15px;
        right: 15px;
    }
    
    .nav-arrow {
        width: 40px;
        height: 40px;
        font-size: 1rem;
    }
    
    .nav-arrow.left { left: 10px; }
    .nav-arrow.right { right: 10px; }
    /* Ajuste Maestro para Hero Caption Izquierdo en celular */
    .hero-caption, .hero-caption2 {
        position: relative; /* Lo sacamos de su posicionamiento absoluto y forzado */
        top: auto;
        left: auto;
        transform: none;
        width: 90%;
        margin: 0 auto;
        padding: 0;
    }
    
    .hero-media {
        height: auto;
        min-height: 500px;
        padding: 4rem 0; /* Espacio para que el texto crezca sin cortarse */
    }

    .hero-caption2 {
        text-align: center; /* En móviles el centro siempre es más amigable, pero fluye correctamente */
    }

    .hero-caption2 h1 {
        font-size: clamp(1.8rem, 8vw, 2.5rem); 
        hyphens: auto; /* Permite dividir palabras larguísimas de ser absolutamente necesario */
    }
    
    .hero-caption h1 {
        font-size: clamp(1.8rem, 8vw, 2.5rem); 
    }

    .split-wrapper {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .side-image {
        height: 260px;
        min-height: 260px;
    }
    
    .split-image-container {
        min-height: 260px;
    }

    /* === MAGIA PARA LA VISTA MÓVIL DE PROYECTOS Y OTRAS TARJETAS === */
    .grid-4-layout, .values-grid, .news-grid, .contact-strip, .form-grid, .footer-grid, .metrics-grid, .project-grid {
        grid-template-columns: 1fr;
    }
    
    .project-filters {
        justify-content: center;
    }
    
    .history-item {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 2rem 0;
    }
    .history-item::before { top: 2.2rem; left: -45px; }
    .history-list { padding-left: 1.5rem; }

    .division-card, .value-card, .news-card, .grid-card {
        padding: 1.5rem;
    }

    .footer-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
        text-align: center;
    }
    .footer-logo {
        margin: 0 auto;
    }
    .footer ul {
        align-items: center;
    }
    .footer-socials {
        justify-content: center;
    }
    
    .modal-container {
        padding: 2rem 1.5rem;
        width: 95%;
    }
    .modal-header h3 {
        font-size: 1.5rem;
    }
}

@media (prefers-reduced-motion:reduce) {
    *, *:before, *:after {
        scroll-behavior: auto;
        transition-duration: .01ms !important;
        animation-duration: .01ms !important;
    }
    .reveal {
        opacity: 1;
        transform: none;
    }
}

/* =========================================
   NUEVAS SECCIONES DE DIVISIONES Y CTA
   ========================================= */

/* Banner Call to Action (CTA) Universal */
.cta-strip {
    background: var(--color-surface-offset);
    padding: 4rem 2rem;
    text-align: center;
    border-radius: 16px;
    margin: 2rem auto;
    max-width: 1000px;
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
}
.cta-strip h2 {
    font-family: var(--font-display);
    font-size: var(--text-2xl);
    margin-bottom: 2rem;
    color: var(--color-text);
}

/* Línea de tiempo Horizontal (Metodología y Urbanización) */
.process-timeline {
    display: flex;
    justify-content: space-between;
    position: relative;
    margin: 3rem 0 1rem;
    gap: 1.5rem;
}
.process-timeline::before {
    content: '';
    position: absolute;
    top: 30px;
    left: 50px;
    right: 50px;
    height: 2px;
    background: var(--color-border);
    z-index: 1;
}
.pt-step {
    position: relative;
    z-index: 2;
    text-align: center;
    flex: 1;
    background: transparent;
}
.pt-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--color-surface);
    border: 3px solid var(--color-primary);
    color: var(--color-primary);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.5rem;
    margin: 0 auto 1.5rem;
    transition: transform 0.3s ease, background 0.3s ease, color 0.3s ease;
    box-shadow: 0 0 0 10px var(--color-bg); /* Oculta la línea de fondo detrás del círculo */
}
.pt-step:hover .pt-icon {
    background: var(--color-primary);
    color: #fff;
    transform: scale(1.1);
}
.pt-step h4 {
    font-size: 1.1rem;
    margin-bottom: 0.5rem;
    font-family: var(--font-display);
}
.pt-step p {
    font-size: 0.9rem;
    color: var(--color-text-muted);
}

/* Tarjetas de Flotilla y Modelos */
.specs-list {
    list-style: none;
    padding: 0;
    margin: 1.5rem 0 0 0;
    text-align: left;
}
.specs-list li {
    font-size: 0.9rem;
    color: var(--color-text-muted);
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--color-divider);
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.specs-list li:last-child {
    border-bottom: none;
}
.specs-list i {
    color: var(--color-primary);
    width: 20px;
}

/* Pilares de Guardería (Warm Colors) */
.pillar-card {
    background: var(--color-surface); /* Aquí está el cambio clave */
    border-top: 4px solid var(--color-gold);
}
.pillar-card i {
    color: var(--color-gold) !important;
}

/* Ajustes Móviles para la Línea de Tiempo */
@media (max-width: 760px) {
    .process-timeline {
        flex-direction: column;
        gap: 2rem;
    }
    .process-timeline::before {
        top: 30px;
        bottom: 30px;
        left: 29px;
        right: auto;
        width: 2px;
        height: auto;
    }
    .pt-step {
        display: flex;
        text-align: left;
        align-items: flex-start;
        gap: 1.5rem;
    }
    .pt-icon {
        margin: 0;
        box-shadow: 0 0 0 8px var(--color-bg);
        flex-shrink: 0;
    }
}

