/* ============================================================
   BASE — Tu Cajita
   Estilos globales de body, tipografía, links y elementos
   de texto. Depende de tokens.css.
   ============================================================ */

body {
  font-family: var(--font-sans);
  font-size: var(--font-size-base);
  font-weight: var(--font-weight-regular);
  line-height: var(--line-height-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
}

/* --- Jerarquía tipográfica --- */

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: var(--font-weight-bold);
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h4, h5, h6 {
  font-family: var(--font-sans);
  font-weight: var(--font-weight-semi);
  line-height: var(--line-height-tight);
  color: var(--color-text);
}

h1 { font-size: var(--font-size-3xl); }
h2 { font-size: var(--font-size-2xl); }
h3 { font-size: var(--font-size-xl); }
h4 { font-size: var(--font-size-lg); }
h5 { font-size: var(--font-size-md); }
h6 { font-size: var(--font-size-base); }

p {
  line-height: var(--line-height-loose);
  color: var(--color-text);
}

/* --- Links --- */

a:hover {
  color: var(--color-accent);
}

/* --- Texto de acento (script) --- */

.text-script {
  font-family: var(--font-script);
  color: var(--color-accent);
}

/* --- Clases de utilidad tipográfica --- */

.text-center  { text-align: center; }
.text-accent  { color: var(--color-accent); }
.text-light   { color: var(--color-text-light); }
.text-white   { color: var(--color-white); }
.text-sm      { font-size: var(--font-size-sm); }
.text-xs      { font-size: var(--font-size-xs); }

.font-semi    { font-weight: var(--font-weight-semi); }
.font-bold    { font-weight: var(--font-weight-bold); }

/* --- Focus visible (accesibilidad de teclado) --- */

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* Quitar outline por defecto solo cuando no es foco de teclado */
:focus:not(:focus-visible) {
  outline: none;
}

/* --- Separador visual --- */

.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

/* --- Badge (contador carrito, etiquetas producto) --- */

.badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 1.25rem;
  height: 1.25rem;
  padding: 0 var(--space-1);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-bold);
  line-height: 1;
  background-color: var(--color-accent);
  color: var(--color-white);
}

/* --- Botones base --- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-6);
  border-radius: var(--radius-full);
  font-family: var(--font-sans);
  font-size: var(--font-size-sm);
  font-weight: var(--font-weight-semi);
  letter-spacing: 0.03em;
  transition: background-color var(--transition-base),
              transform var(--transition-fast),
              box-shadow var(--transition-base);
  cursor: pointer;
  border: none;
  white-space: nowrap;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
  box-shadow: var(--shadow-md);
  color: var(--color-white);
}

.btn-outline {
  background-color: transparent;
  color: var(--color-accent);
  border: 2px solid var(--color-accent);
}

.btn-outline:hover {
  background-color: var(--color-accent-subtle);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-text);
}

.btn-ghost:hover {
  background-color: var(--color-accent-subtle);
  color: var(--color-accent);
}

.btn-lg {
  padding: var(--space-4) var(--space-8);
  font-size: var(--font-size-base);
}

.btn-sm {
  padding: var(--space-2) var(--space-4);
  font-size: var(--font-size-xs);
}

/* --- Etiquetas de producto (chip) --- */

.chip {
  display: inline-block;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--font-size-xs);
  font-weight: var(--font-weight-semi);
  background-color: var(--color-accent-subtle);
  color: var(--color-accent);
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.chip-white {
  background-color: rgba(255,255,255,0.25);
  color: var(--color-white);
}
