/**
 * VSE Sistemas Electrónicos - Main CSS
 * Variables Globales y Estilos Base
 * Versión: 1.0
 */

/* ========================================================================
   VARIABLES CSS - PALETA DE COLORES Y SISTEMA DE DISEÑO
   ======================================================================== */

:root {
  /* ===== PALETA PRINCIPAL - INDUSTRIAL/CORPORATIVA ===== */
  
  /* Colores Base Oscuros */
  --color-primary-dark: #0D1B2A;        /* Azul oscuro industrial */
  --color-primary: #1B263B;             /* Azul corporativo principal */
  --color-primary-light: #415A77;       /* Azul medio */
  
  /* Colores de Acento */
  --color-accent-orange: #FF6B35;       /* Naranja industrial */
  --color-accent-blue: #1E88E5;         /* Azul tecnológico */
  --color-accent-yellow: #FFC107;       /* Amarillo advertencia/energía */
  
  /* Colores de Apoyo */
  --color-success: #2E7D32;             /* Verde (sistemas activos) */
  --color-warning: #F57C00;             /* Naranja (alertas) */
  --color-error: #C62828;               /* Rojo (crítico) */
  
  /* Grises Industriales */
  --color-gray-50: #FAFAFA;
  --color-gray-100: #F5F5F5;
  --color-gray-200: #EEEEEE;
  --color-gray-300: #E0E0E0;
  --color-gray-400: #BDBDBD;
  --color-gray-500: #9E9E9E;
  --color-gray-600: #757575;
  --color-gray-700: #616161;
  --color-gray-800: #424242;
  --color-gray-900: #212121;
  
  /* Backgrounds */
  --bg-primary: #FFFFFF;
  --bg-secondary: #F8F9FA;
  --bg-dark: #0D1B2A;
  --bg-overlay: rgba(13, 27, 42, 0.85);
  
  /* ===== TIPOGRAFÍA ===== */
  --font-primary: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-headings: 'Montserrat', sans-serif;
  --font-mono: 'Roboto Mono', monospace;
  
  /* Tamaños de Fuente */
  --text-xs: 0.75rem;      /* 12px */
  --text-sm: 0.875rem;     /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-lg: 1.125rem;     /* 18px */
  --text-xl: 1.25rem;      /* 20px */
  --text-2xl: 1.5rem;      /* 24px */
  --text-3xl: 1.875rem;    /* 30px */
  --text-4xl: 2.25rem;     /* 36px */
  --text-5xl: 3rem;        /* 48px */
  --text-6xl: 3.75rem;     /* 60px */
  
  /* ===== ESPACIADO ===== */
  --space-xs: 0.25rem;     /* 4px */
  --space-sm: 0.5rem;      /* 8px */
  --space-md: 1rem;        /* 16px */
  --space-lg: 1.5rem;      /* 24px */
  --space-xl: 2rem;        /* 32px */
  --space-2xl: 3rem;       /* 48px */
  --space-3xl: 4rem;       /* 64px */
  --space-4xl: 6rem;       /* 96px */
  
  /* ===== BORDES Y SOMBRAS ===== */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.05);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.1);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.15);
  
  /* ===== TRANSICIONES ===== */
  --transition-fast: 150ms ease-in-out;
  --transition-base: 250ms ease-in-out;
  --transition-slow: 350ms ease-in-out;
  
  /* ===== ANCHOS MÁXIMOS ===== */
  --max-width-sm: 640px;
  --max-width-md: 768px;
  --max-width-lg: 1024px;
  --max-width-xl: 1280px;
  --max-width-2xl: 1536px;
  --max-width-content: 1200px;
}

/* Modo Oscuro (Opcional para secciones específicas) */
[data-theme="dark"] {
  --bg-primary: #0D1B2A;
  --bg-secondary: #1B263B;
  --color-text-primary: #FFFFFF;
  --color-text-secondary: #E0E0E0;
}

/* ========================================================================
   RESET Y ESTILOS BASE
   ======================================================================== */

/* Box sizing reset */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* HTML y Body */
html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  width: 100%;
}

body {
  font-family: var(--font-primary);
  overflow-x: hidden;
  width: 100%;
  max-width: 100vw;
  position: relative;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-gray-900);
  background-color: var(--bg-primary);
}

/* Tipografía */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-headings);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: var(--space-lg);
  color: var(--color-primary-dark);
}

h1 {
  font-size: var(--text-5xl);
}

h2 {
  font-size: var(--text-4xl);
}

h3 {
  font-size: var(--text-3xl);
}

h4 {
  font-size: var(--text-2xl);
}

h5 {
  font-size: var(--text-xl);
}

h6 {
  font-size: var(--text-lg);
}

p {
  margin-bottom: var(--space-md);
}

