/* =========================================================
   Horno Luna (demo) — estilos de la tienda
   ========================================================= */
:root {
  --bg: #f6efe4;
  --paper: #fffaf2;
  --ink: #2b1d14;
  --muted: #7a6656;
  --line: #e7dccb;
  --accent: #c2512b;        /* terracota */
  --accent-ink: #fff;
  --wa: #1d9e55;            /* verde WhatsApp, un poco más sobrio */
  --radius: 18px;
  --radius-sm: 12px;
  --wrap: 1180px;
  --gutter: clamp(16px, 4vw, 32px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --serif: "Fraunces", Georgia, serif;
  --sans: "DM Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body.no-scroll { overflow: hidden; }
h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button, input, select, textarea { font: inherit; color: inherit; }
ul { margin: 0; padding: 0; list-style: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.wrap { max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }

/* ---------- Botones ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 18px;
  border: 0;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
  transition: transform .2s var(--ease), background .2s, box-shadow .2s;
}
.btn:hover { transform: translateY(-1px); }
.btn .ti { font-size: 1.15em; }
.btn--block { width: 100%; }
.btn--soft { background: var(--line); color: var(--ink); }
.btn--wa { background: var(--wa); color: #fff; }
.btn--wa:hover { box-shadow: 0 10px 24px -12px var(--wa); }
.btn--add { padding: 9px 14px; background: var(--accent); color: var(--accent-ink); font-size: .92rem; }

.icon {
  display: inline-grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: var(--line);
  font-size: 1.2rem;
  cursor: pointer;
}
.icon--sm { width: 32px; height: 32px; font-size: 1rem; background: transparent; color: var(--muted); }
.icon--sm:hover { background: var(--line); color: var(--accent); }

/* ---------- Aviso de demo ---------- */
.demo-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 6px 18px;
  padding: 9px var(--gutter);
  background: #0a0b0d;
  color: #e9ece8;
  font-size: .88rem;
  text-align: center;
}
.demo-bar p { display: inline-flex; align-items: center; gap: 6px; }
.demo-bar b { color: #9dff3a; }
.demo-bar .ti-sparkles { color: #9dff3a; }
.demo-bar a { display: inline-flex; align-items: center; gap: 4px; color: #9dff3a; font-weight: 600; text-decoration: none; }
.demo-bar a:hover { text-decoration: underline; }

/* ---------- Cabecera ---------- */
.top {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(246, 239, 228, .9);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
.top__inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }

.logo { display: inline-flex; align-items: center; gap: 10px; font-family: var(--serif); font-size: 1.35rem; font-weight: 700; text-decoration: none; }
.logo em { font-style: normal; color: var(--accent); }
.logo__mark { display: grid; place-items: center; width: 36px; height: 36px; border-radius: 50%; background: var(--ink); color: #f3d38a; font-size: 1.15rem; }

.cart-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-weight: 600;
  cursor: pointer;
}
.cart-btn .ti { font-size: 1.25rem; }
.cart-btn__count {
  display: grid;
  place-items: center;
  min-width: 22px;
  height: 22px;
  padding-inline: 6px;
  border-radius: 999px;
  background: var(--line);
  color: var(--muted);
  font-size: .78rem;
}
.cart-btn__count.is-on { background: var(--accent); color: #fff; }
.cart-btn.is-bump { animation: bump .4s var(--ease); }
@keyframes bump { 40% { transform: scale(1.08); } }

/* ---------- Portada ---------- */
.hero { padding: clamp(40px, 7vw, 80px) 0 clamp(28px, 4vw, 44px); }
.hero__tag { display: inline-flex; align-items: center; gap: 6px; padding: 6px 12px; border-radius: 999px; background: var(--paper); color: var(--muted); font-size: .85rem; border: 1px solid var(--line); }
.hero h1 {
  margin-top: 18px;
  max-width: 16ch;
  font-family: var(--serif);
  font-size: clamp(2.2rem, 6vw, 4rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.hero h1 span { color: var(--accent); }
.hero__sub { margin-top: 16px; max-width: 46ch; color: var(--muted); font-size: 1.08rem; }
.hero__perks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 26px; }
.hero__perks li { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: var(--paper); border: 1px solid var(--line); font-size: .9rem; font-weight: 500; }
.hero__perks .ti { color: var(--accent); font-size: 1.1rem; }

/* ---------- Catálogo ---------- */
.shop { padding-bottom: 80px; }
.toolbar {
  position: sticky;
  top: 68px;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  margin-bottom: 18px;
  background: var(--bg);
}
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; max-width: 100%; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  font-weight: 500;
  font-size: .92rem;
  cursor: pointer;
  transition: background .2s, color .2s, border-color .2s;
}
.chip:hover { border-color: var(--ink); }
.chip.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.search { display: flex; align-items: center; gap: 8px; width: min(280px, 100%); padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); }
.search .ti { color: var(--muted); }
.search input { flex: 1; min-width: 0; padding: 10px 0; border: 0; background: none; outline: none; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }

.card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--paper);
  border: 1px solid var(--line);
  transition: transform .25s var(--ease), box-shadow .25s;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 18px 36px -24px rgba(43, 29, 20, .45); }

.card__img {
  position: relative;
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 3;
  background:
    radial-gradient(circle at 30% 25%, rgba(255, 255, 255, .55), transparent 55%),
    var(--tono);
  color: var(--ink);
  font-size: 4.2rem;
}
.card__img .ti { transition: transform .4s var(--ease); }
.card:hover .card__img .ti { transform: rotate(-8deg) scale(1.06); }
.card__tag { position: absolute; top: 12px; left: 12px; padding: 4px 10px; border-radius: 999px; background: var(--ink); color: var(--paper); font-size: .75rem; font-weight: 600; }

.card__body { display: flex; flex-direction: column; flex: 1; padding: 16px 16px 18px; }
.card__cat { color: var(--accent); font-size: .78rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; }
.card h3 { margin-top: 4px; font-size: 1.12rem; }
.card__desc { margin-top: 4px; color: var(--muted); font-size: .9rem; flex: 1; }
.card__foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; min-height: 40px; }
.price { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }

.stepper { display: inline-flex; align-items: center; gap: 4px; padding: 3px; border-radius: 999px; background: var(--ink); color: var(--paper); }
.stepper button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; border-radius: 50%; background: transparent; color: inherit; cursor: pointer; }
.stepper button:hover { background: rgba(255, 255, 255, .14); }
.stepper span { min-width: 22px; text-align: center; font-weight: 600; }
.stepper--sm { margin-top: 8px; background: var(--bg); color: var(--ink); border: 1px solid var(--line); }
.stepper--sm button { width: 28px; height: 28px; }
.stepper--sm button:hover { background: var(--line); }

.empty { padding: 48px 0; text-align: center; color: var(--muted); }

/* ---------- Pie ---------- */
.foot { border-top: 1px solid var(--line); padding: 22px 0; color: var(--muted); font-size: .88rem; }
.foot__inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px; }
.foot a { color: var(--ink); font-weight: 600; }

