/* Base estructural compartida. Cada propuesta define colores, tipografía y estética en su propio styles.css. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 88px; }
body { margin: 0; min-height: 100vh; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: hidden; }
img { max-width: 100%; display: block; }
a { color: inherit; }
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
h1, h2, h3, p, dl, dd, ul, figure { margin: 0; }
ul { padding: 0; list-style: none; }
[hidden] { display: none !important; }
.vh { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; background: #000; color: #fff; }
.skip:focus { top: 12px; }
.ico { width: 1.15em; height: 1.15em; flex: none; }
/* El contenedor del ícono no debe alinearse a la línea base del texto (quedaba desplazado hacia arriba) */
[data-icon] { display: inline-flex; align-items: center; justify-content: center; flex: none; }
:focus-visible { outline: 2px solid var(--focus, #c9a24a); outline-offset: 3px; }
html.dt-open, html.menu-open { overflow: hidden; }

/* Chips de filtro (radio) */
fieldset { min-width: 0; max-width: 100%; }
.chips { max-width: 100%; }
.chip { position: relative; display: inline-flex; }
.chip input { position: absolute; opacity: 0; inset: 0; margin: 0; cursor: pointer; }
.chip span { pointer-events: none; }

/* Revelado al hacer scroll (solo con JS y sin preferencia de movimiento reducido) */
.js .rv:not(.in) { opacity: 0; transform: translateY(18px); }
.js .rv { transition: opacity .7s cubic-bezier(.2,.7,.2,1), transform .7s cubic-bezier(.2,.7,.2,1); transition-delay: calc(var(--d, 0) * 70ms); }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .rv:not(.in) { opacity: 1; transform: none; }
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}

/* WhatsApp flotante */
.wa-float { position: fixed; right: max(16px, env(safe-area-inset-right)); bottom: max(16px, env(safe-area-inset-bottom)); z-index: 40;
  display: inline-flex; align-items: center; gap: 8px; height: 56px; padding: 0 20px 0 16px; border-radius: 999px;
  background: #1f9d55; color: #fff; text-decoration: none; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25);
  transition: transform .25s ease, box-shadow .25s ease; }
.wa-float .ico { width: 26px; height: 26px; }
.wa-float:hover { transform: translateY(-2px); box-shadow: 0 14px 36px rgba(0,0,0,.3); }
@media (max-width: 640px) { .wa-float { width: 56px; padding: 0; justify-content: center; } .wa-float span { display: none; } }

/* Ficha de detalle (dialog) — estructura */
.detalle { padding: 0; border: 0; max-width: min(1180px, calc(100vw - 48px)); width: 100%; max-height: calc(100dvh - 48px); overflow: hidden; }
.detalle::backdrop { background: rgba(0,0,0,.72); backdrop-filter: blur(6px); }
.detalle[open] { animation: dt-in .35s cubic-bezier(.2,.7,.2,1); }
@keyframes dt-in { from { opacity: 0; transform: translateY(16px) scale(.985); } }
.dt { position: relative; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); max-height: calc(100dvh - 48px); overflow: auto; }
.dt-x { position: absolute; top: 14px; right: 14px; z-index: 3; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 0; }
.dt-galeria { min-width: 0; }
.dt-main { position: relative; aspect-ratio: 4 / 3; overflow: hidden; }
.dt-main img { width: 100%; height: 100%; object-fit: cover; }
.dt-nav { position: absolute; top: 50%; translate: 0 -50%; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 50%; border: 0; }
.dt-prev { left: 12px; } .dt-next { right: 12px; }
.dt-n { position: absolute; left: 12px; bottom: 12px; padding: 4px 10px; border-radius: 99px; font-size: 13px; background: rgba(0,0,0,.6); color: #fff; }
.dt-thumbs { display: flex; gap: 8px; overflow-x: auto; padding: 10px; scrollbar-width: thin; }
.dt-thumbs button { flex: none; width: 76px; height: 58px; padding: 0; border: 2px solid transparent; overflow: hidden; opacity: .6; transition: opacity .2s, border-color .2s; background: none; }
.dt-thumbs button[aria-current], .dt-thumbs button:hover { opacity: 1; }
.dt-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.dt-info { padding: 40px 36px 32px; display: flex; flex-direction: column; gap: 18px; }
.dt-kicker { display: flex; flex-wrap: wrap; gap: 8px; }
.dt-precio small { display: block; }
.dt-datos { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px 16px; }
.dt-datos > div { display: grid; grid-template-columns: auto 1fr; column-gap: 10px; align-items: center; }
.dt-datos .ico { grid-row: span 2; width: 22px; height: 22px; }
.dt-extras ul { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; }
.dt-extras li { display: inline-flex; align-items: center; gap: 6px; }
.dt-acciones { display: flex; flex-wrap: wrap; gap: 10px; margin-top: auto; padding-top: 8px; }
.dt-volver { display: inline-flex; align-items: center; gap: 6px; background: none; border: 0; padding: 10px 0; min-height: 44px; }
@media (max-width: 860px) {
  .detalle { max-width: 100vw; max-height: 100dvh; height: 100dvh; margin: 0; }
  .dt { grid-template-columns: 1fr; max-height: 100dvh; height: 100%; }
  .dt-info { padding: 24px 20px calc(96px + env(safe-area-inset-bottom)); }
  .dt-acciones { position: sticky; bottom: 0; }
}
