:root {
  --yellow: #ffd400;
  --yellow-soft: rgba(255, 212, 0, 0.14);
  --bg: #0b0b0c;
  --surface: #141416;
  --surface-2: #1c1c1f;
  --line: #2a2a2f;
  --text: #f4f4f5;
  --muted: #9b9ba4;
  --danger: #ff6b6b;
  --radius: 18px;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif,
    "Apple Color Emoji", "Segoe UI Emoji";
  font-size: 15px;
  color: var(--text);
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { height: 100%; }
body { margin: 0; background: var(--bg); overflow-x: hidden; }
img { display: block; max-width: 100%; }
button { font: inherit; color: inherit; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.muted { color: var(--muted); }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* Resplandor amarillo de fondo, como el halo del ejemplo */
.glow {
  position: fixed; inset: -20vh -10vw auto; height: 70vh; pointer-events: none; z-index: 0;
  background:
    radial-gradient(ellipse 45% 55% at 70% 0%, rgba(255, 212, 0, 0.16), transparent 70%),
    radial-gradient(ellipse 35% 40% at 20% 10%, rgba(255, 255, 255, 0.05), transparent 70%);
  filter: blur(10px);
}

/* Encabezado */
.top {
  position: sticky; top: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between;
  padding: 14px 20px; background: linear-gradient(var(--bg) 60%, transparent);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--text); text-decoration: none; font-weight: 700; letter-spacing: .01em; }
.brand img { width: 30px; height: 30px; border-radius: 50%; }
.cart-pill {
  display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--line); font-size: 14px;
}
.cart-pill svg { width: 18px; height: 18px; }
.cart-pill b { background: var(--yellow); color: #000; border-radius: 999px; min-width: 20px; padding: 1px 6px; font-size: 12px; }

/* Zona de chat */
.chat { position: relative; z-index: 1; max-width: 860px; margin: 0 auto; padding: 0 20px 240px; }

/* Bienvenida */
.welcome { text-align: center; padding: 6vh 0 20px; animation: rise .6s ease both; }
.logo-ring {
  width: 88px; height: 88px; margin: 0 auto 18px; border-radius: 50%; padding: 3px;
  background: conic-gradient(from 180deg, var(--yellow), #fff3a8, var(--yellow));
  box-shadow: 0 0 40px rgba(255, 212, 0, 0.35);
  animation: breathe 4s ease-in-out infinite;
}
.logo-ring img { width: 100%; height: 100%; border-radius: 50%; background: #000; border: 3px solid var(--bg); }
.eyebrow { color: var(--yellow); font-size: 13px; font-weight: 600; letter-spacing: .08em; text-transform: uppercase; margin: 0 0 8px; }
.welcome h1 { font-size: clamp(28px, 5vw, 42px); line-height: 1.1; margin: 0 0 14px; letter-spacing: -.02em; }
.lead { color: var(--muted); max-width: 560px; margin: 0 auto 28px; line-height: 1.55; font-size: 16px; }
.lead strong { color: var(--text); }

.tips { display: grid; grid-template-columns: 1.25fr 1fr 1fr; gap: 12px; text-align: left; }
.tip {
  display: flex; gap: 12px; align-items: flex-start; padding: 16px; border-radius: var(--radius); text-align: left;
  background: var(--surface); border: 1px solid var(--line); transition: border-color .2s, transform .2s, background .2s;
}
.tip:hover { border-color: #3d3d44; transform: translateY(-2px); }
.tip-body { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: var(--muted); line-height: 1.4; }
.tip-body strong { color: var(--text); font-size: 14px; font-weight: 600; }
.tip-photo { border-color: rgba(255, 212, 0, 0.45); background: linear-gradient(160deg, var(--yellow-soft), var(--surface) 60%); }
.tip-photo:hover { border-color: var(--yellow); }
.tip-icon { flex-shrink: 0; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--yellow); color: #000; }
.badge { align-self: flex-start; background: var(--yellow); color: #000; font-size: 11px; font-weight: 700; padding: 2px 8px; border-radius: 999px; letter-spacing: .02em; }

/* Mensajes */
.messages { display: flex; flex-direction: column; gap: 22px; padding-top: 10px; }
.msg { animation: rise .35s ease both; }
.msg-user { align-self: flex-end; max-width: min(78%, 480px); display: flex; flex-direction: column; align-items: flex-end; gap: 8px; }
.msg-user img { width: 180px; border-radius: 14px; border: 1px solid var(--line); }
.msg-user p { margin: 0; padding: 11px 15px; background: var(--surface-2); border: 1px solid var(--line); border-radius: 18px 18px 4px 18px; line-height: 1.45; }
.msg-bot { display: grid; grid-template-columns: 34px 1fr; gap: 12px; align-items: start; }
.avatar { width: 34px; height: 34px; border-radius: 50%; background: #000; border: 2px solid var(--yellow); }
.bot-body { min-width: 0; padding-top: 5px; }
.bot-body > p { margin: 0 0 14px; line-height: 1.5; }

/* Animación de tinta */
.inking { display: flex; align-items: center; gap: 14px; min-height: 44px; }
.ink { width: 96px; height: 44px; flex-shrink: 0; overflow: visible; stroke: none; }
.ink g { filter: url(#goo); }
.ink circle { fill: var(--yellow); transform-box: fill-box; transform-origin: center; }
.ink .d1 { animation: drop1 1.6s ease-in-out infinite; }
.ink .d2 { animation: drop2 1.6s ease-in-out infinite; }
.ink .d3 { animation: drop3 1.6s ease-in-out infinite; }
.ink .drip { animation: drip 1.6s ease-in infinite; }
.ink .line { fill: none; stroke: rgba(255, 212, 0, .55); stroke-width: 2; stroke-dasharray: 120; animation: needle 2.4s ease-in-out infinite; }
.phrase { color: var(--muted); font-size: 14px; transition: opacity .3s; }
.phrase.fade { opacity: 0; }

@keyframes drop1 { 0%, 100% { transform: translateX(0) scale(1); } 50% { transform: translateX(18px) scale(.7); } }
@keyframes drop2 { 0%, 100% { transform: scale(.8); } 50% { transform: scale(1.25); } }
@keyframes drop3 { 0%, 100% { transform: translateX(0) scale(1); } 50% { transform: translateX(-18px) scale(.7); } }
@keyframes drip { 0% { transform: translateY(-4px) scale(.4); opacity: 0; } 40% { opacity: 1; } 100% { transform: translateY(16px) scale(.9); opacity: 0; } }
@keyframes needle { 0% { stroke-dashoffset: 120; } 60% { stroke-dashoffset: 0; } 100% { stroke-dashoffset: -120; } }
@keyframes rise { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: none; } }
@keyframes breathe { 50% { box-shadow: 0 0 60px rgba(255, 212, 0, 0.5); } }

/* Resultados */
.results { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 8px 8px 12px;
  display: flex; flex-direction: column; gap: 8px; animation: rise .4s ease both;
}
.card:nth-child(2) { animation-delay: .06s; } .card:nth-child(3) { animation-delay: .12s; }
.card:nth-child(4) { animation-delay: .18s; } .card:nth-child(5) { animation-delay: .24s; } .card:nth-child(6) { animation-delay: .3s; }
.card-img { aspect-ratio: 1; width: 100%; object-fit: contain; background: #fff; border-radius: 12px; }
.card-info { padding: 0 4px; display: flex; flex-direction: column; gap: 4px; flex: 1; }
.card-name { font-size: 14px; font-weight: 600; margin: 0; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.price { display: flex; align-items: baseline; gap: 6px; font-size: 14px; }
.price strong { color: var(--yellow); }
.price s { color: var(--muted); font-size: 12px; }
.card .btn { margin: 4px 4px 0; }
.follow { margin-top: 14px; color: var(--muted); font-size: 14px; }

/* Botones */
.btn { border: 0; border-radius: 12px; padding: 10px 14px; font-weight: 700; font-size: 14px; transition: background .2s, transform .1s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--yellow); color: #000; }
.btn-primary:hover { background: #ffe033; }
.btn-primary:disabled { opacity: .5; cursor: default; }
.btn-added { background: var(--surface-2); color: var(--yellow); border: 1px solid rgba(255, 212, 0, .4); }
.btn-soldout { background: var(--surface-2); color: var(--muted); cursor: default; }
.btn-ghost { background: none; color: var(--muted); }
.btn-block { width: 100%; }
.icon-btn { background: none; border: 0; padding: 8px; border-radius: 10px; display: grid; place-items: center; }
.icon-btn:hover { background: var(--surface-2); }

/* Barra inferior (composer) */
.dock {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  padding: 24px 16px calc(12px + env(safe-area-inset-bottom));
  background: linear-gradient(transparent, var(--bg) 35%);
}
.composer {
  max-width: 760px; margin: 0 auto; background: var(--surface); border: 1px solid rgba(255, 212, 0, .35);
  border-radius: 22px; padding: 12px 12px 10px; box-shadow: 0 0 0 4px rgba(255, 212, 0, .05), 0 10px 40px rgba(0, 0, 0, .5);
  transition: border-color .2s, box-shadow .2s;
}
.composer:focus-within { border-color: var(--yellow); box-shadow: 0 0 0 4px rgba(255, 212, 0, .12), 0 10px 40px rgba(0, 0, 0, .5); }
.composer.dragging { border-style: dashed; border-color: var(--yellow); }
.composer textarea {
  width: 100%; resize: none; border: 0; outline: none; background: none; padding: 6px 8px; overflow: hidden;
  font-size: 16px; line-height: 1.4; max-height: 140px;
}
.composer textarea::placeholder { color: #6f6f78; }
.composer-row { display: flex; align-items: center; gap: 10px; margin-top: 6px; }
.photo-btn {
  display: inline-flex; align-items: center; gap: 8px; padding: 10px 16px; border-radius: 14px; cursor: pointer;
  background: var(--yellow); color: #000; font-weight: 700; font-size: 14px; transition: background .2s, transform .1s;
  box-shadow: 0 0 20px rgba(255, 212, 0, .25);
}
.photo-btn:hover { background: #ffe033; }
.photo-btn:active { transform: scale(.98); }
.photo-btn svg { width: 20px; height: 20px; }
.hint { color: var(--muted); font-size: 12.5px; }
.send {
  margin-left: auto; width: 44px; height: 44px; border-radius: 14px; border: 1px solid var(--line);
  background: var(--surface-2); color: var(--text); display: grid; place-items: center; transition: background .2s, color .2s;
}
.send.ready { background: #fff; color: #000; border-color: #fff; }
.send:disabled { opacity: .5; cursor: default; }
.attach { position: relative; display: inline-block; margin: 2px 0 6px 6px; }
.attach img { width: 64px; height: 64px; object-fit: cover; border-radius: 12px; border: 1px solid var(--line); }
.attach button {
  position: absolute; top: -8px; right: -8px; width: 22px; height: 22px; border-radius: 50%;
  border: 0; background: #fff; color: #000; font-size: 15px; line-height: 1; display: grid; place-items: center;
}
.fineprint { text-align: center; color: #5f5f68; font-size: 12px; margin: 10px 0 0; }

/* Panel de selección */
.scrim { position: fixed; inset: 0; background: rgba(0, 0, 0, .6); z-index: 30; backdrop-filter: blur(2px); }
.drawer {
  position: fixed; top: 0; right: 0; bottom: 0; width: min(420px, 100%); z-index: 40; overflow-y: auto;
  background: var(--surface); border-left: 1px solid var(--line); padding: 18px; display: flex; flex-direction: column;
}
.drawer-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.drawer-head h2 { font-size: 18px; margin: 0; }
.view { display: flex; flex-direction: column; flex: 1; }
.cart-items { list-style: none; padding: 0; margin: 0; }
.cart-item { display: grid; grid-template-columns: 60px 1fr auto; gap: 12px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.cart-item img { width: 60px; height: 60px; object-fit: contain; background: #fff; border-radius: 10px; }
.cart-item .name { font-size: 14px; line-height: 1.3; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 10px; }
.qty button { background: none; border: 0; width: 30px; height: 30px; font-size: 16px; }
.qty span { min-width: 20px; text-align: center; font-weight: 600; font-size: 14px; }
.drawer-foot { margin-top: auto; padding-top: 16px; }
.total-row { display: flex; justify-content: space-between; font-size: 16px; margin: 12px 0; }
.total-row strong { color: var(--yellow); }
#checkoutView { gap: 12px; }
#checkoutView label { display: flex; flex-direction: column; gap: 6px; font-size: 14px; font-weight: 600; }
#checkoutView input, #checkoutView textarea {
  background: var(--surface-2); border: 1px solid var(--line); border-radius: 12px; padding: 11px 12px; font-weight: 400; outline: none;
}
#checkoutView input:focus, #checkoutView textarea:focus { border-color: var(--yellow); }
.error { color: var(--danger); font-size: 14px; margin: 0; }
.done { text-align: center; justify-content: center; }
.done-icon { width: 60px; height: 60px; border-radius: 50%; background: var(--yellow); color: #000; display: grid; place-items: center; margin: 0 auto 14px; font-size: 28px; font-weight: 700; }

.toast {
  position: fixed; left: 50%; top: 70px; transform: translateX(-50%); z-index: 50;
  background: var(--yellow); color: #000; font-weight: 600; padding: 10px 16px; border-radius: 12px; font-size: 14px;
  animation: rise .25s ease both;
}

@media (max-width: 720px) {
  .chat { padding: 0 16px 230px; }
  .welcome { padding-top: 3vh; }
  .tips { grid-template-columns: 1fr; }
  .results { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .msg-bot { grid-template-columns: 1fr; }
  .avatar { display: none; }
  .hint { display: none; }
  .photo-btn { flex: 1; justify-content: center; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition: none !important; }
}
.shipping-note { color: var(--muted); font-size: 13px; line-height: 1.45; margin: -6px 0 12px; }
.wa-btn { display: block; text-align: center; text-decoration: none; margin-top: 10px; }