/*
 * Element defaults shared by every app. Tag selectors belong here, plus the few class rules that
 * every app styled identically (the test-mode banner and the fee breakdown, OD-UI-012), kept once.
 */

/*
 * Typefaces: unmodified Latin woff2 files from the pinned Fontsource packages, served same-origin
 * (the page CSP has no font-src, so fonts fall back to default-src 'self'). No CDN. Swap keeps
 * text visible with the system fallback while a file loads. Bodoni Moda (OD-UI-012) replaced
 * Literata for headings; Lato is unchanged (OD-UI-004).
 */
@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../vendor/fonts/bodoni-moda-5.3.0/bodoni-moda-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Bodoni Moda";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../../vendor/fonts/bodoni-moda-5.3.0/bodoni-moda-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../../vendor/fonts/lato-5.3.0/lato-latin-400-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../../vendor/fonts/lato-5.3.0/lato-latin-700-normal.woff2") format("woff2");
}

@font-face {
  font-family: "Lato";
  font-style: normal;
  font-weight: 900;
  font-display: swap;
  src: url("../../vendor/fonts/lato-5.3.0/lato-latin-900-normal.woff2") format("woff2");
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  font-family: var(--font-family);
  font-size: var(--font-size-base);
  line-height: var(--line-height-base);
  color: var(--color-text);
  background: var(--color-page);
}

h1,
h2,
h3,
p,
ul {
  margin: 0;
}

/*
 * saper.club hierarchy (OD-UI-012): Bodoni Moda headings in the heading ink, set slightly tight.
 * A heading without a class takes the fluid scale; an app class sets its own size (the POS caps its
 * headings at 24 px), and the unitless 1.2 keeps its line proportional.
 */
h1,
h2,
h3 {
  font-family: var(--font-family-heading);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: var(--heading-letter-spacing);
  color: var(--color-heading);
}

h1:not([class]) {
  font-size: var(--font-size-h1);
  line-height: var(--line-height-h1);
}

h2:not([class]) {
  font-size: var(--font-size-h2);
  line-height: var(--line-height-h2);
}

h3:not([class]) {
  font-size: var(--font-size-h3);
  line-height: var(--line-height-h3);
}

small {
  font-size: var(--font-size-small);
  line-height: var(--line-height-small);
}

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

button,
input,
select {
  font: inherit;
  font-size: max(1rem, 16px); /* 16px minimum avoids iOS zoom on focus */
  min-height: var(--touch-target-min);
}

button {
  cursor: pointer;
}

button:disabled {
  cursor: not-allowed;
}

:focus-visible {
  outline: var(--focus-ring-width) solid var(--color-focus);
  outline-offset: var(--focus-ring-offset);
}

/*
 * "Modo de prueba" banner, once for every page (OD-UI-012 dedupe). Each page keeps the class
 * test-mode-notice, which the event server hides (OD-UI-010); the POS adds its sticky position.
 */
.test-mode-banner {
  padding: var(--space-3) var(--space-4);
  padding-top: max(var(--space-3), env(safe-area-inset-top));
  background: var(--color-warning-surface);
  color: var(--color-warning-text);
  font-weight: 700;
  text-align: center;
  border-bottom: 2px solid var(--color-warning-text);
}

/*
 * "Costo del servicio" breakdown (platform-fee-breakdown design D8), shared by the POS and the
 * wallet: label and amount on one row, the fiscal detail behind a native disclosure with a
 * full-size touch target.
 */
.breakdown {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
}

.breakdown__row {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--space-2);
}

.breakdown__label,
.breakdown__amount {
  margin: 0;
}

.breakdown__amount {
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.breakdown-details {
  font-size: var(--font-size-small);
}

.breakdown__summary {
  min-height: var(--touch-target-min);
  display: flex;
  align-items: center;
  cursor: pointer;
  font-weight: 700;
}

@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;
  }
}
