/* ==========================================================================
   CSS Variables & Settings (Basado en requerimientos)
   ========================================================================== */
   :root {
    /* Paleta Principal */
    --color-bg: #0f1724;
    --color-surface: #0b1220;
    --color-primary: #0ea5d3;
    --color-primary-hover: #0c8bb2;
    --color-accent: #ff6b6b;
    --color-muted: #94a3b8;
    --color-white: #ffffff;
    --color-error: #ef4444;
    --color-success: #10b981;

    /* Tipografías */
    --font-heading: 'Poppins', sans-serif;
    --font-body: 'Inter', sans-serif;
    
    /* Escala de espacios (Base 4px) */
    --space-0: 0;
    --space-4: 4px;
    --space-8: 8px;
    --space-12: 12px;
    --space-16: 16px;
    --space-24: 24px;
    --space-32: 32px;
    --space-48: 48px;
    --space-64: 64px;

    /* Layout */
    --container-max: 1200px;
    --header-height: 80px;

    /* Sombras y Transiciones */
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.3);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.4);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.5);
    --glass-bg: rgba(11, 18, 32, 0.85);
    --transition-fast: 150ms ease-out;
    --transition-normal: 250ms ease-out;
    --transition-reveal: 700ms cubic-bezier(0.2, 0.8, 0.2, 1);
}

/* Modo Claro */
.light-theme {
    --color-bg: #f8fafc;
    --color-surface: #ffffff;
    --color-muted: #475569;
    --color-white: #0f172a;
    --glass-bg: rgba(255, 255, 255, 0.9);
    --shadow-sm: 0 2px 4px rgba(0,0,0,0.05);
    --shadow-md: 0 4px 12px rgba(0,0,0,0.1);
    --shadow-lg: 0 10px 25px rgba(0,0,0,0.1);
}

/* ==========================================================================
   Resets y Base
   ========================================================================== */
*, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: var(--header-height);
}

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

img, picture, svg { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; transition: color var(--transition-fast); }
ul { list-style: none; }
button, input, textarea { font: inherit; color: inherit; border: none; background: transparent; }
button { cursor: pointer; }

/* Tipografía */
h1, h2, h3, h4 { font-family: var(--font-heading); line-height: 1.2; margin-bottom: var(--space-16); color: var(--color-white); }
h1 { font-size: clamp(2.2rem, 5vw, 4rem); font-weight: 800; }
h2 { font-size: clamp(1.8rem, 4vw, 2.5rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }
p { margin-bottom: var(--space-16); color: var(--color-muted); font-weight: 300; }
strong { font-weight: 600; color: var(--color-white); }

:focus-visible { outline: 3px solid var(--color-primary); outline-offset: 3px; }

/* ==========================================================================
   Utilidades Globales
   ========================================================================== */
.container {
    max-width: var(--container-max);
    margin: 0 auto;
    padding-inline: var(--space-16);
}

.sr-only {
    position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); border: 0;
}

.bg-surface { background-color: var(--color-surface); }
.section { padding-block: var(--space-64); }
.section-header { text-align: center; margin-bottom: var(--space-48); max-width: 700px; margin-inline: auto; }
.grid { display: grid; gap: var(--space-24); }

.skip-link {
    position: absolute; top: -100%; left: var(--space-16);
    background: var(--color-primary); color: #fff;
    padding: var(--space-8) var(--space-16); z-index: 9999;
    transition: top var(--transition-fast);
}
.skip-link:focus { top: var(--space-16); }

/* Botones */
.btn {
    display: inline-flex; align-items: center; justify-content: center;
    padding: var(--space-12) var(--space-24); border-radius: 4px;
    font-weight: 600; font-family: var(--font-body); text-align: center;
    transition: transform var(--transition-fast), box-shadow var(--transition-fast), background var(--transition-fast);
}
.btn:hover { transform: scale(1.03); box-shadow: var(--shadow-md); }
.btn:active { transform: scale(0.98); }

