/* components-2.css — version 2
 *
 * Cuando hagas un cambio relevante que invalide caché, renombra a
 * components-3.css y actualiza la referencia en layout.phtml /
 * base.html.
 */

/* ─── Skip link ──────────────────────────────────────────────────── */
.skip-link {
  position: absolute; left: -9999px; top: auto; width: 1px; height: 1px;
}
.skip-link:focus {
  position: fixed; left: 1rem; top: 1rem; width: auto; height: auto;
  padding: .5rem 1rem; background: var(--brand-900); color: white;
  z-index: 100; border-radius: var(--radius-sm);
}

/* ─── Site header ────────────────────────────────────────────────── */
.site-header {
  background: var(--surface-1);
  border-bottom: 1px solid var(--color-border);
  position: sticky; top: 0; z-index: 50;
}
.site-header__inner {
  display: flex; justify-content: space-between; align-items: center;
  padding: 1rem 0; gap: 1.5rem; flex-wrap: wrap;
}
.brand { display: flex; align-items: center; gap: .5rem; text-decoration: none; color: var(--color-text); }
.brand__mark {
  font-family: var(--font-display);
  font-weight: 600;
  background: var(--brand-600); color: white;
  padding: 4px 8px; border-radius: var(--radius-sm);
  font-size: var(--fs-base);
}
.brand__name { font-family: var(--font-display); font-weight: 600; font-size: var(--fs-lg); }
.brand__tld { color: var(--color-text-soft); font-weight: 400; }
.site-nav { display: flex; gap: 1rem; align-items: center; flex-wrap: wrap; }
.site-nav__link { color: var(--color-text); text-decoration: none; font-size: var(--fs-sm); }
.site-nav__link:hover { color: var(--brand-600); }

/* ─── Site footer ────────────────────────────────────────────────── */
.site-footer {
  background: var(--surface-2);
  border-top: 1px solid var(--color-border);
  margin-top: 4rem;
  padding: 2rem 0;
}
.site-footer__inner {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem;
  font-size: var(--fs-sm);
}
.site-footer a { color: var(--color-text); }

/* ─── Main grid (content + sidebar) ──────────────────────────────── */
.main-grid {
  display: grid;
  grid-template-columns: 1fr 280px;
  gap: 2.5rem;
  align-items: start;
  margin: 2rem 0;
}
@media (max-width: 900px) {
  .main-grid { grid-template-columns: 1fr; }
}

.sidebar { position: sticky; top: 5rem; }
.sidebar__block { margin-bottom: 1.5rem; }
.sidebar__heading {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--color-text-soft);
  margin: 0 0 .5rem;
  font-weight: 600;
}
.sidebar__list { list-style: none; padding: 0; margin: 0; }
.sidebar__list li { padding: .25rem 0; }
.sidebar__list a { color: var(--color-text); text-decoration: none; }
.sidebar__list a:hover { color: var(--brand-600); }

/* ─── Sidebar search ─────────────────────────────────────────────── */
.sidebar__search { display: flex; gap: .25rem; margin-bottom: 1.5rem; }
.sidebar__search input {
  flex: 1; min-width: 0;
  padding: .45rem .6rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-surface);
  color: var(--color-text);
  font: inherit;
  box-sizing: border-box;
}
.sidebar__search input:focus { outline: 2px solid var(--brand-400); outline-offset: 1px; }

/* ─── Category tree (collapsible) ────────────────────────────────── */
.cat-tree { list-style: none; padding: 0; margin: 0; }
.cat-tree--nested { padding-left: 1.25rem; margin-top: .15rem; }
.cat-tree__item { padding: 0; line-height: 1.5; }

/* details/summary */
.cat-tree__group { }
.cat-tree__summary {
  cursor: pointer;
  display: block;
  padding: .15rem 0;
  list-style: none;          /* quita marker en Firefox */
  position: relative;
}
.cat-tree__summary::-webkit-details-marker { display: none; }
.cat-tree__summary::marker { content: ''; }

