/*
  ============================================
  BGF WELDING - CSS RESET & NORMALIZE
  Reset de estilos base para consistencia
  ============================================
*/

/* Box sizing border-box para todos los elementos */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* Reset de márgenes y paddings */
body,
h1, h2, h3, h4, h5, h6,
p, blockquote, pre,
dl, dd, ol, ul,
figure,
fieldset, legend {
  margin: 0;
  padding: 0;
}

/* Configuración base del HTML y Body */
html {
  font-size: var(--font-size-base);
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

body {
  font-family: var(--font-secondary);
  font-size: var(--font-size-body);
  font-weight: var(--font-weight-normal);
  line-height: var(--line-height-normal);
  color: var(--color-dark);
  background-color: var(--color-white);
  overflow-x: hidden;
  min-height: 100vh;
}

/* Reset de listas */
ul,
ol {
  list-style: none;
}

/* Reset de enlaces */
a {
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

a:hover,
a:focus {
  text-decoration: none;
}

/* Reset de botones */
button {
  font-family: inherit;
  font-size: inherit;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0;
  color: inherit;
}

button:focus {
  outline: none;
}

/* Reset de inputs y formularios */
input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

input:focus,
textarea:focus,
select:focus {
  outline: none;
}

/* Eliminar flechas de input 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;
}

/* Reset de imágenes y media */
img,
picture,
video,
canvas,
svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Evitar problemas con SVG */
svg {
  fill: currentColor;
}

/* Reset de tablas */
table {
  border-collapse: collapse;
  border-spacing: 0;
  width: 100%;
}

/* Reset de elementos de formulario */
fieldset {
  border: none;
}

/* Eliminar apariencia por defecto de select */
select {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
}

/* Tipografía base para headings */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-primary);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-primary-dark);
}

h1 { font-size: var(--font-size-h1); }
h2 { font-size: var(--font-size-h2); }
h3 { font-size: var(--font-size-h3); }
h4 { font-size: var(--font-size-h4); }
h5 { font-size: var(--font-size-h5); }
h6 { font-size: var(--font-size-h6); }

/* Párrafos */
p {
  margin-bottom: var(--spacing-md);
}

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

/* Strong y emphasis */
strong,
b {
  font-weight: var(--font-weight-bold);
}

em,
i {
  font-style: italic;
}

/* Blockquotes */
blockquote {
  border-left: var(--border-width-thicker) solid var(--color-accent);
  padding-left: var(--spacing-lg);
  font-style: italic;
  color: var(--color-gray);
}

/* Code */
code,
pre {
  font-family: var(--font-monospace);
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: var(--spacing-md);
  background-color: var(--color-light);
  border-radius: var(--border-radius-md);
}

/* HR */
hr {
  border: none;
  border-top: var(--border-width) solid var(--color-light-gray);
  margin: var(--spacing-xl) 0;
}

/* Selección de texto */
::selection {
  background-color: var(--color-accent);
  color: var(--color-white);
}

::-moz-selection {
  background-color: var(--color-accent);
  color: var(--color-white);
}

/* Scrollbar personalizado (Webkit) */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--color-light);
}

::-webkit-scrollbar-thumb {
  background: var(--color-gray);
  border-radius: var(--border-radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-dark-gray);
}

/* Accesibilidad - Skip to content */
.skip-to-content {
  position: absolute;
  top: -100px;
  left: 0;
  background: var(--color-accent);
  color: var(--color-white);
  padding: var(--spacing-md);
  text-decoration: none;
  z-index: var(--z-index-tooltip);
}

.skip-to-content:focus {
  top: 0;
}

/* Focus visible para accesibilidad */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

/* Ocultar visualmente pero mantener accesible */
.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;
}

/* Reducir movimiento para usuarios que lo prefieran */
@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;
  }
}