.btn-primary { background: var(--color-primary); color: #fff; }
.btn-primary:hover { background: var(--color-primary-hover); }

.btn-secondary { border: 2px solid var(--color-muted); color: var(--color-white); }
.btn-secondary:hover { border-color: var(--color-white); background: rgba(255,255,255,0.05); }

.btn-text { padding: 0; color: var(--color-primary); font-weight: 600; }
.btn-text:hover { color: var(--color-primary-hover); transform: none; box-shadow: none; text-decoration: underline; }
.btn-block { width: 100%; }

/* ==========================================================================
   Header & Navbar
   ========================================================================== */
.header {
    position: fixed; top: 0; width: 100%; height: var(--header-height);
    background: var(--glass-bg); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px);
    z-index: 1000; border-bottom: 1px solid rgba(255,255,255,0.05);
    transition: box-shadow var(--transition-fast);
}
.header.scrolled { box-shadow: var(--shadow-md); }
.header-container { display: flex; justify-content: space-between; align-items: center; height: 100%; }

.logo img { 
    max-height: 70px; 
    width: auto; 
}

.nav { display: flex; align-items: center; gap: var(--space-32); }
.nav-list { display: flex; gap: var(--space-24); }
.nav-link { font-weight: 600; font-size: 0.95rem; }
.nav-link:hover { color: var(--color-primary); }
.nav-actions { display: flex; align-items: center; gap: var(--space-16); }

.icon-btn { padding: var(--space-8); border-radius: 50%; transition: background var(--transition-fast); }
.icon-btn:hover { background: rgba(255,255,255,0.1); }

/* Hamburger (Mobile) */
.hamburger { display: none; flex-direction: column; gap: 5px; padding: var(--space-4); z-index: 1001; }
.hamburger .bar { width: 25px; height: 3px; background: var(--color-white); transition: 0.3s; }
.hamburger[aria-expanded="true"] .bar:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.hamburger[aria-expanded="true"] .bar:nth-child(2) { opacity: 0; }
.hamburger[aria-expanded="true"] .bar:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }


/* ==========================================================================
   Hero Section (Fullscreen Image + Glass Text)
   ========================================================================== */
   .hero-title, 
.hero-subtitle {
    color: #ffffff !important;
}

.fullscreen-hero {
    position: relative;
    height: 100vh;
    display: flex;
    align-items: center;
    overflow: hidden;
    padding-top: var(--header-height);
}

.hero-carousel-bg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.carousel-slide {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity 1.5s ease-in-out, transform 6s ease-in-out;
    transform: scale(1.05);
}

.carousel-slide.active {
    opacity: 1;
    transform: scale(1);
    z-index: 1;
}

.carousel-slide img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-overlay-global {
    position: absolute;
    inset: 0;
    background: rgba(11, 18, 32, 0.4); 
    z-index: 2;
}

.hero-content-wrapper {
    position: relative;
    z-index: 3;
    width: 100%;
}

.hero-text-glass {
    max-width: 650px;
    padding: var(--space-48);
    background: rgba(11, 18, 32, 0.65);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 16px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: var(--shadow-lg);
    
    opacity: 0;
    transform: translateX(50vw);
    animation: slideGlassFromCenter 1.2s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
}

@keyframes slideGlassFromCenter {
    to { opacity: 1; transform: translateX(0); }
}

.hero-title {
    font-size: clamp(2.2rem, 4vw, 3.5rem);
    margin-bottom: var(--space-16);
    line-height: 1.1;
    color: #fff;
}

.hero-subtitle {
    font-size: 1.1rem;
    color: rgba(255, 255, 255, 0.9);
    margin-bottom: var(--space-32);
}

.hero-cta { display: flex; gap: var(--space-16); flex-wrap: wrap; }

.carousel-indicators {
    position: absolute;
    bottom: var(--space-32);
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: var(--space-12);
    z-index: 5;
}

.indicator {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.4);
    cursor: pointer;
    transition: all var(--transition-fast);
}

.indicator.active {
    background: var(--color-primary);
    transform: scale(1.3);
}

@media (max-width: 768px) {
    .hero-text-glass {
        padding: var(--space-32) var(--space-24);
        border-radius: 12px;
    }
}

/* ==========================================================================
   Nosotros & Stats
   ========================================================================== */
.about-grid { grid-template-columns: 1fr; align-items: center; gap: var(--space-48); }
.features-list li { display: flex; align-items: center; gap: var(--space-12); margin-bottom: var(--space-12); font-weight: 600; color: var(--color-white); }
.features-list svg { color: var(--color-primary); flex-shrink: 0; }
.about-stats { display: flex; gap: var(--space-24); flex-wrap: wrap; }

