/* ═══════════════════════════════════════════════════════════════
   BASE.CSS — Tokens, Reset, Tipografía, Helpers
   Sistema de diseño Hi-Fi RALOZ v2
═══════════════════════════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=DM+Sans:ital,opsz,wght@0,9..40,400;0,9..40,500;0,9..40,600;0,9..40,700;0,9..40,800;1,9..40,400&family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;0,9..144,700;1,9..144,400;1,9..144,600&display=swap');

:root {
  /* Paleta principal */
  --blue:        #1d3a8a;
  --blue-dark:   #142a64;
  --blue-soft:   #eef2fb;
  --yellow:      #f6c23d;
  --yellow-dark: #d9a31a;
  --red:         #c1352e;
  --green:       #2f7a3a;

  /* Neutros */
  --ink:   #15171c;
  --ink-2: #3a3d46;
  --muted: #6b6f7a;
  --line:  #e6e4dc;
  --paper: #fbf9f3;
  --white: #ffffff;

  /* Sombras */
  --shadow:    0 1px 2px rgba(0,0,0,0.04), 0 8px 24px rgba(0,0,0,0.06);
  --shadow-lg: 0 4px 12px rgba(0,0,0,0.05), 0 20px 50px rgba(0,0,0,0.10);
  --shadow-md: 0 4px 6px rgba(0,0,0,0.04), 0 10px 24px rgba(0,0,0,0.08);

  /* Radios */
  --radius:    14px;
  --radius-sm: 8px;
  --radius-lg: 20px;

  /* Transiciones */
  --transition: all 0.2s ease;
  --ease-out:    cubic-bezier(0.23, 1, 0.32, 1);
  --ease-drawer: cubic-bezier(0.32, 0.72, 0, 1);

  /* Aliases de compatibilidad (referenciados en CSS antiguo) */
  --blue-light:  #283593;
  --blue-xlight: #5C6BC0;
  --navy:        var(--ink);
  --text-dark:   var(--ink);
  --text-body:   var(--ink-2);
  --text-muted:  var(--muted);
  --text-light:  var(--white);
  --border:      var(--line);
  --bg-main:     var(--paper);
  --bg-section:  #f4f1e8;
  --bg-card:     var(--white);
  --bg-dark:     var(--ink);
  --shadow-blue: 0 8px 32px rgba(29,58,138,0.15);
  --shadow-yellow: 0 8px 32px rgba(246,194,61,0.25);
  --shadow-card: var(--shadow);
  --glass-bg:    rgba(255,255,255,0.8);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  font-family: 'DM Sans', system-ui, sans-serif;
  color: var(--ink);
  background: var(--paper);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  font-size: 15.5px;
}

img  { max-width: 100%; display: block; }
a    { color: inherit; text-decoration: none; }
button { font-family: inherit; cursor: pointer; border: none; }

/* Fraunces en headings de display */
h1, h2, h3,
.display,
.section-title,
.hero h1 {
  font-family: 'Fraunces', serif;
  font-weight: 600;
  line-height: 1.08;
  letter-spacing: -0.5px;
}

/* ===== ACCESIBILIDAD ===== */
.sr-only {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
:focus-visible { outline: 3px solid var(--yellow); outline-offset: 2px; }

/* ===== ANIMACIONES ===== */
@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes fadeInLeft {
  from { opacity: 0; transform: translateX(-16px); }
  to   { opacity: 1; transform: translateX(0); }
}
@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}
@keyframes scaleIn {
  from { opacity: 0; transform: scale(0.95); }
  to   { opacity: 1; transform: scale(1); }
}
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(-7px); }
}
@keyframes shimmer {
  0%   { background-position: -200% center; }
  100% { background-position:  200% center; }
}
@keyframes spin {
  to { transform: rotate(360deg); }
}
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50%       { opacity: 0.5; }
}

.animate-fade-in-up   { animation: fadeInUp  0.6s var(--ease-out) forwards; }
.animate-fade-in-left { animation: fadeInLeft 0.55s var(--ease-out) forwards; }
.animate-scale-in     { animation: scaleIn   0.4s var(--ease-out) forwards; }
.animate-float        { animation: float 4s ease-in-out infinite; }

.stagger-1 { animation-delay: 60ms; }
.stagger-2 { animation-delay: 120ms; }
.stagger-3 { animation-delay: 180ms; }
.stagger-4 { animation-delay: 240ms; }

/* ===== HAPTIC FEEDBACK ===== */
button,
a[class*="btn-"],
.btn {
  transition: transform 160ms var(--ease-out),
              background-color 160ms var(--ease-out),
              box-shadow 160ms var(--ease-out),
              opacity 160ms var(--ease-out);
}
button:active,
a[class*="btn-"]:active,
.btn:active { transform: scale(0.97); }

/* ===== SPA VIEWS — solo la activa es visible ===== */
.spa-view {
  display: none;
}
.spa-view.active {
  display: block;
  animation: fadeIn 0.25s var(--ease-out);
}

/* ===== SECCIÓN LAYOUT COMÚN ===== */
.section-outer {
  padding: 72px 28px;
  max-width: 1280px;
  margin: 0 auto;
}
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: 32px;
}
.section-eyebrow {
  color: var(--blue);
  font-weight: 600;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.6px;
  display: block;
  margin-bottom: 8px;
}
.section-title {
  font-family: 'Fraunces', serif;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.05;
  letter-spacing: -1px;
  font-weight: 600;
  color: var(--ink);
  margin: 0 0 10px;
}
.section-title em  { font-style: italic; color: var(--blue); }
.section-title .accent {
  background-image: linear-gradient(transparent 65%, var(--yellow) 65%);
  padding: 0 4px;
}
.section-sub {
  font-size: 16px;
  color: var(--ink-2);
  max-width: 560px;
  margin: 0;
  line-height: 1.55;
}
.section-link {
  color: var(--ink);
  font-weight: 600;
  font-size: 14px;
  border-bottom: 2px solid var(--yellow);
  padding-bottom: 2px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  white-space: nowrap;
  flex-shrink: 0;
}

/* ===== HELPERS LEGACY ===== */
.txt-blue { color: var(--blue); }
.txt-gold  { color: var(--yellow-dark); }

/* section-header legacy (usado por tienda y otros) */
.section-header {
  text-align: center;
  padding: 0 0 36px;
}
.section-header h2 {
  font-family: 'Fraunces', serif;
  font-size: clamp(28px, 4vw, 40px);
  font-weight: 600;
  letter-spacing: -0.8px;
  line-height: 1.1;
  color: var(--ink);
  margin-bottom: 10px;
}
.section-header h2 span { color: var(--yellow-dark); }
.section-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--blue-soft);
  color: var(--blue);
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  margin-bottom: 12px;
}
.section-subtitle {
  color: var(--muted);
  font-size: 15px;
  max-width: 560px;
  margin: 0 auto;
  line-height: 1.55;
}