/* ---------- Carrito lateral ---------- */
.overlay { position: fixed; inset: 0; z-index: 40; background: rgba(43, 29, 20, .4); animation: fade .25s; }
@keyframes fade { from { opacity: 0; } }

.cart {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  width: min(420px, 100%);
  background: var(--paper);
  box-shadow: -20px 0 50px -30px rgba(43, 29, 20, .6);
  transform: translateX(100%);
  visibility: hidden;
  transition: transform .35s var(--ease), visibility .35s;
}
.cart.is-open { transform: none; visibility: visible; }

.cart__head { display: flex; align-items: center; justify-content: space-between; padding: 18px 20px; border-bottom: 1px solid var(--line); }
.cart__head h2 { font-family: var(--serif); font-size: 1.4rem; }

.cart__body { flex: 1; overflow-y: auto; padding: 8px 20px 20px; }

.line { display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line); }
.line__img { flex: none; display: grid; place-items: center; width: 60px; height: 60px; border-radius: var(--radius-sm); background: var(--tono); font-size: 1.8rem; }
.line__info { flex: 1; min-width: 0; }
.line__name { font-weight: 600; }
.line__price { color: var(--muted); font-size: .85rem; }
.line__side { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; }
.line__total { font-weight: 700; }

.cart__empty { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 60px 0; text-align: center; color: var(--muted); }
.cart__empty .ti { font-size: 3rem; color: var(--line); }

