/* 
   Cedeño Morales Montajes Industriales S.A.
   Hoja de Estilos Moderna (Vanilla CSS)
*/

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&display=swap');

/* --- Capas del Cascade --- */
@layer reset, base, theme, layout, components, utilities;

@layer reset {
  *, *::before, *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
  }
  
  html {
    scroll-behavior: smooth;
    scroll-padding-top: 80px;
    -webkit-text-size-adjust: 100%;
  }

  body {
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
  }

  img, picture, video, canvas, svg {
    display: block;
    max-width: 100%;
    height: auto;
  }

  input, button, textarea, select {
    font: inherit;
  }

  a {
    text-decoration: none;
    color: inherit;
  }

  ul, ol {
    list-style: none;
  }
}

@layer base {
  :root {
    /* --- Tipografías --- */
    --font-heading: 'Outfit', sans-serif;
    --font-body: 'Inter', sans-serif;

    /* --- Tokens de Espaciado --- */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2.5rem;
    --space-xl: 4rem;
    --space-xxl: 6rem;

    /* --- Bordes y Transiciones --- */
    --radius-sm: 0.375rem;
    --radius-md: 0.75rem;
    --radius-lg: 1.25rem;
    --radius-full: 9999px;
    --transition-fast: 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    --transition-slow: 0.5s cubic-bezier(0.4, 0, 0.2, 1);

    /* --- Sombras --- */
    --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
    --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
    --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1), 0 4px 6px -2px rgba(0, 0, 0, 0.05);
    --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15), 0 10px 10px -5px rgba(0, 0, 0, 0.04);
  }

  body {
    font-family: var(--font-body);
    font-size: 1rem;
    background-color: var(--bg-primary);
    color: var(--text-primary);
    transition: background-color var(--transition-normal), color var(--transition-normal);
  }

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

  h1 {
    font-size: clamp(2.5rem, 1rem + 5vw, 4.5rem);
    text-wrap: balance;
  }

  h2 {
    font-size: clamp(1.8rem, 1rem + 3vw, 3rem);
    text-wrap: balance;
    margin-bottom: var(--space-md);
  }

  h3 {
    font-size: clamp(1.4rem, 1rem + 1.5vw, 2rem);
  }

  p {
    font-size: clamp(0.95rem, 0.9rem + 0.2vw, 1.1rem);
    font-weight: 400;
    color: var(--text-secondary);
    text-wrap: pretty;
  }
}

