/* Demo de tienda Rayuela · usa las variables que define el panel de administración */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--fondo);
  color: #1a1a1a;
  line-height: 1.5;
}
a { color: var(--primario); text-decoration: none; }
a:hover { text-decoration: underline; }
.contenedor { max-width: 1120px; margin: 0 auto; padding: 0 20px; }

/* banner demo */
.demo-banner {
  background: #6d28d9; color: #fff; text-align: center;
  font-size: 13px; font-weight: 600; padding: 6px 10px;
}

/* cabecera */
.cabecera { background: #fff; border-bottom: 1px solid #e5e5e5; position: sticky; top: 0; z-index: 20; }
.cabecera-fila { display: flex; align-items: center; gap: 18px; padding: 12px 20px; flex-wrap: wrap; }
.marca { font-size: 21px; font-weight: 800; color: var(--secundario); display: flex; align-items: center; gap: 8px; }
.marca:hover { text-decoration: none; }
.marca-punto { width: 12px; height: 12px; border-radius: 50%; background: var(--primario); display: inline-block; }
.buscador { flex: 1; display: flex; min-width: 240px; }
.buscador input {
  flex: 1; padding: 9px 12px; border: 1px solid #ccc; border-radius: 8px 0 0 8px; font-size: 15px;
}
.buscador button {
  padding: 9px 16px; border: none; background: var(--primario); color: #fff; font-weight: 600;
  border-radius: 0 8px 8px 0; cursor: pointer;
}
.nav { display: flex; gap: 16px; font-size: 14px; font-weight: 600; }

/* hero */
.hero { padding: 34px 0 10px; }
.hero h1 { font-size: 34px; margin: 0 0 6px; color: var(--secundario); }
.hero-texto { margin: 0 0 18px; color: #444; }
.hero-datos { display: flex; gap: 28px; flex-wrap: wrap; }
.hero-datos div { display: flex; flex-direction: column; }
.hero-datos strong { font-size: 26px; color: var(--primario); }
.hero-datos span { font-size: 13px; color: #666; }

.titulo-seccion { margin: 30px 0 14px; font-size: 20px; color: var(--secundario); }

/* grilla de libros */
.grilla { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
.tarjeta { display: flex; flex-direction: column; background: #fff; border-radius: 10px; overflow: hidden;
           box-shadow: 0 1px 3px rgba(0,0,0,.12); transition: transform .12s ease, box-shadow .12s ease; }
.tarjeta:hover { transform: translateY(-2px); box-shadow: 0 4px 14px rgba(0,0,0,.16); text-decoration: none; }
.tapa { aspect-ratio: 3 / 4.2; background: #f0eeea; display: flex; align-items: center; justify-content: center; overflow: hidden; }
.tapa img { width: 100%; height: 100%; object-fit: contain; }
.tapa-vacia { font-size: 11px; color: #8a8a8a; padding: 8px; text-align: center; overflow: hidden; }
.tapa-vacia.grande { font-size: 14px; }
.tarjeta-texto { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; }
.tarjeta-titulo { font-size: 14px; font-weight: 600; line-height: 1.25; color: #111;
                  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.tarjeta-autor { font-size: 12px; color: #666; }
.tarjeta-precio { font-size: 15px; font-weight: 700; color: var(--secundario); margin-top: 4px;
                  display: flex; align-items: center; gap: 6px; }
.punto { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.punto.ok { background: #16a34a; }
.punto.no { background: #d1d5db; }

/* ficha */
.ficha { display: grid; grid-template-columns: 320px 1fr; gap: 34px; padding: 28px 0; }
.ficha-tapa img { width: 100%; border-radius: 8px; box-shadow: 0 6px 20px rgba(0,0,0,.18); }
.ficha-datos h1 { margin: 0 0 6px; font-size: 27px; line-height: 1.2; }
.ficha-autor { margin: 0 0 14px; font-size: 17px; color: #444; }
.ficha-meta { display: flex; flex-wrap: wrap; gap: 6px 22px; font-size: 13px; color: #555; margin-bottom: 20px; }
.ficha-meta strong { color: #333; }
.precio-caja { background: #fff; border-radius: 10px; padding: 16px 20px; box-shadow: 0 1px 3px rgba(0,0,0,.1); margin-bottom: 16px; }
.precio { font-size: 32px; font-weight: 800; color: var(--secundario); }
.disponible { font-size: 14px; font-weight: 600; margin-top: 2px; }
.disponible.ok { color: #15803d; }
.disponible.no { color: #b45309; }
.acciones { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 22px; }
.boton { padding: 10px 18px; border-radius: 8px; border: 1px solid #cbd5e1; background: #fff;
         color: #111; font-weight: 600; font-size: 14px; cursor: pointer; display: inline-block; }
.boton:hover { background: #f8fafc; text-decoration: none; }
.boton.primario { background: var(--primario); border-color: var(--primario); color: #fff; }
.boton.primario:hover { filter: brightness(.94); }
.chico-boton { padding: 6px 10px; font-size: 12px; }
.sinopsis h2 { font-size: 17px; margin: 0 0 6px; }
.sinopsis p { margin: 0; white-space: pre-line; color: #333; }

/* resultados y tablas */
.resultado-cabecera { padding: 24px 0 6px; }
.resultado-cabecera h1 { margin: 0; font-size: 26px; }
.resultado-cabecera p { margin: 4px 0 0; color: #666; }
.filtros { margin: 10px 0 18px; font-size: 14px; }
.tabla { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; margin-bottom: 20px; }
.tabla th, .tabla td { padding: 10px 14px; text-align: left; border-bottom: 1px solid #eee; font-size: 14px; }
.tabla th { background: #f8fafc; font-size: 12px; text-transform: uppercase; letter-spacing: .04em; color: #666; }
.tabla tfoot td { font-weight: 700; background: #fafafa; }
.chico { font-size: 12px; color: #777; }
.paginado { display: flex; gap: 14px; align-items: center; justify-content: center; padding: 22px 0; font-size: 14px; }
.aviso { background: #fff7ed; border: 1px solid #fed7aa; color: #7c2d12; padding: 14px 18px; border-radius: 10px; margin: 18px 0; }
.aviso-chico { font-size: 13px; color: #92400e; background: #fffbeb; padding: 8px 12px; border-radius: 8px; }

/* admin */
.panel fieldset { background: #fff; border: 1px solid #e5e7eb; border-radius: 10px; padding: 16px 20px; margin: 0 0 18px; }
.panel legend { font-weight: 700; padding: 0 6px; color: var(--secundario); }
.panel label { display: block; margin: 10px 0; font-size: 14px; }
.panel label input[type=text], .panel label input:not([type]) { width: 100%; padding: 8px 10px; border: 1px solid #ccc; border-radius: 8px; font-size: 14px; margin-top: 4px; }
.panel .interruptor { display: flex; align-items: center; gap: 8px; }
.paletas { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 10px; margin: 8px 0 14px; }
.paleta { display: flex; align-items: center; gap: 10px; border: 2px solid #e5e7eb; border-radius: 10px;
          padding: 10px 12px; cursor: pointer; font-size: 13px; }
.paleta.elegida { border-color: var(--primario); background: #fff7f2; }
.muestra { width: 34px; height: 34px; border-radius: 50%; display: inline-block;
           background: conic-gradient(var(--p) 0 120deg, var(--s) 120deg 240deg, var(--f) 240deg 360deg); }
.personalizado { display: flex; gap: 18px; flex-wrap: wrap; align-items: center; }
.personalizado label { display: flex; align-items: center; gap: 8px; margin: 0; }
.personalizado input[type=color] { width: 44px; height: 30px; border: 1px solid #ccc; border-radius: 6px; padding: 0; }
.herramientas { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 14px; }
.herramienta { background: #fff; border-radius: 10px; padding: 16px 18px; box-shadow: 0 1px 3px rgba(0,0,0,.1);
               display: flex; flex-direction: column; gap: 4px; }
.herramienta strong { color: var(--secundario); }
.herramienta span { font-size: 13px; color: #666; }

/* pie */
.pie { border-top: 1px solid #e5e5e5; margin-top: 46px; padding: 22px 0 34px; font-size: 13px; color: #555; background: #fff; }
.pie-chico { font-size: 12px; color: #888; margin-top: 4px; }

@media (max-width: 720px) {
  .ficha { grid-template-columns: 1fr; }
  .ficha-tapa { max-width: 220px; }
  .hero h1 { font-size: 26px; }
  .nav { font-size: 13px; gap: 12px; }
}

@media print {
  .cabecera, .pie, .demo-banner, .nav, .acciones { display: none; }
}
