/**
 * RESET CSS - GOMALOR
 * Normalización cross-browser para comportamiento consistente
 * Basado en modern-normalize y mejores prácticas 2025
 */

/* ============================================
   Box Sizing
   ============================================ */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* ============================================
   Document & Sections
   ============================================ */

html {
  /* Previene ajustes de tamaño de fuente en orientación landscape en iOS */
  -webkit-text-size-adjust: 100%;
  /* Scroll suave para navegación */
  scroll-behavior: smooth;
  /* Mejora renderizado de fuentes */
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  margin: 0;
  /* Altura mínima de 100vh */
  min-height: 100vh;
  /* Mejora renderizado de texto */
  text-rendering: optimizeSpeed;
  line-height: 1.5;
}

/* ============================================
   Tipografía
   ============================================ */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-weight: inherit;
  line-height: 1.2;
}

p {
  margin: 0;
}

a {
  text-decoration: none;
  color: inherit;
  background-color: transparent;
}

a:not([class]) {
  text-decoration-skip-ink: auto;
}

/* ============================================
   Listas
   ============================================ */

ul,
ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* ============================================
   Media Elements
   ============================================ */

img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  border-style: none;
}

/* ============================================
   Formularios
   ============================================ */

input,
button,
textarea,
select {
  font: inherit;
  margin: 0;
}

button,
[type="button"],
[type="reset"],
[type="submit"] {
  -webkit-appearance: button;
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

button::-moz-focus-inner,
[type="button"]::-moz-focus-inner,
[type="reset"]::-moz-focus-inner,
[type="submit"]::-moz-focus-inner {
  border-style: none;
  padding: 0;
}

button:-moz-focusring,
[type="button"]:-moz-focusring,
[type="reset"]:-moz-focusring,
[type="submit"]:-moz-focusring {
  outline: 1px dotted ButtonText;
}

textarea {
  overflow: auto;
  resize: vertical;
}

input::placeholder,
textarea::placeholder {
  opacity: 0.5;
}

/* Quitar spinner de inputs numéricos */
input::-webkit-outer-spin-button,
input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

input[type="number"] {
  -moz-appearance: textfield;
}

/* ============================================
   Tablas
   ============================================ */

table {
  border-collapse: collapse;
  border-spacing: 0;
}

/* ============================================
   Elementos Interactivos
   ============================================ */

summary {
  display: list-item;
  cursor: pointer;
}

[disabled] {
  cursor: not-allowed;
}

/* ============================================
   Accesibilidad
   ============================================ */

/* Skip to main content link (oculto visualmente pero accesible) */
.skip-to-main {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 999;
  padding: 1em;
  background-color: var(--color-primary);
  color: var(--color-white);
  text-decoration: none;
}

.skip-to-main:focus {
  left: 50%;
  transform: translateX(-50%);
}

/* Focus visible para navegación por teclado */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* Ocultar outline en mouse clicks pero mantenerlo en keyboard navigation */
:focus:not(:focus-visible) {
  outline: none;
}

/* ============================================
   Utilidades de Accesibilidad
   ============================================ */

/* Visually hidden pero accesible para screen readers */
.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;
}

/* ============================================
   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;
  }
}

/* ============================================
   Print Styles
   ============================================ */

@media print {
  *,
  *::before,
  *::after {
    background: transparent !important;
    color: #000 !important;
    box-shadow: none !important;
    text-shadow: none !important;
  }

  a,
  a:visited {
    text-decoration: underline;
  }

  a[href]::after {
    content: " (" attr(href) ")";
  }

  img {
    page-break-inside: avoid;
  }

  p,
  h2,
  h3 {
    orphans: 3;
    widows: 3;
  }

  h2,
  h3 {
    page-break-after: avoid;
  }
}