/* ═══════════════════════════════════════════════════════════
   MapStock — sistema de diseño
   Plataforma web responsiva. Sin frameworks CSS, sin build step.
   ═══════════════════════════════════════════════════════════ */

:root {
  --blue: #1A73E8;
  --blue-d: #0D5DBF;
  --blue-l: #5B9BF0;
  --green: #00C896;
  --green-d: #009E78;
  --green-ink: #00795C;
  --red: #E53935;
  --red-ink: #C62828;
  --amber: #F59E0B;
  --amber-ink: #B45309;
  --purple: #8B5CF6;
  --dark: #0A0F1E;
  --dark-2: #111827;
  --dark-3: #12233F;
  --ink: #1B2130;
  --muted: #5E6C87;
  --muted-2: #8791A6;
  --cream: #F4F6FA;
  --line: #E4E8EF;
  --line-2: #F0F3F8;
  --white: #fff;

  --r-sm: 9px;
  --r: 12px;
  --r-lg: 16px;
  --shadow: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, .10);
  --shadow-lg: 0 18px 44px rgba(10, 15, 30, .18);

  /* Las pisa el bloque que emite Typography con la fuente elegida. */
  --font-body: system-ui, -apple-system, Segoe UI, sans-serif;
  --font-display: var(--font-body);

  --nav-h: 67px;   /* alto real de la barra de abajo en mobile, sin el área segura */
  --header-h: 60px;
  --maxw: 1180px;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 15.5px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--cream);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
}

