
/* Layout: app de una columna (máx. 480px) pensada para el celular. Barra de pestañas abajo; el formulario de producto es una sola pantalla con barra de acción propia. */
:root {
  --bg: #FBF5F7;
  --surface: #FFFFFF;
  --ink: #2B1830;
  --muted: #6F6475;
  --line: #EBDDE4;
  --accent: #B8325F;
  --on-accent: #FFFFFF;
  --accent-soft: #F8E1EA;
  --good: #2A7552;
  --good-soft: #DDF1E7;
  --warn: #8F5206;
  --warn-soft: #FBEBD0;
  --tile-s: 70%;
  --tile-l: 88%;
  --shadow: 0 1px 2px rgb(43 24 48 / .06), 0 6px 18px rgb(43 24 48 / .06);
  --font-display: "Bricolage Grotesque", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
  --font-body: "Figtree", "Avenir Next", "Helvetica Neue", Arial, sans-serif;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #1A1220; --surface: #261A2D; --ink: #F6EAF1; --muted: #B7A6BE; --line: #3A2A44;
    --accent: #F07AA3; --on-accent: #2B1830; --accent-soft: #46223A;
    --good: #6FD0A2; --good-soft: #1F3A2E; --warn: #F0B964; --warn-soft: #403016;
    --tile-s: 30%; --tile-l: 26%; --shadow: 0 1px 2px rgb(0 0 0 / .4);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #1A1220; --surface: #261A2D; --ink: #F6EAF1; --muted: #B7A6BE; --line: #3A2A44;
  --accent: #F07AA3; --on-accent: #2B1830; --accent-soft: #46223A;
  --good: #6FD0A2; --good-soft: #1F3A2E; --warn: #F0B964; --warn-soft: #403016;
  --tile-s: 30%; --tile-l: 26%; --shadow: 0 1px 2px rgb(0 0 0 / .4);
  color-scheme: dark;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
  background: var(--bg); color: var(--ink);
  font: 400 16px/1.45 var(--font-body);
  padding-left: max(16px, env(safe-area-inset-left, 0px));
  padding-right: max(16px, env(safe-area-inset-right, 0px));
  -webkit-tap-highlight-color: transparent;
}
body::before { content: ""; position: fixed; inset: 0 0 auto; height: env(safe-area-inset-top, 0px); z-index: 30; background: var(--bg); }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.app { max-width: 480px; margin: 0 auto; padding-bottom: 104px; }
h1, h2, h3 { font-family: var(--font-display); margin: 0; letter-spacing: -.01em; text-wrap: balance; }
.num { font-variant-numeric: tabular-nums; }

/* encabezado */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20; background: var(--bg); display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 14px 0 10px; }
.brand { font: 700 22px/1 var(--font-display); letter-spacing: -.02em; }
.brand small { display: block; font: 500 12px/1.3 var(--font-body); color: var(--muted); letter-spacing: 0; margin-top: 4px; }
.link { background: none; border: 0; color: var(--accent); font-weight: 600; padding: 10px 4px; min-height: 44px; }
.pill-demo { font-size: 12px; font-weight: 600; background: var(--warn-soft); color: var(--warn); padding: 4px 10px; border-radius: 99px; white-space: nowrap; }

