/**
 * base.css
 * Reset, tipografía base, utilidades globales
 */

/* ============================================
   RESET
   ============================================ */

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
}

body {
  font-family: var(--font-family-primary);
  font-weight: var(--font-weight-regular);
  font-size: var(--typo-size-body-m);
  line-height: var(--typo-lh-relaxed);
  color: var(--color-text-default);
  background-color: var(--color-bg-default);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}

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

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

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

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

p a {
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
}

ul, ol {
  list-style: none;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-bold);
  line-height: var(--typo-lh-tight);
  letter-spacing: var(--typo-ls-tight);
}

p {
  line-height: var(--typo-lh-relaxed);
}

/* ============================================
   SKIP TO CONTENT (Accesibilidad)
   ============================================ */

.skip-to-content {
  position: absolute;
  top: -100%;
  left: var(--spacing-md);
  padding: var(--spacing-3) var(--spacing-md);
  background: var(--color-brand-primary);
  color: var(--color-text-inverse);
  font-weight: var(--font-weight-bold);
  font-size: var(--typo-size-body-s);
  border-radius: var(--radius-md);
  z-index: var(--z-toast);
  transition: top var(--transition-base);
}

.skip-to-content:focus {
  top: var(--spacing-3);
}

/* ============================================
   TIPOGRAFÍA
   ============================================ */

.display {
  font-family: var(--font-family-secondary);
  font-size: var(--typo-size-display);
  font-weight: var(--font-weight-bold);
  line-height: var(--typo-lh-tight);
  letter-spacing: var(--typo-ls-tight);
}

.heading-xxl {
  font-family: var(--font-family-secondary);
  font-size: var(--typo-size-heading-xxl);
  font-weight: var(--font-weight-bold);
  line-height: var(--typo-lh-tight);
  letter-spacing: var(--typo-ls-tight);
}

.heading-xl {
  font-family: var(--font-family-secondary);
  font-size: var(--typo-size-heading-xl);
  font-weight: var(--font-weight-bold);
  line-height: var(--typo-lh-tight);
  letter-spacing: var(--typo-ls-tight);
}

.heading-l {
  font-family: var(--font-family-secondary);
  font-size: var(--typo-size-heading-l);
  font-weight: var(--font-weight-bold);
  line-height: var(--typo-lh-tight);
}

.heading-m {
  font-family: var(--font-family-secondary);
  font-size: var(--typo-size-heading-m);
  font-weight: var(--font-weight-bold);
  line-height: var(--typo-lh-tight);
}

.heading-s {
  font-family: var(--font-family-primary);
  font-size: var(--typo-size-heading-s);
  font-weight: var(--font-weight-bold);
  line-height: var(--typo-lh-snug);
}

.heading-xs {
  font-family: var(--font-family-primary);
  font-size: var(--typo-size-heading-xs);
  font-weight: var(--font-weight-bold);
  line-height: var(--typo-lh-snug);
}

.body-xl {
  font-size: var(--typo-size-body-xl);
  line-height: var(--typo-lh-relaxed);
}

.body-l {
  font-size: var(--typo-size-body-l);
  line-height: var(--typo-lh-relaxed);
}

.body-m {
  font-size: var(--typo-size-body-m);
  line-height: var(--typo-lh-relaxed);
}

.body-s {
  font-size: var(--typo-size-body-s);
  line-height: var(--typo-lh-normal);
}

.body-xs {
  font-size: var(--typo-size-body-xs);
  line-height: var(--typo-lh-normal);
}

.text-semibold { font-weight: var(--font-weight-semibold); }
.text-bold     { font-weight: var(--font-weight-bold); }

.text-brand    { color: var(--color-brand-primary); }
.text-muted    { color: var(--color-text-secondary); }
.text-inverse  { color: var(--color-text-inverse); }

/* ============================================
   FOCUS VISIBLE (Accesibilidad)
   ============================================ */

:focus-visible {
  outline: 2px solid var(--color-brand-primary);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* ============================================
   SELECCIÓN
   ============================================ */

::selection {
  background-color: var(--color-tile-200);
  color: var(--color-tile-900);
}

/* ============================================
   SCROLLBAR (webkit)
   ============================================ */

::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

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

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

::-webkit-scrollbar-thumb:hover {
  background: var(--color-tile-500);
}

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

.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;
}

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

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

/* ============================================
   LEGAL PAGES (shared)
   ============================================ */

.legal-page-theme {
  background:
    radial-gradient(circle at 0% 0%, rgba(14, 119, 135, 0.08), transparent 40%),
    radial-gradient(circle at 100% 20%, rgba(199, 173, 119, 0.16), transparent 35%),
    var(--color-bg-subtle);
  color: var(--color-text-default);
}

.legal-page {
  min-height: 100vh;
  padding: var(--spacing-12) 0;
}

.legal-page-back {
  width: 100%;
  max-width: var(--container-md);
  margin: 0 auto var(--spacing-5);
  padding: 0 var(--spacing-lg);
}

