/**
 * INVENTA - Sistema de Gestión de Inventario
 * Archivo: reset.css
 * Propósito: Resetear estilos predeterminados del navegador
 * 
 * APRENDIZAJE: Cada navegador tiene sus propios estilos por defecto.
 * Este archivo los "resetea" para tener una base consistente en todos
 * los navegadores (Chrome, Firefox, Safari, Edge, etc.)
 */

/* ========================================
   RESET BÁSICO
   ======================================== */

/* Resetear márgenes y padding de todos los elementos */
/* APRENDIZAJE: El selector * selecciona TODOS los elementos */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    /* IMPORTANTE: hace que padding y border se incluyan en el ancho/alto */
}

/* ========================================
   HTML Y BODY
   ======================================== */

html {
    /* APRENDIZAJE: 1rem = 16px por defecto. Esto es la base para todos los rem */
    font-size: 16px;

    /* Mejora el renderizado de fuentes */
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;

    /* Mejora el scroll en móviles */
    -webkit-overflow-scrolling: touch;

    /* Altura completa */
    height: 100%;
}

body {
    /* Fuente del sistema */
    font-family: var(--font-primary);
    font-size: var(--font-size-base);
    line-height: var(--line-height-normal);
    color: var(--text-primary);
    background-color: var(--bg-secondary);

    /* Altura completa */
    min-height: 100%;

    /* Prevenir scroll horizontal en móviles */
    overflow-x: hidden;
}

/* ========================================
   TIPOGRAFÍA
   ======================================== */

/* Títulos */
h1,
h2,
h3,
h4,
h5,
h6 {
    margin: 0;
    font-weight: var(--font-weight-semibold);
    line-height: var(--line-height-tight);
    color: var(--text-primary);
}

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árrafos */
p {
    margin: 0;
    line-height: var(--line-height-normal);
}

/* Enlaces */
a {
    color: var(--primary-500);
    text-decoration: none;
    transition: color var(--transition-fast);
}

a:hover {
    color: var(--primary-700);
}

/* Listas */
ul,
ol {
    list-style: none;
}

/* ========================================
   FORMULARIOS
   ======================================== */

/* APRENDIZAJE: Resetear estilos de inputs para tener control total */

button,
input,
textarea,
select {
    font-family: inherit;
    /* Heredar fuente del body */
    font-size: inherit;
    line-height: inherit;
    color: inherit;
    border: none;
    background: none;
    outline: none;
    /* Quitamos el outline por defecto */
}

/* Quitar las flechitas de los inputs tipo number */
input[type="number"]::-webkit-inner-spin-button,
input[type="number"]::-webkit-outer-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

input[type="number"] {
    -moz-appearance: textfield;
    /* Firefox */
}

/* Quitar el ícono de búsqueda en Chrome */
input[type="search"]::-webkit-search-cancel-button,
input[type="search"]::-webkit-search-decoration {
    -webkit-appearance: none;
}

/* Botones */
button {
    cursor: pointer;
}

button:disabled {
    cursor: not-allowed;
    opacity: 0.6;
}

/* ========================================
   TABLAS
   ======================================== */

table {
    border-collapse: collapse;
    border-spacing: 0;
    width: 100%;
}

/* ========================================
   IMÁGENES Y MEDIA
   ======================================== */

img,
picture,
video,
canvas,
svg {
    display: block;
    /* APRENDIZAJE: Previene espacio extra debajo de imágenes */
    max-width: 100%;
    /* APRENDIZAJE: Responsive por defecto - nunca más ancho que su contenedor */
    height: auto;
    /* Mantener proporción */
}

/* ========================================
   OTROS ELEMENTOS
   ======================================== */

/* Código */
code,
pre {
    font-family: var(--font-monospace);
}

/* Línea horizontal */
hr {
    border: 0;
    border-top: var(--border-width-thin) solid var(--border-color);
    margin: var(--spacing-4) 0;
}

/* Blockquote */
blockquote {
    margin: 0;
    padding-left: var(--spacing-4);
    border-left: 4px solid var(--primary-500);
}

/* ========================================
   UTILIDADES GLOBALES
   ======================================== */

/* APRENDIZAJE: Clases útiles que se usan en toda la aplicación */

/* Ocultar visualmente pero mantener accesible 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-width: 0;
}

/* Ocultar elemento completamente */
.hidden {
    display: none !important;
}

/* Scrollbar personalizado (opcional) */
::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--gray-100);
}

::-webkit-scrollbar-thumb {
    background: var(--gray-400);
    border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--gray-500);
}