/* tarjetas y secciones */
.sec { margin-top: 22px; }
.sec > h2 { font-size: 19px; margin-bottom: 10px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; padding: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.hero { padding: 18px 16px; }
.hero h1 { font-size: 26px; line-height: 1.1; }
.bar { height: 8px; border-radius: 99px; background: var(--accent-soft); overflow: hidden; margin: 14px 0 4px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 99px; transition: width .3s; }

.check { list-style: none; margin: 0; padding: 0; }
.check li { display: grid; grid-template-columns: 28px 1fr; gap: 12px; padding: 14px 0; border-top: 1px solid var(--line); align-items: start; }
.check li:first-child { border-top: 0; }
.dot { width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; margin-top: 1px; background: var(--warn-soft); color: var(--warn); font-weight: 700; font-size: 14px; }
.dot.ok { background: var(--good-soft); color: var(--good); }
.check b { display: block; font-weight: 600; }
.tag { display: inline-block; font-size: 12px; font-weight: 600; color: var(--muted); border: 1px solid var(--line); border-radius: 99px; padding: 2px 9px; margin-top: 6px; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 18px; border-radius: 14px; border: 1.5px solid var(--accent); background: var(--accent); color: var(--on-accent); font-weight: 700; }
.btn.ghost { background: transparent; color: var(--accent); }
.btn.sm { min-height: 40px; padding: 0 14px; font-size: 14px; border-radius: 12px; margin-top: 8px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.quick { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.quick button { text-align: left; background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 6px; min-height: 92px; align-content: start; }
.quick svg { color: var(--accent); }
.quick b { font-weight: 600; }
.empty { text-align: center; padding: 26px 16px; }
.empty svg { color: var(--accent); margin-bottom: 8px; }

/* productos */
.search { width: 100%; min-height: 48px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 0 14px 0 42px; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='20' height='20' viewBox='0 0 24 24' fill='none' stroke='%23999' stroke-width='2' stroke-linecap='round'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath d='m20 20-3.5-3.5'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: 13px center; }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 10px 0 4px; margin-inline: -2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip { flex: none; min-height: 40px; padding: 0 14px; border-radius: 99px; border: 1px solid var(--line); background: var(--surface); font-weight: 500; font-size: 14px; white-space: nowrap; }
.chip[aria-pressed="true"], .chip.on { background: var(--accent); border-color: var(--accent); color: var(--on-accent); font-weight: 600; }
.chip.warn[aria-pressed="true"] { background: var(--warn); border-color: var(--warn); color: var(--surface); }
.list { margin-top: 8px; display: grid; gap: 0; }
.row { display: grid; grid-template-columns: 52px 1fr auto; gap: 12px; align-items: center; padding: 11px 0; border-top: 1px solid var(--line); }
.row:first-child { border-top: 0; }
.tile { width: 52px; height: 52px; border-radius: 14px; display: grid; place-items: center; background: hsl(var(--h) var(--tile-s) var(--tile-l)); color: hsl(var(--h) 45% 38%); }
:root[data-theme="dark"] .tile { color: hsl(var(--h) 60% 75%); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .tile { color: hsl(var(--h) 60% 75%); } }
.row .nm { font-weight: 600; line-height: 1.25; overflow-wrap: anywhere; }
.row .meta { font-size: 13px; color: var(--muted); }
.price { min-height: 44px; min-width: 84px; border: 1px solid var(--line); background: var(--surface); border-radius: 12px; padding: 0 10px; font-weight: 600; text-align: right; }
.price.prov { border-color: var(--warn); color: var(--warn); background: var(--warn-soft); }
.price small { display: block; font-size: 11px; font-weight: 600; line-height: 1.1; }
.editrow { grid-column: 1 / -1; display: flex; gap: 8px; align-items: center; padding-top: 4px; }
.editrow input { flex: 1; min-width: 0; }
.count { font-size: 13px; color: var(--muted); margin-top: 10px; }

/* formulario */
.field { margin-top: 20px; }
.field > label, .lbl { display: block; font-weight: 600; margin-bottom: 8px; }
.hint { font-size: 13px; color: var(--muted); margin-top: 6px; }
.inp { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface); padding: 0 14px; }
textarea.inp { padding: 12px 14px; min-height: 96px; resize: vertical; }
.money { position: relative; }
.money span { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--muted); font-weight: 600; }
.money .inp { padding-left: 34px; font-weight: 600; font-size: 18px; }
.photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.ph { position: relative; aspect-ratio: 1; border-radius: 16px; overflow: hidden; background: var(--surface); border: 1px solid var(--line); }
.ph img { width: 100%; height: 100%; object-fit: cover; display: block; }
.ph .x { position: absolute; top: 6px; right: 6px; width: 32px; height: 32px; border-radius: 50%; border: 0; background: rgb(0 0 0 / .6); color: #fff; font-size: 18px; line-height: 1; }
.ph .main { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 700; background: var(--accent); color: var(--on-accent); border-radius: 99px; padding: 2px 8px; }
.add { aspect-ratio: 1; border-radius: 16px; border: 2px dashed var(--accent); background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; align-content: center; gap: 4px; font-weight: 600; font-size: 13px; text-align: center; padding: 6px; }
.add.big { grid-column: 1 / -1; aspect-ratio: auto; min-height: 120px; font-size: 15px; }
.sw { display: flex; align-items: center; justify-content: space-between; gap: 12px; min-height: 52px; padding: 8px 14px; background: var(--surface); border: 1px solid var(--line); border-radius: 14px; }
.sw b { font-weight: 600; display: block; }
.toggle { appearance: none; width: 50px; height: 30px; border-radius: 99px; background: var(--line); position: relative; flex: none; border: 0; cursor: pointer; transition: background .2s; }
.toggle::after { content: ""; position: absolute; top: 3px; left: 3px; width: 24px; height: 24px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgb(0 0 0 / .3); transition: transform .2s; }
.toggle:checked { background: var(--accent); }
.toggle:checked::after { transform: translateX(20px); }
.sub { margin-top: 10px; padding: 14px; border-radius: 14px; background: var(--accent-soft); display: grid; gap: 12px; }
.vals { display: flex; flex-wrap: wrap; gap: 8px; }
.val { display: inline-flex; align-items: center; gap: 4px; min-height: 36px; padding: 0 6px 0 12px; border-radius: 99px; background: var(--surface); border: 1px solid var(--line); font-weight: 500; }
.val button { border: 0; background: none; width: 28px; height: 28px; border-radius: 50%; color: var(--muted); font-size: 18px; line-height: 1; }
.inline { display: flex; gap: 8px; }
.inline .inp { min-width: 0; }
.vt { display: grid; gap: 8px; }
.vr { display: grid; grid-template-columns: 1fr 1fr 78px; gap: 8px; align-items: center; }
.vr b { grid-column: 1 / -1; font-weight: 600; }
.vr .inp { min-height: 44px; padding: 0 10px; }
.sku { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 50px; padding: 0 14px; border-radius: 14px; border: 1px dashed var(--line); background: var(--surface); }
.sku code { font: 700 16px/1 var(--font-body); letter-spacing: .04em; }
.preview { display: grid; grid-template-columns: 96px 1fr; gap: 14px; align-items: center; }
.preview .pimg { aspect-ratio: 1; border-radius: 14px; background: var(--accent-soft); overflow: hidden; display: grid; place-items: center; color: var(--accent); }
.preview .pimg img { width: 100%; height: 100%; object-fit: cover; }
.preview h3 { font-size: 17px; line-height: 1.2; overflow-wrap: anywhere; }
.preview .pp { font-weight: 700; margin-top: 4px; }
.preview .pp s { color: var(--muted); font-weight: 400; margin-left: 6px; }
.actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line); padding: 10px max(16px, env(safe-area-inset-left, 0px)) calc(10px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.actions > div { max-width: 480px; margin: 0 auto; display: grid; gap: 8px; }
.actions .two { display: grid; grid-template-columns: 1fr 1.4fr; gap: 10px; }
.missing { font-size: 13px; color: var(--muted); text-align: center; min-height: 18px; }
.app.form { padding-bottom: 170px; }

/* pestañas */
.tabs { position: fixed; left: 0; right: 0; bottom: 0; z-index: 25; background: var(--surface); border-top: 1px solid var(--line); padding: 6px max(16px, env(safe-area-inset-left, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-right, 0px)); }
.tabs > div { max-width: 480px; margin: 0 auto; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; }
.tab { border: 0; background: none; min-height: 54px; border-radius: 14px; display: grid; justify-items: center; align-content: center; gap: 2px; font-size: 12px; font-weight: 600; color: var(--muted); }
.tab[aria-current="page"] { color: var(--accent); background: var(--accent-soft); }
.tab.plus { color: var(--on-accent); background: var(--accent); }

/* aviso y confirmación */
.toast { position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom, 0px)); transform: translate(-50%, 20px); opacity: 0; pointer-events: none; z-index: 40; background: var(--ink); color: var(--bg); padding: 12px 18px; border-radius: 14px; font-weight: 600; font-size: 14px; max-width: calc(100% - 32px); text-align: center; transition: opacity .2s, transform .2s; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.scrim { position: fixed; inset: 0; z-index: 50; background: rgb(20 8 24 / .55); display: grid; align-items: end; padding: 0 max(16px, env(safe-area-inset-left, 0px)) 0 max(16px, env(safe-area-inset-right, 0px)); }
.sheet { max-width: 480px; width: 100%; margin: 0 auto; background: var(--surface); border-radius: 24px 24px 0 0; padding: 24px 20px calc(24px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 12px; text-align: center; }
.sheet h2 { font-size: 24px; }
.sheet .okmark { width: 56px; height: 56px; border-radius: 50%; background: var(--good-soft); color: var(--good); display: grid; place-items: center; margin: 0 auto; }
@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

/* conexión y estados */
.tile img { width: 100%; height: 100%; object-fit: cover; border-radius: 14px; display: block; }
.connect { max-width: 480px; margin: 0 auto; padding: 28px 0 40px; display: grid; gap: 16px; }
.connect h1 { font-size: 30px; line-height: 1.1; }
.connect details { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; padding: 4px 16px 16px; }
.connect summary { min-height: 48px; display: flex; align-items: center; font-weight: 600; cursor: pointer; }
.connect .field { margin-top: 14px; }
.err { background: var(--warn-soft); color: var(--warn); border-radius: 14px; padding: 12px 14px; font-size: 14px; font-weight: 500; overflow-wrap: anywhere; }
.loading { text-align: center; padding: 36px 0; color: var(--muted); }
.banner { background: var(--warn-soft); color: var(--warn); border-radius: 14px; padding: 10px 14px; font-size: 13px; font-weight: 500; margin-top: 4px; display: flex; gap: 10px; align-items: center; justify-content: space-between; }
.banner button { border: 0; background: none; color: inherit; font-weight: 700; text-decoration: underline; min-height: 36px; }
.steps { margin: 0; padding: 0; list-style: none; text-align: left; display: grid; gap: 8px; font-size: 14px; }
.steps li { color: var(--muted); } .steps li.on { color: var(--ink); font-weight: 600; } .steps li.done { color: var(--good); }

/* logo */
.brand { display: flex; align-items: center; gap: 10px; }
.brand img { border-radius: 12px; background: #fff; border: 1px solid var(--line); flex: none; }
.logo-card { background: #fff; border: 1px solid var(--line); border-radius: 22px; padding: 18px 22px; display: grid; place-items: center; }
.logo-card img { width: 100%; max-width: 320px; height: auto; display: block; }

/* selector de sitio y Studio */
.connect .brand { font-family: var(--font-display); font-weight: 700; letter-spacing: -.02em; }
.sites { display: grid; gap: 14px; }
.site-card { background: var(--surface); border: 1px solid var(--line); border-radius: 20px; padding: 14px; display: grid; gap: 12px; }
.site-logo { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 10px 14px; display: grid; place-items: center; }
.site-logo img { height: 84px; width: auto; max-width: 100%; object-fit: contain; display: block; }
.site-info { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; }
.site-info b { font-family: var(--font-display); font-size: 18px; flex-basis: 100%; }
.site-info .small { flex-basis: 100%; margin-top: -4px; }
.badge { font-size: 12px; font-weight: 600; border-radius: 99px; padding: 3px 10px; background: var(--accent-soft); color: var(--accent); }
.badge.ok { background: var(--good-soft); color: var(--good); }
.site-act { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.site-act .btn { flex: 1; }
.notice { background: var(--warn-soft); color: var(--warn); border-radius: 14px; padding: 12px 14px; display: grid; gap: 4px; font-size: 14px; margin-top: 8px; }
.notice b { font-weight: 700; }
.rowbtn { width: 100%; border: 0; border-top: 1px solid var(--line); background: none; text-align: left; min-height: 72px; cursor: pointer; }
.list .rowbtn:first-child { border-top: 0; }
.chev { font-size: 28px; color: var(--muted); padding: 0 4px; }

/* logos en el encabezado de cada sitio */
.logo-pill { background: #fff; border: 1px solid var(--line); border-radius: 14px; padding: 4px 12px; display: inline-grid; place-items: center; }
.logo-pill img { height: 42px; width: auto; max-width: 150px; object-fit: contain; display: block; border: 0; background: none; border-radius: 0; }
