/* Catálogo, ficha y secciones del inicio que salen de la base. Mismos tokens que tienda.css;
   archivo aparte para que ninguno crezca sin control. */

.centrado { text-align: center; margin-top: 26px; }

/* Categorías destacadas del inicio */
.cat-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 18px; margin: 0; padding: 0; list-style: none; }
.cat-card {
  display: grid; grid-template-columns: 96px 1fr; gap: 16px; align-items: center;
  background: var(--surface); border-radius: var(--r-md); padding: 18px;
}
.cat-card img { width: 96px; height: 96px; }
.cat-card h3 { font-size: 22px; margin-bottom: 6px; }
.cat-card h3 a { text-decoration: none; }
.cat-card h3 a:hover { text-decoration: underline; text-underline-offset: 4px; }
.cat-subs { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 14px; color: var(--muted); }
.cat-subs a { text-underline-offset: 3px; }
.pcard-img { width: 100%; height: auto; aspect-ratio: 16 / 10; object-fit: cover; border-radius: var(--r-sm); }
.branches-2 { grid-template-columns: repeat(2, 1fr); }

/* Migas de pan */
.migas ol { list-style: none; margin: 18px 0 8px; padding: 0; display: flex; flex-wrap: wrap; gap: 4px; font-size: 14px; color: var(--muted); }
.migas li + li::before { content: "/"; margin-right: 4px; }
.migas a { text-underline-offset: 3px; }
.migas a[aria-current="page"] { color: var(--ink); text-decoration: none; }

/* Listado */
.cat-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.cat-head h1 { font-size: clamp(30px, 3.6vw, 42px); }
.cat-head p { margin: 0; }
.ir-filtros { display: none; }
.cat-layout { display: grid; grid-template-columns: 250px 1fr; gap: 28px; align-items: start; }
.cat-side { display: grid; gap: 24px; }
.cat-side-h { font-family: var(--f-caps); font-size: 15px; letter-spacing: .1em; margin: 0 0 10px; }
.cat-arbol, .cat-arbol ul { list-style: none; margin: 0; padding: 0; font-size: 15px; }
.cat-arbol > li { margin-bottom: 8px; }
.cat-arbol ul { padding-left: 14px; margin-top: 4px; font-size: 14px; color: var(--muted); display: grid; gap: 2px; }
.cat-arbol a { text-decoration: none; display: inline-block; padding-block: 2px; }
.cat-arbol a:hover { text-decoration: underline; text-underline-offset: 3px; }
.cat-arbol a[aria-current="page"] { color: var(--rose); font-weight: 600; }
.cat-filtros { display: grid; gap: 12px; background: var(--surface); border-radius: var(--r-md); padding: 16px; }
.cat-filtros .field input, .cat-filtros .field select { padding: 8px 10px; font-size: 14px; }
.cat-precio { border: 0; padding: 0; margin: 0; }
.cat-precio legend { font-weight: 500; margin-bottom: 4px; }
.cat-precio label { font-size: 13px; color: var(--muted); }
.cat-precio .row2 { grid-template-columns: 1fr 1fr; }
.paginas { display: flex; justify-content: center; align-items: center; gap: 14px; margin-top: 28px; font-size: 14px; }

/* Tarjeta enlazada del listado */
.p-link { display: grid; grid-template-rows: auto 1fr; text-decoration: none; color: inherit; border-radius: var(--r-md); }
.p-link:hover .p-name { text-decoration: underline; text-underline-offset: 3px; }
.p-media .p-foto { width: 100%; height: 100%; object-fit: cover; }
.p-desde { font-weight: 400; font-size: 13px; color: var(--muted); margin-right: 4px; }
.p-price del, .ficha-precio del { color: var(--muted); font-weight: 400; margin-right: 6px; }
.badge.agotado { background: #efe9e4; color: #4f463e; }

/* Ficha */
.ficha-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr); gap: 36px; align-items: start; margin-top: 10px; }
.galeria { display: grid; gap: 10px; min-width: 0; }
.galeria-tira {
  display: grid; grid-auto-flow: column; grid-auto-columns: 100%; overflow-x: auto; scroll-snap-type: x mandatory;
  border-radius: var(--r-md); background: var(--surface); scrollbar-width: thin;
}
.galeria-foto { scroll-snap-align: start; aspect-ratio: 1 / 1; display: grid; place-items: center; }
.galeria-foto img { width: 100%; height: 100%; object-fit: cover; }
.galeria-mini { list-style: none; margin: 0; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
.galeria-mini a { display: block; width: 72px; height: 72px; border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--line); }
.galeria-mini img { width: 100%; height: 100%; object-fit: cover; }
.ficha-info { display: grid; gap: 14px; align-content: start; }
.ficha-info h1 { font-size: clamp(30px, 3.6vw, 44px); }
.ficha-desc { margin: 0; color: var(--muted); white-space: pre-line; }
.selector fieldset { border: 0; padding: 0; margin: 0 0 8px; display: grid; gap: 8px; }
.selector legend { font-weight: 500; margin-bottom: 6px; }
.opcion {
  display: flex; gap: 10px; align-items: center; border: 1px solid var(--line); border-radius: var(--r-sm);
  padding: 10px 12px; background: var(--card); cursor: pointer; font-size: 15px;
}
.opcion:has(input:checked) { border-color: var(--stem-deep); background: var(--surface); }
.opcion input { accent-color: var(--stem-deep); width: 18px; height: 18px; }
.variante { display: grid; gap: 10px; justify-items: start; }
.ficha-datos { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px 18px; margin: 0; width: 100%; }
.ficha-datos dt { font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.ficha-datos dd { margin: 0; }
.ficha-precio { margin: 4px 0 0; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 8px; }
.ficha-precio strong { font-size: 30px; font-weight: 600; color: var(--rose); font-variant-numeric: tabular-nums; }
.ficha-promo { margin: 0; font-size: 14px; color: var(--stem-deep); font-weight: 500; }
.ficha-iva { margin: 0; font-size: 14px; color: var(--muted); }

/* Nosotros */
.nosotros { display: grid; gap: 18px; }
.nosotros-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
.nosotros h2 { font-size: 28px; }
.nosotros p { margin: 0; }
.nosotros-valores ul { columns: 3; margin: 0; padding-left: 20px; }

@media (max-width: 860px) {
  .cat-layout, .ficha-grid { grid-template-columns: 1fr; }
  /* En el teléfono los resultados van primero; los filtros quedan debajo. */
  .cat-side { order: 2; }
  .ir-filtros { display: inline-flex; }
  .cat-side-h { scroll-margin-top: 140px; }
  /* Más baja que cuadrada, para que el precio y el botón queden a la vista sin desplazar. */
  .galeria-foto { aspect-ratio: 4 / 3; }
  .galeria-foto .sin-foto { width: 50%; height: auto; }
  .nosotros-grid { grid-template-columns: 1fr; }
  .nosotros-valores ul { columns: 2; }
}
@media (max-width: 460px) {
  .branches-2 { grid-template-columns: 1fr; }
  .cat-card { grid-template-columns: 64px 1fr; }
  .cat-card img { width: 64px; height: 64px; }
  .nosotros-valores ul { columns: 1; }
}