.stat-card {
    background: var(--color-surface); padding: var(--space-24); border-radius: 8px;
    text-align: center; flex: 1; min-width: 140px; border-bottom: 3px solid var(--color-primary);
    box-shadow: var(--shadow-sm);
}
.stat-number-wrapper { display: flex; justify-content: center; align-items: center; margin-bottom: var(--space-8); }
.stat-number, .stat-symbol { font-size: 3.5rem; font-weight: 800; color: var(--color-primary); line-height: 1; }
.stat-label { font-size: 0.9rem; color: var(--color-muted); text-transform: uppercase; letter-spacing: 1px; }


/* ==========================================================================
   Grid de Tarjetas (Productos/Servicios)
   ========================================================================== */
.cards-grid { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.card {
    background: var(--color-bg); border-radius: 8px; overflow: hidden;
    box-shadow: var(--shadow-sm); transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    border: 1px solid rgba(255,255,255,0.05); display: flex; flex-direction: column;
}
.card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--color-primary); }
.card-img { height: 220px; overflow: hidden; }
.card-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.card:hover .card-img img { transform: scale(1.05); }
.card-body { padding: var(--space-24); flex-grow: 1; display: flex; flex-direction: column; align-items: flex-start; }
.card-body p { flex-grow: 1; }
.card-body .btn-text { margin-top: var(--space-16); }


/* ==========================================================================
   Representaciones
   ========================================================================== */
.rep-grid { grid-template-columns: 1fr; }
.rep-item {
    background: var(--color-surface); padding: var(--space-32); border-radius: 8px;
    border-left: 4px solid var(--color-accent); box-shadow: var(--shadow-sm);
    transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
    cursor: default;
}
.rep-item:hover {
    transform: translateY(-6px) scale(1.02);
    box-shadow: var(--shadow-lg);
    border-left-color: var(--color-primary);
    background: linear-gradient(135deg, var(--color-surface) 60%, rgba(14, 165, 211, 0.08));
}
.rep-item h3 { color: var(--color-accent); font-size: 1.5rem; transition: color 0.3s ease; }
.rep-item:hover h3 { color: var(--color-primary); }


/* ==========================================================================
   Sección Operativa y Respaldo (Tarjetas Bento)
   ========================================================================== */
.bento-grid {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-24);
    justify-content: center;
}

.bento-card {
    background: var(--color-bg); padding: var(--space-32); border-radius: 8px;
    border-top: 4px solid var(--color-primary); box-shadow: var(--shadow-sm);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    display: flex; flex-direction: column;
    flex: 0 1 100%;
    width: 100%;
}

.bento-card:hover { transform: translateY(-8px); box-shadow: var(--shadow-lg); border-color: var(--color-accent); }

.bento-icon {
    color: var(--color-accent); margin-bottom: var(--space-16); background: rgba(255, 107, 107, 0.1);
    width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
    transition: background var(--transition-fast);
}

