:root {
  --bg: #fffdf8;
  --surface: #ffffff;
  --surface-alt: #fff3d6;
  --text: #1f2937;
  --muted: #6b7280;
  --line: #e7e2d8;
  --brand: #0f766e;
  --brand-dark: #115e59;
  --accent: #f59e0b;
  --danger: #dc2626;
  --radius: 16px;
  --shadow: 0 8px 24px rgba(31, 41, 55, 0.08);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Segoe UI", system-ui, -apple-system, Roboto, Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fffaf0 0%, var(--bg) 220px);
  line-height: 1.6;
}
img { max-width: 100%; display: block; }
a { color: var(--brand); text-decoration: none; }
a:hover { color: var(--brand-dark); text-decoration: underline; }
h1, h2, h3 { line-height: 1.2; margin: 0 0 .5rem; }
p { margin: 0 0 1rem; }
ul { margin: 0; padding: 0; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0;
}
.skip-link:focus {
  position: fixed; left: 1rem; top: 1rem; width: auto; height: auto; margin: 0; padding: .6rem .9rem;
  clip: auto; overflow: visible; background: #fff; color: var(--brand-dark); border: 2px solid var(--brand);
  border-radius: 10px; z-index: 100; font-weight: 700;
}
.contenedor { width: min(1120px, 100% - 2rem); margin: 0 auto; }

