/* Referencia visual: /producto.html. Estilos independientes del index de v3. */
:root {
  --ink: #111111;
  --hero: #c5d888;
  --hero-ink: #000;
  --hero-copy: #262626;
  --hero-muted: #525252;
  --hero-action-bg: #000;
  --hero-action-ink: #fff;
  --hero-focus: #1d22df;
  --pink: #f9b1be;
  --white: #ffffff;
  --muted: #525252;
  --border: #e5e5e5;
  --font: 'Inter', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-nav: 'Outfit', sans-serif;
  --font-brand: 'Fredoka', sans-serif;
  --header-height: 64px;
  --ease: cubic-bezier(.2, .8, .25, 1);
}
*, *::before, *::after { box-sizing: border-box; }
html { overflow-x: hidden; scroll-padding-top: 80px; }
body { margin: 0; min-width: 280px; overflow-x: hidden; background: var(--white); color: var(--ink); font-family: var(--font); -webkit-font-smoothing: antialiased; }
body.menu-open { overflow: hidden; }
[hidden] { display: none !important; }
h1, h2, p { margin: 0; }
button, a { -webkit-tap-highlight-color: transparent; }
button { font: inherit; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
button:focus-visible, a:focus-visible, summary:focus-visible { outline: 3px solid #1d22df; outline-offset: 4px; }
.container { width: min(100%, 1280px); margin-inline: auto; padding-inline: 24px; }
.heading-heavy { font-weight: 900; letter-spacing: -.035em; }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; top: 8px; left: 8px; z-index: 100; padding: 12px; background: white; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 28px; border: 1px solid transparent; border-radius: 999px; background: #000; color: white; text-align: center; font-size: 14px; font-weight: 700; line-height: 20px; }
.button:hover { background: #262626; }
.text-link { text-decoration: underline; }

/* Encabezado: mismas dimensiones e identidad que el index. */
.site-header { position: sticky; top: 0; z-index: 50; height: var(--header-height); padding-inline: clamp(20px, 4vw, 48px); background: white; color: #000; font-family: var(--font-nav); }
.header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr); align-items: center; gap: 16px; height: 100%; }
.menu-trigger { display: inline-flex; align-items: center; justify-self: start; gap: 8px; min-height: 44px; min-width: 44px; border: 0; padding: 0; background: none; font-size: 14px; font-weight: 600; color: #000; }
.menu-trigger svg { width: 24px; height: 24px; fill: none; stroke: currentColor; }
.brand { font-family: var(--font-brand); font-size: 36px; font-weight: 800; letter-spacing: -.02em; color: #000; }
.header-order { justify-self: end; min-height: 32px; padding: 6px 20px; font-size: 12px; line-height: 16px; white-space: nowrap; color: #fff; }
.header-order svg { flex-shrink: 0; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.site-menu { position: fixed; inset: 0 auto 0 0; width: min(565px, 90vw); height: 100dvh; max-height: none; max-width: none; margin: 0; padding: 0; border: 0; overflow-y: auto; overscroll-behavior: contain; background: white; color: var(--ink); font-family: var(--font-brand); }
.site-menu::backdrop { background: rgb(25 20 25 / 38%); }
.menu-top { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-inline: 24px; padding-block: 26px; border-bottom: 1px solid var(--border); }
.menu-top a { font-size: clamp(28px, 3vw, 44px); font-weight: 700; line-height: 1.1; overflow-wrap: anywhere; }
.menu-top button { flex-shrink: 0; width: 54px; height: 54px; padding: 0; border: 1px solid var(--ink); border-radius: 50%; background: white; color: var(--ink); font: 400 40px/1 Arial, sans-serif; }
.site-menu nav { display: flex; flex-direction: column; padding: 12px 24px 32px; }
.site-menu nav a { padding-block: 22px; font-size: clamp(38px, 4vw, 64px); font-weight: 700; letter-spacing: -.03em; line-height: 1.3; }
.site-menu a:hover { color: #1d22df; }

/* Producto: misma cuadrícula, fondo, foto y división ondulada */
body[data-product-theme='espiral-chocolate'] { --hero: #3c2218; }
body[data-product-theme='relampago-glaseado'] { --hero: #1c3879; }
body[data-product-theme='espiral-fresa'] { --hero: #b83253; }
body[data-product-theme='brownie-cosmico'] { --hero: #2a1b14; }
body[data-product-theme='chispas-chocolate'], body[data-product-theme='clasica-azul'] { --hero: #fff; }
body[data-product-tone='dark'] {
  --hero-ink: #fff;
  --hero-copy: #ffffffe6;
  --hero-muted: #ffffffcc;
  --hero-action-bg: #fff;
  --hero-action-ink: var(--hero);
  --hero-focus: #fff;
}
.hero { position: relative; padding-block: 24px 112px; overflow: hidden; background: var(--hero); color: var(--hero-ink); }
.hero h1, .hero .product-badge, .hero .stars { color: var(--hero-ink); }
.hero .product-description, .hero .rating { color: var(--hero-copy); }
.hero .price del, .hero .rating-divider, .hero .app-status, .hero #photo-unavailable { color: var(--hero-muted); }
.hero .order-button, .hero .discount { background: var(--hero-action-bg); color: var(--hero-action-ink); }
.hero .favorite, .hero .favorite:hover { border-color: var(--hero-ink); color: var(--hero-ink); }
.hero :focus-visible { outline-color: var(--hero-focus); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1fr); align-items: center; gap: 32px; }
.photo-column { display: flex; justify-content: center; min-width: 0; }
.photo-frame { position: relative; display: grid; place-items: center; width: 100%; max-width: 500px; aspect-ratio: 1; }
.photo-frame img { width: 100%; height: 100%; min-height: 0; object-fit: contain; filter: drop-shadow(0 25px 25px #00000026); opacity: 1; transition: opacity .4s var(--ease); }
.photo-frame.is-loading img { opacity: 0; }
#photo-unavailable { padding: 24px; text-align: center; color: var(--muted); font-size: 14px; }
.product-info { min-width: 0; max-width: 576px; }
.product-badge { margin-bottom: 8px; color: #171717; font-size: 15px; font-weight: 600; line-height: 1.5; }
h1 { margin-bottom: 16px; color: #000; font-size: 30px; line-height: 1.1; overflow-wrap: anywhere; }
.product-description { margin-bottom: 32px; color: #262626; font-size: 14px; font-weight: 400; line-height: 1.625; white-space: pre-line; overflow-wrap: anywhere; }
.price { display: flex; align-items: baseline; flex-wrap: wrap; gap: 10px; margin-block: -16px 20px; font-size: 20px; font-weight: 600; }
.price del { font-size: 15px; font-weight: 400; color: var(--muted); }
.discount { position: absolute; top: 12px; right: 12px; padding: 8px 12px; border-radius: 999px; background: #000; color: white; font-size: 14px; font-weight: 700; }
.actions { display: flex; flex-direction: column; align-items: stretch; gap: 12px; margin-bottom: 24px; }
.order-button { padding: 14px 40px; }
.favorite { padding: 14px 32px; border-color: #404040; background: transparent; color: #171717; font-weight: 600; }
.favorite:hover { border-color: black; background: transparent; }
.favorite svg { flex-shrink: 0; width: 16px; height: 16px; stroke: currentColor; fill: none; }
.favorite[aria-pressed='true'] svg { fill: currentColor; }
.favorite.is-popping svg { animation: favorite-pop .32s var(--ease); }
.rating { display: inline-flex; align-items: center; flex-wrap: wrap; gap: 8px; color: #262626; font-size: 12px; font-weight: 600; line-height: 1.5; }
.stars { display: inline-flex; align-items: center; flex-shrink: 0; color: #000; }
.stars svg { width: 20px; height: 20px; }
.rating-divider { margin-inline: 4px; color: #737373; }
.wave { position: absolute; inset: auto 0 0; overflow: hidden; line-height: 0; pointer-events: none; }
.wave svg { width: 100%; height: 60px; }

/* Reseñas: las mismas tarjetas con borde, comillas rosas y sombra */
.reviews { padding-block: 64px; background: white; }
.section-heading { margin-bottom: 32px; }
h2 { margin-bottom: 8px; color: #000; font-size: 30px; line-height: 1.2; overflow-wrap: anywhere; }
.section-heading p { color: #262626; font-size: 14px; font-weight: 500; line-height: 20px; }
.review-grid { display: grid; grid-template-columns: minmax(0, 1fr); gap: 24px; margin-bottom: 48px; }
.review-card { display: flex; flex-direction: column; justify-content: space-between; min-width: 0; min-height: 170px; padding: 24px; border: 1px solid #171717; border-radius: 12px; background: white; box-shadow: 4px 4px 0 #0000000f; }
.review-quote { margin-bottom: 8px; color: var(--pink); font-family: Georgia, serif; font-size: 30px; font-weight: 900; line-height: 1; }
.review-text { color: #171717; font-size: 13px; font-weight: 400; line-height: 1.625; overflow-wrap: anywhere; white-space: pre-line; }
.review-author { margin-top: 16px; color: #262626; font-size: 12px; font-weight: 600; overflow-wrap: anywhere; }
.empty { grid-column: 1 / -1; padding-block: 24px; color: var(--muted); font-size: 14px; }
.review-cta { display: flex; flex-direction: column; align-items: center; gap: 16px; padding-top: 8px; text-align: center; }
.review-cta > p:first-child { color: #171717; font-size: 14px; font-weight: 700; line-height: 20px; }
.app-status { max-width: 576px; color: var(--muted); font-size: 13px; line-height: 1.5; }

/* Ingredientes, sellos existentes y acordeón de alérgenos */
.ingredients { padding-block: 56px; }
.ingredients h2 { margin-bottom: 12px; }
#ingredients { max-width: 768px; margin-bottom: 32px; color: #262626; font-size: 14px; line-height: 1.5; white-space: pre-line; overflow-wrap: anywhere; }
.ingredient-badges { display: flex; align-items: center; flex-wrap: wrap; gap: 16px; }
.ingredient-badge { display: grid; place-items: center; flex-shrink: 0; width: 64px; height: 64px; overflow: hidden; border: 1px solid var(--border); border-radius: 50%; box-shadow: 0 1px 2px #0000000d; }
.ingredient-badge svg { width: 100%; height: 100%; }
.seals { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 24px; }
.seals span { max-width: 100%; padding: 10px 16px; border: 1px solid #ddd; border-radius: 99px; font-size: 14px; overflow-wrap: anywhere; }
.allergens { padding-block: 48px 96px; }
.allergens h2 { margin-bottom: 24px; }
.allergens details { overflow: hidden; border: 1px solid var(--border); border-radius: 12px; background: white; }
.allergens summary { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 20px; list-style: none; color: #171717; font-size: 14px; font-weight: 600; cursor: pointer; }
.allergens summary::-webkit-details-marker { display: none; }
.allergens summary svg { flex-shrink: 0; width: 16px; height: 16px; color: #737373; }
.allergens details[open] summary svg { transform: rotate(180deg); }
#allergens { padding: 16px 20px 20px; border-top: 1px solid #f5f5f5; color: var(--muted); font-size: 12px; line-height: 1.625; white-space: pre-line; overflow-wrap: anywhere; }

/* Estados de carga y error, sin sustituir el diseño del producto */
.state { padding-block: 100px; text-align: center; }
.state p { margin-block: 16px 24px; line-height: 1.5; }
.state-actions { display: flex; justify-content: center; align-items: center; flex-wrap: wrap; gap: 24px; }
.skeleton { position: relative; overflow: hidden; border-radius: 12px; background: #ffffff55; }
.skeleton::after, .photo-frame.is-loading::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, transparent, #ffffff66, transparent); transform: translateX(-100%); animation: shimmer 1.3s linear infinite; }
.skeleton-photo { width: min(100%, 500px); aspect-ratio: 1; justify-self: center; }
.skeleton-info { display: grid; gap: 20px; }
.skeleton-badge { width: 30%; height: 20px; }
.skeleton-title { width: 90%; height: 96px; }
.skeleton-copy { height: 90px; }
.skeleton-actions { width: 85%; height: 50px; border-radius: 999px; }
#content.is-revealing { animation: content-reveal .4s ease; }
@keyframes shimmer { to { transform: translateX(100%); } }
@keyframes favorite-pop { 50% { transform: scale(1.2); } }
@keyframes content-reveal { from { opacity: 0; } to { opacity: 1; } }

@media (min-width: 640px) {
  h1 { font-size: 36px; }
  h2 { font-size: 36px; }
  .product-description { font-size: 16px; }
  .actions { flex-direction: row; align-items: center; flex-wrap: wrap; }
  .rating { font-size: 13px; }
  .review-text { font-size: 14px; }
  .ingredient-badges { gap: 24px; }
  .ingredient-badge { width: 80px; height: 80px; }
  .allergens summary { font-size: 16px; }
  #allergens { font-size: 14px; }
}
@media (min-width: 768px) { .review-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 1024px) {
  .container { padding-inline: 48px; }
  .hero { padding-bottom: 144px; }
  .hero-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 48px; }
  .photo-column { justify-content: flex-start; }
  h1 { font-size: 44px; }
  .wave svg { height: 90px; }
}
@media (max-width: 767px) {
  .brand { font-size: 30px; }
  .site-menu nav a { font-size: 42px; letter-spacing: -1px; }
}
@media (max-width: 639px) {
  :root { --header-height: 52px; }
  .header-inner { gap: 8px; }
  .brand { font-size: 28px; }
  .menu-trigger span { display: none; }
  .header-order { width: 44px; height: 36px; padding: 0; }
  .cart-label { display: none; }
  .header-order svg { width: 20px; height: 20px; }
}
@media (max-width: 319px) {
  .site-header { padding-inline: 12px; }
  .header-inner { gap: 4px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
.product-editorial-text { white-space:pre-wrap; overflow-wrap:anywhere; padding:18px 20px; line-height:1.7 }
.allergens details+details { margin-top:12px }
