/* ==========================================================================
   Corporación ARAEL — Gestión Porcina
   css/base.css
   Reset, tipografía y estilos base. Solo usa variables de variables.css.
   Orden de carga: variables.css → base.css → layout.css → componentes.css
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. RESET
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  font-family: var(--fuente);
  font-size: 15px;
  line-height: 1.55;
  color: var(--texto);
  background: var(--fondo-app);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  transition: background-color var(--transicion), color var(--transicion);
}

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

/* El logotipo nunca se deforma */
img.logo,
.logo img,
.logo svg {
  width: auto;
  height: auto;
  object-fit: contain;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

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

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

button:disabled,
[disabled] {
  cursor: not-allowed;
  opacity: 0.6;
}

[hidden] {
  display: none !important;
}

/* --------------------------------------------------------------------------
   2. TIPOGRAFÍA
   -------------------------------------------------------------------------- */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-weight: 700;
  line-height: 1.25;
  color: var(--texto);
  letter-spacing: -0.01em;
}

h1 { font-size: 1.75rem; }
h2 { font-size: 1.4rem; }
h3 { font-size: 1.15rem; }
h4 { font-size: 1rem; }
h5,
h6 { font-size: 0.9rem; }

p + p {
  margin-top: var(--espacio-3);
}

small,
.texto-pequeno {
  font-size: 0.8125rem;
}

strong,
b {
  font-weight: 600;
}

a {
  color: var(--primario);
  text-decoration: none;
  transition: color var(--transicion);
}

a:hover {
  color: var(--primario-hover);
  text-decoration: underline;
}

hr {
  border: 0;
  border-top: 1px solid var(--borde);
  margin: var(--espacio-5) 0;
}

code,
kbd,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.875em;
}

code {
  padding: 2px 6px;
  background: var(--primario-suave);
  border-radius: var(--radio-sm);
}

/* --------------------------------------------------------------------------
   3. FOCO Y ACCESIBILIDAD
   -------------------------------------------------------------------------- */
:focus {
  outline: none;
}

:focus-visible {
  outline: 2px solid var(--campo-foco);
  outline-offset: 2px;
  border-radius: var(--radio-sm);
}

::selection {
  background: var(--acento-suave);
  color: var(--texto);
}

/* Texto solo 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;
}

/* --------------------------------------------------------------------------
   4. BARRAS DE DESPLAZAMIENTO
   -------------------------------------------------------------------------- */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--borde-fuerte) transparent;
}

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

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

::-webkit-scrollbar-thumb {
  background: var(--borde-fuerte);
  border-radius: 999px;
  border: 2px solid transparent;
  background-clip: content-box;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--texto-suave);
  background-clip: content-box;
}

/* --------------------------------------------------------------------------
   5. UTILIDADES MÍNIMAS
   -------------------------------------------------------------------------- */
.texto-suave   { color: var(--texto-suave); }
.texto-acento  { color: var(--texto-acento); }
.texto-exito   { color: var(--exito); }
.texto-peligro { color: var(--peligro); }
.texto-centro  { text-align: center; }
.texto-derecha { text-align: right; }
.negrita       { font-weight: 600; }
.sin-salto     { white-space: nowrap; }

.fila {
  display: flex;
  align-items: center;
  gap: var(--espacio-3);
}

.fila-entre {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--espacio-3);
}

.columna {
  display: flex;
  flex-direction: column;
  gap: var(--espacio-3);
}

/* --------------------------------------------------------------------------
   6. MOVIMIENTO REDUCIDO
   -------------------------------------------------------------------------- */
@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;
  }
}
