/* ==========================================================================
   RESET MODERNO & ACCESIBILIDAD GLOBAL
   Cumple con Web Interface Guidelines y WCAG 2.1 AA/AAA
   ========================================================================== */

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

html {
  font-size: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  tab-size: 4;
  overflow-x: hidden;
  max-width: 100vw;
  width: 100%;
}

body {
  min-height: 100vh;
  width: 100%;
  max-width: 100vw;
  background-color: var(--color-bg-main);
  color: var(--color-text-main);
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  position: relative;
}

/* Enlace para saltar al contenido principal (Accesibilidad teclado) */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 1rem;
  z-index: calc(var(--z-toast) + 10);
  background-color: var(--color-primary);
  color: var(--color-text-inverse);
  padding: 0.75rem 1.25rem;
  border-radius: var(--radius-sm);
  font-weight: var(--font-weight-semibold);
  text-decoration: none;
  box-shadow: var(--shadow-lg);
  transition: transform var(--transition-fast);
}

.skip-to-content:focus {
  top: 1rem;
  outline: 3px solid var(--color-accent);
}

/* Tipografía jerárquica */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  color: var(--color-primary);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  text-wrap: balance;
  scroll-margin-top: 5.5rem;
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }

p {
  margin-bottom: var(--space-sm);
  max-width: 72ch;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: inherit;
  text-decoration: none;
  transition: color var(--transition-fast), opacity var(--transition-fast);
}

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

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

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

ul, ol {
  list-style: none;
}

table {
  border-collapse: collapse;
  width: 100%;
}

/* Números tabulares para precios, medidas y comparativas */
.tabular-nums, .price, .metric-value, .stat-number, .badge-discount {
  font-variant-numeric: tabular-nums;
}

/* ==========================================================================
   ESTADOS DE FOCO (FOCUS-VISIBLE)
   Directriz: foco visible claro, sin outline: none huérfano
   ========================================================================== */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-xs);
}

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

/* Clases de utilidad y 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-width: 0;
}

.container {
  width: 100%;
  max-width: var(--container-max-width);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--container-padding);
  padding-right: var(--container-padding);
}

/* ==========================================================================
   SCROLLBARS DE LUJO PERSONALIZADOS (GLOBAL & MODALES)
   ========================================================================== */
/* Navegadores estándar (Firefox 64+) */
* {
  scrollbar-width: thin;
  scrollbar-color: rgba(212, 175, 55, 0.45) #0B0D0F;
}

/* Motores WebKit / Blink (Chrome, Edge, Safari, Opera, Brave) */
::-webkit-scrollbar {
  width: 7px;
  height: 7px;
}

::-webkit-scrollbar-track {
  background: #0B0D0F;
}

::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, #D4AF37 0%, #997300 100%);
  border-radius: 9999px;
  border: 1px solid rgba(11, 13, 15, 0.6);
}

::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(180deg, #F3E5AB 0%, #D4AF37 100%);
  box-shadow: 0 0 10px rgba(212, 175, 55, 0.6);
}

::-webkit-scrollbar-corner {
  background: transparent;
}
