/* ============================================================
   Tienda servida — solo los remiendos
   ------------------------------------------------------------
   Las páginas que entrega el servidor usan las MISMAS clases que
   la tienda de siempre (pnav, pfooter, hero, ptile, cat-grid…),
   que portal.css ya define. Aquí va únicamente lo que allí no
   existe, porque en la versión del navegador lo resuelve un
   componente y no una hoja de estilo.

   La primera versión de estas páginas traía su propia paleta y
   sus propias tarjetas. El resultado fue una portada visiblemente
   más pobre que la que ya teníamos. Este archivo se mantiene
   corto a propósito: cuanto menos haya aquí, menos puede
   desviarse la tienda servida de la real.
   ============================================================ */

/* La tarjeta ahora es un enlace, no un article con onclick. Hereda
   el color del texto para que el nombre y el precio no salgan azules
   y subrayados, que es lo que hace un enlace por defecto. */
.portal-root a.ptile {
  text-decoration: none;
  color: inherit;
  display: flex;
  flex-direction: column;
}
.portal-root a.ptile:focus-visible,
.portal-root a.hero-card:focus-visible {
  outline: 2px solid var(--cacao);
  outline-offset: 3px;
}

.portal-root a.hero-card { text-decoration: none; color: inherit; }

/* El precio anterior cuando hay descuento. En el portal lo pinta el
   componente de la tarjeta; aquí hace falta declararlo. */
.portal-root .ptile-antes {
  display: block;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--cacao);
  text-decoration: line-through;
  margin-top: 2px;
}

/* Foto real dentro de los huecos que el portal reserva para el emoji.
   Se estira al hueco completo sin deformarse, y el hueco ya tiene su
   proporción, así que la página no salta mientras carga. */
.portal-root .ptile-image img,
.portal-root .hero-card-ph img,
.portal-root .ptile-image picture,
.portal-root .hero-card-ph picture {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  border-radius: inherit;
}

/* El buscador es un formulario de verdad -funciona sin JavaScript-, y
   eso mete un <form> donde el portal tenía un <label> suelto. */
.portal-root .cat-search input[type="search"] {
  appearance: none;
  -webkit-appearance: none;
}

/* Migas de pan: no existen en el portal porque allí no hacen falta,
   pero en una página servida son lo que le dice al buscador dónde
   está parada la ficha. */
.portal-root .migas {
  font-size: 13px;
  color: var(--cacao);
  padding: 18px 0 0;
}
.portal-root .migas a { color: var(--cacao); }

@media (prefers-reduced-motion: reduce) {
  .portal-root a.ptile, .portal-root a.hero-card { transition: none; }
}

/* ── Galería sin JavaScript ─────────────────────────────────
   Un radio oculto por foto y una etiqueta que hace de miniatura.
   Marcar el radio trae al frente su imagen. Funciona con teclado
   y sin que cargue nada más, que es de lo que se trata esta
   página. En la tienda del navegador esto lo hace un componente;
   aquí no hay componente que valga.                             */
.portal-root .pd-radio { position: absolute; opacity: 0; pointer-events: none; }

/* El hueco de cada foto. Es un div y no la imagen misma porque cuando la
   foto se guardó aquí viene envuelta en un <picture> -varios anchos, WebP- y
   las reglas de abajo cuentan hermanos POR TIPO de elemento: si a veces es
   <img> y a veces <picture>, la cuenta se desordena. Con el div siempre se
   cuentan divs. */
.portal-root .pd-main .pd-foto {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  border-radius: 24px;
  overflow: hidden;
  opacity: 0;
  transition: opacity .25s ease;
}
.portal-root .pd-main .pd-foto img,
.portal-root .pd-main .pd-foto picture {
  width: 100%; height: 100%; object-fit: cover; display: block;
}
/* Si hay UNA sola foto no se pinta ningun radio, asi que ninguna
   regla de abajo la alcanzaria y quedaria invisible. Esta la salva. */
.portal-root .pd-main .pd-foto:only-of-type { opacity: 1; }

.portal-root .pd-radio:nth-of-type(1):checked ~ .pd-main .pd-foto:nth-of-type(1),
.portal-root .pd-radio:nth-of-type(2):checked ~ .pd-main .pd-foto:nth-of-type(2),
.portal-root .pd-radio:nth-of-type(3):checked ~ .pd-main .pd-foto:nth-of-type(3),
.portal-root .pd-radio:nth-of-type(4):checked ~ .pd-main .pd-foto:nth-of-type(4),
.portal-root .pd-radio:nth-of-type(5):checked ~ .pd-main .pd-foto:nth-of-type(5),
.portal-root .pd-radio:nth-of-type(6):checked ~ .pd-main .pd-foto:nth-of-type(6),
.portal-root .pd-radio:nth-of-type(7):checked ~ .pd-main .pd-foto:nth-of-type(7),
.portal-root .pd-radio:nth-of-type(8):checked ~ .pd-main .pd-foto:nth-of-type(8) { opacity: 1; }


