/* =====================================================================
   BUYGO — componentes propios (sobre la base visual de AccessPro)
   ===================================================================== */
.badge-warning { background: color-mix(in srgb, var(--warning) 18%, transparent); color: var(--warning); }
.badge-info { background: color-mix(in srgb, var(--info) 16%, transparent); color: var(--info); }
.badge-accent { background: var(--accent-dim); color: var(--accent); }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-success:hover { background: var(--success); filter: brightness(1.08); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--surface-alt); }
.btn-icon { padding: 8px; width: 38px; height: 38px; justify-content: center; }
.btn-lg { padding: 14px 20px; font-size: 1rem; border-radius: 12px; }
.muted { color: var(--text-muted); }
.small { font-size: 0.8rem; }
.row { display: flex; gap: 10px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.grow { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 10px; }
.money { font-family: var(--font-mono); font-weight: 600; white-space: nowrap; }
.strike { text-decoration: line-through; color: var(--text-muted); font-weight: 400; font-size: 0.85em; }
.ellipsis { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr { height: 1px; background: var(--border); margin: 14px 0; border: 0; }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text); font-weight: 600; font-size: 0.84rem;
  cursor: pointer; white-space: nowrap;
}
.chip.active { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 6px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.content.flush { padding: 0; }
.page-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.page-head h2 { margin: 0; font-size: 1.25rem; letter-spacing: -0.01em; }

/* ---------- Marca ---------- */
.bg-mark {
  width: 36px; height: 36px; border-radius: 10px; background: var(--accent); color: #fff; display: flex;
  align-items: center; justify-content: center; flex-shrink: 0; font-weight: 800; font-size: 0.95rem; letter-spacing: -0.04em;
}
.bg-mark img { width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }

/* ---------- Entrar / registro ---------- */
.auth-screen { width: 100%; min-height: 100vh; display: grid; grid-template-columns: 1.05fr 1fr; }
.auth-hero {
  background: radial-gradient(1200px 600px at -10% -10%, #ffb37f 0%, transparent 55%), linear-gradient(150deg, #ff7a32 0%, #f0501a 55%, #c93a10 100%);
  color: #fff; padding: 48px; display: flex; flex-direction: column; justify-content: space-between; position: relative; overflow: hidden;
}
.auth-hero h1 { font-size: clamp(2rem, 4vw, 3.2rem); line-height: 1.05; margin: 0 0 12px; letter-spacing: -0.03em; }
.auth-hero p { font-size: 1.05rem; opacity: 0.92; max-width: 420px; margin: 0; }
.auth-hero .hero-brand { display: flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; }
.auth-hero .hero-brand .bg-mark { background: #fff; color: var(--accent); }
.auth-hero .hero-pills { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 22px; }
.auth-hero .hero-pills span { background: rgba(255,255,255,.18); border: 1px solid rgba(255,255,255,.3); border-radius: 999px; padding: 6px 12px; font-size: 0.82rem; font-weight: 600; }
.auth-hero .hero-art { position: absolute; right: -60px; bottom: -40px; width: 360px; opacity: 0.18; }
.auth-side { display: flex; align-items: center; justify-content: center; padding: 28px 20px; background: var(--bg); }
.auth-card { width: 100%; max-width: 420px; }
.auth-card h2 { margin: 0 0 4px; font-size: 1.45rem; letter-spacing: -0.02em; }
.auth-card > p { margin: 0 0 22px; color: var(--text-muted); font-size: 0.9rem; }
.role-cards { display: grid; gap: 10px; }
.role-card {
  display: flex; gap: 14px; align-items: center; padding: 16px; border-radius: 14px; border: 1px solid var(--border);
  background: var(--surface); cursor: pointer; text-align: left; width: 100%; color: var(--text); font: inherit;
}
.role-card:hover { border-color: var(--accent); }
.role-card .ric { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-dim); color: var(--accent); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.role-card .ric .i { width: 24px; height: 24px; }
.role-card strong { display: block; }
.role-card span { color: var(--text-muted); font-size: 0.82rem; }
.steps { display: flex; gap: 6px; margin-bottom: 18px; }
.steps i { flex: 1; height: 4px; border-radius: 4px; background: var(--border); }
.steps i.on { background: var(--accent); }
@media (max-width: 860px) {
  .auth-screen { grid-template-columns: 1fr; }
  .auth-hero { padding: 28px 22px 26px; min-height: auto; }
  .auth-hero h1 { font-size: 1.8rem; }
  .auth-hero .hero-art { width: 200px; right: -30px; bottom: -30px; }
  .auth-hero .hero-pills { display: none; }
  .auth-hero .hero-copy { margin-top: 18px; }
}

/* ---------- Captura de fotos (registro / productos / expediente) ---------- */
.shot-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 10px; }
.shot {
  position: relative; border: 1px dashed var(--border); border-radius: 12px; background: var(--surface-alt);
  aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  cursor: pointer; overflow: hidden; color: var(--text-muted); font-size: 0.8rem; text-align: center; padding: 8px;
}
.shot.done { border-style: solid; border-color: var(--success); }
.shot img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.shot .shot-label { position: relative; z-index: 1; background: rgba(0,0,0,.55); color: #fff; padding: 2px 8px; border-radius: 6px; }
.shot.req .shot-label::after { content: ' *'; color: var(--accent); }
.shot input { display: none; }

/* ---------- Mapa ---------- */
.map { width: 100%; height: 320px; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--border); background: var(--surface-alt); z-index: 0; }
.map.tall { height: 420px; }
.map.short { height: 220px; }
.leaflet-container { font-family: var(--font-ui); }
.pin-biz {
  width: 34px; height: 34px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); background: var(--accent);
  border: 2px solid #fff; box-shadow: 0 4px 10px rgba(0,0,0,.3); display: flex; align-items: center; justify-content: center;
}
.pin-biz.off { background: #8d8a84; }
.pin-biz .i { transform: rotate(45deg); color: #fff; width: 17px; height: 17px; }
.pin-me { width: 18px; height: 18px; border-radius: 50%; background: var(--info); border: 3px solid #fff; box-shadow: 0 0 0 6px color-mix(in srgb, var(--info) 30%, transparent); }
.pin-driver { width: 38px; height: 38px; border-radius: 50%; background: #1f1d1a; color: #fff; border: 3px solid var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 12px rgba(0,0,0,.35); }
.pin-driver .i { width: 20px; height: 20px; }
.pin-home { width: 32px; height: 32px; border-radius: 50%; background: var(--success); color: #fff; border: 3px solid #fff; display: flex; align-items: center; justify-content: center; box-shadow: 0 4px 10px rgba(0,0,0,.3); }
.pin-home .i { width: 16px; height: 16px; }
.map-pick-hint { position: absolute; z-index: 500; left: 50%; top: 10px; transform: translateX(-50%); background: var(--surface); border: 1px solid var(--border); border-radius: 999px; padding: 6px 12px; font-size: 0.78rem; box-shadow: 0 4px 12px rgba(0,0,0,.15); pointer-events: none; }
.map-wrap { position: relative; }
.map-center-pin { position: absolute; left: 50%; top: 50%; z-index: 500; transform: translate(-50%, -100%); pointer-events: none; color: var(--accent); }
.map-center-pin .i { width: 40px; height: 40px; filter: drop-shadow(0 3px 4px rgba(0,0,0,.35)); fill: var(--accent); stroke: #fff; }

/* ---------- Comprador: explorar ---------- */
.explore-top { position: sticky; top: 0; z-index: 30; background: var(--bg); padding: 12px 0 8px; }
.searchbar { display: flex; align-items: center; gap: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 4px 6px 4px 14px; }
.searchbar input { flex: 1; border: 0; background: transparent; padding: 10px 0; outline: none; font-size: 1rem; min-width: 0; }
.searchbar .i { color: var(--text-muted); }
.addr-pill { display: inline-flex; align-items: center; gap: 6px; font-weight: 700; font-size: 0.9rem; background: none; border: 0; color: var(--text); cursor: pointer; padding: 4px 0; max-width: 100%; }
.addr-pill span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.addr-pill .i { color: var(--accent); flex-shrink: 0; }
.biz-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(300px, 100%), 1fr)); gap: 14px; }
.biz-card { background: var(--surface); border: 1px solid var(--border); border-radius: 16px; overflow: hidden; cursor: pointer; transition: transform .12s ease, box-shadow .12s ease; display: flex; flex-direction: column; text-align: left; color: var(--text); font: inherit; padding: 0; }
.biz-card:hover { transform: translateY(-2px); box-shadow: 0 10px 24px rgba(0,0,0,.12); }
.biz-cover { position: relative; aspect-ratio: 16 / 7; background: var(--surface-alt) center / cover no-repeat; }
.biz-cover .badges { position: absolute; left: 10px; top: 10px; display: flex; gap: 6px; }
.biz-cover .badge { background: rgba(0,0,0,.65); color: #fff; }
.biz-cover .badge.open { background: var(--success); }
.biz-cover .fav { position: absolute; right: 10px; top: 10px; }
.biz-card.closed .biz-cover { filter: grayscale(.7); opacity: .8; }
.biz-body { padding: 12px 14px 14px; display: flex; gap: 12px; align-items: flex-start; }
.biz-logo { width: 46px; height: 46px; border-radius: 12px; background: var(--accent-dim) center / cover; flex-shrink: 0; margin-top: -32px; border: 3px solid var(--surface); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.biz-name { font-weight: 800; font-size: 1rem; letter-spacing: -0.01em; }
.biz-meta { display: flex; gap: 10px; flex-wrap: wrap; font-size: 0.8rem; color: var(--text-muted); margin-top: 4px; }
.biz-meta .i { width: 14px; height: 14px; vertical-align: -2px; }
.star { color: #f5a623; }
.promo-strip { display: flex; gap: 12px; overflow-x: auto; padding-bottom: 6px; scrollbar-width: none; }
.promo-card { flex: 0 0 min(300px, 80vw); border-radius: 16px; padding: 16px; color: #fff; background: linear-gradient(135deg, #ff7a32, #e2401a); cursor: pointer; position: relative; overflow: hidden; min-height: 112px; display: flex; flex-direction: column; justify-content: flex-end; border: 0; text-align: left; font: inherit; }
.promo-card.img { background-size: cover; background-position: center; }
.promo-card.img::before { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.75), rgba(0,0,0,.05)); }
.promo-card > * { position: relative; }
.promo-card strong { font-size: 1.05rem; }
.promo-card span { font-size: 0.8rem; opacity: .9; }
.section-title { font-size: 1.05rem; font-weight: 800; margin: 22px 0 10px; letter-spacing: -0.01em; display: flex; align-items: center; justify-content: space-between; }

/* ---------- Pagina del negocio ---------- */
.store-hero { position: relative; border-radius: 18px; overflow: hidden; background: var(--surface-alt) center / cover; aspect-ratio: 16 / 5; min-height: 150px; }
.store-hero::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(0,0,0,.6), rgba(0,0,0,0) 60%); }
.store-hero .back { position: absolute; left: 12px; top: 12px; z-index: 2; background: rgba(255,255,255,.92); color: #111; border-radius: 50%; width: 38px; height: 38px; border: 0; display: flex; align-items: center; justify-content: center; cursor: pointer; }
.store-hero .fav { position: absolute; right: 12px; top: 12px; z-index: 2; }
.store-head { display: flex; gap: 14px; align-items: flex-end; margin: -38px 16px 0; position: relative; z-index: 2; }
.store-head .biz-logo { width: 76px; height: 76px; margin: 0; border-radius: 18px; border-width: 4px; }
.store-info { padding: 12px 2px 4px; }
.store-info h1 { margin: 0; font-size: 1.45rem; letter-spacing: -0.02em; }
.store-facts { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.store-facts .fact { background: var(--surface); border: 1px solid var(--border); border-radius: 10px; padding: 6px 10px; font-size: 0.8rem; display: inline-flex; gap: 6px; align-items: center; }
.store-facts .fact .i { width: 15px; height: 15px; color: var(--accent); }
.cat-tabs { position: sticky; top: 0; z-index: 25; background: var(--bg); padding: 10px 0; }
.product-row { display: flex; gap: 14px; padding: 14px; background: var(--surface); border: 1px solid var(--border); border-radius: 14px; cursor: pointer; text-align: left; width: 100%; color: var(--text); font: inherit; }
.product-row:hover { border-color: var(--accent); }
.product-row.soldout { opacity: .55; cursor: default; }
.product-row .pimg { width: 92px; height: 92px; border-radius: 12px; background: var(--surface-alt) center / cover; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.product-row .pname { font-weight: 700; }
.product-row .pdesc { color: var(--text-muted); font-size: 0.82rem; margin: 4px 0 8px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.products { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(340px, 100%), 1fr)); gap: 10px; }
.cart-bar {
  position: fixed; left: 50%; transform: translateX(-50%); bottom: 18px; z-index: 40; width: min(520px, calc(100vw - 24px));
  display: flex; align-items: center; gap: 12px; padding: 14px 18px; border-radius: 16px; background: var(--accent); color: #fff;
  box-shadow: 0 14px 30px rgba(240, 90, 26, .4); cursor: pointer; border: 0; font: inherit; font-weight: 700;
}
.cart-bar .count { background: rgba(255,255,255,.25); border-radius: 8px; padding: 2px 9px; }
@media (max-width: 860px) { .cart-bar { bottom: calc(76px + env(safe-area-inset-bottom)); } }
.opt-group { border: 1px solid var(--border); border-radius: 12px; padding: 12px; margin-bottom: 12px; }
.opt-group .ghead { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; font-weight: 700; }
.opt { display: flex; align-items: center; gap: 10px; padding: 8px 2px; cursor: pointer; }
.opt input { width: 20px; height: 20px; accent-color: var(--accent); }
.opt .grow { font-size: 0.92rem; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; }
.qty button { background: var(--surface-alt); border: 0; width: 40px; height: 40px; cursor: pointer; color: var(--text); display: flex; align-items: center; justify-content: center; }
.qty span { min-width: 44px; text-align: center; font-weight: 700; font-family: var(--font-mono); }
.modal.wide { max-width: 640px; }
.modal .mimg { width: calc(100% + 44px); margin: -22px -22px 14px; aspect-ratio: 16 / 9; background: var(--surface-alt) center / cover; border-radius: var(--radius) var(--radius) 0 0; }
@media (max-width: 600px) {
  .modal-backdrop { align-items: flex-end; padding: 0; }
  .modal { border-radius: 18px 18px 0 0; max-height: 92vh; max-width: 100%; }
  .modal .mimg { border-radius: 18px 18px 0 0; }
}

/* ---------- Pago / carrito ---------- */
.checkout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 18px; align-items: start; }
@media (max-width: 960px) { .checkout { grid-template-columns: 1fr; } }
.seg2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.choice {
  display: flex; gap: 10px; align-items: center; padding: 12px 14px; border: 1px solid var(--border); border-radius: 12px;
  background: var(--surface); cursor: pointer; color: var(--text); font: inherit; text-align: left; width: 100%;
}
.choice.active, .choice:has(input:checked) { border-color: var(--accent); background: var(--accent-dim); }
.choice input { accent-color: var(--accent); width: 18px; height: 18px; }
.choice .i { color: var(--accent); }
.choice small { display: block; color: var(--text-muted); font-size: 0.76rem; }
.choice:disabled { opacity: .5; cursor: not-allowed; }
.sum-line { display: flex; justify-content: space-between; padding: 5px 0; font-size: 0.92rem; }
.sum-line.total { font-size: 1.15rem; font-weight: 800; border-top: 1px solid var(--border); margin-top: 6px; padding-top: 12px; }
.cart-line { display: flex; gap: 10px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--border); }
.cart-line:last-child { border-bottom: 0; }

/* ---------- Seguimiento del pedido ---------- */
.track-grid { display: grid; grid-template-columns: minmax(0, 1fr) 380px; gap: 18px; align-items: start; }
@media (max-width: 960px) { .track-grid { grid-template-columns: 1fr; } }
.stepper { display: flex; flex-direction: column; gap: 0; }
.stepper .st { display: flex; gap: 12px; align-items: flex-start; position: relative; padding-bottom: 16px; }
.stepper .st:not(:last-child)::before { content: ''; position: absolute; left: 13px; top: 28px; bottom: 0; width: 2px; background: var(--border); }
.stepper .st.done:not(:last-child)::before { background: var(--accent); }
.stepper .dot { width: 28px; height: 28px; border-radius: 50%; border: 2px solid var(--border); background: var(--surface); display: flex; align-items: center; justify-content: center; flex-shrink: 0; color: var(--text-muted); }
.stepper .st.done .dot { background: var(--accent); border-color: var(--accent); color: #fff; }
.stepper .st.now .dot { border-color: var(--accent); color: var(--accent); box-shadow: 0 0 0 5px var(--accent-dim); animation: pulse 1.6s infinite; }
.stepper .dot .i { width: 15px; height: 15px; }
.stepper .st strong { display: block; font-size: 0.92rem; }
.stepper .st small { color: var(--text-muted); font-size: 0.76rem; }
@keyframes pulse { 0%, 100% { box-shadow: 0 0 0 4px var(--accent-dim); } 50% { box-shadow: 0 0 0 9px transparent; } }
.status-hero { border-radius: 18px; padding: 18px; background: linear-gradient(135deg, var(--accent), #d9441a); color: #fff; margin-bottom: 16px; }
.status-hero h2 { margin: 0; font-size: 1.35rem; }
.status-hero p { margin: 4px 0 0; opacity: .92; }
.status-hero.done { background: linear-gradient(135deg, #22a565, #187a4a); }
.status-hero.bad { background: linear-gradient(135deg, #6d6a64, #45433f); }
.pin-box { display: flex; align-items: center; gap: 14px; padding: 14px 16px; border-radius: 14px; border: 2px dashed var(--accent); background: var(--accent-dim); }
.pin-box .pin { font-family: var(--font-mono); font-size: 2rem; font-weight: 700; letter-spacing: .3em; color: var(--accent); }
.person { display: flex; gap: 12px; align-items: center; }
.avatar { width: 46px; height: 46px; border-radius: 50%; background: var(--surface-alt) center / cover; display: flex; align-items: center; justify-content: center; color: var(--text-muted); flex-shrink: 0; overflow: hidden; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.stars-input { display: flex; gap: 4px; }
.stars-input button { background: none; border: 0; font-size: 1.9rem; color: var(--border); cursor: pointer; padding: 0 2px; line-height: 1; }
.stars-input button.on { color: #f5a623; }

/* ---------- Chat del pedido ---------- */
.ochat { display: flex; flex-direction: column; height: min(60vh, 460px); }
.ochat-log { flex: 1; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; padding: 6px 2px 10px; }
.ochat-msg { max-width: 82%; padding: 8px 12px; border-radius: 14px; background: var(--surface-alt); font-size: 0.9rem; align-self: flex-start; }
.ochat-msg.me { background: var(--accent); color: #fff; align-self: flex-end; border-bottom-right-radius: 4px; }
.ochat-msg small { display: block; font-size: 0.68rem; opacity: .75; margin-bottom: 2px; font-weight: 700; }
.ochat-form { display: flex; gap: 8px; }
.ochat-form input { flex: 1; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--border); background: var(--bg); min-width: 0; }
.quick-replies { display: flex; gap: 6px; overflow-x: auto; margin-bottom: 8px; scrollbar-width: none; }
.quick-replies .chip { padding: 6px 10px; font-size: 0.76rem; }

/* ---------- Negocio: tablero de pedidos ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(260px, 1fr)); gap: 14px; align-items: start; }
@media (max-width: 1200px) { .board { grid-template-columns: repeat(4, minmax(250px, 1fr)); overflow-x: auto; padding-bottom: 10px; scroll-snap-type: x mandatory; } .board > * { scroll-snap-align: start; } }
.board-col { background: var(--surface-alt); border-radius: 16px; padding: 10px; min-height: 160px; }
.board-col h3 { margin: 4px 6px 10px; font-size: 0.86rem; display: flex; justify-content: space-between; align-items: center; text-transform: uppercase; letter-spacing: .04em; color: var(--text-muted); }
.board-col h3 .n { background: var(--surface); border-radius: 999px; padding: 1px 9px; color: var(--text); }
.ocard { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px; margin-bottom: 10px; }
.ocard.new { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-dim); animation: glow 1.4s ease-in-out infinite; }
@keyframes glow { 50% { box-shadow: 0 0 0 7px transparent; } }
.ocard .ohead { display: flex; justify-content: space-between; gap: 8px; align-items: center; margin-bottom: 6px; }
.ocard .code { font-family: var(--font-mono); font-weight: 700; }
.ocard .timer { font-family: var(--font-mono); font-size: 0.78rem; color: var(--text-muted); }
.ocard .timer.late { color: var(--danger); font-weight: 700; }
.ocard ul { margin: 6px 0; padding: 0; list-style: none; font-size: 0.86rem; }
.ocard li { padding: 3px 0; }
.ocard li .opts { display: block; color: var(--text-muted); font-size: 0.76rem; }
.ocard .oactions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 10px; }
.ocard .oactions .btn { flex: 1; justify-content: center; }
.settle { font-size: 0.78rem; padding: 6px 8px; border-radius: 8px; background: var(--surface-alt); margin-top: 6px; }
.biz-status-bar { display: flex; gap: 10px; align-items: center; padding: 10px 14px; border-radius: 14px; background: var(--surface); border: 1px solid var(--border); margin-bottom: 14px; flex-wrap: wrap; }
.switch { position: relative; width: 52px; height: 30px; flex-shrink: 0; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch span { position: absolute; inset: 0; background: var(--border); border-radius: 999px; transition: .2s; cursor: pointer; }
.switch span::before { content: ''; position: absolute; width: 24px; height: 24px; left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: .2s; box-shadow: 0 2px 4px rgba(0,0,0,.2); }
.switch input:checked + span { background: var(--success); }
.switch input:checked + span::before { transform: translateX(22px); }

/* ---------- Catalogo (admin) ---------- */
.cat-item { display: flex; gap: 12px; align-items: center; padding: 10px; border-bottom: 1px solid var(--border); }
.cat-item:last-child { border-bottom: 0; }
.cat-item .pimg { width: 54px; height: 54px; border-radius: 10px; background: var(--surface-alt) center / cover; flex-shrink: 0; display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.og-editor { border: 1px solid var(--border); border-radius: 12px; padding: 10px; margin-bottom: 10px; background: var(--bg); }
.og-editor .orow { display: grid; grid-template-columns: 1fr 100px 36px; gap: 6px; margin-bottom: 6px; }
.og-editor input, .og-editor select { padding: 8px 10px; border-radius: 8px; border: 1px solid var(--border); background: var(--surface); width: 100%; }
.sched-row { display: grid; grid-template-columns: 96px 1fr; gap: 10px; align-items: center; padding: 6px 0; border-bottom: 1px solid var(--border); }
.sched-row .ranges { display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.sched-row input[type=time] { padding: 6px 8px; border-radius: 8px; border: 1px solid var(--border); background: var(--bg); }
@media (max-width: 520px) { .sched-row { grid-template-columns: 1fr; } }

/* ---------- Repartidor ---------- */
.drv-hero { border-radius: 20px; padding: 20px; background: var(--surface); border: 1px solid var(--border); display: flex; gap: 16px; align-items: center; flex-wrap: wrap; }
.drv-hero.on { background: linear-gradient(135deg, #1f8f55, #136b3e); color: #fff; border-color: transparent; }
.drv-hero.on .muted { color: rgba(255,255,255,.85); }
.power-btn { width: 84px; height: 84px; border-radius: 50%; border: 0; background: var(--accent); color: #fff; display: flex; align-items: center; justify-content: center; cursor: pointer; box-shadow: 0 10px 24px rgba(240, 90, 26, .35); flex-shrink: 0; }
.power-btn .i { width: 38px; height: 38px; }
.drv-hero.on .power-btn { background: #fff; color: var(--success); box-shadow: 0 0 0 8px rgba(255,255,255,.18); }
.offer-overlay { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,.7); display: flex; align-items: flex-end; justify-content: center; padding: 0; }
.offer-card { width: min(520px, 100%); background: var(--surface); border-radius: 22px 22px 0 0; padding: 20px; animation: slideup .25s ease-out; }
@media (min-width: 700px) { .offer-overlay { align-items: center; } .offer-card { border-radius: 22px; } }
@keyframes slideup { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
.offer-earn { font-size: 2.4rem; font-weight: 800; letter-spacing: -0.03em; color: var(--success); font-family: var(--font-mono); }
.countdown { height: 8px; border-radius: 8px; background: var(--surface-alt); overflow: hidden; margin: 10px 0 16px; }
.countdown div { height: 100%; background: var(--accent); transition: width 1s linear; }
.route-pts { display: flex; flex-direction: column; gap: 10px; margin: 12px 0; }
.route-pts .pt { display: flex; gap: 10px; align-items: flex-start; }
.route-pts .pt .i { color: var(--accent); flex-shrink: 0; margin-top: 2px; }
.kpi-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(140px, 100%), 1fr)); gap: 10px; }
.kpi { background: var(--surface); border: 1px solid var(--border); border-radius: 14px; padding: 12px 14px; }
.kpi .label { color: var(--text-muted); font-size: 0.76rem; font-weight: 600; }
.kpi .value { font-size: 1.35rem; font-weight: 800; letter-spacing: -0.02em; margin-top: 2px; font-family: var(--font-mono); }
.kpi.accent { border-top: 3px solid var(--accent); }
.kpi.good { border-top: 3px solid var(--success); }
.kpi.bad { border-top: 3px solid var(--danger); }

/* ---------- Admin: expediente / regiones ---------- */
.kyc-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.kyc-grid figure { margin: 0; border: 1px solid var(--border); border-radius: 12px; overflow: hidden; background: var(--surface-alt); }
.kyc-grid img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; cursor: zoom-in; }
.kyc-grid figcaption { font-size: 0.76rem; padding: 6px 8px; color: var(--text-muted); }
.cfg-section { border: 1px solid var(--border); border-radius: 14px; padding: 14px; margin-bottom: 14px; }
.cfg-section h4 { margin: 0 0 12px; font-size: 0.9rem; display: flex; gap: 8px; align-items: center; }
.cfg-section h4 .i { color: var(--accent); }
.form-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(190px, 100%), 1fr)); gap: 0 14px; }
.bars { display: flex; align-items: flex-end; gap: 6px; height: 140px; }
.bars .bar { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; height: 100%; gap: 4px; min-width: 18px; }
.bars .bar div { width: 100%; max-width: 26px; background: var(--accent); border-radius: 6px 6px 2px 2px; min-height: 2px; }
.bars .bar span { font-size: 0.64rem; color: var(--text-muted); white-space: nowrap; }
.status-dot { display: inline-block; width: 9px; height: 9px; border-radius: 50%; background: var(--text-muted); margin-right: 6px; }
.status-dot.on { background: var(--success); box-shadow: 0 0 0 4px color-mix(in srgb, var(--success) 25%, transparent); }
.status-dot.off { background: var(--danger); }
.pending-hero { text-align: center; padding: 30px 20px; }
.pending-hero .big-ic { width: 72px; height: 72px; border-radius: 50%; background: var(--accent-dim); color: var(--accent); display: inline-flex; align-items: center; justify-content: center; margin-bottom: 12px; }
.pending-hero .big-ic .i { width: 34px; height: 34px; }
img.zoom { position: fixed; inset: 0; margin: auto; max-width: 96vw; max-height: 92vh; z-index: 500; border-radius: 12px; box-shadow: 0 0 0 100vmax rgba(0,0,0,.8); cursor: zoom-out; }
.spinner { display: inline-block; width: 16px; height: 16px; border: 2px solid currentColor; border-right-color: transparent; border-radius: 50%; animation: spin .7s linear infinite; vertical-align: -3px; }
@keyframes spin { to { transform: rotate(360deg); } }
.powered { display: flex; gap: 8px; align-items: center; padding: 12px 8px 0; font-size: 0.74rem; color: var(--text-muted); line-height: 1.25; }
.powered img { width: 26px; height: 26px; border-radius: 7px; }
.segmented { display: inline-flex; gap: 6px; }
a.role-card, a.choice { text-decoration: none; }
.product-row .pdesc:empty { display: none; }
/* celular: nada se sale de la pantalla */
.checkout > *, .track-grid > *, .grid > * { min-width: 0; }
.field select { max-width: 100%; min-width: 0; text-overflow: ellipsis; }
@media (max-width: 960px) { .checkout, .track-grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 600px) {
  .content { padding: 14px 14px 96px; }
  .map.tall { height: 300px; }
  .pin-box .pin { font-size: 1.6rem; letter-spacing: .18em; }
  .page-head h2 { font-size: 1.1rem; }
  .board-col { min-width: 82vw; }
}
.pin-box > div.grow { min-width: 0; }
.field textarea { font-family: var(--font-ui); font-size: .95rem; }
.field textarea.mono, textarea[name=headers], textarea[name=body] { font-family: var(--font-mono); font-size: .82rem; }
.biz-status-bar .grow { min-width: 150px; }
.biz-cover.nophoto, .store-hero.nophoto { background: radial-gradient(circle at 20% 20%, color-mix(in srgb, var(--accent) 22%, transparent), transparent 60%), linear-gradient(135deg, var(--accent-dim), var(--surface-alt)); display: flex; align-items: center; justify-content: center; color: var(--accent); }
.biz-cover.nophoto > .i, .store-hero.nophoto > .i { width: 54px; height: 54px; opacity: .55; }
.store-hero.nophoto::after { display: none; }

/* ---- Mapas: modo noche para la capa de calles y selector Calles / Satélite / Híbrido ---- */
.leaflet-tile-pane .tiles-dark { filter: invert(1) hue-rotate(180deg) brightness(0.9) contrast(0.9); }
.leaflet-control-layers { border-radius: 10px !important; border: 1px solid var(--border) !important; box-shadow: 0 4px 14px rgba(0,0,0,.18) !important; background: var(--surface) !important; color: var(--text); font-family: var(--font-ui); }
.leaflet-control-layers-toggle { width: 36px !important; height: 36px !important; background-size: 20px 20px !important; }
.leaflet-control-layers-expanded { padding: 8px 12px 8px 8px !important; }
.leaflet-control-layers label { display: flex; align-items: center; gap: 6px; padding: 4px 2px; font-size: 0.85rem; cursor: pointer; }
.leaflet-control-layers-selector { accent-color: var(--accent); margin: 0; }