.legal-shell {
  background: var(--color-bg-default);
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-2xl);
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.legal-header {
  padding: var(--spacing-11) var(--spacing-11) var(--spacing-10);
  background:
    linear-gradient(135deg, rgba(14, 119, 135, 0.1) 0%, rgba(199, 173, 119, 0.15) 100%),
    var(--color-bg-default);
  border-bottom: 1px solid var(--color-border-default);
}

.legal-back-link {
  display: inline-flex;
  align-items: center;
  gap: var(--spacing-2);
  margin-bottom: 0;
  color: var(--color-brand-primary-dark);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
}

.legal-back-link:hover {
  text-decoration: underline;
}

.legal-kicker {
  display: inline-flex;
  align-items: center;
  padding: var(--spacing-2) var(--spacing-4);
  border-radius: var(--radius-full);
  background: rgba(14, 119, 135, 0.12);
  color: var(--color-brand-primary-dark);
  font-size: var(--typo-size-body-s);
  font-weight: var(--font-weight-semibold);
  letter-spacing: var(--typo-ls-wide);
  text-transform: uppercase;
  margin-bottom: var(--spacing-6);
}

.legal-title {
  font-family: var(--font-family-secondary);
  font-size: clamp(1rem, 2vw, 2rem);
  line-height: var(--typo-lh-tight);
  color: var(--color-brand-primary-dark);
  margin-bottom: var(--spacing-4);
}

.legal-intro {
  max-width: 72ch;
  color: var(--color-text-secondary);
}

.legal-content {
  padding: var(--spacing-11);
  display: grid;
  gap: var(--spacing-9);
}

.legal-section {
  display: grid;
  gap: var(--spacing-5);
}

.legal-section h2,
.legal-section h3,
.legal-section h4 {
  color: var(--color-silver-800);
  line-height: var(--typo-lh-snug);
}

.legal-section h2 {
  font-size: clamp(1.1rem, 2.5vw, 1.4rem);
  border-bottom: 1px solid var(--color-border-default);
  padding-bottom: var(--spacing-3);
}

.legal-section h3 {
  font-size: clamp(1.08rem, 2.1vw, 1.35rem);
  margin-top: var(--spacing-3);
}

.legal-section h4 {
  font-size: var(--typo-size-body-l);
  margin-top: var(--spacing-2);
}

.legal-section p,
.legal-section li {
  color: var(--color-text-default);
  line-height: var(--typo-lh-loose);
}

.legal-section strong {
  color: var(--color-silver-900);
  font-weight: var(--font-weight-bold);
}

.legal-list {
  list-style: disc;
  padding-left: 1.35rem;
  display: grid;
  gap: var(--spacing-3);
}

.legal-cookie-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--spacing-5);
}

.legal-cookie-card {
  border: 1px solid var(--color-border-default);
  border-radius: var(--radius-lg);
  padding: var(--spacing-6);
  background: var(--color-bg-subtle);
}

.legal-cookie-card h4 {
  margin-bottom: var(--spacing-2);
  color: var(--color-silver-800);
  font-size: var(--typo-size-body-m);
}

.legal-cookie-card p {
  color: var(--color-text-secondary);
  font-size: var(--typo-size-body-s);
}

.legal-note {
  padding: var(--spacing-6);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(14, 119, 135, 0.25);
  background: rgba(14, 119, 135, 0.06);
}

.legal-footer {
  padding: var(--spacing-8) var(--spacing-11) var(--spacing-11);
  border-top: 1px solid var(--color-border-default);
  color: var(--color-text-secondary);
}

.legal-footer a,
.legal-link {
  color: var(--color-brand-primary);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

/* ============================================
   RESPONSIVE TIPOGRAFÍA
   ============================================ */

@media (max-width: 1024px) {
  .heading-xxl { font-size: var(--typo-size-heading-xl); }
  .heading-xl  { font-size: var(--typo-size-heading-l); }
  .heading-l   { font-size: var(--typo-size-heading-m); }

  .legal-page {
    padding: var(--spacing-10) 0;
  }

  .legal-header,
  .legal-content,
  .legal-footer {
    padding-left: var(--spacing-8);
    padding-right: var(--spacing-8);
  }

  .legal-cookie-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .display     { font-size: var(--typo-size-mobile-heading-xxl); }
  .heading-xxl { font-size: var(--typo-size-mobile-heading-xxl); }
  .heading-xl  { font-size: var(--typo-size-mobile-heading-xl); }
  .heading-l   { font-size: var(--typo-size-mobile-heading-l); }
  .heading-m   { font-size: var(--typo-size-mobile-heading-m); }
  .heading-s   { font-size: var(--typo-size-mobile-heading-s); }
  .body-xl     { font-size: var(--typo-size-mobile-body-l); }
  .body-l      { font-size: var(--typo-size-mobile-body-l); }

  .legal-page {
    padding: var(--spacing-7) 0;
  }

  .legal-page-back {
    padding: 0 var(--spacing-5);
    margin-bottom: var(--spacing-4);
  }

  .legal-header,
  .legal-content,
  .legal-footer {
    padding-left: var(--spacing-6);
    padding-right: var(--spacing-6);
  }
}