.bento-card:hover .bento-icon { background: var(--color-accent); color: #fff; }
.bento-card h3 { font-size: 1.2rem; color: var(--color-white); margin-bottom: var(--space-12); }
.bento-card p { flex-grow: 1; font-size: 0.95rem; }

.bento-links { display: flex; gap: var(--space-8); margin-top: var(--space-16); flex-wrap: wrap; }
.bento-links a {
    font-size: 0.8rem; font-weight: 600; padding: var(--space-4) var(--space-8);
    background: rgba(255, 255, 255, 0.05); border: 1px solid var(--color-muted);
    border-radius: 4px; transition: all var(--transition-fast);
}
.bento-links a:hover { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }

/* ==========================================================================
   Sección Contacto (Estilo Split Layout)
   ========================================================================== */
.contact-split { display: grid; grid-template-columns: 1fr; gap: var(--space-48); align-items: stretch; }

@media (min-width: 850px) {
    .contact-split { grid-template-columns: 1fr 1fr; gap: var(--space-64); }
}

.contact-form-side { display: flex; flex-direction: column; }
.contact-title { position: relative; padding-bottom: var(--space-16); margin-bottom: var(--space-32); font-size: clamp(2rem, 4vw, 3rem); }
.contact-title::after { content: ''; position: absolute; left: 0; bottom: 0; width: 45px; height: 4px; background-color: var(--color-accent); }

.form-group-clean { margin-bottom: var(--space-16); }
.form-group-clean input, .form-group-clean textarea {
    width: 100%; padding: var(--space-16); background-color: var(--color-surface); border: 2px solid transparent;
    border-radius: 4px; font-size: 1rem; color: var(--color-white); transition: border-color var(--transition-fast), background-color var(--transition-fast);
}
.form-group-clean input:focus, .form-group-clean textarea:focus { outline: none; border-color: var(--color-primary); background-color: rgba(255, 255, 255, 0.05); }
.form-group-clean input[aria-invalid="true"], .form-group-clean textarea[aria-invalid="true"] { border-color: var(--color-error); }
.error-msg { display: block; color: var(--color-error); font-size: 0.8rem; margin-top: var(--space-4); min-height: 1.2em; }

.btn-accent { background-color: var(--color-accent); color: #fff; }
.btn-accent:hover { background-color: #e55a5a; }
.form-submit-btn { align-self: flex-start; padding: var(--space-12) var(--space-48); margin-top: var(--space-8); }

.contact-info-side {
    background-color: var(--color-surface); border-radius: 8px; overflow: hidden; 
    display: flex; flex-direction: column; box-shadow: var(--shadow-sm);
}

.info-content { padding: var(--space-48); flex-grow: 1; }
.info-block { margin-bottom: var(--space-32); }
.info-block:last-child { margin-bottom: 0; }
.info-block h3 { font-size: 1.1rem; text-transform: uppercase; letter-spacing: 1px; margin-bottom: var(--space-16); color: var(--color-white); }
.info-block p { margin-bottom: var(--space-4); color: var(--color-muted); font-size: 1.05rem; }

.map-wrapper { width: 100%; height: 350px; margin-top: auto; }
.map-wrapper iframe { width: 100%; height: 100%; border: none; filter: grayscale(80%) invert(100%) contrast(90%); }
.light-theme .map-wrapper iframe { filter: none; }


/* ==========================================================================
   Footer y Generales
   ========================================================================== */
.footer { background: var(--color-surface); padding-top: var(--space-64); border-top: 1px solid rgba(255,255,255,0.05); }
.footer-grid { grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); gap: var(--space-32); margin-bottom: var(--space-48); }
.footer-col h3 { margin-bottom: var(--space-16); font-size: 1.1rem; }
.footer-col ul li { margin-bottom: var(--space-8); }
.footer-col ul li a:hover { color: var(--color-primary); }
.footer-bottom { border-top: 1px solid rgba(255,255,255,0.05); padding: var(--space-16) 0; text-align: center; font-size: 0.9rem; color: var(--color-muted); }

.modal { position: fixed; inset: 0; z-index: 2000; display: flex; align-items: center; justify-content: center; padding: var(--space-16); }
.modal[hidden] { display: none; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,0.8); backdrop-filter: blur(4px); }
.modal-content {
    position: relative; background: var(--color-surface); padding: var(--space-32);
    border-radius: 8px; max-width: 600px; width: 100%; z-index: 1; box-shadow: var(--shadow-lg);
}
.modal-content ul { margin-bottom: var(--space-16); padding-left: var(--space-24); list-style: disc; color: var(--color-muted); }
.close-btn { position: absolute; top: var(--space-16); right: var(--space-16); background: none; border: none; font-size: 2rem; line-height: 1; color: var(--color-muted); }
.close-btn:hover { color: var(--color-white); }

.toast {
    position: fixed; bottom: var(--space-24); left: 50%; transform: translateX(-50%);
    background: var(--color-success); color: #fff; padding: var(--space-12) var(--space-24);
    border-radius: 4px; box-shadow: var(--shadow-md); z-index: 3000; transition: opacity var(--transition-normal);
}

.sticky-cta {
    display: none; position: fixed; bottom: var(--space-24); right: var(--space-24);
    background: var(--color-accent); color: #fff; padding: var(--space-12) var(--space-24);
    border-radius: 30px; font-weight: 600; box-shadow: var(--shadow-lg); z-index: 900;
    align-items: center; gap: var(--space-8); transition: transform var(--transition-fast);
}
.sticky-cta:hover { transform: scale(1.05); }

.reveal { opacity: 0; transform: translateY(30px); transition: opacity var(--transition-reveal), transform var(--transition-reveal); }
.reveal.active { opacity: 1; transform: translateY(0); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

/* ==========================================================================
   Media Queries Base
   ========================================================================== */
@media (min-width: 560px) {
    .rep-grid { grid-template-columns: repeat(2, 1fr); }
    .bento-card { flex: 0 1 calc(33.333% - 16px); width: auto; }
}

@media (min-width: 768px) {
    .about-grid { grid-template-columns: 1fr 1fr; }
    .hamburger { display: none; }
    .nav { flex-direction: row; }
    .sticky-cta { display: flex; }
}

@media (min-width: 1050px) {
    .rep-grid { grid-template-columns: repeat(4, 1fr); }
    .bento-card { flex: 0 1 calc(33.333% - 16px); width: auto; }
}

@media (max-width: 767px) {
    .hamburger { display: flex; }
    .nav {
        position: fixed; top: var(--header-height); left: 0;
        width: 100%; height: calc(100vh - var(--header-height));
        background: var(--color-surface); flex-direction: column;
        padding: var(--space-32); transform: translateX(100%);
        transition: transform var(--transition-normal);
    }
    .nav.active { transform: translateX(0); }
    .nav-list { flex-direction: column; align-items: center; width: 100%; }
    .nav-link { font-size: 1.2rem; }
}

/* Accesibilidad: Reducción de movimiento */
@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
    .reveal { opacity: 1; transform: none; transition: none; }
}


/* ==========================================================================
   Switch de Idioma (Premium Pill) y Fix Traductor
   ========================================================================== */
.lang-switch-container {
    position: relative;
    margin-right: var(--space-8);
}

.lang-checkbox { display: none; }

.lang-label {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 68px;
    height: 32px;
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 30px;
    position: relative;
    cursor: pointer;
    padding: 0 8px;
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.3);
}