a {
  color: var(--color-accent-blue);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent-orange);
}

/* Listas */
ul, ol {
  margin-left: var(--space-xl);
  margin-bottom: var(--space-md);
}

li {
  margin-bottom: var(--space-sm);
}

/* Imágenes */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

/* Elementos que pueden causar overflow */
pre, code, table {
  overflow-x: auto;
  max-width: 100%;
}

/* Responsive word break */
h1, h2, h3, h4, h5, h6, p, a, span, li {
  word-wrap: break-word;
  overflow-wrap: break-word;
}

/* ========================================================================
   UTILIDADES GLOBALES
   ======================================================================== */

/* Container */
.container {
  width: 100%;
  max-width: var(--max-width-content);
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-md);
  }
}

/* Botones Base */
.btn-primary {
  display: inline-block;
  padding: var(--space-md) var(--space-xl);
  background: var(--color-accent-orange);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}

.btn-primary:hover {
  background: #E65C2E;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

.btn-secondary {
  display: inline-block;
  padding: var(--space-md) var(--space-xl);
  background: var(--color-accent-blue);
  color: white;
  font-weight: 600;
  border: none;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: all var(--transition-base);
  text-align: center;
}

.btn-secondary:hover {
  background: #1565C0;
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg);
  color: white;
}

/* Hero Sections */
.hero-section {
  background: linear-gradient(135deg, var(--color-primary-dark) 0%, var(--color-primary) 100%);
  color: white;
  padding: var(--space-4xl) 0;
  min-height: 500px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Service Cards */
.service-card {
  background: white;
  padding: var(--space-xl);
  border-radius: var(--radius-lg);
  border: 2px solid var(--color-gray-200);
  transition: all var(--transition-base);
}

.service-card:hover {
  border-color: var(--color-accent-orange);
  box-shadow: 0 8px 24px rgba(255, 107, 53, 0.2);
  transform: translateY(-4px);
}

/* Industry Icons */
.industry-icon {
  color: var(--color-accent-blue);
  font-size: var(--text-4xl);
  margin-bottom: var(--space-md);
}

/* ========================================================================
   RESPONSIVE UTILITIES
   ======================================================================== */

/* Ocultar en mobile */
@media (max-width: 768px) {
  .hide-mobile {
    display: none !important;
  }
}

/* Ocultar en desktop */
@media (min-width: 769px) {
  .hide-desktop {
    display: none !important;
  }
}

/* ========================================================================
   GRID SYSTEM
   ======================================================================== */

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

.grid-2 {
  grid-template-columns: repeat(2, 1fr);
}

.grid-3 {
  grid-template-columns: repeat(3, 1fr);
}

.grid-4 {
  grid-template-columns: repeat(4, 1fr);
}

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

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

/* ========================================================================
   SECCIONES COMUNES
   ======================================================================== */

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

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

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

/* ========================================================================
   ACCESIBILIDAD
   ======================================================================== */

/* Focus visible para navegación por teclado */
*:focus-visible {
  outline: 2px solid var(--color-accent-orange);
  outline-offset: 2px;
}

/* Skip to content link */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-primary);
  color: white;
  padding: var(--space-md);
  z-index: 100;
}

.skip-to-content:focus {
  top: 0;
}

/* ========================================================================
   RESPONSIVE - MOBILE FIRST
   ======================================================================== */

/* Asegurar que todos los contenedores sean responsive */
@media (max-width: 768px) {
  /* Prevenir overflow horizontal en móviles/tablets */
  *:not(input[type="checkbox"]):not(input[type="radio"]):not(svg):not(path):not(circle):not(rect),
  *::before,
  *::after {
    max-width: 100%;
  }
  
  /* Títulos más pequeños en móvil */
  h1 {
    font-size: var(--text-3xl);
  }
  
  h2 {
    font-size: var(--text-2xl);
  }
  
  h3 {
    font-size: var(--text-xl);
  }
  
  /* Padding reducido en móvil */
  section {
    padding: var(--space-3xl) 0;
  }
  
  /* Grids a una columna */
  .grid,
  [class*="grid"] {
    grid-template-columns: 1fr !important;
  }
  
  /* Word break más agresivo en móviles */
  h1, h2, h3, h4, h5, h6, p, a, span, li {
    word-break: break-word;
  }
}

@media (max-width: 480px) {
  /* Títulos aún más pequeños en móviles muy pequeños */
  h1 {
    font-size: var(--text-2xl);
  }
  
  h2 {
    font-size: var(--text-xl);
  }
  
  /* Container con menos padding */
  .container {
    padding: 0 var(--space-sm);
  }
  
  /* Botones full width */
  .btn-primary,
  .btn-secondary {
    width: 100%;
    text-align: center;
  }
}