/* Flecha como span real (no pseudo) — fiable cross-browser */
.cat-tree__arrow {
  display: inline-block;
  width: 1em;
  text-align: center;
  vertical-align: baseline;
  color: var(--color-text-soft);
  font-family: var(--font-display);
  font-size: 1em;
  line-height: 1;
  transition: transform var(--t-fast) var(--ease-out);
}
details[open] > .cat-tree__summary > .cat-tree__arrow {
  transform: rotate(90deg);
}

.cat-tree__link,
.cat-tree__leaf {
  display: inline;
  color: var(--color-text);
  text-decoration: none;
  padding: 2px 4px;
  border-radius: var(--radius-sm);
}
.cat-tree__leaf { margin-left: 1em; /* alinea con title de summaries hermanos */ }
.cat-tree__link:hover,
.cat-tree__leaf:hover { color: var(--brand-600); background: var(--surface-2); }
.cat-tree__summary.is-current > .cat-tree__link,
.cat-tree__leaf.is-current {
  background: var(--brand-100);
  color: var(--brand-900);
  font-weight: 500;
}

/* ─── Hero with stats ────────────────────────────────────────────── */
.hero { padding: 2rem 0 1rem; }
.hero__eyebrow {
  font-family: var(--font-display);
  font-size: var(--fs-sm);
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--brand-600);
  margin: 0 0 .5rem;
  font-weight: 600;
}
.hero h1 {
  font-size: var(--fs-3xl);
  line-height: 1.15;
  margin: 0 0 1rem;
  max-width: 22ch;
}
.hero__lead { font-size: var(--fs-lg); color: var(--color-text-soft); max-width: 50ch; }
.hero__cta { display: flex; gap: .5rem; flex-wrap: wrap; margin-top: 1.5rem; }
.hero__welcome { margin-top: 1rem; }

.hero--with-stats {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  align-items: end;
}
@media (max-width: 720px) {
  .hero--with-stats { grid-template-columns: 1fr; }
}

.hero__stats {
  display: grid;
  grid-template-columns: repeat(3, auto);
  gap: 1.25rem 1.5rem;
  margin: 0;
  padding: 1rem 1.5rem;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  border: 1px solid var(--color-border);
}
.hero__stats > div { text-align: center; }
.hero__stats dt {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-2xl);
  color: var(--brand-900);
  line-height: 1;
}
.hero__stats dd {
  margin: .25rem 0 0;
  font-size: var(--fs-xs);
  color: var(--color-text-soft);
  text-transform: uppercase;
  letter-spacing: .06em;
}
@media (max-width: 720px) {
  .hero__stats { padding: .75rem; gap: .5rem 1rem; }
  .hero__stats dt { font-size: var(--fs-xl); }
}

/* ─── Sections ──────────────────────────────────────────────────── */
.section { margin: 3rem 0; }
.section__head { margin-bottom: 1.25rem; }
.section__title {
  font-size: var(--fs-xl);
  margin: 0;
  font-weight: 600;
}

/* ─── Two-column layouts ─────────────────────────────────────────── */
.two-col { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.two-col--gap-lg { gap: 3rem; }
@media (max-width: 720px) { .two-col, .two-col--gap-lg { grid-template-columns: 1fr; } }

/* ─── Product grid (featured) ────────────────────────────────────── */
.product-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}
.product-card {
  display: flex; flex-direction: column; gap: .75rem;
  padding: 1rem;
  background: var(--surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  text-decoration: none;
  color: var(--color-text);
  transition: transform var(--t-fast), box-shadow var(--t-fast);
}
.product-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 4px 12px rgba(7,32,63,.08);
}
.product-card__cover {
  aspect-ratio: 4 / 3;
  background: var(--surface-2);
  border-radius: var(--radius-sm);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-display);
  font-size: var(--fs-2xl);
  font-weight: 600;
  color: var(--brand-400);
  overflow: hidden;
}
.product-card__cover img { width: 100%; height: 100%; object-fit: cover; }
.product-card__title { font-size: var(--fs-base); font-weight: 600; margin: 0 0 .25rem; }
.product-card__desc { font-size: var(--fs-sm); color: var(--color-text-soft); margin: 0; }
.product-card__meta {
  display: flex; gap: .35rem; flex-wrap: wrap; align-items: center;
  font-size: var(--fs-xs); color: var(--color-text-soft);
  margin-top: .5rem;
}

