/* =========================================================
   SANTA ELENA MARKET — estilos (mobile-first)
   ========================================================= */
:root {
  --bg: #070b16;
  --surface: #0f1524;
  --surface-2: #161e33;
  --surface-3: #1d2740;
  --line: rgba(148, 163, 184, .12);
  --text: #f1f5f9;
  --text-2: #a5b1c6;
  --text-3: #6b7894;
  --primary: #2f7bff;
  --primary-2: #1f63e0;
  --primary-soft: rgba(47, 123, 255, .14);
  --success: #16c784;
  --success-soft: rgba(22, 199, 132, .14);
  --warn: #f5a524;
  --danger: #f04452;
  --wa: #25d366;
  --radius: 16px;
  --radius-sm: 12px;
  --shadow: 0 10px 30px rgba(0, 0, 0, .35);
  --tabbar-h: 64px;
  --top-h: 56px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  color-scheme: dark;
}
:root[data-theme="light"] {
  --bg: #f3f5f9;
  --surface: #ffffff;
  --surface-2: #f1f4f9;
  --surface-3: #e5eaf2;
  --line: rgba(15, 23, 42, .08);
  --text: #0f172a;
  --text-2: #475569;
  --text-3: #8592a6;
  --primary-soft: rgba(47, 123, 255, .1);
  --shadow: 0 10px 30px rgba(15, 23, 42, .1);
  color-scheme: light;
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body {
  font-family: 'Inter', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  min-height: 100dvh;
  overscroll-behavior-y: none;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
input, select, textarea { font: inherit; color: inherit; }
img { display: block; max-width: 100%; }
.ic { width: 22px; height: 22px; flex-shrink: 0; }
.ic.sm { width: 16px; height: 16px; }
.ic.xs { width: 13px; height: 13px; }
.ic.lg { width: 28px; height: 28px; }
.hidden { display: none !important; }
.muted { color: var(--text-2); }
.tiny { font-size: 12px; color: var(--text-3); }

/* ---------- Splash ---------- */
#splash {
  position: fixed; inset: 0; z-index: 99999; background: var(--bg);
  display: grid; place-items: center; transition: opacity .35s ease, visibility .35s;
}
#splash.out { opacity: 0; visibility: hidden; }
.splash-logo { display: grid; justify-items: center; gap: 14px; animation: pop .6s ease; }
.splash-logo .mark { width: 76px; height: 76px; border-radius: 22px; }
.splash-logo .mark .ic { width: 40px; height: 40px; }
.splash-logo b { font-size: 20px; letter-spacing: -.3px; }
@keyframes pop { from { transform: scale(.85); opacity: 0; } to { transform: none; opacity: 1; } }

/* ---------- Marca ---------- */
.mark {
  width: 36px; height: 36px; border-radius: 11px; display: grid; place-items: center; color: var(--primary);
  background: #fff; border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 4px 14px rgba(47, 123, 255, .18);
}
.mark .ic { width: 20px; height: 20px; }
.mark .logo-ic, .splash-logo .mark .ic, .auth-hero .mark .ic { width: 78%; height: 78%; }

/* ---------- Top bar ---------- */
.topbar {
  position: sticky; top: 0; z-index: 50;
  padding: calc(8px + var(--safe-t)) 16px 8px;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(160%) blur(14px);
  -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.topbar.scrolled { border-bottom-color: var(--line); }
.topbar-row { display: flex; align-items: center; gap: 10px; min-height: 40px; }
.topbar h1 { font-size: 17px; font-weight: 700; flex: 1; letter-spacing: -.2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.brand { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0; }
.brand-txt b { display: block; font-size: 16px; letter-spacing: -.3px; line-height: 1.1; }
.brand-txt span { font-size: 11.5px; color: var(--text-3); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 12px; display: grid; place-items: center;
  background: var(--surface); border: 1px solid var(--line); position: relative; flex-shrink: 0;
  transition: transform .12s;
}
.icon-btn:active { transform: scale(.92); }
.icon-btn.ghost { background: transparent; border-color: transparent; }
.dot-badge {
  position: absolute; top: -4px; right: -4px; min-width: 18px; height: 18px; padding: 0 5px;
  border-radius: 9px; background: var(--danger); color: #fff; font-size: 10.5px; font-weight: 700;
  display: grid; place-items: center; border: 2px solid var(--bg);
}

/* Buscador */
.searchbar {
  display: flex; align-items: center; gap: 10px; height: 46px; padding: 0 14px; margin-top: 10px;
  border-radius: 14px; background: var(--surface); border: 1px solid var(--line); color: var(--text-3);
}
.searchbar input { flex: 1; background: transparent; border: 0; outline: 0; color: var(--text); font-size: 15px; min-width: 0; }
.searchbar input::placeholder { color: var(--text-3); }
.searchbar .filter-btn { color: var(--text-2); display: grid; place-items: center; height: 32px; width: 32px; border-radius: 9px; }
.searchbar:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }

/* ---------- Vistas ---------- */
#view { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 24px); min-height: 100dvh; }
.page { padding: 4px 16px 0; animation: fadeIn .22s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.section { margin-top: 24px; }
.section-head { display: flex; align-items: flex-end; justify-content: space-between; margin-bottom: 12px; gap: 12px; }
.section-head h2 { font-size: 18px; font-weight: 700; letter-spacing: -.3px; }
.section-head .kicker { display: block; font-size: 11px; font-weight: 700; letter-spacing: .8px; color: var(--primary); text-transform: uppercase; margin-bottom: 2px; }
.link { color: var(--primary); font-size: 13.5px; font-weight: 600; display: inline-flex; align-items: center; gap: 2px; white-space: nowrap; }

/* ---------- Banners ---------- */
.banners { display: flex; gap: 12px; overflow-x: auto; scroll-snap-type: x mandatory; margin: 14px -16px 0; padding: 0 16px; scrollbar-width: none; }
.banners::-webkit-scrollbar, .hscroll::-webkit-scrollbar, .chips::-webkit-scrollbar { display: none; }
.banner {
  position: relative; flex: 0 0 100%; height: 172px; border-radius: 20px; overflow: hidden; scroll-snap-align: center;
  background: var(--surface-2); color: #fff; cursor: pointer;
}
.banner img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner.plain::after { background: radial-gradient(circle at 85% 30%, rgba(255,255,255,.18), transparent 55%); }
.banner-icon { position: absolute; right: -10px; bottom: -18px; color: rgba(255,255,255,.22); z-index: 1; }
.banner-icon .ic { width: 150px; height: 150px; stroke-width: 1.4; }
.banner::after { content: ''; position: absolute; inset: 0; background: linear-gradient(90deg, rgba(5, 10, 25, .92) 0%, rgba(5, 10, 25, .55) 55%, rgba(5, 10, 25, .1) 100%); }
.banner-body { position: relative; z-index: 1; padding: 18px; height: 100%; display: flex; flex-direction: column; justify-content: flex-end; max-width: 78%; }
.banner-kicker { align-self: flex-start; font-size: 10.5px; font-weight: 700; letter-spacing: .6px; text-transform: uppercase; padding: 4px 9px; border-radius: 20px; background: rgba(255, 255, 255, .16); backdrop-filter: blur(6px); margin-bottom: 8px; }
.banner h3 { font-size: 20px; line-height: 1.15; letter-spacing: -.4px; }
.banner p { font-size: 12.5px; opacity: .85; margin-top: 4px; }
.banner-dots { display: flex; justify-content: center; gap: 6px; margin-top: 10px; }
.banner-dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--surface-3); transition: all .25s; }
.banner-dots i.on { width: 18px; background: var(--primary); }

/* ---------- Categorías ---------- */
.cat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px 8px; }
.cat-item { display: grid; justify-items: center; gap: 6px; text-align: center; font-size: 11.5px; font-weight: 500; color: var(--text-2); }
.cat-icon { width: 54px; height: 54px; border-radius: 16px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); transition: transform .15s; }
.cat-item:active .cat-icon { transform: scale(.92); }
.cat-icon .ic { width: 24px; height: 24px; }

