/* ==========================================================================
   WebCraft Studio — base de las plantillas demo (/demo/<giro>/) · v3
   Solo infraestructura: reset, contenedor, estructura de la navegación y su
   menú móvil, campos de formulario, componentes funcionales (pestañas,
   filtros, selección de opciones, carrito) y la barra de WebCraft.
   El diseño visual de cada demo vive en su propia página, a propósito:
   así ninguna hereda el "look" de otra.
   ========================================================================== */
:root {
  --bg: #fff; --text: #111; --muted: #666; --line: rgba(0,0,0,.12);
  --accent: #111; --accent-ink: #fff;
  --font-body: system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif; --font-display: var(--font-body);
  --max: 1240px; --nav-h: 76px; --radius: 10px;
}
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 16px); -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font-body); color: var(--text); background: var(--bg); -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; padding-bottom: 72px; overflow-x: hidden; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; cursor: pointer; background: none; border: 0; padding: 0; }
h1, h2, h3, h4, p, ul, ol, figure, blockquote, dl, dd { margin: 0; }
ul, ol { padding: 0; list-style: none; }
h1, h2, h3 { text-wrap: balance; }
p { text-wrap: pretty; }
table { width: 100%; border-collapse: collapse; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 clamp(20px, 4vw, 40px); }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.ico { width: 1.25em; height: 1.25em; flex: none; stroke: currentColor; fill: none; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

/* ── Marca (demo.js la reemplaza con el nombre del visitante) ─────────────── */
.brand { display: inline-flex; align-items: center; gap: 10px; white-space: nowrap; }
.brand__nombre { min-width: 0; max-width: min(58vw, 440px); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── Navegación: estructura y menú móvil (colores y tipografía, en cada demo) */
.nav { position: sticky; top: 0; z-index: 50; height: var(--nav-h); display: flex; align-items: center; background: var(--nav-bg, var(--bg)); color: var(--nav-text, var(--text)); transition: background .35s, color .35s, box-shadow .35s; }
.nav--overlay { position: fixed; left: 0; right: 0; background: transparent; color: var(--nav-overlay-text, #fff); }
.nav--overlay.is-scrolled, .nav--overlay.is-open { background: var(--nav-bg, var(--bg)); color: var(--nav-text, var(--text)); box-shadow: 0 1px 0 var(--nav-line, var(--line)); }
.nav > .wrap { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.nav__links { display: flex; align-items: center; gap: clamp(18px, 2.4vw, 34px); }
.nav__toggle { display: none; width: 44px; height: 44px; align-items: center; justify-content: center; margin-right: -10px; }
.nav__toggle span, .nav__toggle span::before, .nav__toggle span::after { display: block; width: 22px; height: 1.5px; background: currentColor; position: relative; transition: transform .25s, background .25s; }
.nav__toggle span::before, .nav__toggle span::after { content: ""; position: absolute; left: 0; }
.nav__toggle span::before { top: -7px; } .nav__toggle span::after { top: 7px; }
.nav.is-open .nav__toggle span { background: transparent; }
.nav.is-open .nav__toggle span::before { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav__toggle span::after { transform: translateY(-7px) rotate(-45deg); }
@media (max-width: 960px) {
  .nav__links { display: none; }
  .nav__toggle { display: inline-flex; }
  .nav .nav__cta { display: none; }
  .nav.is-open .nav__links { display: flex; position: absolute; top: var(--nav-h); left: 0; right: 0; flex-direction: column; align-items: stretch; gap: 0; padding: 6px clamp(20px, 4vw, 40px) 18px; background: var(--nav-bg, var(--bg)); color: var(--nav-text, var(--text)); box-shadow: 0 18px 30px -24px rgba(0,0,0,.5); }
  .nav.is-open .nav__links a { padding: 14px 0; border-bottom: 1px solid var(--nav-line, var(--line)); }
}

/* ── Formularios ─────────────────────────────────────────────────────────── */
.field { display: grid; gap: 8px; font-size: .8rem; font-weight: 600; letter-spacing: .02em; }
.field input, .field select, .field textarea { width: 100%; padding: .9em 1em; font: inherit; font-size: 1rem; font-weight: 400; letter-spacing: 0; color: inherit; background: var(--field-bg, transparent); border: 1px solid var(--field-line, var(--line)); border-radius: var(--field-radius, var(--radius)); outline: none; transition: border-color .2s, box-shadow .2s; }
.field select { -webkit-appearance: none; appearance: none; padding-right: 2.6em; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' fill='none' stroke='%23888' stroke-width='1.6'%3E%3Cpath d='M1 1.5l5 5 5-5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 1em center; }
.field select option { color: #111; }
.field textarea { min-height: 110px; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 22%, transparent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 560px) { .row2 { grid-template-columns: 1fr; } }

/* ── Componentes funcionales (el aspecto lo define cada demo) ───────────── */
.scroller { display: grid; grid-auto-flow: column; grid-auto-columns: var(--item, min(82%, 380px)); gap: var(--gap, 20px); overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; overscroll-behavior-x: contain; }
.scroller::-webkit-scrollbar { display: none; }
.scroller > * { scroll-snap-align: start; }
.marquee { overflow: hidden; white-space: nowrap; }
.marquee__in { display: inline-flex; gap: 3em; padding-right: 3em; animation: marquee 36s linear infinite; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* Carrito / lista de pedido ([data-cart]) */
.cart { position: fixed; top: 0; right: 0; bottom: 0; z-index: 130; width: min(420px, 100vw); display: flex; flex-direction: column; background: var(--cart-bg, #fff); color: var(--cart-text, #111); box-shadow: -30px 0 60px -30px rgba(0,0,0,.45); transform: translateX(105%); transition: transform .4s cubic-bezier(.2,.7,.2,1); }
.cart.is-open { transform: none; }
.cart__shade { position: fixed; inset: 0; z-index: 129; background: rgba(10,10,10,.45); opacity: 0; pointer-events: none; transition: opacity .3s; }
.cart__shade.is-open { opacity: 1; pointer-events: auto; }
.cart__head { display: flex; align-items: center; justify-content: space-between; padding: 22px 24px; border-bottom: 1px solid var(--cart-line, rgba(0,0,0,.1)); }
.cart__list { flex: 1; overflow-y: auto; padding: 8px 24px; }
.cart__item { display: grid; grid-template-columns: 1fr auto auto; gap: 12px; align-items: center; padding: 16px 0; border-bottom: 1px solid var(--cart-line, rgba(0,0,0,.1)); font-size: .95rem; }
.cart__qty { display: inline-flex; align-items: center; border: 1px solid var(--cart-line, rgba(0,0,0,.15)); border-radius: 999px; }
.cart__qty button { width: 30px; height: 30px; font-size: 1rem; }
.cart__qty span { min-width: 20px; text-align: center; font-variant-numeric: tabular-nums; }
.cart__empty { padding: 40px 0; text-align: center; opacity: .6; }
.cart__foot { padding: 20px 24px 28px; border-top: 1px solid var(--cart-line, rgba(0,0,0,.1)); display: grid; gap: 14px; }
.cart__total { display: flex; justify-content: space-between; font-weight: 700; font-size: 1.1rem; }

/* ── Animación de entrada: solo con demo.js activo (.js-reveal) ─────────── */
.js-reveal .reveal { opacity: 0; transform: translateY(24px); transition: opacity .9s cubic-bezier(.2,.7,.2,1), transform .9s cubic-bezier(.2,.7,.2,1); }
.js-reveal .reveal.in { opacity: 1; transform: none; }
.js-reveal .reveal.d1 { transition-delay: .08s; } .js-reveal .reveal.d2 { transition-delay: .16s; } .js-reveal .reveal.d3 { transition-delay: .24s; }

/* ── Botón flotante de WhatsApp del negocio (demo.js) ───────────────────── */
.float-wa { position: fixed; right: 20px; bottom: 82px; z-index: 60; width: 54px; height: 54px; display: grid; place-items: center; border-radius: 50%; background: #25d366; color: #fff; box-shadow: 0 12px 30px -10px rgba(0,0,0,.45); transition: transform .2s; }
.float-wa:hover { transform: scale(1.06); }
.float-wa svg { width: 26px; height: 26px; }

/* ── Barra de WebCraft y avisos (demo.js) ───────────────────────────────── */
.wc-bar { position: fixed; left: 50%; bottom: 14px; z-index: 100; transform: translateX(-50%); display: flex; align-items: center; gap: 4px; max-width: calc(100vw - 20px); padding: 6px 6px 6px 18px; border-radius: 999px; background: rgba(16,14,13,.94); color: #f5f3ef; border: 1px solid rgba(255,255,255,.12); box-shadow: 0 16px 40px -14px rgba(0,0,0,.6); font: 500 13.5px/1.2 Inter, system-ui, -apple-system, 'Segoe UI', sans-serif; letter-spacing: 0; text-transform: none; -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.wc-bar__logo { font-weight: 800; margin-right: 8px; white-space: nowrap; } .wc-bar__logo b { color: #f97316; font-weight: 800; }
.wc-bar__txt { color: rgba(245,243,239,.6); margin-right: 8px; white-space: nowrap; max-width: 260px; overflow: hidden; text-overflow: ellipsis; }
.wc-bar a { padding: 10px 15px; border-radius: 999px; font-weight: 600; white-space: nowrap; transition: background .2s; }
.wc-bar__all:hover { background: rgba(255,255,255,.1); }
.wc-bar__cta { background: #ea580c; color: #fff; } .wc-bar__cta:hover { background: #f97316; }
@media (max-width: 640px) { .wc-bar__txt { display: none; } .wc-bar { padding-left: 14px; } .wc-bar a { padding: 10px 12px; } }
.wc-toast { position: fixed; left: 50%; bottom: 80px; z-index: 140; width: max-content; max-width: min(440px, calc(100vw - 32px)); padding: 14px 18px; border-radius: 14px; background: #fff; color: #1c1917; box-shadow: 0 20px 50px -12px rgba(0,0,0,.45); font: 500 14px/1.45 Inter, system-ui, sans-serif; letter-spacing: 0; text-transform: none; opacity: 0; pointer-events: none; transform: translate(-50%, 12px); transition: opacity .25s, transform .25s; }
.wc-toast.show { opacity: 1; transform: translate(-50%, 0); }
.wc-toast b { color: #c2410c; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js-reveal .reveal { opacity: 1; transform: none; transition: none; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
