/* ProWoodMX — base compartida (mecánica). La estética vive en cada propuesta. */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 90px; overflow-x: hidden; }
body { overflow-x: clip; }
html.cargando, html.sin-scroll, html.modal-abierto { overflow: hidden; }
body { margin: 0; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p, dl, dd, figure, blockquote { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
[hidden] { display: none !important; }
.sr { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--foco, #A9835A); outline-offset: 3px; }
.ico { width: 1em; height: 1em; flex: none; }

/* Preloader: solo con JS */
.pre { display: none; }
.js .pre { display: flex; }

/* Aparición al hacer scroll */
.js [data-reveal] { opacity: 0; transform: translateY(26px); transition: opacity 1.1s cubic-bezier(.2,.7,.2,1) var(--d, 0s), transform 1.1s cubic-bezier(.2,.7,.2,1) var(--d, 0s); }
.js [data-reveal].in { opacity: 1; transform: none; }

/* Entrada de tarjetas al filtrar */
.entra { animation: pwEntra .7s cubic-bezier(.2,.7,.2,1) both; animation-delay: calc(min(var(--i, 0), 12) * 40ms); }
@keyframes pwEntra { from { opacity: 0; transform: translateY(16px) scale(.985); } }

/* ---------- Comparador antes / después ---------- */
.ba { position: relative; overflow: hidden; --pos: 50%; user-select: none; -webkit-user-select: none; touch-action: pan-y; cursor: ew-resize; isolation: isolate; }
.ba img { width: 100%; height: 100%; object-fit: cover; pointer-events: none; -webkit-user-drag: none; }
.ba__antes { position: absolute; inset: 0; }
.ba__despues { position: absolute; inset: 0; clip-path: inset(0 0 0 var(--pos)); }
.ba__linea { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--ba-linea, #fff); pointer-events: none; z-index: 2; box-shadow: 0 0 18px rgba(0,0,0,.25); }
.ba__mango { position: absolute; top: 50%; left: var(--pos); width: 54px; height: 54px; margin: -27px 0 0 -27px; border-radius: 50%; display: grid; place-items: center; pointer-events: none; z-index: 3; background: var(--ba-mango, rgba(255,255,255,.92)); color: var(--ba-mango-ico, #1c1916); box-shadow: 0 10px 30px rgba(0,0,0,.22); backdrop-filter: blur(6px); transition: transform .3s; }
.ba__mango svg { width: 26px; height: 26px; }
.ba.arrastrando .ba__mango { transform: scale(.92); }
.ba input[type=range] { position: absolute; left: 0; right: 0; bottom: 0; width: 100%; height: 1px; opacity: 0; margin: 0; }
.ba:focus-within .ba__mango { outline: 2px solid var(--foco, #A9835A); outline-offset: 4px; }
.ba__tag { position: absolute; top: 16px; z-index: 2; pointer-events: none; font-size: 11px; letter-spacing: .22em; text-transform: uppercase; padding: 8px 12px; background: rgba(20,17,15,.55); color: #fff; backdrop-filter: blur(8px); }
.ba__tag--antes { left: 16px; }
.ba__tag--despues { right: 16px; }

/* ---------- Ficha de producto ---------- */
.pw-modal { padding: 0; border: 0; width: min(1060px, calc(100% - 28px)); max-width: none; max-height: calc(100dvh - 28px); background: transparent; color: inherit; overflow: visible; }
.pw-modal::backdrop { background: rgba(14, 12, 10, .62); backdrop-filter: blur(6px); }
.pw-modal[open] { animation: pwModal .55s cubic-bezier(.2,.7,.2,1); }
.pw-modal[open]::backdrop { animation: pwFade .4s ease; }
@keyframes pwModal { from { opacity: 0; transform: translateY(24px) scale(.985); } }
@keyframes pwFade { from { opacity: 0; } }
.pw-modal__caja { position: relative; display: grid; grid-template-columns: 1.08fr 1fr; max-height: calc(100dvh - 28px); overflow: auto; }
.pw-modal__foto img { width: 100%; height: 100%; object-fit: cover; aspect-ratio: 1; }
.pw-modal__info { display: flex; flex-direction: column; justify-content: center; gap: 18px; padding: clamp(28px, 4vw, 56px); }
.pw-modal__medidas { display: grid; grid-template-columns: repeat(3, auto); justify-content: start; column-gap: 0; }
.pw-modal__medidas div { padding-right: 20px; }
.pw-modal__cerrar { position: absolute; top: 14px; right: 14px; z-index: 2; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; }
.pw-modal__cerrar svg { width: 22px; height: 22px; }
@media (max-width: 760px) {
  .pw-modal__caja { grid-template-columns: 1fr; }
  .pw-modal__foto img { aspect-ratio: 4 / 3; }
}

/* ---------- Filete de madera (detalle de moldura) ---------- */
.filete { position: relative; height: 9px; border-top: 1px solid var(--filete-linea, rgba(0,0,0,.14)); border-bottom: 1px solid var(--filete-linea, rgba(0,0,0,.14)); }
.filete::before { content: ""; position: absolute; left: 0; right: 0; top: 2px; height: 3px; background: url(/assets/img/textura/roble-sm.webp) 0 30% / 700px auto; box-shadow: inset 0 1px 0 rgba(255,255,255,.35), inset 0 -1px 0 rgba(0,0,0,.25); }

/* Texto con veta de madera */
@supports ((-webkit-background-clip: text) or (background-clip: text)) {
  .veta { background: url(/assets/img/textura/nogal.webp) 0 38% / 900px auto; -webkit-background-clip: text; background-clip: text; color: transparent !important; -webkit-text-fill-color: transparent; }
  .veta--roble { background-image: url(/assets/img/textura/roble.webp); }
  .veta--pino { background-image: url(/assets/img/textura/pino.webp); }
}

/* ---------- WhatsApp flotante ---------- */
.wa-flotante { position: fixed; right: max(18px, env(safe-area-inset-right)); bottom: max(18px, env(safe-area-inset-bottom)); z-index: 70; display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 0 0 0; border-radius: 40px; transition: transform .4s cubic-bezier(.2,.7,.2,1), box-shadow .4s, opacity .6s; }
.wa-flotante__ico { width: 58px; height: 58px; border-radius: 50%; display: grid; place-items: center; flex: none; }
.wa-flotante__ico svg { width: 28px; height: 28px; }
.wa-flotante__txt { max-width: 0; overflow: hidden; white-space: nowrap; font-size: 14px; transition: max-width .5s cubic-bezier(.2,.7,.2,1), padding .5s; }
.wa-flotante:hover .wa-flotante__txt, .wa-flotante:focus-visible .wa-flotante__txt { max-width: 220px; padding-left: 20px; }
.wa-flotante:hover { transform: translateY(-3px); }
html.cargando .wa-flotante { opacity: 0; }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; scroll-behavior: auto !important; } }