/* balance evita el huérfano suelto ("…moto 150 / cc") en títulos de 2-3 líneas */
h1, h2, h3, h4 {
  font-family: var(--font-display); font-weight: 800; margin: 0; line-height: 1.2;
  text-wrap: balance;
}
h1 { font-size: 25px; }
h2 { font-size: 20px; }
h3 { font-size: 16.5px; }
h4 { font-size: 14px; }
p { margin: 0; text-wrap: pretty; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
img { max-width: 100%; display: block; }

::-webkit-scrollbar { width: 7px; height: 7px; }
::-webkit-scrollbar-thumb { background: #C9D0DC; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

.material-symbols-outlined { font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 24; vertical-align: middle; }
.fill-1 { font-variation-settings: 'FILL' 1, 'wght' 500; }

/* ── tipografía utilitaria (set mínimo, no un clon de Tailwind) ── */
.display { font-family: var(--font-display); font-weight: 800; }
.t-xs { font-size: 11.5px; }
.t-sm { font-size: 13px; }
.t-md { font-size: 14.5px; }
.t-lg { font-size: 17.5px; }
.b6 { font-weight: 600; }
.b7 { font-weight: 700; }
.b8 { font-weight: 800; }
.muted { color: var(--muted); }
.muted-2 { color: var(--muted-2); }
.c-blue { color: var(--blue); }
.c-green { color: var(--green-ink); }
.c-red { color: var(--red-ink); }
.c-amber { color: var(--amber-ink); }
.center { text-align: center; }
.right { text-align: right; }
.strike { text-decoration: line-through; }
.upper { text-transform: uppercase; letter-spacing: .05em; }
.truncate { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ── layout ── */
.row { display: flex; align-items: center; gap: 10px; }
.row-top { display: flex; align-items: flex-start; gap: 10px; }
.col { display: flex; flex-direction: column; gap: 10px; }
.grow { flex: 1; min-width: 0; }
.wrap { flex-wrap: wrap; }
.gap-sm { gap: 6px; }
.gap-lg { gap: 16px; }
.mt { margin-top: 12px; }
.mb { margin-bottom: 12px; }
.hidden { display: none !important; }

.grid { display: grid; gap: 12px; }
.g2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.g3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.g4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 16px; width: 100%; }
.container-sm { max-width: 560px; margin: 0 auto; padding: 0 16px; width: 100%; }

/* ═══════════ shell de la app (comprador) ═══════════ */
.app { display: flex; flex-direction: column; min-height: 100dvh; }
.app-main { flex: 1; padding-bottom: calc(var(--nav-h) + env(safe-area-inset-bottom)); }

.topbar {
  background: linear-gradient(135deg, var(--dark), var(--dark-3));
  color: #fff;
  position: sticky;
  top: 0;
  z-index: 40;
}
.topbar .container { display: flex; align-items: center; gap: 12px; min-height: var(--header-h); }
.brand { display: flex; align-items: center; gap: 9px; text-decoration: none; }
.brand:hover { text-decoration: none; }

.loc-btn {
  background: none; border: none; padding: 0; cursor: pointer; font: inherit;
  display: flex; align-items: center; gap: 3px; color: var(--muted-2); font-size: 12.5px; margin-top: 2px;
}
.loc-btn:hover { color: #fff; }

.avatar {
  width: 34px; height: 34px; border-radius: 50%; flex-shrink: 0;
  background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2);
  color: #fff; font-weight: 700; font-size: 13px; cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; text-decoration: none;
}
.avatar:hover { background: rgba(255, 255, 255, .2); text-decoration: none; }
.avatar-lg {
  width: 66px; height: 66px; font-size: 23px; font-family: var(--font-display); font-weight: 800;
  background: linear-gradient(135deg, var(--blue), var(--green)); border: 2px solid rgba(255, 255, 255, .35);
}

/* En mobile es una barra fija abajo (por eso va fuera del flujo y su lugar en
   el markup no importa); en desktop entra en el flujo, debajo del encabezado. */
.bnav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 45;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding: 6px 4px calc(9px + env(safe-area-inset-bottom));
}
.btab {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 1px;
  color: var(--muted-2); font-size: 11px; font-weight: 600; padding: 5px; border-radius: var(--r-sm);
  background: none; border: none; font-family: inherit; cursor: pointer; text-decoration: none;
}
.btab:hover { text-decoration: none; }
.btab .material-symbols-outlined { font-size: 23px; }
.btab.on { color: var(--blue); }
.btab.on .material-symbols-outlined { font-variation-settings: 'FILL' 1, 'wght' 600; }

/* ── buscador ── */
.searchbox {
  display: flex; align-items: center; background: #fff; border-radius: var(--r);
  padding: 0 4px 0 12px; box-shadow: 0 6px 20px rgba(0, 0, 0, .28);
}
.searchbox input {
  border: none; box-shadow: none !important; flex: 1; font-size: 15.5px; padding: 13px 8px; background: none;
}
.searchbox input:focus { border: none; }
.btn-ai {
  background: linear-gradient(135deg, var(--purple), var(--blue)); border: none; border-radius: var(--r-sm);
  width: 34px; height: 34px; display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer; flex-shrink: 0; text-decoration: none;
}
.btn-ai:hover { text-decoration: none; filter: brightness(1.08); }

/* ── componentes ── */
.card { background: #fff; border: 1px solid var(--line); border-radius: 14px; box-shadow: var(--shadow); }
.card-p { padding: 14px; }
.card-link { width: 100%; text-align: left; font-family: inherit; color: inherit; cursor: pointer; }
.card-link:hover { text-decoration: none; border-color: #C7D6EE; box-shadow: var(--shadow-md); }

.btn {
  border: none; cursor: pointer; font-family: inherit; font-weight: 700; border-radius: 10px;
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  transition: .16s; font-size: 14.5px; padding: 11px 17px; text-decoration: none; line-height: 1.2;
}
.btn:hover { text-decoration: none; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn .material-symbols-outlined { font-size: 17px; }
.btn-p { background: linear-gradient(135deg, var(--blue), var(--blue-d)); color: #fff; box-shadow: 0 3px 12px rgba(26, 115, 232, .32); }
.btn-p:hover { transform: translateY(-1px); box-shadow: 0 6px 18px rgba(26, 115, 232, .42); color: #fff; }
.btn-g { background: linear-gradient(135deg, var(--green), var(--green-d)); color: #fff; box-shadow: 0 3px 12px rgba(0, 200, 150, .3); }
.btn-g:hover { transform: translateY(-1px); color: #fff; }
.btn-o { background: #fff; color: var(--ink); border: 1px solid #DDE3EC; }
.btn-o:hover { border-color: var(--blue); color: var(--blue); }
.btn-d { background: var(--red); color: #fff; }
.btn-d:hover { color: #fff; filter: brightness(1.06); }
.btn-sm { padding: 6px 11px; font-size: 12.5px; border-radius: 8px; }
.btn-sm .material-symbols-outlined { font-size: 14px; }
.btn-block { width: 100%; }
.btn-icon { width: 36px; height: 36px; padding: 0; border-radius: 10px; }

.badge {
  display: inline-flex; align-items: center; gap: 3px; padding: 3px 9px;
  border-radius: 999px; font-size: 11.5px; font-weight: 700; white-space: nowrap;
}
.badge .material-symbols-outlined { font-size: 12px; }
.b-green { background: rgba(0, 200, 150, .14); color: var(--green-ink); }
.b-blue { background: rgba(26, 115, 232, .12); color: var(--blue); }
.b-amber { background: rgba(245, 158, 11, .15); color: var(--amber-ink); }
.b-red { background: rgba(229, 57, 53, .12); color: var(--red-ink); }
.b-gray { background: #EEF1F6; color: var(--muted); }
.b-purple { background: rgba(139, 92, 246, .13); color: #6D28D9; }

.chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 6px 12px; border-radius: 999px;
  font-size: 13.5px; font-weight: 600; background: #fff; border: 1px solid #DDE3EC; color: #4A5568;
  cursor: pointer; white-space: nowrap; font-family: inherit; text-decoration: none;
}
.chip:hover { border-color: var(--blue); color: var(--blue); text-decoration: none; }
.chip.on { background: var(--blue); border-color: var(--blue); color: #fff; }

.seg { display: flex; background: #EBEFF6; border-radius: 10px; padding: 3px; gap: 2px; flex-shrink: 0; }
.seg button, .seg a {
  flex: 0 0 auto; padding: 8px 14px; font-size: 13.5px; font-weight: 700; border-radius: 8px; border: none;
  white-space: nowrap;
  background: none; color: var(--muted); cursor: pointer; font-family: inherit;
  display: flex; align-items: center; justify-content: center; gap: 5px; text-decoration: none;
}
.seg .material-symbols-outlined { font-size: 15px; }
.seg .on { background: #fff; color: var(--blue); box-shadow: 0 1px 4px rgba(16, 24, 40, .12); }

input, select, textarea {
  font-family: inherit; font-size: 15px; border: 1px solid #DDE3EC; border-radius: var(--r-sm);
  padding: 10px 13px; width: 100%; outline: none; background: #fff; color: var(--ink);
}
input:focus, select:focus, textarea:focus { border-color: var(--blue); box-shadow: 0 0 0 3px rgba(26, 115, 232, .13); }
input[type=checkbox] { width: auto; }
select { appearance: none; background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236B7894' d='M2 4l4 4 4-4z'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 10px center; padding-right: 28px; }
label.lbl {
  font-size: 11px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em;
  color: var(--muted); display: block; margin-bottom: 5px;
}
.field { display: block; }
.err { color: var(--red-ink); font-size: 12.5px; margin-top: 4px; }

.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13.5px; }
thead th {
  background: #EEF2F8; padding: 10px 12px; text-align: left; font-size: 11px; font-weight: 800;
  color: #4A5568; text-transform: uppercase; letter-spacing: .04em; border-bottom: 1px solid var(--line);
  position: sticky; top: 0; z-index: 1; white-space: nowrap;
}
tbody td { padding: 9px 11px; border-bottom: 1px solid var(--line-2); vertical-align: middle; }
tbody tr:hover { background: #F8FAFD; }
table input, table select { padding: 6px 9px; font-size: 13px; }

.stat { background: #fff; border: 1px solid var(--line); border-radius: 13px; padding: 14px; }
.stat h4 { font-family: inherit; font-size: 11px; text-transform: uppercase; letter-spacing: .04em; color: var(--muted); font-weight: 800; }
.stat .v { font-size: 27px; font-weight: 800; color: var(--dark); line-height: 1.15; margin-top: 2px; font-family: var(--font-display); }
.edge-b { border-left: 4px solid var(--blue); }
.edge-g { border-left: 4px solid var(--green); }
.edge-a { border-left: 4px solid var(--amber); }
.edge-r { border-left: 4px solid var(--red); }

.info { background: linear-gradient(90deg, rgba(26, 115, 232, .09), rgba(26, 115, 232, .02)); border: 1px solid rgba(26, 115, 232, .2); border-radius: 11px; padding: 12px 14px; }
.info-g { background: linear-gradient(90deg, rgba(0, 200, 150, .1), rgba(0, 200, 150, .02)); border: 1px solid rgba(0, 200, 150, .25); border-radius: 11px; padding: 12px 14px; }
.info-r { background: rgba(229, 57, 53, .06); border: 1px solid rgba(229, 57, 53, .22); border-radius: 11px; padding: 12px 14px; }

.hscroll {
  display: flex; gap: 7px; overflow-x: auto; scrollbar-width: none;
  padding-bottom: 2px; overscroll-behavior-x: contain;
}
.hscroll::-webkit-scrollbar { display: none; }
.hscroll > * { flex-shrink: 0; }
/* Sólo cuando hay algo más allá del borde: agarre para arrastrar y un
   desvanecido a la derecha que avisa que la fila sigue. */
.hscroll.can-scroll { cursor: grab; }
.hscroll.can-scroll:not(.at-end) {
  mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
  -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 34px), transparent);
}
.hscroll.dragging { cursor: grabbing; user-select: none; }

.thumb {
  width: 46px; height: 46px; border-radius: 12px; background: #EEF3FB; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center; font-size: 21px; overflow: hidden;
}
.thumb img { width: 100%; height: 100%; object-fit: cover; }

.hero { background: linear-gradient(135deg, var(--green), var(--blue-d)); padding: 22px 0 30px; color: #fff; }
.hero-ai { background: linear-gradient(135deg, var(--purple), var(--blue)); }
/* Fondo oscuro: el texto que no aclara su color hereda --ink y desaparece. */
.hero-dark { background: linear-gradient(135deg, var(--dark), var(--dark-3)); color: #fff; padding: 20px 0 24px; }
.hero-dark .muted, .hero-dark .muted-2 { color: rgba(255, 255, 255, .74); }

.empty { text-align: center; padding: 34px 18px; color: var(--muted); }
.empty .material-symbols-outlined { font-size: 40px; color: #C9D0DC; }

.sep { height: 1px; background: var(--line-2); border: 0; margin: 12px 0; }

.menu-list { overflow: hidden; }
.menu-list .item {
  display: flex; align-items: center; gap: 10px; width: 100%; padding: 13px 15px;
  border: none; border-bottom: 1px solid var(--line-2); background: none; font-family: inherit;
  font-size: 14.5px; font-weight: 600; color: var(--ink); cursor: pointer; text-align: left; text-decoration: none;
}
.menu-list .item:last-child { border-bottom: none; }
.menu-list .item:hover { background: #F8FAFD; text-decoration: none; }

/* ── mapa ── */
.map-shell { position: relative; height: calc(100dvh - var(--header-h) - var(--nav-h) - 118px); min-height: 340px; }
.map-canvas { position: absolute; inset: 0; border-radius: 0; background: #E8EFF7; }
.map-badge {
  position: absolute; top: 10px; left: 10px; z-index: 2;
  display: flex; align-items: center; gap: 6px; background: rgba(255, 255, 255, .95);
  border: 1px solid rgba(0, 200, 150, .35); border-radius: 999px; padding: 5px 12px;
  font-size: 12px; font-weight: 700; color: var(--green-ink); box-shadow: 0 3px 10px rgba(0, 0, 0, .12);
}
.map-sheet { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 2; }
.map-fallback { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; padding: 24px; text-align: center; color: var(--muted); }

.home-chips { margin-top: 10px; }

/* Portada a lo Google Maps: el mapa ocupa toda la pantalla y el buscador, los
   rubros y "Ver lista" flotan encima. La capa no captura clics en los huecos,
   así el mapa se sigue pudiendo arrastrar entre los botones. */
.map-shell.map-full { height: calc(100dvh - var(--header-h) - var(--nav-h) - env(safe-area-inset-bottom)); min-height: 420px; }
.map-top {
  position: absolute; top: 12px; left: 12px; right: 12px; z-index: 3;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.map-top > * { pointer-events: auto; }
.map-top .searchbox { border-radius: 26px; padding-left: 16px; box-shadow: 0 2px 6px rgba(0, 0, 0, .3); }
.map-top .searchbox input { padding: 12px 8px; }
.map-top .home-chips { margin: 0 -12px; padding: 2px 12px 6px; }
.map-top .chip { border: 0; box-shadow: 0 1px 4px rgba(0, 0, 0, .28); padding: 7px 14px; }
.map-top .chip:not(.on) { color: #3c4043; }
.map-top .map-badge { position: static; align-self: flex-start; }
.map-note {
  align-self: flex-start; background: #fff; border-radius: 12px; padding: 7px 12px;
  font-size: 12.5px; box-shadow: 0 1px 4px rgba(0, 0, 0, .25);
}
.map-fab {
  position: absolute; left: 50%; bottom: 22px; transform: translateX(-50%); z-index: 3;
  display: inline-flex; align-items: center; gap: 7px; background: #fff; color: var(--blue);
  font-weight: 700; font-size: 14px; padding: 11px 20px; border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .3); text-decoration: none; white-space: nowrap;
}
.map-fab:hover { text-decoration: none; background: #f8f9fa; }

/* Resultados de la búsqueda sobre el mapa: una barra con "Ver lista" y el
   paginador, y debajo las tarjetas en carrusel. La que queda centrada manda
   dónde mira el mapa. */
.map-sheet { left: 0; right: 0; bottom: 10px; pointer-events: none; }
.map-sheet > * { pointer-events: auto; }
.map-sheet-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 12px 8px; pointer-events: none; }
.map-sheet-bar > * { pointer-events: auto; }
.map-pill {
  display: inline-flex; align-items: center; gap: 6px; background: #fff; color: var(--blue);
  font-weight: 700; font-size: 13.5px; padding: 8px 15px; border-radius: 999px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, .28); text-decoration: none; white-space: nowrap;
}
.map-pill:hover { text-decoration: none; }
.map-pill .material-symbols-outlined { font-size: 19px; }
.map-pager { margin-left: auto; padding: 3px 5px; gap: 2px; color: var(--ink); font-weight: 600; }
.map-pager strong { font-weight: 800; }
.map-car-btn {
  width: 30px; height: 30px; border: 0; border-radius: 50%; background: none; color: var(--blue);
  display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0;
}
.map-car-btn:hover { background: #EEF3FB; }
.map-car-btn:disabled { color: #C9D0DC; cursor: default; background: none; }
.map-carousel {
  position: relative; display: flex; gap: 10px; overflow-x: auto; padding: 2px 12px 4px;
  scroll-snap-type: x mandatory; scroll-padding: 0 12px; scrollbar-width: none; overscroll-behavior-x: contain;
}
.map-carousel::-webkit-scrollbar { display: none; }
.map-card {
  flex: 0 0 88%; max-width: 420px; scroll-snap-align: center; display: flex; align-items: center; gap: 11px;
  padding: 11px 13px; box-shadow: 0 2px 8px rgba(0, 0, 0, .22); border: 2px solid transparent; min-width: 0;
}
.map-card:only-child { flex-basis: 100%; }
.map-card.on { border-color: var(--blue); }
.map-card.is-best.on { border-color: var(--green); }
@media (min-width: 900px) {
  /* 54px: alto real de la barra de pestañas en escritorio (ícono de 24 + 14 arriba y abajo + borde). */
  .map-shell.map-full { height: calc(100dvh - var(--header-h) - 54px); min-height: 460px; }
  .app-main:has(.map-full) { padding-bottom: 0; }
  .map-top { display: grid; grid-template-columns: 420px minmax(0, 1fr); align-items: center; column-gap: 12px; }
  .map-top .home-chips { margin: 0; padding: 4px 2px 6px; }
  .map-top .map-badge, .map-top .map-note { grid-column: 1; justify-self: start; }
  .map-full .map-sheet { right: auto; width: 444px; left: 0; bottom: 16px; }
  .map-full .map-card { flex-basis: 100%; }
}

/* Globo del pin. Vive dentro del InfoWindow de Google, fuera de .app. */
.map-pop { font-family: var(--font-body); min-width: 200px; max-width: 280px; }
.map-pop-t { font-size: 14px; font-weight: 700; line-height: 1.3; margin: 0; color: var(--ink); }
.map-pop-s { font-size: 12px; color: var(--muted); margin: 2px 0 0; }
.map-pop-p { font-family: var(--font-display); font-size: 18px; font-weight: 800; color: var(--green-ink); margin: 6px 0 0; }
.map-pop-more {
  display: block; width: 100%; margin-top: 9px; padding: 6px 10px; border: 1px solid var(--line);
  background: #F8FAFD; border-radius: 9px; font-family: inherit; font-size: 12.5px; font-weight: 700;
  color: var(--blue-d); cursor: pointer;
}
.map-pop-list { max-height: 210px; overflow-y: auto; margin-top: 6px; }
.map-pop-row {
  display: grid; grid-template-columns: 1fr auto; gap: 0 8px; align-items: baseline;
  padding: 7px 2px; border-bottom: 1px solid var(--line-2); text-decoration: none; color: var(--ink);
}
.map-pop-row:last-child { border-bottom: 0; }
.map-pop-row:hover { background: #F8FAFD; text-decoration: none; }
.map-pop-row-n { grid-area: 1 / 1; font-size: 12.5px; font-weight: 700; line-height: 1.25; }
.map-pop-row-b { grid-area: 2 / 1; font-size: 11px; color: var(--muted-2); }
.map-pop-row-p { grid-area: 1 / 2 / 3 / 3; font-family: var(--font-display); font-size: 13px; font-weight: 800; color: var(--green-ink); white-space: nowrap; }
.map-pop-cta {
  display: inline-block; margin-top: 9px; background: var(--blue); color: #fff; font-size: 13px;
  font-weight: 700; padding: 7px 13px; border-radius: 9px; text-decoration: none;
}
.map-pop-cta:hover { color: #fff; text-decoration: none; }
.map-pop-row-p small { display: block; font-family: var(--font-body); font-size: 10.5px; font-weight: 600; color: var(--muted); text-align: right; }

/* Botones flotantes del mapa, a la Google Maps. */
.map-ctrls { display: flex; flex-direction: column; align-items: flex-end; gap: 10px; margin: 0 10px 18px 0; }
.map-ctrl-group { display: flex; flex-direction: column; background: #fff; border-radius: 10px; box-shadow: 0 1px 4px rgba(0, 0, 0, .3); overflow: hidden; }
.map-ctrl {
  width: 42px; height: 42px; display: flex; align-items: center; justify-content: center;
  background: #fff; border: 0; border-radius: 10px; box-shadow: 0 1px 4px rgba(0, 0, 0, .3);
  color: #5f6368; cursor: pointer; padding: 0; -webkit-tap-highlight-color: transparent;
}
.map-ctrl:hover { color: #202124; background: #f8f9fa; }
.map-ctrl:active { background: #eceff1; }
.map-ctrl-group .map-ctrl { border-radius: 0; box-shadow: none; }
.map-ctrl-group .map-ctrl + .map-ctrl { border-top: 1px solid #e6e6e6; }
.map-ctrl.busy svg { color: var(--blue); animation: spin 1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
@media (max-width: 767px) { .map-ctrl { width: 46px; height: 46px; } }

/* Opciones de radio como tarjetas (backoffice). */
.start-opt { display: flex; flex-direction: column; gap: 7px; cursor: pointer; border: 2px solid var(--line); }
.start-opt input { position: absolute; opacity: 0; pointer-events: none; }
.start-opt:has(input:checked) { border-color: var(--blue); background: rgba(26, 115, 232, .04); }

/* Leyenda sobre una foto generada con IA. */
.photo-tag {
  position: absolute; left: 6px; bottom: 6px; background: rgba(10, 15, 30, .72); color: #fff;
  font-size: 10.5px; font-weight: 700; padding: 2px 7px; border-radius: 6px; line-height: 1.5;
}

/* Lista de productos con casillas (ofertas del panel). */
.offer-list { max-height: 340px; overflow-y: auto; border: 1px solid var(--line); border-radius: 10px; background: #fff; }
.offer-item { display: flex; align-items: center; gap: 10px; padding: 9px 11px; border-bottom: 1px solid var(--line-2); cursor: pointer; font-size: 13.5px; }
.offer-item:last-of-type { border-bottom: 0; }
.offer-item:hover { background: #F8FAFD; }
.offer-item:has(input:checked) { background: rgba(0, 200, 150, .07); }
.offer-item input { width: 17px; height: 17px; flex-shrink: 0; accent-color: var(--green-d); }

.ping { width: 7px; height: 7px; border-radius: 50%; background: var(--green); display: inline-block; position: relative; }
.ping::after {
  content: ''; position: absolute; inset: 0; border-radius: 50%; background: rgba(0, 200, 150, .5);
  animation: ping 2s infinite;
}
@keyframes ping { 0%, 100% { transform: scale(1); opacity: .65; } 50% { transform: scale(2.6); opacity: 0; } }
.glow { animation: gl 2.2s ease-in-out infinite; }
@keyframes gl {
  0%, 100% { box-shadow: 0 3px 12px rgba(26, 115, 232, .3), 0 0 0 0 rgba(26, 115, 232, .45); }
  50% { box-shadow: 0 7px 20px rgba(26, 115, 232, .45), 0 0 0 7px rgba(26, 115, 232, 0); }
}
@media (prefers-reduced-motion: reduce) { .glow, .ping::after { animation: none; } }

/* ── chat asistente ── */
.chat { display: flex; flex-direction: column; gap: 11px; padding: 16px 0; }

/* La barra de escritura se pega abajo. En mobile, arriba del nav fijo; en
   desktop el nav está en el encabezado, así que va al borde de la pantalla. */
.chat-bar {
  position: sticky; bottom: var(--nav-h); z-index: 20;
  background: #fff; border-top: 1px solid var(--line); padding: 11px 0 12px;
}
.bubble { max-width: 88%; padding: 11px 15px; font-size: 15px; line-height: 1.6; }
.bubble-u { align-self: flex-end; background: linear-gradient(135deg, var(--blue), var(--blue-d)); color: #fff; border-radius: 14px 14px 4px 14px; max-width: 82%; }
.bubble-b { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-radius: 14px 14px 14px 4px; box-shadow: var(--shadow); }
.bubble-b a { font-weight: 700; }
.typing span { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--muted-2); margin-right: 3px; animation: bounce 1.2s infinite; }
.typing span:nth-child(2) { animation-delay: .15s; }
.typing span:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-4px); } }

/* ── toast ── */
#toast {
  position: fixed; bottom: calc(var(--nav-h) + 16px); left: 50%; transform: translateX(-50%);
  background: var(--dark); color: #fff; padding: 12px 22px; border-radius: 12px; font-size: 13px;
  font-weight: 600; z-index: 9999; opacity: 0; transition: opacity .28s; pointer-events: none; font-size: 14px;
  box-shadow: 0 12px 30px rgba(0, 0, 0, .45); border-left: 4px solid var(--green); max-width: 90vw;
}
#toast.on { opacity: 1; }
#toast.err { border-left-color: var(--red); }

/* ── modal ── */
/* El scroll va en el fondo y no en la tarjeta: si el modal recorta su
   contenido, el desplegable de sugerencias queda cortado adentro. */
.modal-bg {
  position: fixed; inset: 0; background: rgba(10, 15, 30, .55); z-index: 100;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 16px; overflow-y: auto;
}
.modal {
  background: #fff; border-radius: var(--r-lg); width: 100%; max-width: 440px;
  box-shadow: var(--shadow-lg); overflow: visible; margin: auto;
}
.modal-head { padding: 15px 18px; border-bottom: 1px solid var(--line-2); display: flex; align-items: center; gap: 10px; }
.modal-body { padding: 18px; }

/* ═══════════ backoffice (comercio + admin) ═══════════
   El alcance lo define como escritorio; abajo de 1024 px avisamos. */
.bo { display: flex; min-height: 100dvh; }
.bo-side {
  width: 232px; flex-shrink: 0; background: linear-gradient(180deg, var(--dark), var(--dark-2) 60%, var(--dark-3));
  color: #fff; display: flex; flex-direction: column; position: sticky; top: 0; height: 100dvh;
}
.bo-side-head { padding: 14px 15px; border-bottom: 1px solid rgba(255, 255, 255, .09); display: flex; align-items: center; gap: 9px; }
.bo-nav { flex: 1; padding: 6px 0; overflow-y: auto; }
.nav-i {
  display: flex; align-items: center; gap: 10px; padding: 10px 14px; margin: 1px 8px; border-radius: var(--r-sm);
  font-size: 13.5px; font-weight: 600; cursor: pointer; color: rgba(255, 255, 255, .66); border: none;
  background: none; width: calc(100% - 16px); font-family: inherit; text-align: left; transition: .15s; text-decoration: none;
}
.nav-i:hover { background: rgba(255, 255, 255, .07); color: #fff; text-decoration: none; }
.nav-i.on { background: linear-gradient(90deg, rgba(26, 115, 232, .35), rgba(0, 200, 150, .1)); color: #fff; box-shadow: inset 3px 0 0 var(--green); }
.nav-i .material-symbols-outlined { font-size: 18px; }
.nav-sep { font-size: 9.5px; text-transform: uppercase; letter-spacing: .13em; color: rgba(255, 255, 255, .34); padding: 12px 16px 4px; font-weight: 700; }
.bo-side-foot { padding: 12px; border-top: 1px solid rgba(255, 255, 255, .09); display: flex; align-items: center; gap: 9px; }

.bo-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: var(--cream); }
.bo-head {
  min-height: 56px; background: #fff; border-bottom: 1px solid var(--line); display: flex;
  align-items: center; justify-content: space-between; gap: 14px; padding: 8px 20px; flex-shrink: 0;
}
.bo-strip {
  background: linear-gradient(90deg, var(--dark), var(--dark-3)); color: #fff; padding: 6px 20px;
  font-size: 12px; font-weight: 600; display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
}
.bo-body { flex: 1; padding: 20px; }
.bo-narrow { display: none; }

@media (max-width: 1023px) {
  /* .bo-main entero: si sólo se esconden sus hijos, el contenedor vacío sigue
     ocupando su flex:1 y empuja el aviso fuera del centro. */
  .bo-side, .bo-main { display: none; }
  .bo-narrow { display: block; padding: 40px 20px; text-align: center; max-width: 460px; margin: 0 auto; }
}

/* ── responsive de la app ── */
@media (min-width: 900px) {
  .bnav {
    position: sticky; top: var(--header-h); z-index: 39;
    border-top: none; border-bottom: 1px solid var(--line);
    padding: 0 16px; justify-content: center; gap: 4px;
    box-shadow: 0 1px 3px rgba(16, 24, 40, .05);
  }
  .btab {
    flex: 0 0 auto; flex-direction: row; gap: 7px; font-size: 14.5px;
    padding: 14px 20px; border-radius: 0; border-bottom: 2px solid transparent;
  }
  .btab:hover { color: var(--ink); background: #F8FAFD; }
  .btab.on { border-bottom-color: var(--blue); }
  .btab.on:hover { color: var(--blue); }
  .app-main { padding-bottom: 30px; }
  /* Con la barra de chat pegada al borde, ese margen dejaría una franja
     gris debajo de ella. */
  .app-main:has(.chat-bar) { padding-bottom: 0; }
  .chat-bar { bottom: 0; }
  #toast { bottom: 24px; }
  .map-shell { height: calc(100dvh - var(--header-h) - var(--nav-h) - 118px); min-height: 460px; }
}

@media (max-width: 640px) {
  .g4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .g3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  h1 { font-size: 19px; }
}

/* ═══════════ modo dios ═══════════ */
.switch {
  width: 52px; height: 30px; border-radius: 999px; flex-shrink: 0; cursor: pointer;
  border: 1px solid #DDE3EC; background: #EBEFF6; padding: 0; position: relative;
  transition: background .18s, border-color .18s;
}
.switch .knob {
  position: absolute; top: 3px; left: 3px; width: 22px; height: 22px; border-radius: 50%;
  background: #fff; box-shadow: 0 2px 6px rgba(16, 24, 40, .28); transition: transform .18s;
}
.switch.on { background: linear-gradient(135deg, var(--green), var(--green-d)); border-color: var(--green-d); }
.switch.on .knob { transform: translateX(22px); }
.switch:disabled { opacity: .55; cursor: wait; }
.switch:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

.god-row.is-off { background: #FDFBF6; border-color: rgba(245, 158, 11, .4); }
.god-row.is-off h3 { color: var(--amber-ink); }

/* pestaña de un módulo apagado: se ve, pero avisa */
.btab.off { opacity: .45; }

/* ── sugerencias de dirección (Places) ── */
.ac-list {
  position: absolute; z-index: 110; left: 0; right: 0; margin-top: 4px;
  background: #fff; border: 1px solid var(--line); border-radius: var(--r);
  box-shadow: var(--shadow-lg); overflow: hidden; max-height: 260px; overflow-y: auto;
}
.ac-item {
  display: block; width: 100%; text-align: left; padding: 10px 13px; border: none;
  background: none; font-family: inherit; font-size: 14.5px; color: var(--ink);
  cursor: pointer; border-bottom: 1px solid var(--line-2);
}
.ac-item:last-child { border-bottom: none; }
.ac-item:hover, .ac-item.on { background: #EEF3FB; color: var(--blue); }
.field { position: relative; }


/* ── confeti al guardar una oferta ── */
.confetti {
  position: fixed; z-index: 9998; pointer-events: none;
  width: 9px; height: 14px; border-radius: 2px; opacity: 0;
  animation: confetti var(--dur) cubic-bezier(.15, .7, .35, 1) forwards;
}
@keyframes confetti {
  0%   { opacity: 1; transform: translate(0, 0) rotate(0deg) scale(.6); }
  15%  { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(1); }
}
@media (prefers-reduced-motion: reduce) { .confetti { display: none; } }


/* ── feedback de guardado en la grilla de productos ── */
.row-saved td { animation: row-saved 900ms ease-out; }
@keyframes row-saved {
  0% { background: rgba(0, 200, 150, .22); }
  100% { background: transparent; }
}

/* ── ✕ para borrar una foto en el form de producto ── */
.photo-del {
  position: absolute; top: -6px; right: -6px; width: 22px; height: 22px;
  border-radius: 50%; border: none; cursor: pointer; padding: 0;
  background: var(--dark); color: #fff; display: flex; align-items: center;
  justify-content: center; box-shadow: 0 2px 6px rgba(16, 24, 40, .35);
}
.photo-del:hover { background: var(--red); }


/* ── selector de fotos ── */
.file-drop {
  position: relative; display: flex; flex-direction: column; align-items: center;
  gap: 6px; padding: 20px 14px; border: 2px dashed #CBD4E1; border-radius: var(--r);
  background: #F8FAFD; color: var(--muted); text-align: center; cursor: pointer;
  transition: border-color .15s, background .15s;
}
.file-drop input[type=file] {
  position: absolute; inset: 0; opacity: 0; cursor: pointer; width: 100%; height: 100%;
}
.file-drop .fd-text { font-size: 13px; font-weight: 600; }
.file-drop:hover, .file-drop.drag { border-color: var(--blue); background: #EEF3FB; color: var(--blue); }
.file-drop.has-files { border-style: solid; border-color: rgba(0, 200, 150, .5); color: var(--green-ink); }
.fd-previews { margin-top: 8px; }

/* ── KPIs clickeables del dashboard ── */
a.stat { display: block; color: inherit; text-decoration: none; transition: border-color .15s, box-shadow .15s; }
a.stat:hover { text-decoration: none; border-color: var(--blue); box-shadow: var(--shadow-md); }