@layer theme {
  /* --- Esquema de Colores --- */
  :root {
    color-scheme: light dark;

    /* Tonos base HSL */
    --hue-brand: 24;       /* Naranja industrial / cobre */
    --hue-primary: 220;    /* Azul cobalto / acero */
    --hue-dark: 224;       /* Gris azulado muy oscuro */

    /* Colores del Tema Claro */
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    
    --text-primary: #334155;
    --text-secondary: #64748b;
    --text-title: #0f172a;
    
    --brand-color: hsl(var(--hue-brand), 90%, 50%);
    --brand-hover: hsl(var(--hue-brand), 90%, 42%);
    --brand-light: hsl(var(--hue-brand), 95%, 96%);
    
    --accent-color: hsl(var(--hue-primary), 80%, 45%);
    --accent-hover: hsl(var(--hue-primary), 80%, 38%);
    
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --card-shadow: var(--shadow-md);
  }

  /* Sobrescribir variables para Modo Oscuro */
  @media (prefers-color-scheme: dark) {
    :root {
      --bg-primary: #0b0f19;
      --bg-secondary: #111827;
      --bg-tertiary: #1f2937;
      
      --text-primary: #d1d5db;
      --text-secondary: #9ca3af;
      --text-title: #f9fafb;
      
      --brand-color: hsl(var(--hue-brand), 85%, 52%);
      --brand-hover: hsl(var(--hue-brand), 85%, 60%);
      --brand-light: rgba(249, 115, 22, 0.1);
      
      --accent-color: hsl(var(--hue-primary), 70%, 55%);
      --accent-hover: hsl(var(--hue-primary), 70%, 65%);
      
      --border-color: #374151;
      --glass-bg: rgba(17, 24, 39, 0.75);
      --glass-border: rgba(255, 255, 255, 0.08);
      --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
    }
  }

  /* Soporte para selección manual */
  :root[data-theme="light"] {
    color-scheme: light;
    --bg-primary: #f8fafc;
    --bg-secondary: #ffffff;
    --bg-tertiary: #f1f5f9;
    --text-primary: #334155;
    --text-secondary: #64748b;
    --text-title: #0f172a;
    --brand-color: hsl(var(--hue-brand), 90%, 50%);
    --brand-hover: hsl(var(--hue-brand), 90%, 42%);
    --brand-light: hsl(var(--hue-brand), 95%, 96%);
    --accent-color: hsl(var(--hue-primary), 80%, 45%);
    --accent-hover: hsl(var(--hue-primary), 80%, 38%);
    --border-color: #e2e8f0;
    --glass-bg: rgba(255, 255, 255, 0.7);
    --glass-border: rgba(255, 255, 255, 0.4);
    --card-shadow: var(--shadow-md);
  }

  :root[data-theme="dark"] {
    color-scheme: dark;
    --bg-primary: #0b0f19;
    --bg-secondary: #111827;
    --bg-tertiary: #1f2937;
    --text-primary: #d1d5db;
    --text-secondary: #9ca3af;
    --text-title: #f9fafb;
    --brand-color: hsl(var(--hue-brand), 85%, 52%);
    --brand-hover: hsl(var(--hue-brand), 85%, 60%);
    --brand-light: rgba(249, 115, 22, 0.1);
    --accent-color: hsl(var(--hue-primary), 70%, 55%);
    --accent-hover: hsl(var(--hue-primary), 70%, 65%);
    --border-color: #374151;
    --glass-bg: rgba(17, 24, 39, 0.75);
    --glass-border: rgba(255, 255, 255, 0.08);
    --card-shadow: 0 10px 15px -3px rgba(0, 0, 0, 0.3);
  }
}

