/*
 * EVSA Main Stylesheet
 *
 * CSS architecture: modular imports + per-page stylesheets.
 * Core modules are imported here; components.css and per-page CSS
 * (calidad.css, solucion-e2e.css, etc.) are loaded directly in each
 * HTML file with cache-busting query params (?v=XX).
 *
 * Load order: tokens → base → layout → (this file) → components → hero → per-page
 */
@import url('./tokens.css');
@import url('./base.css');
@import url('./layout.css');

/* REMOVED: Wrapping behavior at 1100px (replaced with hamburger menu) */
/* Navigation items should never wrap - switch to hamburger instead */

/* Optional reductions on narrower widths */
@media (max-width: 1280px) {
  .nav-list { gap: clamp(10px, 1.6vw, 24px); }
  .nav-link { font-size: clamp(0.95rem, 1.1vw, 1rem); }
}

/* Primary nav block alignment and tighter spacing per spec */
.primary-nav { justify-self: end; }
.actions { margin-left: clamp(12px, 2vw, 24px); }
.primary-nav .nav-list {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: clamp(8px, 1.2vw, 18px);
}
.primary-nav .nav-list a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  white-space: nowrap;
  text-align: center;
  padding-inline: clamp(8px, 0.9vw, 12px);
  padding-block: 12px;
}

/* CTA button: Contáctanos */
.primary-nav .nav-list a.cta {
  min-height: 44px;
  padding: 12px 20px;
  border-radius: 12px;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  background: var(--color-primary);
  color: var(--color-white);
}

@media (min-width: 1280px) {
  .primary-nav .nav-list { gap: clamp(6px, 1vw, 14px); }
  .primary-nav .nav-list a { padding-inline: clamp(6px, 0.7vw, 10px); }
}
/* EVSA Packing & Logistics - Estilos base */

/* ===== CSS CUSTOM PROPERTIES (TOKENS) ===== */
:root {
  /* Colores EVSA */
  --color-primary: #1A1948;
  --color-accent: #0B3F22;
  --color-warm: #C67129;
  --color-neutral: #DEDDDF;
  
  /* Colores adicionales */
  --color-white: #FFFFFF;
  --color-black: #000000;
  --color-text: #1A1948;
  --color-text-light: rgba(26, 25, 72, 0.7);
  --color-text-muted: rgba(26, 25, 72, 0.6);
  
  /* Tipografías */
  --font-brand: 'Arial Black', Arial, sans-serif;
  --font-heading: 'Aptos Display', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-body: 'EB Garamond', Georgia, serif;
  
  /* Espaciado */
  --space-1: 8px;
  --space-2: 16px;
  --space-3: 24px;
  --space-4: 32px;
  --space-5: 48px;
  --space-6: 64px;
  --space-7: 96px;
  
  /* Cards */
  --radius-card: 24px;
  --shadow-card: 0 10px 30px rgba(0,0,0,0.08), 0 2px 8px rgba(0,0,0,0.06);
  --shadow-card-hover: 0 15px 40px rgba(0,0,0,0.12), 0 4px 12px rgba(0,0,0,0.08);
  
  /* Layout */
  --container-max-width: 1680px;
  --container-padding: var(--space-4);
  --grid-gutter: var(--space-3);
  
  /* Transiciones */
  --transition-fast: 150ms ease-out;
  --transition-normal: 250ms ease-out;
  
  /* Breakpoints */
  --bp-mobile: 768px;
  --bp-tablet: 1024px;
  --bp-desktop: 1200px;
}

/* ===== RESET Y BASE ===== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-white);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* ===== TIPOGRAFÍA ===== */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-primary);
  margin-bottom: var(--space-3);
}

h1 {
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 700;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

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

h4 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

p {
  margin-bottom: var(--space-3);
  color: var(--color-text-light);
}

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

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

/* ===== LAYOUT COMPONENTS ===== */
.container {
  max-width: var(--container-max-width);
  margin: 0 auto;
  padding: 0 var(--container-padding);
}

.card {
  background: var(--color-white);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-card);
  padding: var(--space-4);
  transition: box-shadow var(--transition-normal);
}

.card:hover {
  box-shadow: var(--shadow-card-hover);
}

.section {
  padding: var(--space-7) 0;
}

.section-title {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4vw, 3rem);
  font-weight: 700;
  color: var(--color-primary);
  text-align: center;
  margin-bottom: var(--space-2);
}

.section-subtitle {
  font-family: var(--font-body);
  font-size: 1.25rem;
  color: var(--color-text-light);
  text-align: center;
  margin-bottom: var(--space-6);
  max-width: 600px;
  margin-left: auto;
  margin-right: auto;
}

/* ===== BOTONES ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-card);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: none;
  cursor: pointer;
  transition: all var(--transition-normal);
  min-height: 48px;
  gap: var(--space-1);
}

.btn-primary {
  background-color: var(--color-primary);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-accent);
  transform: translateY(-2px);
}

.btn-secondary {
  background-color: var(--color-warm);
  color: var(--color-white);
}

.btn-secondary:hover {
  background-color: #B85A1F;
  transform: translateY(-2px);
}

.btn-tertiary {
  background-color: transparent;
  color: var(--color-primary);
  border: 2px solid var(--color-primary);
}

.btn-tertiary:hover {
  background-color: var(--color-primary);
  color: var(--color-white);
}

/* ===== NAVEGACIÓN ===== */
/* Navigation styles are now in components.css for consistency */
/* Removed duplicate rules to avoid conflicts */

