/* ============================================================================
   BASE.CSS — Reset + typography defaults sector automotriz
   ============================================================================ */

/* ============================================================================
   Modern reset
   ============================================================================ */

*, *::before, *::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

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

body {
  font-family: var(--font-body);
  font-size: var(--type-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  background: var(--surface-page);
  min-height: 100vh;
  /* Tabular figures by default for sector — números técnicos */
  font-variant-numeric: tabular-nums;
}

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

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

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

a {
  color: var(--text-link);
  text-decoration: none;
  text-underline-offset: 4px;
  transition: color var(--transition-fast);
}

a:hover {
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

ul, ol {
  list-style: none;
}

/* ============================================================================
   Typography defaults
   ============================================================================ */

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  color: var(--text-primary);
  text-transform: uppercase;
}

h1 {
  font-size: var(--type-3xl);
  line-height: var(--leading-tight);
  letter-spacing: var(--tracking-tight);
}

h2 {
  font-size: var(--type-2xl);
}

h3 {
  font-family: var(--font-body);
  font-size: var(--type-xl);
  font-weight: 700;
  text-transform: none;
  letter-spacing: var(--tracking-normal);
}

h4 {
  font-family: var(--font-body);
  font-size: var(--type-lg);
  font-weight: 600;
  text-transform: none;
}

p {
  font-family: var(--font-body);
  font-size: var(--type-base);
  line-height: var(--leading-normal);
  color: var(--text-primary);
  max-width: 65ch;
}

p.lead {
  font-size: var(--type-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
}

strong, b {
  font-weight: 700;
}

em, i {
  font-style: italic;
}

code, pre, .mono {
  font-family: var(--font-mono);
  font-size: 0.95em;
}

/* ============================================================================
   Selection
   ============================================================================ */

::selection {
  background: var(--mas-blue);
  color: white;
}

/* ============================================================================
   Focus outline (accessible, no removed)
   ============================================================================ */

:focus-visible {
  outline: 3px solid var(--mas-blue);
  outline-offset: 2px;
}

/* ============================================================================
   Containers
   ============================================================================ */

.container {
  width: 100%;
  max-width: var(--container-default);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container-narrow {
  max-width: var(--container-narrow);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

.container-wide {
  max-width: var(--container-wide);
  margin-inline: auto;
  padding-inline: var(--space-6);
}

@media (min-width: 768px) {
  .container, .container-narrow, .container-wide {
    padding-inline: var(--space-12);
  }
}

/* ============================================================================
   Sections — alternating rhythm light/dark
   ============================================================================ */

.section {
  padding-block: var(--section-padding-y-mobile);
}

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

.section--light {
  background: var(--surface-page);
  color: var(--text-primary);
}

.section--alt {
  background: var(--surface-page-alt);
  color: var(--text-primary);
}

.section--dark {
  background: var(--surface-dark);
  color: var(--text-on-dark);
}

.section--dark h1, .section--dark h2, .section--dark h3 {
  color: var(--text-on-dark);
}

.section--dark p {
  color: var(--text-on-dark-mut);
}

/* ============================================================================
   Eyebrow labels (industrial mono uppercase)
   ============================================================================ */

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--type-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: var(--tracking-shop);
  color: var(--text-secondary);
  margin-bottom: var(--space-4);
}

.eyebrow::before {
  content: "";
  display: inline-block;
  width: 24px;
  height: 1.5px;
  background: currentColor;
  flex-shrink: 0;
}

.eyebrow--blue  { color: var(--mas-blue); }
.eyebrow--amber { color: var(--shop-amber); }
.eyebrow--white { color: rgba(255, 255, 255, 0.85); }

.section--dark .eyebrow:not(.eyebrow--blue):not(.eyebrow--amber):not(.eyebrow--white) {
  color: var(--text-on-dark-mut);
}

.section--blue-deep .eyebrow {
  color: var(--mas-blue-soft);
}

/* ============================================================================
   Section title + lead helpers
   ============================================================================ */

.section-header {
  max-width: 65ch;
  margin-bottom: var(--space-12);
}

.section-title {
  font-family: var(--font-display);
  font-size: var(--type-3xl);
  line-height: var(--leading-snug);
  letter-spacing: var(--tracking-tight);
  text-transform: uppercase;
  color: var(--text-primary);
  max-width: 22ch;
}

.section-title--white { color: white; }

.section-title .title-highlight {
  color: var(--mas-blue-soft);
}

.section-lead {
  font-family: var(--font-body);
  font-size: var(--type-lg);
  line-height: var(--leading-relaxed);
  color: var(--text-secondary);
  margin-top: var(--space-6);
  max-width: 60ch;
}

.section-lead--white {
  color: rgba(255, 255, 255, 0.85);
}

/* ============================================================================
   Visually hidden (accessibility helper)
   ============================================================================ */

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

/* ============================================================================
   Skip link (keyboard accessibility)
   ============================================================================ */

.skip-link {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--shop-amber);
  color: var(--shop-graphite);
  padding: var(--space-3) var(--space-6);
  text-decoration: none;
  font-weight: 700;
  z-index: var(--z-toast);
  transition: top var(--transition-fast);
}

.skip-link:focus {
  top: 0;
}

/* ============================================================================
   Mobile sticky CTA bar (sector-specific obligatorio)
   ============================================================================ */

.mobile-cta-bar {
  display: none;
}

@media (max-width: 767px) {
  .mobile-cta-bar {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--shop-graphite);
    border-top: 2px solid var(--mas-blue);
    z-index: var(--z-sticky);
    padding: var(--space-3);
    gap: var(--space-2);
  }

  .mobile-cta-bar a {
    flex: 1;
    text-align: center;
    padding: var(--space-3) var(--space-4);
    font-family: var(--font-body);
    font-weight: 700;
    font-size: var(--type-sm);
    border-radius: var(--radius-sm);
    text-decoration: none;
  }

  .mobile-cta-bar .cta-call {
    background: var(--mas-blue);
    color: white;
  }

  .mobile-cta-bar .cta-whatsapp {
    background: var(--color-whatsapp);
    color: white;
  }

  /* Add padding to body to compensate for sticky bar */
  body {
    padding-bottom: calc(var(--space-16) + env(safe-area-inset-bottom));
  }
}
