/* Comanda: sitio público, tiendas y herramientas. Sin fuentes externas (carga rápida con señal débil). */
:root {
  --brand: #C2410C; --brand-ink: #9A3412; --brand-soft: #FFF1E7;
  --ink: #1C1917; --muted: #57534E; --line: #E7E0D6; --bg: #FFFBF5; --card: #FFFFFF;
  --ok: #15803D; --ok-soft: #E8F6EC; --warn: #A16207; --warn-soft: #FEF6DD; --danger: #B91C1C; --danger-soft: #FDECEC;
  --radius: 14px; --shadow: 0 1px 2px rgba(28,25,23,.06), 0 4px 16px rgba(28,25,23,.06);
  color-scheme: light;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.55 system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif; }
img { max-width: 100%; display: block; }
a { color: var(--brand-ink); }
h1, h2, h3 { line-height: 1.15; letter-spacing: -.02em; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.8rem, 5vw, 2.8rem); }
h2 { font-size: clamp(1.35rem, 3.4vw, 1.9rem); }
h3 { font-size: 1.1rem; }
p { margin: 0 0 1rem; }
.wrap { max-width: 1080px; margin: 0 auto; padding: 0 16px; }
.narrow { max-width: 760px; }
.muted { color: var(--muted); }
.small { font-size: .88rem; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 3px solid #2563EB; outline-offset: 2px; }

/* Encabezado y pie del sitio */
.site-head { background: var(--card); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.site-head .wrap { display: flex; align-items: center; gap: 12px; min-height: 60px; }
.logo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 1.3rem; letter-spacing: -.04em; color: var(--ink); text-decoration: none; }
.logo svg { width: 28px; height: 28px; }
.site-nav { margin-left: auto; display: flex; gap: 4px; align-items: center; flex-wrap: wrap; }
.site-nav a { color: var(--ink); text-decoration: none; padding: 8px 10px; border-radius: 10px; font-weight: 600; font-size: .95rem; }
.site-nav a:hover { background: var(--brand-soft); }
.site-nav .hide-sm { display: none; }
@media (min-width: 720px) { .site-nav .hide-sm { display: inline-block; } }
.site-foot { border-top: 1px solid var(--line); margin-top: 48px; padding: 28px 0 40px; color: var(--muted); font-size: .92rem; }
.site-foot nav { display: flex; flex-wrap: wrap; gap: 6px 18px; margin-bottom: 10px; }
.site-foot a { color: var(--muted); }

/* Botones */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 10px 18px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--ink); font: inherit; font-weight: 700; text-decoration: none; cursor: pointer; }
.btn:hover { border-color: #CFC5B7; }
.btn.primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn.primary:hover { background: var(--brand-ink); }
.btn.block { width: 100%; }
.btn.small { min-height: 36px; padding: 6px 12px; font-size: .9rem; }
.btn[disabled] { opacity: .55; cursor: not-allowed; }
.btn.ghost { background: transparent; border-color: transparent; }

/* Secciones del sitio */
.hero { padding: 48px 0 32px; }
.hero .lead { font-size: 1.15rem; color: var(--muted); max-width: 44rem; }
.hero .ctas { display: flex; flex-wrap: wrap; gap: 10px; margin: 20px 0 8px; }
.section { padding: 36px 0; }
.grid { display: grid; gap: 16px; }
@media (min-width: 720px) { .grid.c2 { grid-template-columns: repeat(2, 1fr); } .grid.c3 { grid-template-columns: repeat(3, 1fr); } }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.steps { counter-reset: s; list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 16px 16px 60px; position: relative; }
.steps li::before { content: counter(s); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: #fff; display: grid; place-items: center; font-weight: 800; }
.check { list-style: none; padding: 0; margin: 0 0 1rem; }
.check li { padding-left: 26px; position: relative; margin: 6px 0; }
.check li::before { content: ""; position: absolute; left: 4px; top: .45em; width: 12px; height: 7px; border-left: 3px solid var(--ok); border-bottom: 3px solid var(--ok); transform: rotate(-45deg); }
.price { font-size: 2.2rem; font-weight: 800; letter-spacing: -.03em; }
.price small { font-size: 1rem; font-weight: 600; color: var(--muted); }
.plan.featured { border: 2px solid var(--brand); }
.tag { display: inline-block; padding: 2px 10px; border-radius: 99px; font-size: .78rem; font-weight: 700; background: var(--brand-soft); color: var(--brand-ink); }
.note { background: var(--warn-soft); border: 1px solid #F3E2B3; border-radius: 12px; padding: 12px 14px; font-size: .94rem; }
details.faq { background: var(--card); border: 1px solid var(--line); border-radius: 12px; padding: 12px 16px; margin: 8px 0; }
details.faq summary { font-weight: 700; cursor: pointer; }
.crumbs { font-size: .9rem; margin: 16px 0 0; color: var(--muted); }
.crumbs a { color: var(--muted); }

/* Formularios */
label.f { display: block; margin: 0 0 12px; font-weight: 600; }
label.f > span { display: block; margin-bottom: 4px; }
input, select, textarea { width: 100%; font: inherit; padding: 10px 12px; border: 1px solid #CFC5B7; border-radius: 10px; background: #fff; color: var(--ink); min-height: 44px; }
textarea { min-height: 80px; resize: vertical; }
.row { display: flex; gap: 10px; flex-wrap: wrap; }
.row > * { flex: 1 1 140px; }
.choices { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.choice { display: inline-flex; align-items: center; gap: 8px; border: 1px solid #CFC5B7; border-radius: 10px; padding: 8px 12px; background: #fff; cursor: pointer; font-weight: 600; min-height: 44px; }
.choice input { width: auto; min-height: 0; margin: 0; }
.choice:has(input:checked) { border-color: var(--brand); background: var(--brand-soft); }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.error { background: var(--danger-soft); color: var(--danger); border-radius: 10px; padding: 10px 12px; margin: 8px 0; font-weight: 600; }
table.calc { width: 100%; border-collapse: collapse; font-size: .95rem; }
table.calc th, table.calc td { border-bottom: 1px solid var(--line); padding: 6px 4px; text-align: left; vertical-align: middle; }
table.calc input { min-height: 38px; padding: 6px 8px; }
.result { background: var(--ok-soft); border-radius: 12px; padding: 14px; font-weight: 600; }
.result strong { font-size: 1.4rem; display: block; }

/* Tienda pública */
.store-cover { height: 160px; background: linear-gradient(135deg, var(--theme, var(--brand)), #1C1917); background-size: cover; background-position: center; }
@media (min-width: 720px) { .store-cover { height: 220px; } }
.store-head { position: relative; margin-top: -44px; display: flex; gap: 14px; align-items: flex-end; }
.store-logo { width: 88px; height: 88px; border-radius: 20px; border: 4px solid #fff; background: #fff; object-fit: cover; box-shadow: var(--shadow); flex: none; display: grid; place-items: center; font-weight: 800; font-size: 2rem; color: var(--theme, var(--brand)); }
.store-title { padding-bottom: 4px; }
.store-title h1 { font-size: clamp(1.5rem, 4.5vw, 2.2rem); margin: 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; margin: 12px 0; }
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 10px; border-radius: 99px; background: #F5F0E8; font-size: .86rem; font-weight: 600; }
.chip.ok { background: var(--ok-soft); color: var(--ok); }
.chip.off { background: var(--danger-soft); color: var(--danger); }
.catnav { position: sticky; top: 0; z-index: 10; background: var(--bg); border-bottom: 1px solid var(--line); overflow-x: auto; white-space: nowrap; scrollbar-width: none; }
.catnav a { display: inline-block; padding: 12px 12px; color: var(--ink); text-decoration: none; font-weight: 700; font-size: .95rem; }
.catnav a:hover { color: var(--theme, var(--brand)); }
.menu-section { padding-top: 18px; scroll-margin-top: 50px; }
.products { display: grid; gap: 10px; }
@media (min-width: 760px) { .products { grid-template-columns: repeat(2, 1fr); } }
.product { display: flex; gap: 12px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; align-items: stretch; }
.product .info { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.product h3 { margin: 0 0 4px; font-size: 1.02rem; }
.product .desc { color: var(--muted); font-size: .9rem; margin: 0 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.product .foot { margin-top: auto; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product .pp { font-weight: 800; }
.product img { width: 96px; height: 96px; border-radius: 12px; object-fit: cover; flex: none; }
.product .add { background: var(--theme, var(--brand)); border-color: var(--theme, var(--brand)); color: #fff; }
.product.soldout { opacity: .6; }
.cartbar { position: fixed; left: 0; right: 0; bottom: 0; padding: 10px 16px calc(10px + env(safe-area-inset-bottom)); background: linear-gradient(transparent, var(--bg) 30%); z-index: 30; }
.cartbar .btn { width: 100%; max-width: 560px; margin: 0 auto; display: flex; justify-content: space-between; background: var(--theme, var(--brand)); border-color: var(--theme, var(--brand)); color: #fff; min-height: 52px; font-size: 1.05rem; }
dialog.sheet { border: none; padding: 0; border-radius: 18px 18px 0 0; width: 100%; max-width: 560px; max-height: 92dvh; margin: auto auto 0; background: var(--card); color: var(--ink); }
@media (min-width: 720px) { dialog.sheet { border-radius: 18px; margin: auto; } }
dialog.sheet::backdrop { background: rgba(28,25,23,.5); }
.sheet-head { display: flex; align-items: center; justify-content: space-between; padding: 14px 16px; border-bottom: 1px solid var(--line); position: sticky; top: 0; background: var(--card); z-index: 1; }
.sheet-head h2 { font-size: 1.15rem; margin: 0; }
.sheet-body { padding: 16px; }
.sheet-foot { padding: 12px 16px calc(12px + env(safe-area-inset-bottom)); border-top: 1px solid var(--line); position: sticky; bottom: 0; background: var(--card); }
.optgroup { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; margin: 0 0 12px; }
.optgroup legend { font-weight: 700; padding: 0 4px; }
.opt { display: flex; align-items: center; gap: 10px; padding: 8px 0; border-bottom: 1px dashed var(--line); }
.opt:last-child { border-bottom: none; }
.opt input { width: 20px; height: 20px; min-height: 0; flex: none; }
.opt span:first-of-type { flex: 1; }
.qty { display: inline-flex; align-items: center; border: 1px solid #CFC5B7; border-radius: 12px; overflow: hidden; }
.qty button { width: 44px; height: 44px; border: none; background: #fff; font-size: 1.3rem; cursor: pointer; }
.qty output { min-width: 36px; text-align: center; font-weight: 800; }
.line { display: flex; gap: 10px; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.line .lt { font-weight: 700; white-space: nowrap; }
.totals { margin: 12px 0; }
.totals div { display: flex; justify-content: space-between; padding: 2px 0; }
.totals .grand { font-weight: 800; font-size: 1.15rem; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.demo-bar { background: #1C1917; color: #FFFBF5; text-align: center; padding: 8px 16px; font-size: .9rem; }
.demo-bar a { color: #FDBA74; }
.closed-bar { background: var(--warn-soft); border-bottom: 1px solid #F3E2B3; padding: 10px 16px; text-align: center; font-weight: 600; }
.status-steps { list-style: none; padding: 0; margin: 16px 0; }
.status-steps li { padding: 8px 0 8px 30px; position: relative; color: var(--muted); }
.status-steps li::before { content: ""; position: absolute; left: 6px; top: 13px; width: 12px; height: 12px; border-radius: 50%; border: 2px solid #CFC5B7; background: #fff; }
.status-steps li.done { color: var(--ink); font-weight: 600; }
.status-steps li.done::before { background: var(--ok); border-color: var(--ok); }
.status-steps li.current::before { box-shadow: 0 0 0 4px var(--ok-soft); }
.big-status { font-size: 1.6rem; font-weight: 800; }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
