/* ==========================================================================
   Base: reset, tipografía, utilidades mínimas, accesibilidad
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 16px);
}

body {
  margin: 0;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: var(--font);
  font-size: var(--fs-md);
  line-height: var(--lh);
  color: var(--c-text);
  background: var(--c-paper);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
}
body.is-locked { overflow: hidden; }

main { flex: 1 0 auto; display: block; }

h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--sp-3);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  color: var(--c-ink);
  letter-spacing: -0.01em;
}
h1 { font-size: var(--fs-3xl); }
h2 { font-size: var(--fs-2xl); }
h3 { font-size: var(--fs-xl); }
h4 { font-size: var(--fs-lg); }
p { margin: 0 0 var(--sp-4); }
p:last-child { margin-bottom: 0; }

a { color: inherit; text-decoration: none; }
a:hover { color: var(--c-brand-700); }
.link { color: var(--c-blue); font-weight: var(--fw-medium); }
.link:hover { color: var(--c-blue-600); text-decoration: underline; text-underline-offset: 3px; }
.link--brand { color: var(--c-brand-600); }
.link--brand:hover { color: var(--c-brand-700); }

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: not-allowed; }
ul, ol { margin: 0; padding: 0; list-style: none; }
.prose ul { list-style: disc; padding-left: 1.25rem; margin-bottom: var(--sp-4); }
.prose ol { list-style: decimal; padding-left: 1.25rem; margin-bottom: var(--sp-4); }
hr { border: 0; border-top: var(--border); margin: var(--sp-6) 0; }
table { border-collapse: collapse; width: 100%; }
fieldset { border: 0; margin: 0; padding: 0; min-width: 0; }
legend { padding: 0; }
summary { cursor: pointer; }

.icon {
  display: inline-block;
  width: 1.25em;
  height: 1.25em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  vertical-align: middle;
}
.icon--sm { width: 1em; height: 1em; }
.icon--lg { width: 1.6em; height: 1.6em; }
.icon--xl { width: 2.25em; height: 2.25em; stroke-width: 1.5; }
.icon--fill { fill: currentColor; }

/* Accesibilidad */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--c-blue);
  outline-offset: 2px;
  border-radius: var(--r-xs);
}
.sr-only {
  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 {
  position: absolute;
  left: var(--sp-4);
  top: -100px;
  z-index: calc(var(--z-toast) + 1);
  padding: var(--sp-3) var(--sp-4);
  background: var(--c-ink);
  color: #fff;
  border-radius: var(--r-sm);
  font-weight: var(--fw-semibold);
}
.skip-link:focus { top: var(--sp-3); color: #fff; }

::selection { background: var(--c-brand-100); color: var(--c-ink); }

/* Layout utilitario */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: 880px; }
.container--md { max-width: 1080px; }
.section { padding-block: var(--sp-10); }
.section--tight { padding-block: var(--sp-6); }
.stack > * + * { margin-top: var(--sp-4); }
.stack-sm > * + * { margin-top: var(--sp-2); }
.stack-lg > * + * { margin-top: var(--sp-8); }
.row { display: flex; align-items: center; gap: var(--sp-3); }
.row--between { justify-content: space-between; }
.row--wrap { flex-wrap: wrap; }
.row--top { align-items: flex-start; }
.grow { flex: 1 1 auto; min-width: 0; }
.grid { display: grid; gap: var(--sp-4); }
.grid-2 { display: grid; gap: var(--sp-4); grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); }

/* Texto */
.muted { color: var(--c-muted); }
.subtle { color: var(--c-subtle); }
.text-sm { font-size: var(--fs-sm); }
.text-xs { font-size: var(--fs-xs); }
.text-lg { font-size: var(--fs-lg); }
.text-center { text-align: center; }
.text-right { text-align: right; }
.fw-medium { font-weight: var(--fw-medium); }
.fw-semibold { font-weight: var(--fw-semibold); }
.fw-bold { font-weight: var(--fw-bold); }
.caps { text-transform: uppercase; letter-spacing: var(--tracking-caps); font-size: var(--fs-xs); font-weight: var(--fw-semibold); }
.accent { color: var(--c-brand); }
.nowrap { white-space: nowrap; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { white-space: nowrap; font-weight: var(--fw-semibold); color: var(--c-ink); font-variant-numeric: tabular-nums; }
.price-old { white-space: nowrap; color: var(--c-subtle); text-decoration: line-through; font-size: 0.85em; font-weight: var(--fw-regular); }
.tabular { font-variant-numeric: tabular-nums; }

.mt-0 { margin-top: 0 !important; }
.mt-2 { margin-top: var(--sp-2); }
.mt-4 { margin-top: var(--sp-4); }
.mt-6 { margin-top: var(--sp-6); }
.mt-8 { margin-top: var(--sp-8); }
.mb-0 { margin-bottom: 0 !important; }
.mb-2 { margin-bottom: var(--sp-2); }
.mb-4 { margin-bottom: var(--sp-4); }
.mb-6 { margin-bottom: var(--sp-6); }
.w-full { width: 100%; }

@media (max-width: 767.98px) {
  .hide-mobile { display: none !important; }
}
@media (min-width: 768px) {
  .hide-tablet-up { display: none !important; }
}
@media (min-width: 1024px) {
  .hide-desktop { display: none !important; }
}
@media (max-width: 1023.98px) {
  .only-desktop { display: none !important; }
}

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

/* Listas en rejilla de una columna: nunca más anchas que su contenedor (evita desbordes por texto nowrap) */
.activity, .order-list, .member-list, .term-list, .quick-actions, .reviews, .final-files, .file-list,
.accordion, .legend, .checklist, .mini-items, .dl, .notif-list, .conv-list, .side-nav:not(.side-nav--scroll), .events, .steps--vertical {
  grid-template-columns: minmax(0, 1fr);
}