@layer layout {
  .container {
    width: 100%;
    max-width: 1200px;
    margin-inline: auto;
    padding-inline: var(--space-md);
  }

  .grid {
    display: grid;
    gap: var(--space-md);
  }

  .grid-2 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .grid-3 {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  @media (min-width: 768px) {
    .grid-2 {
      grid-template-columns: repeat(2, 1fr);
    }
    .grid-3 {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (min-width: 1024px) {
    .grid-3 {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  section {
    padding-block: var(--space-xl);
  }

  @media (min-width: 768px) {
    section {
      padding-block: var(--space-xxl);
    }
  }

  .section-header {
    text-align: center;
    max-width: 700px;
    margin-inline: auto;
    margin-bottom: var(--space-xl);
  }

  .section-header span {
    font-family: var(--font-heading);
    font-size: 0.875rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: var(--brand-color);
    display: block;
    margin-bottom: var(--space-xs);
  }
}

@layer components {
  /* --- Header / Navigation --- */
  .navbar-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    z-index: 1000;
    background: var(--glass-bg);
    backdrop-filter: blur(12px) saturate(180%);
    border-bottom: 1px solid var(--glass-border);
    transition: background var(--transition-normal), border var(--transition-normal);
  }

  .navbar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    height: 80px;
  }

  .logo {
    display: flex;
    align-items: center;
    gap: var(--space-xs);
  }

  .logo img {
    height: 50px;
    width: auto;
    transition: transform var(--transition-fast);
  }

  .logo:hover img {
    transform: scale(1.05);
  }

  .logo-text {
    font-family: var(--font-heading);
    font-weight: 800;
    font-size: 1.25rem;
    color: var(--text-title);
    line-height: 1;
  }

  .logo-text span {
    color: var(--brand-color);
    font-size: 0.75rem;
    display: block;
    font-weight: 500;
    letter-spacing: 0.1em;
  }

  .nav-menu {
    display: none;
    gap: var(--space-lg);
  }

  .nav-link {
    font-size: 0.95rem;
    font-weight: 500;
    color: var(--text-primary);
    position: relative;
    transition: color var(--transition-fast);
    padding-block: var(--space-xs);
  }

  .nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 2px;
    background-color: var(--brand-color);
    transition: width var(--transition-fast);
  }

  .nav-link:hover {
    color: var(--brand-color);
  }

  .nav-link:hover::after,
  .nav-link.active::after {
    width: 100%;
  }

  .nav-link.active {
    color: var(--brand-color);
  }

  .nav-controls {
    display: flex;
    align-items: center;
    gap: var(--space-md);
  }

  /* Botón Dark/Light Mode */
  .theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--border-color);
    border-radius: var(--radius-full);
    width: 40px;
    height: 40px;
    display: grid;
    place-items: center;
    cursor: pointer;
    color: var(--text-primary);
    transition: background var(--transition-fast), border var(--transition-fast);
  }

  .theme-toggle-btn:hover {
    background: var(--bg-tertiary);
    border-color: var(--brand-color);
    color: var(--brand-color);
  }

  .theme-toggle-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
  }

  /* Iconos Sol/Luna */
  .theme-toggle-btn .sun-icon {
    display: none;
  }

  :root[data-theme="dark"] .theme-toggle-btn .moon-icon {
    display: none;
  }

  :root[data-theme="dark"] .theme-toggle-btn .sun-icon {
    display: block;
  }

  /* Hamburger Menu Mobile */
  .menu-toggle-btn {
    background: transparent;
    border: none;
    cursor: pointer;
    color: var(--text-primary);
    width: 30px;
    height: 30px;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
  }

  .menu-toggle-btn span {
    width: 100%;
    height: 3px;
    background-color: currentColor;
    border-radius: var(--radius-full);
    transition: transform var(--transition-fast), opacity var(--transition-fast);
  }

  @media (min-width: 768px) {
    .nav-menu {
      display: flex;
    }
    .menu-toggle-btn {
      display: none;
    }
  }

  /* Menú desplegable móvil */
  .mobile-menu {
    position: fixed;
    top: 80px;
    left: 0;
    width: 100%;
    background-color: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: var(--space-md) var(--space-md) var(--space-lg);
    display: flex;
    flex-direction: column;
    gap: var(--space-md);
    transform: translateY(-100%);
    opacity: 0;
    pointer-events: none;
    transition: transform var(--transition-normal), opacity var(--transition-normal);
    z-index: 999;
  }

  .mobile-menu.open {
    transform: translateY(0);
    opacity: 1;
    pointer-events: all;
  }

  .mobile-menu .nav-link {
    font-size: 1.1rem;
    padding-block: var(--space-xs);
  }

  /* --- Botones --- */
  .btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.75rem 1.75rem;
    font-weight: 600;
    border-radius: var(--radius-md);
    transition: background var(--transition-fast), transform var(--transition-fast), box-shadow var(--transition-fast);
    cursor: pointer;
    border: 2px solid transparent;
  }

  .btn-primary {
    background-color: var(--brand-color);
    color: #ffffff;
  }

  .btn-primary:hover {
    background-color: var(--brand-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(249, 115, 22, 0.3);
  }

  .btn-secondary {
    background-color: transparent;
    border-color: var(--border-color);
    color: var(--text-title);
  }

  .btn-secondary:hover {
    background-color: var(--bg-tertiary);
    border-color: var(--brand-color);
    transform: translateY(-2px);
  }

  /* --- Hero Section --- */
  .hero-section {
    position: relative;
    padding-top: 140px;
    padding-bottom: var(--space-xl);
    min-height: 95dvh;
    display: grid;
    align-items: center;
    overflow: hidden;
  }

  .hero-video-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    pointer-events: none;
  }

  .hero-video-bg video {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  .hero-overlay-dark {
    position: absolute;
    inset: 0;
    background: linear-gradient(
      to bottom,
      rgba(11, 15, 25, 0.65) 0%,
      rgba(11, 15, 25, 0.85) 100%
    );
    z-index: 2;
  }

  .hero-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    align-items: center;
    position: relative;
    z-index: 4;
  }

  @media (min-width: 1024px) {
    .hero-grid {
      grid-template-columns: 1.2fr 0.8fr;
    }
  }

  .hero-content {
    z-index: 10;
  }

  .hero-badge {
    display: inline-block;
    padding: 0.35rem 0.85rem;
    background-color: var(--brand-light);
    color: var(--brand-color);
    font-weight: 700;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-radius: var(--radius-full);
    margin-bottom: var(--space-md);
  }

  /* Asegurar que la tipografía del Hero sea siempre blanca para alto contraste con el video */
  .hero-title h1, .hero-title {
    color: #ffffff !important;
    margin-bottom: var(--space-md);
    text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
  }

  .hero-title span {
    color: var(--brand-color);
    background: linear-gradient(135deg, var(--brand-color), #ff9800);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
  }

  .hero-description {
    font-size: 1.2rem;
    line-height: 1.6;
    margin-bottom: var(--space-lg);
    max-width: 600px;
    color: rgba(255, 255, 255, 0.85) !important;
    text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  }

  .hero-buttons {
    display: flex;
    flex-wrap: wrap;
    gap: var(--space-sm);
  }

  .hero-buttons .btn-secondary {
    border-color: rgba(255, 255, 255, 0.5);
    color: #ffffff;
  }

  .hero-buttons .btn-secondary:hover {
    background-color: rgba(255, 255, 255, 0.1);
    border-color: var(--brand-color);
  }

  .hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 5;
  }

  .hero-visual-container {
    position: relative;
    width: 100%;
    max-width: 450px;
    aspect-ratio: 1;
    border-radius: var(--radius-lg);
    background: linear-gradient(135deg, var(--brand-color), var(--accent-color));
    padding: 3px;
    box-shadow: var(--shadow-xl);
    overflow: hidden;
  }

  .hero-visual-inner {
    width: 100%;
    height: 100%;
    background-color: var(--bg-secondary);
    border-radius: calc(var(--radius-lg) - 3px);
    overflow: hidden;
    position: relative;
    display: grid;
    place-items: center;
  }

  .hero-visual-inner img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  /* Chispa/Efecto fondo decorativo */
  .decorative-circle {
    position: absolute;
    width: 300px;
    height: 300px;
    background-color: var(--brand-color);
    filter: blur(120px);
    opacity: 0.15;
    border-radius: var(--radius-full);
    z-index: 3;
    pointer-events: none;
  }

  /* --- Tarjetas de Características (Pillars) --- */
  .feature-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-normal), border var(--transition-normal), box-shadow var(--transition-normal);
    position: relative;
    overflow: hidden;
  }

  .feature-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background-color: transparent;
    transition: background-color var(--transition-fast);
  }

  .feature-card:hover {
    transform: translateY(-5px);
    border-color: var(--brand-color);
    box-shadow: var(--shadow-xl);
  }

  .feature-card:hover::before {
    background-color: var(--brand-color);
  }

  .feature-icon-wrapper {
    background-color: var(--brand-light);
    color: var(--brand-color);
    width: 60px;
    height: 60px;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    margin-bottom: var(--space-md);
  }

  .feature-icon-wrapper svg {
    width: 30px;
    height: 30px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
  }

  .feature-card h3 {
    margin-bottom: var(--space-xs);
  }

  /* --- Sección Quiénes Somos (Con imagen de fondo decorativo) --- */
  .intro-badge-section {
    background-color: var(--bg-tertiary);
    border-radius: var(--radius-lg);
    overflow: hidden;
    display: grid;
    grid-template-columns: 1fr;
  }

  @media (min-width: 1024px) {
    .intro-badge-section {
      grid-template-columns: 1fr 1fr;
    }
  }

  .intro-text-side {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    justify-content: center;
  }

  @media (min-width: 768px) {
    .intro-text-side {
      padding: var(--space-xl);
    }
  }

  .intro-image-side {
    background-image: url('../images/obra-estructura-montaje.png');
    background-size: cover;
    background-position: center;
    min-height: 300px;
    position: relative;
  }

  .intro-image-side::after {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(0,0,0,0.5), transparent);
  }

  /* --- Liderazgo / Directivos --- */
  .leaders-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
    max-width: 1000px;
    margin-inline: auto;
  }

  @media (min-width: 640px) {
    .leaders-grid {
      grid-template-columns: repeat(2, 1fr);
    }
  }

  @media (min-width: 1024px) {
    .leaders-grid {
      grid-template-columns: repeat(3, 1fr);
    }
  }

  .leader-card {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--card-shadow);
    transition: transform var(--transition-normal), box-shadow var(--transition-normal);
    text-align: center;
  }

  .leader-card:hover {
    transform: translateY(-5px);
    box-shadow: var(--shadow-xl);
  }

  .leader-img-wrapper {
    width: 100%;
    aspect-ratio: 1;
    overflow: hidden;
    background-color: var(--bg-tertiary);
    position: relative;
  }

  .leader-img-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
  }

  .leader-card:hover .leader-img-wrapper img {
    transform: scale(1.05);
  }

  .leader-info {
    padding: var(--space-md);
  }

  .leader-name {
    font-size: 1.25rem;
    margin-bottom: var(--space-xs);
  }

  .leader-role {
    font-size: 0.875rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--brand-color);
  }

  .leader-email {
    font-size: 0.85rem;
    margin-top: var(--space-xs);
  }

  .leader-email a {
    color: var(--text-secondary);
    text-decoration: none;
    transition: color var(--transition-fast);
  }

  .leader-email a:hover {
    color: var(--brand-color);
  }

  /* --- Galería / Portafolio --- */
  .portfolio-filters {
    display: flex;
    justify-content: center;
    flex-wrap: wrap;
    gap: var(--space-xs);
    margin-bottom: var(--space-lg);
  }

  .filter-btn {
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    padding: 0.5rem 1.25rem;
    border-radius: var(--radius-full);
    font-weight: 500;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
  }

  .filter-btn:hover,
  .filter-btn.active {
    background-color: var(--brand-color);
    border-color: var(--brand-color);
    color: #ffffff;
  }

  .portfolio-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: var(--space-md);
  }

  .portfolio-item {
    position: relative;
    border-radius: var(--radius-md);
    overflow: hidden;
    aspect-ratio: 4/3;
    box-shadow: var(--card-shadow);
    cursor: pointer;
  }

  .portfolio-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform var(--transition-normal);
  }

  .portfolio-overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(to top, rgba(15, 23, 42, 0.9), rgba(15, 23, 42, 0.4));
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
    padding: var(--space-md);
    opacity: 0;
    pointer-events: none;
    transition: opacity var(--transition-normal);
  }

  .portfolio-item:hover img {
    transform: scale(1.08);
  }

  .portfolio-item:hover .portfolio-overlay {
    opacity: 1;
    pointer-events: all;
  }

  .portfolio-title {
    color: #ffffff;
    font-size: 1.15rem;
    font-weight: 700;
    margin-bottom: var(--space-xs);
  }

  .portfolio-category {
    color: var(--brand-color);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
  }

  /* Animación para ocultar/mostrar elementos de la galería */
  .portfolio-item {
    transition: transform var(--transition-normal), opacity var(--transition-normal), display var(--transition-normal) allow-discrete;
  }

  .portfolio-item.hidden {
    display: none;
    opacity: 0;
  }

  /* --- Lightbox Modal (Usando <dialog> nativo) --- */
  .lightbox-dialog {
    border: none;
    background: transparent;
    padding: 0;
    max-width: 90vw;
    max-height: 90vh;
    margin: auto;
    overflow: visible;
  }

  .lightbox-dialog::backdrop {
    background-color: rgba(11, 15, 25, 0.95);
    backdrop-filter: blur(8px);
  }

  .lightbox-content {
    position: relative;
    background-color: var(--bg-secondary);
    border-radius: var(--radius-lg);
    border: 1px solid var(--border-color);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    box-shadow: var(--shadow-xl);
  }

  .lightbox-img {
    max-height: 80vh;
    width: auto;
    object-fit: contain;
  }

  .lightbox-caption {
    padding: var(--space-md);
    text-align: center;
    border-top: 1px solid var(--border-color);
  }

  .lightbox-caption h3 {
    margin-bottom: var(--space-xs);
    font-size: 1.2rem;
  }

  .lightbox-close-btn {
    position: absolute;
    top: var(--space-sm);
    right: var(--space-sm);
    background-color: rgba(15, 23, 42, 0.7);
    color: #ffffff;
    border: none;
    width: 36px;
    height: 36px;
    border-radius: var(--radius-full);
    display: grid;
    place-items: center;
    cursor: pointer;
    transition: background-color var(--transition-fast);
    z-index: 10;
  }

  .lightbox-close-btn:hover {
    background-color: var(--brand-color);
  }

  .lightbox-close-btn svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
  }

  /* --- Estadísticas (Contadores) --- */
  .stats-section {
    background-color: var(--bg-secondary);
    border-block: 1px solid var(--border-color);
  }

  .stats-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-lg);
    text-align: center;
  }

  @media (min-width: 768px) {
    .stats-grid {
      grid-template-columns: repeat(4, 1fr);
    }
  }

  .stat-card {
    padding: var(--space-md);
  }

  .stat-number {
    font-family: var(--font-heading);
    font-size: clamp(2.5rem, 1.5rem + 3vw, 4rem);
    font-weight: 800;
    color: var(--brand-color);
    line-height: 1;
    margin-bottom: var(--space-xs);
  }

  .stat-label {
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    color: var(--text-primary);
  }

  /* --- Slider de Clientes Infinito --- */
  .client-slider-container {
    margin-top: var(--space-xl);
    padding-top: var(--space-lg);
    padding-bottom: var(--space-md);
    border-top: 1px dashed var(--border-color);
    overflow: hidden;
    position: relative;
    width: 100%;
  }

  .client-slider-title {
    text-align: center;
    font-size: 0.8rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
  }

  .client-slider-track {
    display: flex;
    width: max-content;
    animation: scroll-left 30s linear infinite;
  }

  /* Pausar animación en hover para mejor experiencia */
  .client-slider-track:hover {
    animation-play-state: paused;
  }

  .client-slider-group {
    display: flex;
    align-items: center;
    justify-content: space-around;
    gap: 4rem;
    padding-right: 4rem; /* Mantener espacio idéntico entre grupos */
  }

  .client-logo {
    font-family: var(--font-heading);
    font-size: 1.15rem;
    font-weight: 800;
    letter-spacing: 0.08em;
    color: var(--text-secondary);
    opacity: 0.55;
    transition: opacity var(--transition-fast), color var(--transition-fast), transform var(--transition-fast);
    user-select: none;
    white-space: nowrap;
    cursor: default;
    display: flex;
    align-items: center;
  }

  .client-logo svg {
    height: 42px; /* Bumping height for larger logos */
    width: auto;
    display: block;
  }

  .client-logo:hover {
    opacity: 1;
    color: var(--brand-color);
    transform: scale(1.08);
  }

  @keyframes scroll-left {
    0% {
      transform: translateX(0);
    }
    100% {
      transform: translateX(-50%);
    }
  }

  /* --- Contacto --- */
  .contact-grid {
    display: grid;
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  @media (min-width: 1024px) {
    .contact-grid {
      grid-template-columns: 1.1fr 0.9fr;
    }
  }

  .contact-form-container {
    background-color: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: var(--space-lg);
    border-radius: var(--radius-lg);
    box-shadow: var(--card-shadow);
  }

  @media (min-width: 768px) {
    .contact-form-container {
      padding: var(--space-xl);
    }
  }

  .form-group {
    margin-bottom: var(--space-md);
  }

  .form-label {
    display: block;
    font-size: 0.9rem;
    font-weight: 600;
    margin-bottom: var(--space-xs);
    color: var(--text-title);
  }

  .form-control {
    width: 100%;
    padding: 0.75rem var(--space-sm);
    background-color: var(--bg-primary);
    border: 1px solid var(--border-color);
    border-radius: var(--radius-md);
    color: var(--text-primary);
    transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  }

  .form-control:focus {
    outline: none;
    border-color: var(--brand-color);
    box-shadow: 0 0 0 3px var(--brand-light);
  }

  textarea.form-control {
    resize: vertical;
    min-height: 120px;
  }

  /* Validación de formulario moderna */
  .form-control:user-invalid {
    border-color: #ef4444;
    box-shadow: 0 0 0 3px rgba(239, 68, 68, 0.1);
  }

  .form-error-msg {
    color: #ef4444;
    font-size: 0.8rem;
    margin-top: 4px;
    display: none;
  }

  .form-control:user-invalid + .form-error-msg {
    display: block;
  }

  .form-success-alert {
    display: none;
    padding: var(--space-sm);
    background-color: #dcfce7;
    border: 1px solid #bbf7d0;
    color: #15803d;
    border-radius: var(--radius-md);
    margin-bottom: var(--space-md);
    font-weight: 500;
    font-size: 0.95rem;
  }

  .info-contact-card {
    display: flex;
    flex-direction: column;
    gap: var(--space-lg);
  }

  .info-item {
    display: flex;
    gap: var(--space-md);
  }

  .info-icon-wrapper {
    background-color: var(--brand-light);
    color: var(--brand-color);
    width: 48px;
    height: 48px;
    border-radius: var(--radius-md);
    display: grid;
    place-items: center;
    flex-shrink: 0;
  }

  .info-icon-wrapper svg {
    width: 24px;
    height: 24px;
    stroke: currentColor;
    stroke-width: 2;
    fill: none;
  }

  .info-content h4 {
    font-size: 1.1rem;
    margin-bottom: 4px;
  }

  .info-content p {
    font-size: 0.95rem;
  }

  .info-content a:hover {
    color: var(--brand-color);
  }

  .map-container {
    width: 100%;
    aspect-ratio: 16/9;
    border-radius: var(--radius-lg);
    overflow: hidden;
    border: 1px solid var(--border-color);
    box-shadow: var(--card-shadow);
  }

  .map-container iframe {
    width: 100%;
    height: 100%;
    border: none;
  }

  /* --- Footer --- */
  .footer {
    background-color: var(--bg-secondary);
    border-top: 1px solid var(--border-color);
    padding-block: var(--space-lg);
  }

  .footer-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    gap: var(--space-md);
  }

  @media (min-width: 768px) {
    .footer-content {
      flex-direction: row;
    }
  }

  .social-links {
    display: flex;
    gap: var(--space-md);
  }

  .social-link {
    color: var(--text-secondary);
    transition: color var(--transition-fast), transform var(--transition-fast);
  }

  .social-link:hover {
    color: var(--brand-color);
    transform: translateY(-2px);
  }

  .social-link svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
  }

  .copyright {
    font-size: 0.9rem;
    color: var(--text-secondary);
  }
}

@layer utilities {
  /* --- Clases de Animación y Scroll --- */
  .reveal {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity var(--transition-slow), transform var(--transition-slow);
  }

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

  /* Optimización de Renderizado */
  .optimize-render {
    content-visibility: auto;
    contain-intrinsic-size: auto 500px;
  }
}
