/* ============================================
   EDRA Mexico - Global CSS
   Variables, Reset, Base, Typography, Utilities
   ============================================ */

/* --- CSS Custom Properties --- */
:root {
  /* Colors - EDRA Brand */
  --color-primary: #1B2A5C;
  --color-secondary: #00B4D8;
  --color-cyan-light: #48CAE4;
  --color-aqua: #90E0EF;
  --color-blue-mid: #2A3F7E;
  --color-dark: #0A1128;
  --color-white: #FFFFFF;
  --color-gray-light: #F8FAFC;
  --color-gray-mid: #64748B;
  --color-gray-dark: #1E293B;

  /* Semantic Colors */
  --color-success: #10B981;
  --color-whatsapp: #25D366;
  --color-error: #EF4444;

  /* Typography */
  --font-heading: 'Montserrat', sans-serif;
  --font-body: 'Inter', sans-serif;

  /* Font Sizes - Fluid */
  --text-xs: clamp(0.75rem, 0.7rem + 0.25vw, 0.875rem);
  --text-sm: clamp(0.8125rem, 0.75rem + 0.3vw, 0.9375rem);
  --text-base: clamp(0.9375rem, 0.875rem + 0.3vw, 1.0625rem);
  --text-lg: clamp(1.0625rem, 1rem + 0.35vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.1rem + 0.5vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.3rem + 0.75vw, 2rem);
  --text-3xl: clamp(1.875rem, 1.5rem + 1.2vw, 2.5rem);
  --text-4xl: clamp(2.25rem, 1.8rem + 1.5vw, 3.25rem);
  --text-5xl: clamp(2.75rem, 2rem + 2.5vw, 5rem);

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  --space-3xl: 4rem;
  --space-4xl: 6rem;
  --space-section: clamp(4rem, 3rem + 4vw, 8rem);

  /* Layout */
  --container-max: 1280px;
  --container-narrow: 960px;
  --container-wide: 1440px;
  --navbar-height: 80px;
  --navbar-height-scrolled: 64px;

  /* Borders & Radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --radius-full: 9999px;

  /* Shadows */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 8px 30px rgba(0, 0, 0, 0.12);
  --shadow-xl: 0 16px 50px rgba(0, 0, 0, 0.15);
  --shadow-cyan: 0 4px 20px rgba(0, 180, 216, 0.3);

  /* Transitions */
  --transition-fast: 0.2s ease;
  --transition-base: 0.3s ease;
  --transition-slow: 0.5s ease;
  --transition-smooth: 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);

  /* Z-indexes */
  --z-base: 1;
  --z-dropdown: 100;
  --z-sticky: 200;
  --z-navbar: 500;
  --z-overlay: 800;
  --z-modal: 900;
  --z-preloader: 1000;
  --z-whatsapp: 600;
}

/* --- CSS Reset (Modern) --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-gray-dark);
  background-color: var(--color-white);
  overflow-x: hidden;
  min-height: 100vh;
}

body.no-scroll {
  overflow: hidden;
}

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

img {
  height: auto;
}

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

button {
  cursor: pointer;
  border: none;
  background: none;
}

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

ul,
ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  color: var(--color-primary);
  overflow-wrap: break-word;
}

p {
  overflow-wrap: break-word;
}

/* --- Typography --- */
h1 { font-size: var(--text-5xl); font-weight: 800; }
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); }

.text-gradient {
  background: linear-gradient(135deg, var(--color-secondary), var(--color-cyan-light));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.eyebrow {
  font-family: var(--font-heading);
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-secondary);
  margin-bottom: var(--space-md);
  display: inline-block;
}

/* --- Layout Utilities --- */
.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--space-lg);
  padding-right: var(--space-lg);
}

.container--narrow {
  max-width: var(--container-narrow);
}

.container--wide {
  max-width: var(--container-wide);
}

.section {
  padding-top: var(--space-section);
  padding-bottom: var(--space-section);
}

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

.section--dark h2,
.section--dark h3,
.section--dark h4 {
  color: var(--color-white);
}

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

.section--navy h2,
.section--navy h3,
.section--navy h4 {
  color: var(--color-white);
}

.section--gray {
  background-color: var(--color-gray-light);
}

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

.skip-nav {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  background: var(--color-secondary);
  color: var(--color-white);
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  z-index: calc(var(--z-preloader) + 1);
  font-weight: 600;
  transition: top var(--transition-fast);
}

.skip-nav:focus {
  top: var(--space-md);
}

*:focus-visible {
  outline: 2px solid var(--color-secondary);
  outline-offset: 2px;
}

/* --- Selection --- */
::selection {
  background-color: var(--color-secondary);
  color: var(--color-white);
}

/* --- Scrollbar (WebKit) --- */
::-webkit-scrollbar {
  width: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-dark);
}

::-webkit-scrollbar-thumb {
  background: var(--color-secondary);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-cyan-light);
}

/* --- Reduced Motion --- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .parallax {
    transform: none !important;
  }
}

/* --- Utility Classes --- */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }
.text-white { color: var(--color-white); }
.text-cyan { color: var(--color-secondary); }
.text-gray { color: var(--color-gray-mid); }

.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-center { justify-content: center; }
.justify-between { justify-content: space-between; }
.gap-sm { gap: var(--space-sm); }
.gap-md { gap: var(--space-md); }
.gap-lg { gap: var(--space-lg); }
.gap-xl { gap: var(--space-xl); }
.gap-2xl { gap: var(--space-2xl); }

.grid { display: grid; }

.mx-auto { margin-left: auto; margin-right: auto; }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }
.mt-2xl { margin-top: var(--space-2xl); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }
.mb-2xl { margin-bottom: var(--space-2xl); }

.relative { position: relative; }
.overflow-hidden { overflow: hidden; }

.w-full { width: 100%; }
.h-full { height: 100%; }