.checkout { display: grid; gap: 12px; margin-top: 18px; }
.checkout h3 { margin-top: 8px; font-size: .8rem; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }

.toggle { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.toggle input { position: absolute; opacity: 0; pointer-events: none; }
.toggle span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: .92rem;
  cursor: pointer;
  transition: background .2s, border-color .2s, color .2s;
}
.toggle input:checked + span { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.toggle input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }

.field { display: grid; gap: 5px; font-size: .88rem; font-weight: 600; }
.field input, .field select, .field textarea {
  width: 100%;
  padding: 11px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: #fff;
  font-weight: 400;
  resize: vertical;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field [aria-invalid="true"] { border-color: var(--accent); background: #fff4ef; }

.cart__foot { padding: 16px 20px 20px; border-top: 1px solid var(--line); background: var(--paper); }
.totals { display: grid; gap: 6px; margin: 0 0 14px; }
.totals div { display: flex; justify-content: space-between; color: var(--muted); }
.totals dd { margin: 0; }
.totals__hint { justify-content: center !important; padding: 6px; border-radius: 8px; background: #fbeee0; color: var(--accent) !important; font-size: .85rem; font-weight: 600; }
.totals__total { margin-top: 4px; padding-top: 10px; border-top: 1px dashed var(--line); color: var(--ink) !important; font-size: 1.2rem; font-weight: 700; }

/* ---------- Vista previa del pedido ---------- */
.preview {
  width: min(440px, calc(100% - 32px));
  max-height: calc(100% - 32px);
  padding: 0;
  border: 0;
  border-radius: 22px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 40px 80px -30px rgba(43, 29, 20, .6);
}
.preview::backdrop { background: rgba(43, 29, 20, .5); }
.preview[open] { animation: pop .3s var(--ease); }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.98); } }

.preview__inner { display: flex; flex-direction: column; align-items: center; padding: 28px 22px 22px; text-align: center; }
.preview__icon { display: grid; place-items: center; width: 52px; height: 52px; border-radius: 50%; background: var(--wa); color: #fff; font-size: 1.6rem; }
.preview h2 { margin-top: 14px; font-family: var(--serif); font-size: 1.5rem; }
.preview__sub { margin-top: 6px; color: var(--muted); font-size: .92rem; }

.bubble {
  align-self: stretch;
  margin-top: 16px;
  padding: 14px;
  border-radius: 14px;
  background:
    radial-gradient(circle at 10% 10%, rgba(255, 255, 255, .5), transparent 40%),
    #e7f6dc;
  text-align: left;
}
.bubble pre { margin: 0; font-family: var(--sans); font-size: .88rem; line-height: 1.5; white-space: pre-wrap; word-break: break-word; }

.preview__note { display: flex; gap: 6px; margin-top: 12px; color: var(--muted); font-size: .8rem; text-align: left; }
.preview__note .ti { flex: none; margin-top: 2px; }
.preview__actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; width: 100%; margin-top: 18px; }

/* ---------- Aviso flotante ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 24px;
  z-index: 60;
  padding: 11px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  font-size: .9rem;
  font-weight: 500;
  white-space: nowrap;
  transform: translate(-50%, 20px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s, transform .25s var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Celulares ---------- */
@media (max-width: 640px) {
  .cart-btn__label { display: none; }
  .toolbar { flex-direction: column; align-items: stretch; }
  .search { width: 100%; }
  .grid { grid-template-columns: 1fr 1fr; gap: 12px; }
  .card__img { font-size: 3rem; }
  .card__body { padding: 12px; }
  .card h3 { font-size: 1rem; }
  .card__desc { display: none; }
  .card__foot { flex-direction: column; align-items: stretch; gap: 8px; }
  .card__foot .btn--add, .card__foot .stepper { justify-content: space-between; }
  .card__foot .btn--add { justify-content: center; }
  .preview__actions { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