.chips { display: flex; gap: 8px; overflow-x: auto; margin: 0 -16px; padding: 2px 16px; scrollbar-width: none; }
.chip {
  flex-shrink: 0; height: 36px; padding: 0 14px; border-radius: 18px; display: inline-flex; align-items: center; gap: 6px;
  background: var(--surface); border: 1px solid var(--line); font-size: 13.5px; font-weight: 500; color: var(--text-2); white-space: nowrap;
}
.chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.chip .ic { width: 16px; height: 16px; }

/* ---------- Tarjetas de producto ---------- */
.grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden;
  display: flex; flex-direction: column; position: relative; cursor: pointer; transition: transform .15s;
}
.card:active { transform: scale(.98); }
.thumb { position: relative; aspect-ratio: 1 / 1; background: var(--surface-2); overflow: hidden; }
.thumb img { width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity .3s; }
.thumb img.ok { opacity: 1; }
.thumb.shimmer::before, .img-fallback {
  content: ''; position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 20%, rgba(255, 255, 255, .05) 40%, transparent 60%) var(--surface-2);
  background-size: 200% 100%; animation: shimmer 1.3s infinite;
}
.img-fallback { display: grid; place-items: center; animation: none; color: var(--text-3); }
.img-fallback .ic { width: 38px; height: 38px; opacity: .6; }
@keyframes shimmer { to { background-position: -200% 0; } }
.fav-btn {
  position: absolute; top: 8px; right: 8px; z-index: 2; width: 34px; height: 34px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(8, 12, 24, .55); color: #fff; backdrop-filter: blur(6px);
}
.fav-btn .ic { width: 18px; height: 18px; }
.fav-btn.on { color: #ff4d6d; }
.fav-btn.on .ic path { fill: currentColor; }
.badges { position: absolute; left: 8px; top: 8px; z-index: 2; display: flex; flex-direction: column; gap: 4px; align-items: flex-start; }
.badge { font-size: 10.5px; font-weight: 700; padding: 3px 7px; border-radius: 7px; background: rgba(8, 12, 24, .65); color: #fff; backdrop-filter: blur(6px); display: inline-flex; align-items: center; gap: 3px; }
.badge.sale { background: var(--danger); }
.badge.new { background: var(--success); }
.badge.sold { background: #475569; }
.card-body { padding: 10px 12px 12px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.card-title { font-size: 13.5px; font-weight: 500; line-height: 1.3; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 35px; }
.price { font-size: 17px; font-weight: 800; letter-spacing: -.3px; }
.price.ask { font-size: 14.5px; color: var(--primary); }
.old-price { font-size: 12px; color: var(--text-3); text-decoration: line-through; font-weight: 500; margin-left: 4px; }
.meta { display: flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; }
.meta span { overflow: hidden; text-overflow: ellipsis; }
.meta .ic { width: 13px; height: 13px; }
.meta .star { color: var(--warn); }
.verified { color: var(--success); display: inline-flex; }
.price-row { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-height: 32px; }
.price-row > div { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.add-mini {
  width: 32px; height: 32px; border-radius: 10px; flex-shrink: 0;
  display: grid; place-items: center; background: var(--primary-soft); color: var(--primary); transition: transform .12s;
}
.add-mini:active { transform: scale(.88); background: var(--primary); color: #fff; }
.icon-btn.on { color: #ff4d6d; }
.icon-btn.on .ic path { fill: currentColor; }
body.has-buybar #toasts { bottom: calc(86px + var(--safe-b)); }
body.has-checkoutbar #toasts { bottom: calc(var(--tabbar-h) + var(--safe-b) + 86px); }
.add-mini .ic { width: 18px; height: 18px; }

.hscroll { display: flex; gap: 12px; overflow-x: auto; margin: 0 -16px; padding: 0 16px 4px; scroll-snap-type: x proximity; scrollbar-width: none; }
.hscroll > * { flex: 0 0 158px; scroll-snap-align: start; }

/* Reels preview */
.reel-card { flex-basis: 128px !important; height: 210px; border-radius: 16px; overflow: hidden; position: relative; background: var(--surface-2); cursor: pointer; }
.reel-card img { width: 100%; height: 100%; object-fit: cover; }
.reel-card::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .85), transparent 55%); }
.reel-card .rc-info { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 1; color: #fff; }
.reel-card .rc-info b { font-size: 12px; display: block; line-height: 1.25; }
.reel-card .rc-info span { font-size: 12px; font-weight: 800; color: #6ee7b7; }
.reel-card .rc-play { position: absolute; top: 8px; right: 8px; z-index: 1; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .5); display: grid; place-items: center; color: #fff; }
.reel-card .rc-play .ic { width: 12px; height: 12px; }

/* ---------- Botones ---------- */
.btn {
  height: 50px; padding: 0 20px; border-radius: 14px; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-weight: 650; font-size: 15px; background: var(--surface-2); border: 1px solid var(--line); transition: transform .12s, filter .15s; white-space: nowrap;
}
.btn:active { transform: scale(.97); }
.btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; box-shadow: 0 8px 20px rgba(47, 123, 255, .3); }
.btn.wa { background: var(--wa); border-color: var(--wa); color: #fff; }
.btn.danger { color: var(--danger); }
.btn.outline { background: transparent; }
.btn.block { width: 100%; }
.btn.sm { height: 38px; font-size: 13.5px; border-radius: 11px; padding: 0 14px; }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Detalle de producto ---------- */
.pd-top { position: fixed; top: 0; left: 0; right: 0; z-index: 60; display: flex; justify-content: space-between; padding: calc(10px + var(--safe-t)) 14px 10px; pointer-events: none; }
.pd-top .icon-btn { pointer-events: auto; background: rgba(8, 12, 24, .5); border-color: transparent; color: #fff; backdrop-filter: blur(10px); }
.pd-top { transition: background .2s; }
.pd-top.solid { background: color-mix(in srgb, var(--bg) 90%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom: 1px solid var(--line); }
.pd-top .right { display: flex; gap: 8px; }
.gallery { position: relative; background: var(--surface-2); }
.gallery-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-track .thumb { flex: 0 0 100%; aspect-ratio: 1 / 1; max-height: 62vh; scroll-snap-align: center; }
.gallery-count { position: absolute; right: 14px; bottom: 26px; font-size: 12px; font-weight: 600; padding: 4px 10px; border-radius: 12px; background: rgba(8, 12, 24, .6); color: #fff; }
.pd-sheet { position: relative; margin-top: -16px; background: var(--bg); border-radius: 22px 22px 0 0; padding: 20px 16px 0; }
.pd-cat { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; font-weight: 600; color: var(--primary); background: var(--primary-soft); padding: 5px 10px; border-radius: 20px; }
.pd-title { font-size: 21px; font-weight: 700; letter-spacing: -.4px; line-height: 1.25; margin: 10px 0 6px; }
.pd-rating { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--text-2); }
.stars { display: inline-flex; color: var(--warn); }
.stars .ic { width: 14px; height: 14px; }
.stars .ic path { fill: currentColor; }
.stars .off { color: var(--surface-3); }
.pd-price-box { margin-top: 14px; padding: 14px 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.pd-price { font-size: 28px; font-weight: 800; letter-spacing: -.6px; }
.pd-price .old-price { font-size: 15px; }
.save-tag { display: inline-block; margin-left: 8px; vertical-align: middle; font-size: 12px; font-weight: 700; color: var(--danger); background: rgba(240, 68, 82, .12); padding: 3px 8px; border-radius: 8px; }
.pd-perks { display: grid; gap: 8px; margin-top: 10px; font-size: 13px; color: var(--text-2); }
.pd-perks div { display: flex; gap: 8px; align-items: center; }
.pd-perks .ic { width: 17px; height: 17px; color: var(--success); }
.qty-row { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.stepper { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 12px; background: var(--surface); overflow: hidden; }
.stepper button { width: 38px; height: 38px; display: grid; place-items: center; }
.stepper button .ic { width: 16px; height: 16px; }
.stepper span { min-width: 30px; text-align: center; font-weight: 700; }
.box { margin-top: 14px; padding: 16px; border-radius: var(--radius); background: var(--surface); border: 1px solid var(--line); }
.box h3 { font-size: 15px; font-weight: 700; margin-bottom: 10px; }
.box p { font-size: 14px; color: var(--text-2); line-height: 1.6; white-space: pre-line; }
.spec { display: flex; justify-content: space-between; gap: 12px; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.spec:last-child { border-bottom: 0; padding-bottom: 0; }
.spec span:first-child { color: var(--text-3); }
.spec span:last-child { text-align: right; font-weight: 500; }
.seller-row { display: flex; align-items: center; gap: 12px; }
.avatar {
  width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: 17px; color: #fff; flex-shrink: 0;
  background: linear-gradient(135deg, #2f7bff, #7c5cff);
}
.avatar.lg { width: 72px; height: 72px; font-size: 26px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.seller-row .info { flex: 1; min-width: 0; }
.seller-row .info b { display: flex; align-items: center; gap: 5px; font-size: 15px; }
.seller-row .info b .ic { width: 16px; height: 16px; }
.seller-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 14px; text-align: center; }
.seller-stats div { background: var(--surface-2); border-radius: 12px; padding: 10px 6px; }
.seller-stats b { display: block; font-size: 15px; }
.seller-stats span { font-size: 11px; color: var(--text-3); }
.buy-bar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 70; display: flex; gap: 10px; align-items: center;
  padding: 10px 16px calc(10px + var(--safe-b)); background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line);
}
.buy-bar .btn { flex: 1; padding: 0 12px; }
.buy-bar .icon-btn { width: 50px; height: 50px; border-radius: 14px; }
.buy-bar .icon-btn.wa { background: var(--wa); color: #fff; border-color: var(--wa); }
body.has-buybar .tabbar { display: none; }
body.has-buybar #view { padding-bottom: calc(90px + var(--safe-b)); }

/* ---------- Tab bar ---------- */
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 80; height: calc(var(--tabbar-h) + var(--safe-b)); padding-bottom: var(--safe-b);
  display: grid; grid-template-columns: repeat(5, 1fr); align-items: center;
  background: color-mix(in srgb, var(--surface) 92%, transparent); backdrop-filter: saturate(160%) blur(16px); -webkit-backdrop-filter: saturate(160%) blur(16px);
  border-top: 1px solid var(--line);
}
.tab { display: grid; justify-items: center; gap: 3px; font-size: 10.5px; font-weight: 600; color: var(--text-3); position: relative; padding: 6px 0; }
.tab.on { color: var(--primary); }
.tab .ic { width: 23px; height: 23px; }
.tab .dot-badge { top: 0; right: calc(50% - 22px); border-color: var(--surface); }
.tab-sell { display: grid; justify-items: center; }
.tab-sell span {
  width: 52px; height: 52px; border-radius: 17px; display: grid; place-items: center; color: #fff; margin-top: -22px;
  background: linear-gradient(135deg, #2f7bff, #7c5cff); box-shadow: 0 10px 24px rgba(47, 123, 255, .45); border: 4px solid var(--bg);
}
.tab-sell span .ic { width: 24px; height: 24px; }
.tab-sell small { font-size: 10.5px; font-weight: 600; color: var(--text-3); margin-top: 2px; }

/* ---------- Bottom sheet / modal ---------- */
.sheet-backdrop { position: fixed; inset: 0; z-index: 200; background: rgba(2, 6, 18, .6); opacity: 0; transition: opacity .25s; }
.sheet-backdrop.show { opacity: 1; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 201; max-height: 88dvh; overflow-y: auto;
  background: var(--surface); border-radius: 24px 24px 0 0; padding: 8px 18px calc(18px + var(--safe-b));
  transform: translateY(100%); transition: transform .3s cubic-bezier(.2, .8, .2, 1);
}
.sheet.show { transform: none; }
.sheet .grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--surface-3); margin: 4px auto 14px; }
.sheet h3 { font-size: 18px; font-weight: 700; margin-bottom: 14px; }
.sheet-section { margin-bottom: 18px; }
.sheet-section > label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 8px; }
.opt-grid { display: flex; flex-wrap: wrap; gap: 8px; }

/* ---------- Toast ---------- */
#toasts { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b) + 12px); z-index: 500; display: grid; justify-items: center; gap: 8px; pointer-events: none; padding: 0 16px; }
.toast {
  display: flex; align-items: center; gap: 10px; max-width: 420px; padding: 12px 16px; border-radius: 14px; font-size: 14px; font-weight: 500;
  background: #1b2438; color: #fff; box-shadow: var(--shadow); border: 1px solid rgba(255, 255, 255, .08);
  animation: toastIn .3s ease; pointer-events: auto;
}
:root[data-theme="light"] .toast { background: #0f172a; }
:root[data-theme="light"] .card,
:root[data-theme="light"] .box,
:root[data-theme="light"] .list,
:root[data-theme="light"] .stat,
:root[data-theme="light"] .pd-price-box,
:root[data-theme="light"] .install-card { box-shadow: 0 1px 2px rgba(15, 23, 42, .04), 0 4px 14px rgba(15, 23, 42, .05); }
:root[data-theme="light"] .cat-icon { background: #fff; box-shadow: 0 2px 8px rgba(15, 23, 42, .06); }
:root[data-theme="light"] .searchbar,
:root[data-theme="light"] .chip:not(.on) { background: #fff; }
:root[data-theme="light"] .tab-sell span { border-color: var(--surface); }
:root[data-theme="light"] .profile-head { background: linear-gradient(135deg, #e6efff, #efe9ff); }
:root[data-theme="light"] .price.ask { color: var(--primary-2); }
:root[data-theme="light"] .pd-sheet { background: var(--bg); }
.toast .ic { color: var(--success); width: 20px; height: 20px; }
.toast.err .ic { color: var(--danger); }
.toast button { color: #8fb6ff; font-weight: 700; margin-left: 6px; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.96); } to { opacity: 1; transform: none; } }

/* ---------- Formularios ---------- */
.field { margin-bottom: 14px; }
.field > label { display: block; font-size: 13px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.field .hint { font-size: 12px; color: var(--text-3); margin-top: 5px; }
.input {
  width: 100%; height: 50px; padding: 0 14px; border-radius: 13px; background: var(--surface); border: 1px solid var(--line);
  color: var(--text); font-size: 15.5px; outline: none; transition: border-color .15s, box-shadow .15s; appearance: none;
}
textarea.input { height: auto; min-height: 110px; padding: 12px 14px; resize: vertical; line-height: 1.5; }
select.input { background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%238592a6' stroke-width='2'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; background-size: 18px; padding-right: 40px; }
.input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input.invalid { border-color: var(--danger); }
.input-icon { position: relative; }
.input-icon .ic { position: absolute; left: 14px; top: 50%; transform: translateY(-50%); color: var(--text-3); width: 19px; height: 19px; }
.input-icon .input { padding-left: 44px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.seg { display: flex; background: var(--surface); border: 1px solid var(--line); border-radius: 13px; padding: 4px; gap: 4px; }
.seg button { flex: 1; height: 40px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--text-2); }
.seg button.on { background: var(--primary); color: #fff; }
.check { display: flex; align-items: center; gap: 10px; font-size: 14px; color: var(--text-2); }
.check input { width: 20px; height: 20px; accent-color: var(--primary); }
.photo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.photo-slot { aspect-ratio: 1; border-radius: 14px; overflow: hidden; position: relative; background: var(--surface); border: 1px solid var(--line); }
.photo-slot img { width: 100%; height: 100%; object-fit: cover; }
.photo-slot .rm { position: absolute; top: 5px; right: 5px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; }
.photo-slot .rm .ic { width: 14px; height: 14px; }
.photo-slot .cover-tag { position: absolute; left: 5px; bottom: 5px; font-size: 10px; font-weight: 700; background: var(--primary); color: #fff; padding: 2px 6px; border-radius: 6px; }
.photo-add { border: 2px dashed var(--surface-3); background: transparent; display: grid; place-items: center; align-content: center; gap: 4px; color: var(--text-3); font-size: 12px; font-weight: 600; cursor: pointer; }
.photo-add .ic { width: 26px; height: 26px; }
.steps { display: flex; gap: 6px; margin: 6px 0 18px; }
.steps i { flex: 1; height: 4px; border-radius: 2px; background: var(--surface-3); }
.steps i.on { background: var(--primary); }

/* ---------- Listas ---------- */
.list { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.list-item { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-bottom: 1px solid var(--line); width: 100%; text-align: left; font-size: 15px; }
.list-item:last-child { border-bottom: 0; }
.list-item .li-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); color: var(--text-2); flex-shrink: 0; }
.list-item .li-icon .ic { width: 19px; height: 19px; }
.list-item .grow { flex: 1; min-width: 0; }
.list-item .grow small { display: block; font-size: 12.5px; color: var(--text-3); }
.list-item > .ic:last-child { color: var(--text-3); width: 18px; height: 18px; }
.switch { width: 46px; height: 28px; border-radius: 14px; background: var(--surface-3); position: relative; transition: background .2s; flex-shrink: 0; }
.switch::after { content: ''; position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%; background: #fff; transition: transform .2s; box-shadow: 0 2px 4px rgba(0, 0, 0, .2); }
.switch.on { background: var(--primary); }
.switch.on::after { transform: translateX(18px); }

/* Carrito */
.cart-group { margin-bottom: 14px; }
.cart-seller { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cart-seller .ic { width: 18px; height: 18px; color: var(--text-2); }
.cart-item { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); }
.cart-item:last-child { border-bottom: 0; }
.cart-item .thumb { width: 84px; height: 84px; border-radius: 12px; flex-shrink: 0; aspect-ratio: auto; }
.cart-item .ci-body { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.cart-item .ci-title { font-size: 14px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-item .ci-foot { display: flex; align-items: center; justify-content: space-between; margin-top: auto; }
.cart-item .stepper button { width: 32px; height: 32px; }
.summary .spec { padding: 7px 0; border: 0; }
.summary .total { border-top: 1px solid var(--line); margin-top: 6px; padding-top: 12px; font-size: 17px; font-weight: 800; }
.summary .total span:first-child { color: var(--text); }
.checkout-bar { position: fixed; left: 0; right: 0; bottom: calc(var(--tabbar-h) + var(--safe-b)); z-index: 75; display: flex; align-items: center; gap: 12px; padding: 12px 16px; background: color-mix(in srgb, var(--surface) 95%, transparent); backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.checkout-bar .tot small { display: block; font-size: 12px; color: var(--text-3); }
.checkout-bar .tot b { font-size: 20px; letter-spacing: -.4px; }
.checkout-bar .btn { flex: 1; }
body.has-checkoutbar #view { padding-bottom: calc(var(--tabbar-h) + var(--safe-b) + 90px); }
.pay-opt { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--surface); width: 100%; text-align: left; margin-bottom: 8px; font-weight: 500; }
.pay-opt .li-icon { width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; background: var(--surface-2); }
.pay-opt .radio { margin-left: auto; width: 20px; height: 20px; border-radius: 50%; border: 2px solid var(--surface-3); }
.pay-opt.on { border-color: var(--primary); background: var(--primary-soft); }
.pay-opt.on .radio { border: 6px solid var(--primary); }

/* Pedidos */
.order { padding: 14px 16px; border-bottom: 1px solid var(--line); }
.order:last-child { border-bottom: 0; }
.order-head { display: flex; justify-content: space-between; align-items: center; gap: 8px; font-size: 13px; }
.status { font-size: 11.5px; font-weight: 700; padding: 4px 9px; border-radius: 8px; background: var(--primary-soft); color: var(--primary); white-space: nowrap; }
.status.ok { background: var(--success-soft); color: var(--success); }
.status.warn { background: rgba(245, 165, 36, .14); color: var(--warn); }
.status.off { background: var(--surface-2); color: var(--text-3); }
.order-thumbs { display: flex; gap: 6px; margin: 10px 0; }
.order-thumbs .thumb { width: 52px; height: 52px; border-radius: 10px; aspect-ratio: auto; }
.timeline { display: grid; gap: 0; margin-top: 6px; }
.tl-step { display: flex; gap: 12px; position: relative; padding-bottom: 16px; }
.tl-step:last-child { padding-bottom: 0; }
.tl-step::before { content: ''; position: absolute; left: 9px; top: 20px; bottom: 0; width: 2px; background: var(--surface-3); }
.tl-step:last-child::before { display: none; }
.tl-dot { width: 20px; height: 20px; border-radius: 50%; background: var(--surface-3); display: grid; place-items: center; flex-shrink: 0; z-index: 1; }
.tl-step.done .tl-dot { background: var(--success); color: #fff; }
.tl-step.done::before { background: var(--success); }
.tl-dot .ic { width: 12px; height: 12px; }
.tl-step b { font-size: 14px; display: block; }
.tl-step small { font-size: 12px; color: var(--text-3); }

/* Perfil / panel */
.profile-head { display: flex; align-items: center; gap: 16px; padding: 18px; border-radius: 20px; background: linear-gradient(135deg, rgba(47, 123, 255, .22), rgba(124, 92, 255, .14)); border: 1px solid var(--line); }
.profile-head h2 { font-size: 19px; letter-spacing: -.3px; }
.stat-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-top: 14px; }
.stat { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; padding: 14px 12px; }
.stat b { display: block; font-size: 20px; letter-spacing: -.4px; }
.stat span { font-size: 12px; color: var(--text-3); }
.stat .ic { width: 18px; height: 18px; color: var(--primary); margin-bottom: 6px; }
.bars { display: flex; align-items: flex-end; gap: 8px; height: 120px; padding-top: 10px; }
.bars div { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars i { width: 100%; max-width: 28px; border-radius: 6px 6px 3px 3px; background: var(--primary); min-height: 3px; }
.bars span { font-size: 11px; color: var(--text-3); }
.my-ad { display: flex; gap: 12px; padding: 12px 16px; border-bottom: 1px solid var(--line); align-items: center; }
.my-ad:last-child { border-bottom: 0; }
.my-ad .thumb { width: 64px; height: 64px; border-radius: 12px; aspect-ratio: auto; flex-shrink: 0; }
.my-ad .grow { flex: 1; min-width: 0; }
.my-ad .grow b { font-size: 14px; font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* Vacíos */
.empty { text-align: center; padding: 56px 24px; display: grid; justify-items: center; gap: 10px; }
.empty .em-icon { width: 84px; height: 84px; border-radius: 26px; display: grid; place-items: center; background: var(--surface); border: 1px solid var(--line); color: var(--text-3); margin-bottom: 6px; }
.empty .em-icon .ic { width: 38px; height: 38px; }
.empty h3 { font-size: 18px; }
.empty p { color: var(--text-2); font-size: 14px; max-width: 300px; }
.empty .btn { margin-top: 8px; }

/* Login */
.auth { padding: 24px 20px; max-width: 440px; margin: 0 auto; }
.auth-hero { text-align: center; display: grid; justify-items: center; gap: 10px; margin: 18px 0 26px; }
.auth-hero .mark { width: 64px; height: 64px; border-radius: 20px; }
.auth-hero .mark .ic { width: 32px; height: 32px; }
.auth-hero h2 { font-size: 24px; letter-spacing: -.5px; }
.divider { display: flex; align-items: center; gap: 10px; color: var(--text-3); font-size: 12px; margin: 18px 0; }
.divider::before, .divider::after { content: ''; flex: 1; height: 1px; background: var(--line); }

/* Install banner */
.install-card { display: flex; align-items: center; gap: 12px; padding: 14px; border-radius: 16px; background: var(--surface); border: 1px solid var(--line); margin-top: 16px; }
.install-card .grow { flex: 1; font-size: 13px; }
.install-card .grow b { display: block; font-size: 14px; }

/* ---------- Reels ---------- */
.reels { position: fixed; inset: 0; z-index: 300; background: #000; overflow-y: auto; scroll-snap-type: y mandatory; scrollbar-width: none; }
.reels::-webkit-scrollbar { display: none; }
.reel { height: 100dvh; scroll-snap-align: start; position: relative; display: grid; place-items: center; overflow: hidden; }
.reel .reel-media { position: absolute; inset: 0; }
.reel .reel-media .thumb { height: 100%; aspect-ratio: auto; }
.reel .reel-media img { width: 100%; height: 100%; object-fit: cover; animation: kenburns 14s ease-in-out infinite alternate; }
@keyframes kenburns { from { transform: scale(1); } to { transform: scale(1.12) translate(-2%, -2%); } }
.reel::after { content: ''; position: absolute; inset: 0; background: linear-gradient(to top, rgba(0, 0, 0, .9) 0%, rgba(0, 0, 0, .1) 45%, rgba(0, 0, 0, .35) 100%); pointer-events: none; }
.reel-side { position: absolute; right: 12px; bottom: calc(120px + var(--safe-b)); z-index: 2; display: grid; gap: 18px; justify-items: center; color: #fff; }
.reel-side button, .reel-side a { display: grid; justify-items: center; gap: 4px; font-size: 11.5px; font-weight: 600; }
.reel-side .rs-ic { width: 48px; height: 48px; border-radius: 50%; display: grid; place-items: center; background: rgba(255, 255, 255, .14); backdrop-filter: blur(8px); }
.reel-side .rs-ic.wa { background: var(--wa); }
.reel-side .rs-ic.liked { color: #ff4d6d; }
.reel-side .rs-ic.liked path { fill: currentColor; }
.reel-info { position: absolute; left: 16px; right: 80px; bottom: calc(26px + var(--safe-b)); z-index: 2; color: #fff; }
.reel-info .seller { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14px; margin-bottom: 8px; }
.reel-info .seller .avatar { width: 34px; height: 34px; font-size: 13px; border: 2px solid #fff; }
.reel-info h3 { font-size: 19px; letter-spacing: -.3px; line-height: 1.2; }
.reel-info p { font-size: 13px; opacity: .85; margin: 4px 0 10px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.reel-info .rprice { font-size: 22px; font-weight: 800; color: #6ee7b7; }
.reel-info .btn { height: 42px; margin-top: 10px; font-size: 14px; }
.reels-close { position: fixed; top: calc(14px + var(--safe-t)); left: 14px; z-index: 310; color: #fff; background: rgba(0, 0, 0, .35); border: 0; backdrop-filter: blur(8px); }
.reels-title { position: fixed; top: calc(22px + var(--safe-t)); left: 0; right: 0; text-align: center; z-index: 305; color: #fff; font-weight: 700; font-size: 16px; pointer-events: none; }
.heart-burst { position: absolute; z-index: 3; color: #ff4d6d; animation: burst .8s ease forwards; pointer-events: none; }
.heart-burst .ic { width: 96px; height: 96px; }
.heart-burst path { fill: currentColor; }
@keyframes burst { 0% { transform: scale(.3); opacity: 0; } 30% { transform: scale(1.1); opacity: 1; } 100% { transform: scale(1); opacity: 0; } }

/* Video */
.reel .reel-media video { width: 100%; height: 100%; object-fit: cover; background: #000; }
.reel-sound { position: absolute; top: 50%; left: 50%; z-index: 3; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; display: grid; place-items: center; background: rgba(0, 0, 0, .45); color: #fff; opacity: 0; transition: opacity .25s; pointer-events: none; }
.reel-sound.show { opacity: 1; }
.reel-sound .ic { width: 34px; height: 34px; }
.gvideo video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.video-slot { position: relative; width: 140px; aspect-ratio: 9 / 16; border-radius: 14px; overflow: hidden; background: #000; }
.video-slot video { width: 100%; height: 100%; object-fit: cover; }
.video-slot .vbadge { position: absolute; left: 6px; bottom: 6px; font-size: 11px; font-weight: 700; color: #fff; background: rgba(0, 0, 0, .55); padding: 3px 7px; border-radius: 7px; display: inline-flex; gap: 4px; align-items: center; }
.video-slot .rm { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border-radius: 50%; background: rgba(0, 0, 0, .6); color: #fff; display: grid; place-items: center; }
.video-slot .rm .ic { width: 14px; height: 14px; }
.video-add { width: 140px; aspect-ratio: 9 / 16; }
.phone-field { display: grid; grid-template-columns: 118px 1fr; gap: 8px; }
.phone-field select.input { padding-right: 30px; background-position: right 8px center; }

.legal .box p { line-height: 1.65; }
.legal .box p a { color: var(--primary); font-weight: 600; }
.legal .box h3 { font-size: 16px; }

.price-field { display: grid; grid-template-columns: 112px 1fr; gap: 8px; }
.cur-seg { padding: 3px; }
.cur-seg button { height: 42px; font-size: 13.5px; }

/* Success */
.success-hero { text-align: center; padding: 30px 10px 10px; display: grid; justify-items: center; gap: 10px; }
.success-hero .ok { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; background: var(--success-soft); color: var(--success); animation: pop .5s ease; }
.success-hero .ok .ic { width: 44px; height: 44px; stroke-width: 2.4; }
.success-hero h2 { font-size: 22px; letter-spacing: -.4px; }

/* ---------- Escritorio / tablet ---------- */
@media (min-width: 600px) {
  .grid { grid-template-columns: repeat(3, 1fr); gap: 14px; }
  .cat-grid { grid-template-columns: repeat(6, 1fr); }
  .banner { flex-basis: 80%; height: 210px; }
  .sheet { left: 50%; right: auto; width: 520px; transform: translate(-50%, 100%); }
  .sheet.show { transform: translate(-50%, 0); }
}
@media (min-width: 960px) {
  :root { --tabbar-h: 0px; }
  body { padding-left: 92px; }
  .tabbar {
    top: 0; bottom: 0; right: auto; width: 92px; height: auto; grid-template-columns: 1fr; grid-auto-rows: 74px;
    align-content: center; border-top: 0; border-right: 1px solid var(--line); padding: 0;
  }
  .tab-sell span { margin-top: 0; border: 0; }
  .page, .topbar-inner { max-width: 1180px; margin: 0 auto; }
  .page { padding-left: 28px; padding-right: 28px; }
  .topbar { padding-left: 28px; padding-right: 28px; }
  .grid { grid-template-columns: repeat(4, 1fr); gap: 18px; }
  .cat-grid { grid-template-columns: repeat(7, 1fr); }
  .banner { flex-basis: 48%; height: 230px; }
  .card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
  .pd-top, .buy-bar, .checkout-bar { left: 92px; }
  #toasts { bottom: 24px; }
  .pd-layout { display: grid; grid-template-columns: 1.1fr 1fr; gap: 28px; max-width: 1180px; margin: 0 auto; padding: 76px 28px 0; }
  .pd-layout .gallery { border-radius: 22px; overflow: hidden; position: sticky; top: 76px; align-self: start; }
  .pd-layout .pd-sheet { margin-top: 0; padding-top: 0; }
  .buy-bar { justify-content: flex-end; }
  .buy-bar .btn { flex: 0 0 220px; }
  body.has-buybar .tabbar { display: grid; }
  .hscroll > * { flex-basis: 190px; }
  .reel-card { flex-basis: 160px !important; height: 260px; }
}
@media (min-width: 1300px) {
  .grid { grid-template-columns: repeat(5, 1fr); }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