/* ===== FOOTER ===== */
.footer {
  background-color: var(--color-primary);
  color: var(--color-white);
  padding: var(--space-6) 0 var(--space-4);
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: var(--space-5);
  margin-bottom: var(--space-5);
}

.footer-section h3 {
  color: var(--color-white);
  margin-bottom: var(--space-3);
  font-size: 1.25rem;
}

.footer-section a {
  color: var(--color-white);
  opacity: 0.8;
  transition: opacity var(--transition-fast);
}

.footer-section a:hover {
  opacity: 1;
}

.footer-nav {
  list-style: none;
}

.footer-nav li {
  margin-bottom: var(--space-1);
}

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

.social-placeholder {
  opacity: 0.7;
  font-size: 0.9rem;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.2);
  padding-top: var(--space-3);
  text-align: center;
  opacity: 0.8;
}

/* Hero styles live in src/styles/hero.css module */

/* Hero actions styling */
.hero-actions {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
  margin-top: var(--space-4);
}

.hero-actions .btn {
  background-color: var(--color-white);
  color: var(--color-primary);
}

.hero-actions .btn:hover {
  background-color: var(--color-neutral);
  transform: translateY(-2px);
}

.hero-actions .btn-secondary {
  background-color: var(--color-warm);
  color: var(--color-white);
}

.hero-actions .btn-secondary:hover {
  background-color: #B85A1F;
}

/* Placeholder de imagen */
.placeholder-image {
  background-color: var(--color-neutral);
  border-radius: var(--radius-card);
  height: 260px;
  display: grid;
  place-items: center;
  color: var(--color-primary);
  font-family: var(--font-heading);
  font-weight: 600;
  text-align: center;
  padding: var(--space-4);
}

/* Video responsive */
.video-container {
  position: relative;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.video-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Mapa responsive */
.map-container {
  position: relative;
  padding-top: 56.25%; /* 16:9 aspect ratio */
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-card);
}

.map-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Grid de capacidades - REMOVED DUPLICATE RULES (now in layout.css) */

/* Formulario */
.form-group {
  margin-bottom: var(--space-4);
}

.form-label {
  display: block;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--color-primary);
  margin-bottom: var(--space-1);
}

.form-input,
.form-textarea,
.form-select {
  width: 100%;
  padding: var(--space-2) var(--space-3);
  border: 2px solid var(--color-neutral);
  border-radius: 16px;
  font-family: var(--font-body);
  font-size: 1rem;
  transition: border-color var(--transition-fast);
  min-height: 48px;
}

.form-input:focus,
.form-textarea:focus,
.form-select:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 2px rgba(11, 63, 34, 0.2);
}

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

.form-required {
  color: var(--color-warm);
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .hero-inner {
    grid-template-columns: 1fr;
  }

  .tracks {
    height: 420px;
  }

  .track {
    height: 420px;
  }
}

/* ===== MOBILE LAYOUT (≤767px) ===== */
@media (max-width: 767px) {
  .hero-actions {
    flex-direction: column;
  }

  .hero-actions .btn {
    width: 100%;
    justify-content: center;
  }

  .capacidades-grid {
    grid-template-columns: 1fr;
  }

  .footer-content {
    grid-template-columns: 1fr;
    text-align: center;
  }

  .container {
    padding: 0 var(--space-3);
  }

  .hero-inner {
    padding: 2rem 1rem 4rem;
    gap: 1.5rem;
  }

  .copy {
    margin-left: 0 !important;
    text-align: center;
  }

  .tracks {
    gap: 12px;
    height: 420px;
  }
  
  .track {
    height: 420px;
  }
  
  .evsa-token {
    max-width: 280px;
  }
}

/* ===== UTILIDADES ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

/* Número de etapa */
.etapa-number {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background-color: var(--color-primary);
  color: var(--color-white);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 700;
  margin: 0 auto var(--space-3);
}

/* Navegación activa */
.nav-link.active {
  color: var(--color-accent);
  background-color: rgba(11, 63, 34, 0.1);
}

.mb-1 { margin-bottom: var(--space-1); }
.mb-2 { margin-bottom: var(--space-2); }
.mb-3 { margin-bottom: var(--space-3); }
.mb-4 { margin-bottom: var(--space-4); }
.mb-5 { margin-bottom: var(--space-5); }
.mb-6 { margin-bottom: var(--space-6); }

.mt-1 { margin-top: var(--space-1); }
.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }
.mt-6 { margin-top: var(--space-6); }

.hidden { display: none; }
.visible { display: block; }

/* ===== FOCUS Y ACCESIBILIDAD ===== */
*:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

.btn:focus,
.nav-link:focus,
.lang-toggle:focus {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translateY(30px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out;
}

/* ===== LOADING STATES ===== */
.loading {
  opacity: 0.6;
  pointer-events: none;
}

.loading::after {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  width: 20px;
  height: 20px;
  margin: -10px 0 0 -10px;
  border: 2px solid var(--color-neutral);
  border-top: 2px solid var(--color-primary);
  border-radius: 50%;
  animation: spin 1s linear infinite;
}

@keyframes spin {
  0% { transform: rotate(0deg); }
  100% { transform: rotate(360deg); }
}


/* ===== SCROLL REVEAL — Site-wide entrance animations ===== */
/* Applied by src/scripts/scroll-reveal.js via IntersectionObserver */
.sr {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.65s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.65s cubic-bezier(0.16, 1, 0.3, 1);
}

.sr-visible {
  opacity: 1;
  transform: translateY(0);
}

/* Reduced motion: show everything immediately */
@media (prefers-reduced-motion: reduce) {
  .sr {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