/* La miniatura elegida se marca, y el foco del teclado se ve. */
.portal-root .pd-thumb { cursor: pointer; overflow: hidden; padding: 0; }
.portal-root .pd-thumb img,
.portal-root .pd-thumb picture { width: 100%; height: 100%; object-fit: cover; display: block; }
.portal-root .pd-radio:nth-of-type(1):checked ~ .pd-thumbs .pd-thumb:nth-child(1),
.portal-root .pd-radio:nth-of-type(2):checked ~ .pd-thumbs .pd-thumb:nth-child(2),
.portal-root .pd-radio:nth-of-type(3):checked ~ .pd-thumbs .pd-thumb:nth-child(3),
.portal-root .pd-radio:nth-of-type(4):checked ~ .pd-thumbs .pd-thumb:nth-child(4),
.portal-root .pd-radio:nth-of-type(5):checked ~ .pd-thumbs .pd-thumb:nth-child(5),
.portal-root .pd-radio:nth-of-type(6):checked ~ .pd-thumbs .pd-thumb:nth-child(6),
.portal-root .pd-radio:nth-of-type(7):checked ~ .pd-thumbs .pd-thumb:nth-child(7),
.portal-root .pd-radio:nth-of-type(8):checked ~ .pd-thumbs .pd-thumb:nth-child(8) {
  outline: 2px solid var(--cacao); outline-offset: 2px;
}
.portal-root .pd-radio:focus-visible ~ .pd-thumbs .pd-thumb { outline: 1px dashed var(--cacao); }

@media (prefers-reduced-motion: reduce) {
  .portal-root .pd-main .pd-foto { transition: none; }
}

/* ─────────────────────────────────────────────────────────────────────────────
   PAGINAS DE CONTENIDO SERVIDAS (legales, nosotros, faq, regalos).
   Vivian en Blazor y arrastraban los 4 MB del SPA -con MudBlazor y las 89
   pantallas del ERP- para mostrar texto que no cambia. Ahora las sirve el
   servidor como HTML.
   Este bloque estaba DUPLICADO palabra por palabra en Privacidad.razor y
   Terminos.razor; aqui va una sola vez.
   ───────────────────────────────────────────────────────────────────────────── */
.portal-root .legal-hero { padding: 40px 0 30px 0; background: var(--crema); }
.portal-root .legal-hero h1 { font-size: clamp(40px,5vw,72px); letter-spacing: -1px; }
.portal-root .legal-content {
  max-width: 800px; margin: 0 auto; padding: 60px 20px 100px;
  color: rgba(35,13,2,0.85); font-size: 16px; line-height: 1.8;
}
.portal-root .legal-content h2 {
  font-size: 24px; color: var(--tronco); margin: 40px 0 16px;
  font-family: var(--font-sans); font-weight: 700;
}
.portal-root .legal-content h3 {
  font-size: 18px; color: var(--cacao); margin: 24px 0 12px; font-weight: 600;
}
.portal-root .legal-content p { margin-bottom: 16px; }
.portal-root .legal-content ul { margin-bottom: 20px; padding-left: 20px; list-style-type: disc; }
.portal-root .legal-content li { margin-bottom: 8px; }
.portal-root .legal-content a {
  color: var(--truly-primary); text-decoration: underline; text-underline-offset: 4px;
}

/* ── FAQ servido. El acordeon es <details>/<summary> nativo: nunca necesito JS. ── */
.portal-root .faq-hero { padding: 40px 0 30px 0; }
.portal-root .faq-layout {
  display: grid; grid-template-columns: 200px 1fr; gap: 48px;
  padding: 0 0 80px; align-items: start;
}
.portal-root .faq-nav { position: sticky; top: calc(var(--nav-h) + 24px); }
.portal-root .faq-nav a {
  display: block; padding: 8px 12px; border-radius: 8px;
  font-size: 13px; font-weight: 500; color: rgba(35,13,2,.55);
  transition: color .2s, background .2s; margin-bottom: 4px;
}
.portal-root .faq-nav a:hover, .portal-root .faq-nav a.active {
  color: var(--tronco); background: rgba(35,13,2,.06);
}
.portal-root .faq-group { margin-bottom: 48px; }
.portal-root .faq-group h3 {
  font-size: 22px; font-weight: 700; margin-bottom: 16px;
  padding-bottom: 12px; border-bottom: 1px solid rgba(35,13,2,.1);
}
.portal-root .faq-item {
  border: 1px solid rgba(35,13,2,.08); border-radius: var(--radius-m);
  margin-bottom: 10px; overflow: hidden;
}
.portal-root .faq-item summary {
  padding: 18px 20px; cursor: pointer; list-style: none;
  font-size: 15px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center; gap: 16px;
  background: var(--crema); transition: background .2s;
}
.portal-root .faq-item summary:hover { background: rgba(35,13,2,.04); }
.portal-root .faq-item summary::after {
  content: "+"; font-size: 20px; font-weight: 400; flex-shrink: 0; transition: transform .3s;
}
.portal-root .faq-item[open] summary::after { transform: rotate(45deg); }
.portal-root .faq-item[open] summary { background: var(--tronco); color: var(--mantequilla); }
.portal-root .faq-ans { padding: 18px 20px; font-size: 14px; line-height: 1.65; color: rgba(35,13,2,.75); }
.portal-root .faq-search-wrap { margin-bottom: 32px; }

/* El boton del buscador: invisible hasta que el teclado lo enfoca. Quien navega
   con teclado o sin JavaScript necesita poder enviar el formulario. */
.portal-root .visually-hidden-focusable {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0; padding: 0;
}
.portal-root .visually-hidden-focusable:focus {
  position: static; width: auto; height: auto; overflow: visible;
  clip: auto; white-space: normal;
  margin-top: 10px; padding: 8px 16px; border-radius: 999px;
  background: var(--tronco); color: var(--mantequilla); cursor: pointer;
}

@media (max-width: 760px) {
  .portal-root .faq-layout { grid-template-columns: 1fr; }
  .portal-root .faq-nav { display: none; }
}
