:root {
  --bg: #F3F6F4; --card: #FFFFFF; --text: #0E1A1F; --muted: #5B6B68; --line: #DDE5E2; --soft: #EEF3F0;
  --brand: #0E7A5C; --brand-2: #0A5F47; --brand-soft: #E0F5EC; --pink: #8A6410; --pink-soft: #FDF1D6;  /* acento dorado Softnest */
  --ok: #12A150; --ok-soft: #E3F7EB; --warn: #C27803; --warn-soft: #FFF4DB; --err: #D12E3B; --err-soft: #FDE8EA;
  --grad: linear-gradient(135deg, #0E1A1F 0%, #0E5E47 55%, #0E7A5C 100%);
  --radius: 18px; --shadow: 0 1px 2px rgba(14,26,31,.04), 0 8px 24px rgba(14,26,31,.07);
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0E1A1F; --card: #16252B; --text: #F3F6F4; --muted: #9AABA8; --line: #26363A; --soft: #1D2E33;
    --brand: #3CCB9A; --brand-2: #6FDCB6; --brand-soft: #133A30; --pink: #F2B632; --pink-soft: #3A2E10;
    --ok: #4ADE80; --ok-soft: #173424; --warn: #FBBF24; --warn-soft: #3A2E10; --err: #F87171; --err-soft: #3B1719;
    --shadow: none; color-scheme: dark;
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body { font: 15.5px/1.45 "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif; background: var(--bg); color: var(--text);
  padding-bottom: 84px; -webkit-font-smoothing: antialiased; }
.hidden { display: none !important; }
h1 { font-size: 1.5rem; margin: .2rem 0 .9rem; letter-spacing: -.02em; }
h2 { font-size: 1.1rem; margin: 1.5rem 0 .7rem; letter-spacing: -.01em; }
h3 { font-size: 1rem; margin: 0 0 .2rem; }
p { margin: .25rem 0; }
a { color: var(--brand); }
.muted { color: var(--muted); font-size: .9rem; }
.small { font-size: .82rem; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2.5px solid var(--brand); outline-offset: 2px; }

/* ---------- estructura ---------- */
.topbar { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(12px); }
.brand { display: flex; gap: 9px; align-items: center; font-weight: 800; font-size: 1.15rem; color: var(--text); text-decoration: none; letter-spacing: -.02em; }
.brand img { border-radius: 9px; }
.brand .ao { color: var(--brand); }
.saldo-pill { display: inline-flex; align-items: center; gap: 6px; padding: 7px 12px; border-radius: 999px; background: var(--grad); color: #fff;
  font-weight: 700; font-size: .85rem; text-decoration: none; box-shadow: 0 4px 14px rgba(14,122,92,.3); border: 1.5px solid #F2B632; }
main { max-width: 860px; margin: 0 auto; padding: 8px 16px 24px; outline: none; }
.bottomnav { position: fixed; bottom: 0; left: 0; right: 0; z-index: 20; display: flex; justify-content: space-around;
  background: var(--card); border-top: 1px solid var(--line); padding: 6px 4px calc(6px + env(safe-area-inset-bottom)); }
.bottomnav a { flex: 1; text-align: center; text-decoration: none; color: var(--muted); font-size: .72rem; font-weight: 600;
  display: flex; flex-direction: column; align-items: center; gap: 1px; padding: 5px 0; border-radius: 12px; }
.bottomnav a .ico { font-size: 1.25rem; line-height: 1.3; filter: grayscale(.6); }
.bottomnav a.active { color: var(--brand); background: var(--brand-soft); }
.bottomnav a.active .ico { filter: none; }
.firma { display: flex; justify-content: center; align-items: center; gap: 8px; padding: 12px 16px 96px; color: var(--muted); font-size: 12.5px; }
.firma img { border-radius: 5px; }

/* ---------- componentes ---------- */
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.click { cursor: pointer; transition: transform .12s, border-color .12s; }
.click:hover { border-color: color-mix(in srgb, var(--brand) 40%, var(--line)); }
.click:active { transform: scale(.99); }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
@media (max-width: 520px) { .grid2 { grid-template-columns: 1fr; } }

label { display: block; font-size: .82rem; font-weight: 600; color: var(--muted); margin: .7rem 0 .25rem; }
input, select, textarea { width: 100%; padding: 12px 14px; background: var(--soft); border: 1.5px solid transparent; border-radius: 12px; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--brand); background: var(--card); }
input[type=checkbox], input[type=radio] { width: auto; accent-color: var(--brand); }
textarea { min-height: 70px; resize: vertical; }
.check { display: flex; gap: 10px; align-items: flex-start; color: var(--text); font-weight: 500; font-size: .9rem; }
.check input { margin-top: 3px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 12px 18px; font-weight: 700; border-radius: 14px;
  border: 0; cursor: pointer; background: var(--brand); color: #fff; text-decoration: none; transition: filter .12s, transform .08s; }
@media (prefers-color-scheme: dark) { .btn { color: #0E1A1F; } }
.btn:hover { filter: brightness(1.07); }
.btn:active { transform: scale(.98); }
.btn.grad { background: var(--grad); color: #fff; box-shadow: 0 6px 18px rgba(14,122,92,.28); }
.btn.sec { background: var(--brand-soft); color: var(--brand); }
.btn.ghost { background: transparent; color: var(--brand); border: 1.5px solid var(--line); }
.btn.danger { background: var(--err-soft); color: var(--err); }
.btn.sm { padding: 7px 12px; font-size: .84rem; border-radius: 10px; }
.btn.block { width: 100%; }
.btn:disabled { opacity: .45; cursor: default; transform: none; }
.link { background: none; border: 0; color: var(--brand); font-weight: 700; cursor: pointer; padding: 4px; }

.chip { display: inline-flex; align-items: center; gap: 4px; padding: 3px 10px; border-radius: 999px; font-size: .75rem; font-weight: 700;
  background: var(--brand-soft); color: var(--brand); white-space: nowrap; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.warn { background: var(--warn-soft); color: var(--warn); }
.chip.err { background: var(--err-soft); color: var(--err); }
.chip.gray { background: var(--soft); color: var(--muted); }
.chip.pink { background: var(--pink-soft); color: var(--pink); }

.tabs { display: flex; gap: 6px; margin: 4px 0 14px; overflow-x: auto; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tabs button { flex: none; padding: 9px 16px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700;
  cursor: pointer; font-size: .88rem; }
.tabs button.active { background: var(--text); color: var(--bg); border-color: var(--text); }
.empty { text-align: center; color: var(--muted); padding: 28px 12px; }
.empty .big { font-size: 2.6rem; display: block; margin-bottom: 6px; }

/* ---------- inicio ---------- */
.hola { margin: 6px 0 12px; }
.hola h1 { margin: 0; font-size: 1.6rem; }
.buscador { position: relative; margin-bottom: 16px; }
.buscador input { padding: 15px 16px 15px 46px; background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; box-shadow: var(--shadow); }
.buscador::before { content: "🔎"; position: absolute; left: 16px; top: 50%; transform: translateY(-50%); font-size: 1.05rem; }
.cats { display: grid; grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); gap: 10px; }
.cat { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 14px 6px 12px; border-radius: 18px; background: var(--card);
  border: 1px solid var(--line); text-decoration: none; color: var(--text); font-size: .78rem; font-weight: 700; text-align: center; box-shadow: var(--shadow); }
.cat .emo { font-size: 1.9rem; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 16px; background: var(--brand-soft); }
.carrusel { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(250px, 78%); gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory;
  padding-bottom: 6px; scrollbar-width: none; }
.carrusel::-webkit-scrollbar { display: none; }
.carrusel > * { scroll-snap-align: start; }
@media (min-width: 700px) { .carrusel { grid-auto-columns: 300px; } }
.promo { border-radius: var(--radius); padding: 18px; color: #fff; background: var(--grad); position: relative; overflow: hidden; margin-bottom: 8px; }
.promo::after { content: ""; position: absolute; right: -30px; top: -30px; width: 140px; height: 140px; border-radius: 50%; background: rgba(255,255,255,.12); }
.promo h3 { font-size: 1.1rem; }
.promo p { opacity: .92; font-size: .9rem; }

/* tarjeta de negocio */
.negocio { display: flex; gap: 12px; align-items: center; }
.logo { flex: none; width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; font-size: 1.7rem;
  background: color-mix(in srgb, var(--c, var(--brand)) 16%, var(--card)); }
.negocio h3 { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.meta { display: flex; flex-wrap: wrap; gap: 4px 10px; font-size: .8rem; color: var(--muted); margin-top: 2px; }
.estrella { color: #F59E0B; font-weight: 800; }
.abierto { color: var(--ok); font-weight: 700; }
.cerrado { color: var(--err); font-weight: 700; }

/* ---------- negocio ---------- */
.portada { border-radius: 24px; padding: 20px 18px 18px; color: #fff; margin-bottom: 14px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, var(--c, #0E7A5C), color-mix(in srgb, var(--c, #0E7A5C) 55%, #0E1A1F)); }
.portada::after { content: attr(data-emo); position: absolute; right: -8px; bottom: -22px; font-size: 7.5rem; opacity: .18; }
.portada h1 { margin: 6px 0 4px; font-size: 1.45rem; }
.portada .meta { color: rgba(255,255,255,.88); }
.portada .estrella, .portada .abierto, .portada .cerrado { color: #fff; }
.portada .acciones-top { display: flex; justify-content: space-between; align-items: center; }
.circulo { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255,255,255,.2); color: #fff; font-size: 1.1rem; cursor: pointer;
  display: grid; place-items: center; text-decoration: none; }
.item { display: flex; gap: 12px; align-items: center; padding: 12px 0; border-top: 1px solid var(--line); }
.item:first-child { border-top: 0; }
.item .emo { flex: none; width: 46px; height: 46px; border-radius: 14px; background: var(--soft); display: grid; place-items: center; font-size: 1.5rem; }
.precio { font-weight: 800; white-space: nowrap; }
.antes { text-decoration: line-through; color: var(--muted); font-size: .8rem; font-weight: 500; margin-left: 4px; }
.cantidad { display: inline-flex; align-items: center; gap: 2px; background: var(--brand-soft); border-radius: 12px; }
.cantidad button { width: 34px; height: 34px; border: 0; background: none; color: var(--brand); font-size: 1.2rem; font-weight: 800; cursor: pointer; }
.cantidad span { min-width: 18px; text-align: center; font-weight: 800; color: var(--brand); }
.agregar { width: 36px; height: 36px; border-radius: 12px; border: 0; background: var(--brand); color: #fff; font-size: 1.3rem; font-weight: 700; cursor: pointer; }
.grupo { font-size: .76rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin: 16px 0 2px; }

.carrito-barra { position: fixed; left: 12px; right: 12px; bottom: calc(74px + env(safe-area-inset-bottom)); z-index: 25; max-width: 836px; margin: 0 auto; }
.carrito-barra button { width: 100%; display: flex; justify-content: space-between; align-items: center; padding: 15px 18px; border: 0; border-radius: 16px;
  background: var(--grad); color: #fff; font-weight: 800; cursor: pointer; box-shadow: 0 10px 30px rgba(14,122,92,.4); }
.fab { position: fixed; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 24; width: 56px; height: 56px; border-radius: 50%; border: 0;
  background: var(--card); box-shadow: 0 8px 24px rgba(14,26,31,.18); font-size: 1.5rem; cursor: pointer; }
body.con-carrito .fab { bottom: calc(150px + env(safe-area-inset-bottom)); }

/* agenda */
.dias { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.dias::-webkit-scrollbar { display: none; }
.dias button { flex: none; width: 62px; padding: 8px 0; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; text-align: center; }
.dias button b { display: block; font-size: 1.2rem; }
.dias button small { color: var(--muted); font-size: .7rem; text-transform: uppercase; font-weight: 700; }
.dias button.sel { background: var(--brand); border-color: var(--brand); color: #fff; }
.dias button.sel small { color: rgba(255,255,255,.85); }
.slots { display: grid; grid-template-columns: repeat(auto-fill, minmax(86px, 1fr)); gap: 8px; margin-top: 8px; }
.slots button { padding: 10px 4px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--card); cursor: pointer; font-weight: 700; font-size: .88rem; }
.slots button.sel { background: var(--brand); color: #fff; border-color: var(--brand); }
.opcion { display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1.5px solid var(--line); border-radius: 14px; cursor: pointer; margin-top: 8px; }
.opcion:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.opcion .grow b { display: block; }
.resumen { background: var(--soft); border-radius: 14px; padding: 12px 14px; margin-top: 12px; }
.resumen .row { font-size: .92rem; }
.total { font-size: 1.15rem; font-weight: 800; }
.pin { letter-spacing: .6em; text-align: center; font-size: 1.3rem; font-weight: 800; }

/* ---------- actividad ---------- */
.pasos { display: flex; gap: 4px; margin: 10px 0 4px; }
.pasos span { flex: 1; height: 6px; border-radius: 3px; background: var(--line); }
.pasos span.on { background: var(--brand); }
.pasos-txt { display: flex; justify-content: space-between; font-size: .7rem; color: var(--muted); font-weight: 600; }
.codigo { font-family: ui-monospace, "Cascadia Code", Consolas, monospace; font-weight: 800; letter-spacing: .08em; }

/* ---------- billetera ---------- */
.tarjeta-bt { border-radius: 24px; padding: 22px 20px; color: #fff; background: var(--grad); position: relative; overflow: hidden;
  box-shadow: 0 16px 40px rgba(14,122,92,.35); margin-bottom: 14px; }
.tarjeta-bt::before { content: ""; position: absolute; width: 220px; height: 220px; border-radius: 50%; right: -70px; top: -90px; background: rgba(255,255,255,.12); }
.tarjeta-bt::after { content: ""; position: absolute; width: 160px; height: 160px; border-radius: 50%; right: 40px; bottom: -100px; background: rgba(255,255,255,.08); }
.tarjeta-bt .lab { font-size: .78rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; opacity: .85; }
.tarjeta-bt .saldo { font-size: 2.3rem; font-weight: 800; letter-spacing: -.03em; margin: 2px 0 6px; }
.tarjeta-bt .pie { display: flex; justify-content: space-between; font-size: .82rem; opacity: .92; position: relative; z-index: 1; }
.acciones-bt { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; }
.acciones-bt button { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px 4px; border-radius: 16px; border: 1px solid var(--line);
  background: var(--card); cursor: pointer; font-weight: 700; font-size: .76rem; box-shadow: var(--shadow); }
.acciones-bt button span { font-size: 1.4rem; width: 44px; height: 44px; display: grid; place-items: center; border-radius: 14px; background: var(--brand-soft); }
.mov { display: flex; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.mov:first-child { border-top: 0; }
.mov .emo { flex: none; width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center; background: var(--soft); font-size: 1.15rem; }
.mas { color: var(--ok); font-weight: 800; white-space: nowrap; }
.menos { font-weight: 800; white-space: nowrap; }
.montos { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 8px; }
.montos button { padding: 8px 14px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--card); font-weight: 700; cursor: pointer; }

/* ---------- chat ---------- */
.chat { display: flex; flex-direction: column; gap: 8px; min-height: 280px; max-height: 58vh; overflow-y: auto; padding: 4px 2px 8px; }
.msg { max-width: 86%; padding: 9px 13px; border-radius: 18px; white-space: pre-wrap; font-size: .93rem; }
.msg.bot { background: var(--soft); align-self: flex-start; border-bottom-left-radius: 6px; }
.msg.yo { background: var(--brand); color: #fff; align-self: flex-end; border-bottom-right-radius: 6px; }
@media (prefers-color-scheme: dark) { .msg.yo { color: #0E1A1F; } }
.msg .quien { display: block; font-size: .72rem; font-weight: 800; color: var(--pink); margin-bottom: 2px; }
.sugerencias { display: flex; gap: 6px; flex-wrap: wrap; margin: 6px 0 10px; }
.sugerencias button { padding: 7px 12px; border-radius: 999px; border: 1.5px solid var(--brand); background: transparent; color: var(--brand); font-weight: 700;
  font-size: .82rem; cursor: pointer; text-align: left; }
.escribir { display: flex; gap: 8px; }

/* ---------- auth ---------- */
.auth { max-width: 440px; margin: 2vh auto; }
.auth-hero { text-align: center; padding: 26px 10px 8px; }
.auth-hero img { border-radius: 22px; box-shadow: 0 14px 34px rgba(14,122,92,.35); }
.auth-hero h1 { font-size: 1.9rem; margin: 14px 0 4px; }
.beneficios { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin: 14px 0 18px; text-align: center; font-size: .75rem; font-weight: 700; color: var(--muted); }
.beneficios span { display: block; font-size: 1.5rem; }

/* ---------- modal y aviso ---------- */
dialog { border: 0; border-radius: 24px; padding: 20px; width: min(560px, calc(100vw - 20px)); max-height: 92vh; overflow-y: auto; background: var(--card);
  color: var(--text); box-shadow: 0 30px 80px rgba(0,0,0,.35); }
dialog::backdrop { background: rgba(14,26,31,.5); backdrop-filter: blur(3px); }
@media (max-width: 560px) { dialog { margin: auto 0 0; width: 100vw; max-width: 100vw; border-radius: 24px 24px 0 0; padding-bottom: calc(20px + env(safe-area-inset-bottom)); } }
.modal-cab { display: flex; justify-content: space-between; align-items: center; margin-bottom: 6px; }
.modal-cab h2 { margin: 0; }
.cerrar { width: 36px; height: 36px; border-radius: 50%; border: 0; background: var(--soft); cursor: pointer; font-size: 1rem; }
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; max-width: 92vw;
  background: var(--text); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; box-shadow: 0 10px 30px rgba(0,0,0,.25); }
.exito { text-align: center; padding: 10px 0 4px; }
.exito .big { font-size: 3.4rem; display: block; animation: pop .4s ease-out; }
@keyframes pop { from { transform: scale(.4); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.estrellas { display: flex; gap: 6px; font-size: 2rem; justify-content: center; }
.estrellas button { background: none; border: 0; cursor: pointer; filter: grayscale(1); opacity: .45; font-size: inherit; padding: 0 2px; }
.estrellas button.on { filter: none; opacity: 1; }
.resena { padding: 10px 0; border-top: 1px solid var(--line); }
.resena:first-child { border-top: 0; }
.respuesta { margin-top: 6px; padding: 8px 10px; border-left: 3px solid var(--brand); background: var(--soft); border-radius: 0 10px 10px 0; font-size: .87rem; }
.skeleton { height: 80px; border-radius: var(--radius); background: linear-gradient(90deg, var(--soft), var(--line), var(--soft)); background-size: 200% 100%;
  animation: brillo 1.2s infinite; margin-bottom: 12px; }
@keyframes brillo { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; } }
