/**
 * Modern CSS Reset - Vive Aguachica V2
 * Basado en las mejores prácticas modernas
 */

/* === RESET BÁSICO === */

*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === HTML Y BODY === */

html {
  font-size: 16px;
  line-height: 1.5;
  -webkit-text-size-adjust: 100%;
  -moz-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-primary);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-text-primary);
  background-color: var(--color-background);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* === TIPOGRAFÍA === */

h1, h2, h3, h4, h5, h6 {
  font-weight: var(--font-weight-semibold);
  line-height: var(--line-height-tight);
  color: var(--color-text-primary);
  margin: 0;
}

h1 { font-size: var(--font-size-4xl); }
h2 { font-size: var(--font-size-3xl); }
h3 { font-size: var(--font-size-2xl); }
h4 { font-size: var(--font-size-xl); }
h5 { font-size: var(--font-size-lg); }
h6 { font-size: var(--font-size-base); }

p {
  margin: 0;
  line-height: var(--line-height-relaxed);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-primary-dark);
}

a:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* === LISTAS === */

ul, ol {
  list-style: none;
  margin: 0;
  padding: 0;
}

/* === IMÁGENES Y MEDIA === */

img, 
picture, 
video, 
canvas, 
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

img {
  border-style: none;
}

svg {
  fill: currentColor;
}

/* === FORMULARIOS === */

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: transparent;
  border: none;
  outline: none;
}

button {
  cursor: pointer;
  background: none;
  border: none;
  padding: 0;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.6;
}

input[type="text"],
input[type="email"],
input[type="password"],
input[type="search"],
input[type="url"],
input[type="tel"],
input[type="number"],
textarea,
select {
  appearance: none;
  -webkit-appearance: none;
  -moz-appearance: none;
}

input:focus,
textarea:focus,
select:focus {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}

/* === TABLAS === */

table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

th, td {
  text-align: left;
  vertical-align: top;
  padding: 0;
}

/* === ELEMENTOS INTERACTIVOS === */

summary {
  cursor: pointer;
}

details > summary {
  list-style: none;
}

details > summary::-webkit-details-marker {
  display: none;
}

/* === ELEMENTOS DE BLOQUE === */

blockquote,
dl,
dd,
figure,
hr,
pre {
  margin: 0;
}

hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-4) 0;
}

/* === CÓDIGO === */

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
  font-size: 0.875em;
}

pre {
  overflow: auto;
  padding: var(--space-4);
  background-color: var(--color-surface);
  border-radius: var(--border-radius-md);
}

code {
  padding: var(--space-1) var(--space-2);
  background-color: var(--color-surface);
  border-radius: var(--border-radius-base);
  font-size: 0.875em;
}

pre code {
  padding: 0;
  background: none;
  border-radius: 0;
}

/* === ELEMENTOS SEMÁNTICOS === */

mark {
  background-color: var(--color-secondary);
  color: var(--color-text-primary);
  padding: var(--space-1) var(--space-2);
  border-radius: var(--border-radius-base);
}

small {
  font-size: var(--font-size-sm);
}

sub,
sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sub {
  bottom: -0.25em;
}

sup {
  top: -0.5em;
}

/* === ACCESIBILIDAD === */

/* Ocultar elementos visualmente pero mantenerlos para lectores de pantalla */
.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;
}

/* Mostrar elementos solo para lectores de pantalla cuando tienen foco */
.sr-only:focus {
  position: static;
  width: auto;
  height: auto;
  padding: inherit;
  margin: inherit;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

/* Reducir movimiento para usuarios que lo prefieren */
@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;
  }
}

/* === UTILIDADES DE RESET === */

/* Remover estilos de botón */
.btn-reset {
  background: none;
  border: none;
  padding: 0;
  margin: 0;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

/* Remover estilos de lista */
.list-reset {
  list-style: none;
  padding: 0;
  margin: 0;
}

/* Remover estilos de enlace */
.link-reset {
  color: inherit;
  text-decoration: none;
}

.link-reset:hover {
  color: inherit;
}

/* === WEBKIT SCROLLBAR === */

::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-surface);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray-400);
  border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-gray-500);
}

/* === SELECCIÓN DE TEXTO === */

::selection {
  background-color: var(--color-primary-200);
  color: var(--color-text-primary);
}

::-moz-selection {
  background-color: var(--color-primary-200);
  color: var(--color-text-primary);
}