/* Header */
.site-header { background: rgba(255,253,248,.9); backdrop-filter: blur(6px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.header-fila { display: flex; align-items: center; gap: 1rem; padding: .75rem 0; flex-wrap: wrap; }
.marca { display: inline-flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.15rem; color: var(--text); }
.marca:hover { text-decoration: none; color: var(--brand-dark); }
.marca-icono { font-size: 1.4rem; }
.nav-principal a { font-weight: 600; padding: .4rem .7rem; border-radius: 999px; }
.nav-principal a:hover { background: var(--surface-alt); text-decoration: none; }
.nav-categorias { border-top: 1px solid var(--line); background: #fff; }
.nav-categorias ul { list-style: none; display: flex; gap: .25rem 1rem; padding: .45rem 0; overflow-x: auto; }
.nav-categorias a { display: inline-flex; gap: .35rem; white-space: nowrap; color: var(--muted); font-size: .95rem; }
.nav-categorias a:hover { color: var(--brand-dark); }

/* Buscador */
.buscador { display: flex; gap: .5rem; }
.buscador input {
  flex: 1; min-width: 0; padding: .7rem .9rem; border: 1px solid var(--line);
  border-radius: 999px; font: inherit; background: #fff;
}
.buscador input:focus { outline: 2px solid #99f6e4; border-color: var(--brand); }
.buscador button, .btn {
  display: inline-flex; align-items: center; justify-content: center; gap: .35rem;
  padding: .65rem 1rem; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--text); font: inherit; font-weight: 600; cursor: pointer;
}
.buscador button, .btn-primario { background: var(--brand); color: #fff; border-color: var(--brand); }
.buscador button:hover, .btn-primario:hover { background: var(--brand-dark); color: #fff; text-decoration: none; }
.btn:hover { text-decoration: none; border-color: #cfc8ba; }
.btn-chico { padding: .35rem .7rem; font-size: .9rem; }
.btn-grande { padding: .85rem 1.3rem; font-size: 1.05rem; }
.buscador-cabecera { flex: 1; max-width: 420px; margin-left: auto; }

/* Hero */
.hero { text-align: center; padding: 2.5rem 0 1.5rem; }
.hero h1 { font-size: clamp(1.8rem, 4vw, 3rem); margin-bottom: .5rem; }
.hero-bajada { color: var(--muted); font-size: 1.1rem; max-width: 700px; margin: 0 auto 1.2rem; }
.buscador-hero { max-width: 620px; margin: 0 auto 1.2rem; }
.buscador-hero input { padding: .9rem 1.1rem; font-size: 1.05rem; }
.hero-stats { list-style: none; display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap; }
.hero-stats li { background: #fff; border: 1px solid var(--line); border-radius: 999px; padding: .45rem .9rem; display: flex; gap: .4rem; align-items: baseline; }
.hero-stats strong { font-size: 1.1rem; color: var(--brand-dark); }
.hero-stats span { color: var(--muted); font-size: .95rem; }

/* Secciones y grids */
.seccion { padding: 1.2rem 0 2rem; }
.seccion-cabecera { display: flex; align-items: baseline; justify-content: space-between; gap: 1rem; margin-bottom: 1rem; }
.seccion-cabecera h2 { font-size: 1.45rem; }
.ver-todo { font-weight: 600; white-space: nowrap; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 1rem; }
.grid-categorias { grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); }

/* Tarjetas categoría */
.cat-card {
  display: flex; flex-direction: column; align-items: center; text-align: center; gap: .2rem;
  padding: 1.2rem 1rem; background: var(--surface); border: 1px solid var(--line);
  border-radius: var(--radius); box-shadow: 0 2px 8px rgba(31,41,55,.04); color: var(--text);
}
.cat-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); text-decoration: none; border-color: #d9d2c3; }
.cat-icono { font-size: 2rem; line-height: 1; }
.cat-nombre { font-weight: 700; font-size: 1.05rem; }
.cat-contador { color: var(--muted); font-size: .9rem; }

/* Subcategorías */
.cat-card-sub {
  flex-direction: row; justify-content: flex-start; text-align: left; gap: .45rem;
  padding: .6rem .8rem; font-size: .9rem; border-style: dashed;
}
.cat-card-sub .cat-nombre { font-weight: 600; font-size: .95rem; }
.cat-card-sub .cat-contador { margin-left: auto; white-space: nowrap; }
.bloque-subcategorias { margin-bottom: 2rem; }
.bloque-subcategorias h2 { font-size: 1.2rem; margin-bottom: .9rem; }

/* Tarjetas dibujo */
.card { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; box-shadow: 0 2px 8px rgba(31,41,55,.04); display: flex; flex-direction: column; }
.card:hover { box-shadow: var(--shadow); }
.card-media { position: relative; aspect-ratio: 4 / 3; background: #fafaf7; border-bottom: 1px solid var(--line); }
.card-media img { width: 100%; height: 100%; object-fit: contain; padding: .5rem; }
.card-tipo { position: absolute; top: .5rem; right: .5rem; background: rgba(255,255,255,.95); border: 1px solid var(--line); border-radius: 999px; padding: .1rem .45rem; font-size: .75rem; font-weight: 700; color: var(--muted); }
.card-cuerpo { padding: .85rem; display: flex; flex-direction: column; gap: .3rem; flex: 1; }
.card-titulo { font-size: 1.05rem; margin: 0; }
.card-titulo a { color: var(--text); }
.card-cat { margin: 0; font-size: .9rem; }
.card-cat a { color: var(--muted); }
.card-pie { margin-top: auto; padding-top: .5rem; display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.card-descargas { color: var(--muted); font-size: .9rem; }
.card-acciones { display: flex; gap: .35rem; }

/* Páginas internas */
.pag-cabecera { padding: 1.5rem 0 1rem; }
.pag-cabecera h1 { font-size: clamp(1.6rem, 3vw, 2.2rem); }
.pag-bajada, .pag-contador { color: var(--muted); }
.pag-categoria { display: flex; gap: 1rem; align-items: flex-start; }
.pag-icono { font-size: 3rem; line-height: 1; }
.migas { padding: .8rem 0 0; font-size: .95rem; color: var(--muted); }
.migas ol { list-style: none; display: flex; flex-wrap: wrap; gap: .35rem; }
.migas li + li::before { content: "›"; margin-right: .35rem; color: #b9b2a3; }
.migas a { color: var(--muted); }
.migas [aria-current="page"] { color: var(--text); font-weight: 600; }
.estado-vacio { padding: 2rem; text-align: center; color: var(--muted); background: #fff; border: 1px dashed var(--line); border-radius: var(--radius); }
.resultado-contador { color: var(--muted); margin: .5rem 0 1rem; }
.buscador-pagina { max-width: 700px; margin: 0 0 1rem; }

/* Detalle dibujo */
.detalle { display: grid; grid-template-columns: 1.2fr 1fr; gap: 1.5rem; padding: 1rem 0 1.5rem; align-items: start; }
.detalle-media { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1rem; }
.detalle-img { width: 100%; height: auto; max-height: 70vh; object-fit: contain; margin: 0 auto; }
.detalle-descarga { margin-top: 1rem; width: 100%; }
.detalle-ayuda { margin: .5rem 0 0; color: var(--muted); font-size: .95rem; text-align: center; }
.detalle-info h1 { font-size: 1.8rem; }
.detalle-kicker { margin: 0 0 .25rem; color: var(--brand-dark); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; font-size: .85rem; }
.detalle-cat { font-weight: 600; }
.detalle-desc { color: #374151; }
.ficha { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: .6rem 1rem; margin: 1rem 0; }
.ficha div { background: #fffaf0; border: 1px solid var(--line); border-radius: 12px; padding: .55rem .75rem; }
.ficha dt { font-size: .85rem; color: var(--muted); }
.ficha dd { margin: 0; font-weight: 700; }
.detalle-tags { color: var(--muted); font-size: .95rem; }
.detalle-tags span { font-weight: 600; color: var(--text); }
.detalle-seo { margin-top: 1.2rem; padding: 1rem; border: 1px solid var(--line); border-radius: 12px; background: #fff; }
.detalle-seo h2 { font-size: 1.1rem; margin-bottom: .4rem; }
.detalle-seo ul { padding-left: 1.2rem; color: #374151; }
.seo-texto { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 1.2rem 1.2rem 1rem; }
.seo-texto p { color: #374151; margin-bottom: 0; }

/* Paginación */
.paginacion { display: flex; align-items: center; justify-content: center; gap: .5rem; flex-wrap: wrap; margin: 1.5rem 0 2rem; }
.pag-numeros { list-style: none; display: flex; gap: .25rem; }
.pag-numeros a, .pag-actual, .pag-flecha { display: inline-flex; min-width: 2.2rem; height: 2.2rem; align-items: center; justify-content: center; padding: 0 .6rem; border-radius: 999px; border: 1px solid var(--line); background: #fff; }
.pag-actual { background: var(--brand); color: #fff; border-color: var(--brand); font-weight: 700; }
.pag-flecha { padding: 0 .9rem; }

/* Error */
.error-pagina { text-align: center; padding: 3rem 0 4rem; }
.error-code { font-size: 4rem; font-weight: 800; color: #d6d3c7; margin: 0; line-height: 1; }
.error-mensaje { color: var(--muted); font-size: 1.1rem; }
.error-ruta code { background: #f3f4f6; padding: .15rem .4rem; border-radius: 6px; }
.error-acciones { display: flex; gap: .6rem; justify-content: center; flex-wrap: wrap; margin-top: 1rem; }

/* Footer */
.site-footer { border-top: 1px solid var(--line); background: #fff; margin-top: 2rem; }
.footer-columnas { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 1.5rem; padding: 2rem 0 1.2rem; }
.footer-col h2 { font-size: 1rem; margin-bottom: .5rem; }
.footer-col ul { list-style: none; }
.footer-col li { margin: .25rem 0; }
.footer-col a { color: var(--muted); }
.footer-col a:hover { color: var(--brand-dark); }
.footer-desc { color: var(--muted); max-width: 420px; }
.footer-base { border-top: 1px solid var(--line); padding: .9rem 0 1.2rem; color: var(--muted); font-size: .9rem; }

@media (max-width: 900px) {
  .detalle { grid-template-columns: 1fr; }
  .footer-columnas { grid-template-columns: 1fr 1fr; }
  .footer-marca { grid-column: 1 / -1; }
  .buscador-cabecera { order: 3; max-width: none; width: 100%; margin-left: 0; }
}
@media (max-width: 640px) {
  .header-fila { justify-content: space-between; }
  .nav-principal { margin-left: auto; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
  .grid-categorias { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-columnas { grid-template-columns: 1fr; }
  .seccion-cabecera { flex-direction: column; align-items: flex-start; }
  .ficha { grid-template-columns: 1fr 1fr; }
  .hero { padding-top: 1.6rem; }
}