.light-theme .lang-label {
    background: rgba(0, 0, 0, 0.05);
    border-color: rgba(0, 0, 0, 0.1);
    box-shadow: inset 0 2px 4px rgba(0,0,0,0.1);
}

.lang-text {
    font-size: 0.75rem;
    font-weight: 800;
    z-index: 1;
    color: var(--color-muted);
    transition: color 0.3s ease;
    user-select: none;
}

/* Colores dinámicos según selección */
.lang-text.es { color: var(--color-white); }
.light-theme .lang-text.es { color: var(--color-bg); }

.lang-checkbox:checked + .lang-label .lang-text.en { color: var(--color-white); }
.light-theme .lang-checkbox:checked + .lang-label .lang-text.en { color: var(--color-bg); }

.lang-checkbox:checked + .lang-label .lang-text.es { color: var(--color-muted); }

/* La "bolita" que se desliza */
.lang-slider {
    position: absolute;
    top: 2px;
    left: 2px;
    width: 32px;
    height: 26px;
    background: var(--color-primary);
    border-radius: 20px;
    transition: transform 0.3s cubic-bezier(0.25, 0.1, 0.25, 1), background 0.3s;
    box-shadow: 0 2px 5px rgba(0,0,0,0.2);
}

.lang-checkbox:checked + .lang-label .lang-slider {
    transform: translateX(30px);
    background: var(--color-accent); /* Cambia a rojo cuando está en inglés */
}

/* ==========================================================================
   Estilos para Banderas Telefónicas
   ========================================================================== */

.flag-icon {
    display: inline-block;
    width: 1.2em;
    height: 0.75em;
    object-fit: cover;
    margin-right: 0.20em;
    vertical-align: 0.02em;
    border-radius: 2px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

.info-block a {
    color: var(--color-primary);
    text-decoration: none;
    transition: color var(--transition-fast);
}

.info-block a:hover {
    color: var(--color-accent);
    text-decoration: underline;
}

.light-theme .info-block a {
    color: var(--color-primary);
}

.light-theme .info-block a:hover {
    color: var(--color-accent);
}