/* ─── Row cards (top / new) ──────────────────────────────────────── */
.row-cards { display: flex; flex-direction: column; gap: .25rem; }
.row-card {
  display: flex; align-items: center; gap: .75rem;
  padding: .65rem .75rem;
  text-decoration: none;
  color: var(--color-text);
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}
.row-card:hover { background: var(--surface-2); }
.row-card__rank {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: var(--fs-base);
  color: var(--brand-400);
  width: 1.6rem;
  text-align: right;
  flex-shrink: 0;
}
.row-card__main { display: flex; flex-direction: column; min-width: 0; flex: 1; }
.row-card__title {
  font-size: var(--fs-sm);
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.row-card__meta {
  display: flex; gap: .5rem; flex-wrap: wrap;
  font-size: var(--fs-xs); color: var(--color-text-soft);
}
.row-card__cat {
  background: var(--brand-100); color: var(--brand-900);
  padding: 1px 6px; border-radius: 3px;
}

/* ─── Badge ──────────────────────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  background: var(--brand-100); color: var(--brand-900);
  border-radius: var(--radius-sm);
  font-size: var(--fs-xs);
}

/* ─── Buttons ────────────────────────────────────────────────────── */
.btn {
  display: inline-block;
  padding: .55rem 1.1rem;
  background: var(--surface-2); color: var(--color-text);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
  font: inherit; font-weight: 500;
  cursor: pointer;
  transition: background var(--t-fast), border-color var(--t-fast);
}
.btn:hover { background: var(--brand-100); border-color: var(--brand-400); }
.btn--primary { background: var(--brand-600); color: white; border-color: var(--brand-600); }
.btn--primary:hover { background: var(--brand-900); border-color: var(--brand-900); }
.btn--ghost { background: transparent; }
.btn--danger { background: #c0392b; color: white; border-color: #c0392b; }
.btn--danger:hover { background: #962d22; border-color: #962d22; }
.btn--sm { padding: .3rem .75rem; font-size: var(--fs-sm); }
.btn--lg { padding: .75rem 1.5rem; font-size: var(--fs-base); }

/* ─── Forms (uniform width across all inputs) ────────────────────── */
.form-page {
  max-width: 480px;
  margin: 1rem auto 4rem;
}
.form { margin-top: 1rem; }
.field { margin-bottom: 1.25rem; }
.field__label {
  display: block;
  margin-bottom: .35rem;
  font-size: var(--fs-sm);
  font-weight: 500;
}
/* Una sola regla aplica a TODOS los inputs/textareas/selects con la
   misma clase. Antes había inputs con estilos inline distintos y se
   veían de tamaños diferentes. */
.field__input,
.field input,
.field textarea,
.field select {
  display: block;
  width: 100%;
  box-sizing: border-box;
  padding: .55rem .75rem;
  font: inherit;
  color: var(--color-text);
  background: var(--surface-1);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.field__input:focus,
.field input:focus,
.field textarea:focus,
.field select:focus {
  outline: none;
  border-color: var(--brand-400);
  box-shadow: 0 0 0 3px rgba(78,143,224,.18);
}
.field__input--mono { font-family: var(--font-mono); letter-spacing: 1px; }
.field__hint { margin: .25rem 0 0; font-size: var(--fs-xs); color: var(--color-text-soft); }
.field__error { margin: .25rem 0 0; font-size: var(--fs-sm); color: #c0392b; }

.form-footer {
  margin-top: 2rem; padding-top: 1.25rem;
  border-top: 1px solid var(--color-border);
  font-size: var(--fs-sm); color: var(--color-text-soft);
}
.form-footer a { color: var(--brand-600); }

/* ─── Account page ───────────────────────────────────────────────── */
.account-section {
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--color-border);
}
.account-section:last-child { border-bottom: none; }
.account-section h2 {
  font-size: var(--fs-lg);
  margin: 0 0 1rem;
}
.account-section--danger h2 { color: #c0392b; }

/* ─── Alerts (flash) ─────────────────────────────────────────────── */
.alert {
  padding: .75rem 1rem;
  margin: 0 0 1rem;
  border-radius: var(--radius-sm);
  border-left: 3px solid;
  background: var(--surface-2);
}
.alert--success { background: #ecfdf5; color: #065f46; border-color: #10b981; }
.alert--info    { background: #eff6ff; color: #1e3a8a; border-color: #3b82f6; }
.alert--warning { background: #fefce8; color: #713f12; border-color: #eab308; }
.alert--danger  { background: #fef2f2; color: #7f1d1d; border-color: #ef4444; }

/* ─── Product detail ─────────────────────────────────────────────── */
.product-detail__head {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 2rem;
  margin: 1.5rem 0;
}
@media (max-width: 600px) {
  .product-detail__head { grid-template-columns: 1fr; }
}
.product-detail__cover {
  aspect-ratio: 1;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  display: flex; align-items: center; justify-content: center;
  overflow: hidden;
}
.product-detail__cover img { width: 100%; height: 100%; object-fit: cover; }
.product-detail__title { font-size: var(--fs-2xl); margin: 0 0 .5rem; }
.product-detail__lead { font-size: var(--fs-lg); color: var(--color-text-soft); }

.product-meta {
  display: grid;
  grid-template-columns: max-content 1fr;
  column-gap: 1.5rem;
  row-gap: .5rem;
  margin: 2rem 0;
  padding: 1.25rem 1.5rem;
  background: var(--surface-2);
  border-radius: var(--radius-md);
}
.product-meta__label { font-size: var(--fs-sm); color: var(--color-text-soft); margin: 0; }
.product-meta__value { margin: 0; font-size: var(--fs-sm); }
.product-meta__value--mono { font-family: var(--font-mono); word-break: break-all; }

/* ─── Markdown content (.md) ─────────────────────────────────────── */
.md { line-height: 1.7; }
.md p { margin: 0 0 1rem; }
.md h2 { font-size: var(--fs-xl); margin: 2rem 0 .75rem; }
.md h3 { font-size: var(--fs-lg); margin: 1.5rem 0 .5rem; }
.md h4 { font-size: var(--fs-base); margin: 1.25rem 0 .5rem; font-weight: 600; }
.md ul, .md ol { margin: 0 0 1rem 1.5rem; padding: 0; }
.md li { margin: .25rem 0; }
.md a { color: var(--brand-600); }
.md .md-code {
  font-family: var(--font-mono);
  background: var(--surface-2);
  padding: 1px 5px;
  border-radius: 3px;
  font-size: .9em;
}
.md .md-pre {
  background: var(--brand-900);
  color: #e6edf3;
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
  overflow-x: auto;
  margin: 1rem 0;
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
  line-height: 1.5;
}
.md .md-pre code { background: transparent; padding: 0; color: inherit; font-size: inherit; }
.md blockquote {
  border-left: 3px solid var(--brand-400);
  padding-left: 1rem;
  margin: 1rem 0;
  color: var(--color-text-soft);
}

/* ─── Vídeos y contenido para clientes ───────────────────────────── */
.md .md-video { margin: 1.5rem 0; }
.md .md-video video {
  display: block;
  width: 100%;
  max-width: 640px;
  height: auto;
  aspect-ratio: 4 / 3;
  background: #000;
  border-radius: var(--radius-md);
}
.md .md-video figcaption { margin-top: .5rem; font-size: var(--fs-sm); color: var(--color-text-soft); }
.members { margin-top: 2rem; }
.members__locked {
  display: flex;
  gap: 1.25rem;
  align-items: flex-start;
  max-width: 640px;
  padding: 1.5rem;
  background: var(--surface-2);
  border-radius: var(--radius-md);
}
.members__play {
  flex: none;
  display: flex; align-items: center; justify-content: center;
  width: 3.5rem; height: 3.5rem;
  border-radius: 50%;
  background: var(--brand-900);
  color: white;
  font-size: 1.25rem;
}
.members__locked p { margin: 0 0 .75rem; }
.members__title { font-weight: 600; font-size: var(--fs-lg); }
.members__actions { display: flex; gap: .5rem; flex-wrap: wrap; margin: 0; }

/* ─── Tags ───────────────────────────────────────────────────────── */
.tag-list { display: flex; gap: .35rem; flex-wrap: wrap; }
.tag {
  display: inline-block;
  padding: 2px 8px;
  font-size: var(--fs-xs);
  background: var(--surface-2);
  color: var(--color-text);
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.tag:hover { background: var(--brand-100); color: var(--brand-900); }

/* ─── Reviews / rating ───────────────────────────────────────────── */
.rating-summary {
  display: flex; gap: .5rem; align-items: baseline; margin-top: .5rem;
}
.rating-stars { letter-spacing: 1px; color: var(--color-border); }
.star { color: var(--color-border); }
.star--on { color: #F5B400; }
.rating-number { font-weight: 600; }

.reviews { margin-top: 3rem; }
.review-list {
  list-style: none; padding: 0; margin: 1.5rem 0;
  display: flex; flex-direction: column; gap: 1rem;
}
.review {
  background: var(--surface-2);
  padding: 1rem 1.25rem;
  border-radius: var(--radius-md);
}
.review__head {
  display: flex; gap: .5rem; align-items: baseline; flex-wrap: wrap;
  margin-bottom: .5rem;
}
.review__user { font-size: var(--fs-sm); }
.review__body { margin: 0; }
.review-form { margin-top: 2.5rem; padding-top: 1.5rem; border-top: 1px solid var(--color-border); }
.rating-input { display: flex; flex-direction: row-reverse; justify-content: flex-end; gap: .25rem; }
.rating-input__label { cursor: pointer; padding: .25rem .5rem; border-radius: var(--radius-sm); }
.rating-input__label:has(input:checked) { background: var(--brand-100); }
.rating-input__label input { position: absolute; opacity: 0; pointer-events: none; }

/* ─── Breadcrumb ──────────────────────────────────────────────────── */
.breadcrumb {
  font-size: var(--fs-sm);
  color: var(--color-text-soft);
  display: flex; flex-wrap: wrap; gap: .35rem; align-items: center;
}
.breadcrumb a { color: var(--brand-600); text-decoration: none; }
.breadcrumb a:hover { text-decoration: underline; }
.breadcrumb__sep { color: var(--color-text-soft); opacity: .6; }

/* ─── Empty / util ───────────────────────────────────────────────── */
.empty {
  padding: 2.5rem 1rem;
  text-align: center;
  background: var(--surface-2);
  border-radius: var(--radius-md);
  color: var(--color-text-soft);
}
.empty p { margin: 0; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.text-soft  { color: var(--color-text-soft); }
.text-muted { color: var(--color-text-soft); }
.text-sm    { font-size: var(--fs-sm); }

/* ─── Container variants ─────────────────────────────────────────── */
.container { max-width: 1100px; margin: 0 auto; padding: 0 1rem; }
.container--narrow { max-width: 480px; margin: 0 auto; padding: 0 1rem; }

/* ─── Portada: hero con la imagen de la caja ───────────────────────────── */
.hero--home {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2.5rem;
  align-items: center;
  padding: 2.5rem 0;
}
.hero--home .hero__art img { max-width: 360px; width: 100%; height: auto; }
@media (max-width: 760px) {
  .hero--home { grid-template-columns: 1fr; }
  .hero--home .hero__art { order: -1; max-width: 260px; }
}

/* ─── CTA row (zona clientes / páginas con botones) ──────────────── */
.cta-row { display: flex; gap: .75rem; flex-wrap: wrap; margin: 1.5rem 0; }
