/**
 * DTC — base: reset mínimo + tipografía + accesibilidad.
 * Port de dtc_theme_v2/css/base/{reset,typography,a11y}.css.
 * Requiere tokens.css antes.
 */

/* ---- Tipografía: Nunito variable vendorizada (un solo woff2, 400–800) ---- */
@font-face {
  font-family: "Nunito";
  src: url("/static/dtc/fonts/nunito-vf.woff2") format("woff2");
  font-weight: 400 800;
  font-style: normal;
  font-display: swap;
}

/* ---- Reset ---- */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
}

body {
  font-family: var(--dtc-font-ui);
  color: var(--dtc-text);
  height: 100dvh;
  overflow: hidden;
  font-size: 14px;
  line-height: 1.45;
  background: var(--dtc-bg);
  -webkit-font-smoothing: antialiased;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration: none;
}

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

svg {
  flex: none;
}

[hidden] {
  display: none !important;
}

[x-cloak] {
  display: none !important;
}

img {
  max-width: 100%;
  height: auto;
}

h1,
h2,
h3,
h4 {
  letter-spacing: -.015em;
  line-height: 1.25;
}

code,
kbd,
pre,
samp {
  font-family: var(--dtc-font-mono);
}

::selection {
  background: var(--dtc-primary-soft);
  color: var(--dtc-primary-strong);
}

/* Scrollbars finos y tokenizados (las páginas viejas los definían a mano) */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--dtc-border) transparent;
}

*::-webkit-scrollbar {
  width: 8px;
  height: 8px;
}

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

*::-webkit-scrollbar-thumb {
  background: var(--dtc-border);
  border-radius: 4px;
}

*::-webkit-scrollbar-thumb:hover {
  background: var(--dtc-faint);
}

/* ---- Accesibilidad ---- */
button:focus-visible,
a:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible,
[tabindex]:focus-visible {
  outline: none;
  box-shadow: var(--dtc-focus);
  border-radius: var(--dtc-radius-sm);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.skip-link.focusable:focus {
  position: fixed !important;
  top: 10px;
  left: 50%;
  transform: translateX(-50%);
  width: auto;
  height: auto;
  margin: 0;
  padding: 9px 18px;
  clip: auto;
  background: var(--dtc-text);
  color: var(--dtc-surface);
  border-radius: 999px;
  font-weight: 700;
  z-index: 200;
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition-duration: 0ms !important;
    animation-duration: 0ms !important;
  }
}
