/* ==========================================================================
   micdlv — app.css
   Mobile-first. Sin dependencias. Moderno, profesional, amigable.
   v19: Refresh visual (Inter font, íconos SVG, paleta vibrante)
   ========================================================================== */

/* --- 1. Reset + tokens ------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }

:root {
  /* color — paleta moderna, vibrante pero cálida */
  --c-bg:        #f8fafc;
  --c-bg-2:      #eef2f7;     /* fondo con profundidad */
  --c-surface:   #ffffff;
  --c-text:      #0b1220;
  --c-muted:     #64748b;
  --c-line:      #e5e7eb;
  --c-primary:   #4f46e5;     /* indigo-600, más friendly que azul puro */
  --c-primary-2: #4338ca;     /* indigo-700 hover */
  --c-primary-3: #6366f1;     /* indigo-500 light */
  --c-accent:    #f59e0b;     /* amber-500 */
  --c-accent-2:  #d97706;     /* amber-600 */
  --c-success:   #10b981;
  --c-danger:    #ef4444;
  --c-warn:      #f59e0b;
  --c-whatsapp:  #25d366;
  --c-brigada:   #7c3aed;     /* morado de Brigada CDLV */

  /* gradientes */
  --g-primary: linear-gradient(135deg, #6366f1 0%, #4f46e5 100%);
  --g-warm:    linear-gradient(135deg, #fbbf24 0%, #f59e0b 100%);
  --g-cool:    linear-gradient(135deg, #06b6d4 0%, #0891b2 100%);
  --g-pink:    linear-gradient(135deg, #f472b6 0%, #ec4899 100%);
  --g-soft:    linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);

  /* radii */
  --r-xs:  4px;
  --r-sm:  8px;
  --r-md:  12px;
  --r-lg:  16px;
  --r-xl:  20px;
  --r-2xl: 28px;
  --r-pill: 999px;

  /* sombras — más sutiles y modernas */
  --sh-1: 0 1px 2px rgba(15,23,42,.05);
  --sh-2: 0 4px 12px rgba(15,23,42,.06), 0 1px 3px rgba(15,23,42,.04);
  --sh-3: 0 12px 32px rgba(15,23,42,.10), 0 2px 8px rgba(15,23,42,.04);
  --sh-4: 0 24px 56px rgba(15,23,42,.16), 0 4px 16px rgba(15,23,42,.06);
  --sh-focus: 0 0 0 3px rgba(99,102,241,.25);

  /* layout */
  --topbar-h: 64px;
  --tabbar-h: 68px;
  --max-w: 720px;
  --safe-top: env(safe-area-inset-top, 0);
  --safe-bottom: env(safe-area-inset-bottom, 0);

  /* motion */
  --t-fast:  120ms cubic-bezier(.4,0,.2,1);
  --t-mid:   200ms cubic-bezier(.4,0,.2,1);
  --t-slow:  320ms cubic-bezier(.4,0,.2,1);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.55;
  color: var(--c-text);
  background:
    radial-gradient(ellipse 800px 400px at 50% -100px, rgba(99,102,241,.10) 0%, transparent 60%),
    var(--c-bg);
  background-attachment: fixed;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: 'cv11', 'ss01';
  letter-spacing: -0.005em;
  padding-top: calc(var(--topbar-h) + var(--safe-top));
  padding-bottom: calc(var(--tabbar-h) + var(--safe-bottom) + 100px);
  min-height: 100vh;
  min-height: 100dvh;
}

img, svg { max-width: 100%; display: block; }
a { color: var(--c-primary); text-decoration: none; }
a:hover { text-decoration: underline; }
button { font: inherit; cursor: pointer; }

/* --- Form responsive (mobile) --- */
@media (max-width: 600px) {
  .form-card { padding: 14px 12px !important; }
  .form-card__title { font-size: 18px !important; }
  .form-card__subtitle { font-size: 15px !important; }
  .form-label { margin-bottom: 12px; }
  .form-label span { font-size: 13px; }
  input[type="text"], input[type="tel"], input[type="email"], input[type="url"],
  input[type="number"], input[type="time"], input[type="date"],
  input[type="file"], select, textarea {
    font-size: 16px !important; /* evita zoom en iOS */
    padding: 8px 10px;
    max-width: 100%;
  }
  textarea { min-height: 80px; }
  fieldset.form-label { padding: 10px 10px !important; }
fieldset.form-label { margin-left: 0; margin-right: 0; min-inline-size: 0; }
fieldset.form-label legend { padding: 0 4px; margin-left: -4px; }
/* Forzar alineación a la izquierda dentro de fieldsets (combate text-align:center heredado de .form-card) */
fieldset.form-label,
fieldset.form-label * { text-align: left; }
  .btn--block { padding: 10px 14px; font-size: 14px; }
  /* Fieldset de tipo (radio cards) */
  fieldset[style*="display: flex; gap: 8px;"] > div > label {
    padding: 8px 10px !important;
  }
  fieldset[style*="display: flex; gap: 8px;"] > div > label strong {
    font-size: 13px;
  }
  fieldset[style*="display: flex; gap: 8px;"] > div > label small {
    font-size: 11px;
  }
}

/* --- 2. Top bar -------------------------------------------------------- */
.topbar {
  position: fixed; inset: 0 0 auto 0;
  height: calc(var(--topbar-h) + var(--safe-top));
  padding-top: var(--safe-top);
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-bottom: 1px solid rgba(15,23,42,0.06);
  display: flex; align-items: center; justify-content: space-between;
  padding-left: 14px; padding-right: 10px;
  z-index: 50;
  box-shadow: 0 1px 0 rgba(15,23,42,0.02);
}
.topbar__brand {
  display: flex; align-items: center; gap: 10px;
  color: var(--c-text); text-decoration: none;
  min-width: 0; flex: 1 1 auto; max-width: 100%;
}
.topbar__brand:hover { text-decoration: none; }
.topbar__logo {
  width: 36px; height: 36px;
  border-radius: 10px;
  background: var(--g-primary);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 4px 12px rgba(79,70,229,0.30);
  flex-shrink: 0;
  overflow: hidden;
}
.topbar__logo svg { width: 22px; height: 22px; color: #fff; }
.topbar__name { min-width: 0; overflow: hidden; }
.topbar__name strong {
  display: block;
  font-size: 17px;
  line-height: 1.2;
  font-weight: 800;
  letter-spacing: -0.02em;
  background: var(--g-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.topbar__name small {
  display: block;
  color: var(--c-muted);
  font-size: 10.5px;
  line-height: 1.3;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: 0.01em;
}
.topbar__cta {
  display: inline-flex; align-items: center; gap: 6px;
  background: #fff;
  color: var(--c-text);
  padding: 7px 11px;
  border-radius: var(--r-pill);
  font-size: 13px;
  font-weight: 600;
  text-decoration: none;
  border: 1px solid var(--c-line);
  transition: all var(--t-fast);
}
.topbar__cta:hover {
  background: var(--c-bg-2);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--sh-1);
}
.topbar__cta svg { width: 16px; height: 16px; flex-shrink: 0; }

/* Variantes de color por contexto */
.topbar__cta--install {
  background: var(--g-primary) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 4px 12px rgba(79,70,229,0.30);
  display: inline-flex !important;
}
.topbar__cta--install:hover {
  background: var(--c-primary-2) !important;
  box-shadow: 0 6px 16px rgba(79,70,229,0.40);
}
.topbar__cta--install.is-installed {
  display: none !important;
}
.topbar__cta--notif {
  background: linear-gradient(135deg, #fef3c7 0%, #fde68a 100%) !important;
  color: #92400e !important;
  border-color: #fcd34d !important;
}
.topbar__cta--admin {
  background: var(--c-brigada) !important;
  color: #fff !important;
  border-color: transparent !important;
}
.topbar__cta--user {
  background: linear-gradient(135deg, #dbeafe 0%, #bfdbfe 100%) !important;
  color: #1e3a8a !important;
  border-color: #93c5fd !important;
}
.topbar__cta-text { display: none; }
@media (min-width: 480px) {
  .topbar__cta-text { display: inline; }
}

/* --- 3. Main ----------------------------------------------------------- */
.app-main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 16px;
}

/* --- 4. Hero (home) ---------------------------------------------------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(ellipse 600px 300px at 100% 0%, rgba(245,158,11,0.30) 0%, transparent 60%),
    radial-gradient(ellipse 500px 300px at 0% 100%, rgba(99,102,241,0.40) 0%, transparent 60%),
    var(--g-primary);
  color: #fff;
  border-radius: var(--r-2xl);
  padding: 28px 22px;
  margin-bottom: 20px;
  box-shadow: var(--sh-3);
}
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='40' height='40' viewBox='0 0 40 40'%3E%3Ccircle cx='1' cy='1' r='1' fill='rgba(255,255,255,0.05)'/%3E%3C/svg%3E");
  pointer-events: none;
}
.hero > * { position: relative; z-index: 1; }
.hero h1 {
  margin: 0 0 6px;
  font-size: 26px;
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.025em;
}
.hero p {
  margin: 0 0 16px;
  opacity: .92;
  font-size: 15px;
  line-height: 1.45;
  max-width: 36ch;
}
.hero__search {
  display: flex; gap: 6px; align-items: center;
  background: #fff;
  border-radius: var(--r-pill);
  padding: 5px 5px 5px 18px;
  box-shadow: var(--sh-2);
  transition: box-shadow var(--t-fast);
}
.hero__search:focus-within {
  box-shadow: var(--sh-3), 0 0 0 3px rgba(255,255,255,0.40);
}
.hero__search svg { width: 18px; height: 18px; color: var(--c-muted); flex-shrink: 0; }
.hero__search input {
  flex: 1; border: 0; background: transparent;
  font: inherit; padding: 10px 0;
  outline: none; color: var(--c-text);
  min-width: 0;
}
.hero__search button {
  border: 0;
  background: var(--g-warm);
  color: #fff;
  padding: 10px 18px;
  border-radius: var(--r-pill);
  font-weight: 700; font-size: 14px;
  cursor: pointer;
  transition: all var(--t-fast);
  box-shadow: 0 2px 8px rgba(245,158,11,0.40);
}
.hero__search button:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(245,158,11,0.50);
}
.hero__search button:active { transform: translateY(0); }

.hero__chips {
  display: flex; flex-wrap: wrap; gap: 6px;
  margin-top: 14px;
}
.hero__chip {
  display: inline-flex; align-items: center; gap: 5px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  color: #fff; padding: 6px 12px;
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600;
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.20);
  transition: all var(--t-fast);
}
.hero__chip:hover {
  background: rgba(255,255,255,.30);
  text-decoration: none;
  transform: translateY(-1px);
}

/* --- 5. Section title -------------------------------------------------- */
.section {
  margin: 24px 0 8px;
}
.section__head {
  display: flex; align-items: baseline; justify-content: space-between;
  margin-bottom: 12px;
  padding: 0 4px;
}
.section__title {
  margin: 0;
  font-size: 18px;
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section__link {
  font-size: 13px; color: var(--c-primary); font-weight: 600;
  display: inline-flex; align-items: center; gap: 3px;
}
.section__link:hover { text-decoration: none; }

/* --- 6. Categorías grid ------------------------------------------------- */
.catgrid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
@media (min-width: 480px) { .catgrid { grid-template-columns: repeat(5, 1fr); } }

.cat {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 7px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: 14px 6px;
  text-align: center;
  color: var(--c-text);
  text-decoration: none;
  transition: all var(--t-fast);
  position: relative;
  overflow: hidden;
}
.cat::before {
  content: '';
  position: absolute;
  inset: 0;
  background: var(--cat-color, transparent);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.cat > * { position: relative; z-index: 1; }
.cat:hover {
  box-shadow: var(--sh-2);
  transform: translateY(-2px);
  text-decoration: none;
  border-color: transparent;
}
.cat:hover::before { opacity: 0.06; }
.cat:active { transform: translateY(0); }
.cat__icon {
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  background: var(--cat-color, var(--c-bg-2));
  color: #fff;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
.cat__icon svg { width: 22px; height: 22px; }
.cat__icon-emoji {
  font-size: 24px;
  line-height: 1;
  background: var(--cat-color, var(--c-bg-2));
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 12px;
  box-shadow: 0 4px 10px rgba(0,0,0,0.06);
}
.cat__name {
  font-size: 11.5px; font-weight: 600; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.01em;
}

/* --- 7. Card local ----------------------------------------------------- */
.local {
  display: flex; gap: 14px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-lg);
  padding: 14px;
  margin-bottom: 10px;
  text-decoration: none; color: var(--c-text);
  box-shadow: var(--sh-1);
  transition: all var(--t-fast);
  position: relative;
}
.local:hover {
  box-shadow: var(--sh-2);
  transform: translateY(-1px);
  text-decoration: none;
  border-color: var(--c-line);
}
.local:active { transform: translateY(0); }
.local__img {
  flex: 0 0 84px;
  width: 84px; height: 84px;
  border-radius: var(--r-md);
  object-fit: cover;
  background: var(--c-bg-2);
  box-shadow: var(--sh-1);
}
.local__body { flex: 1; min-width: 0; }
.local__name {
  display: flex; align-items: center; gap: 6px;
  font-size: 15.5px; font-weight: 700; line-height: 1.25;
  margin-bottom: 4px;
  letter-spacing: -0.015em;
}
.local__cat {
  font-size: 11.5px; color: var(--c-muted); font-weight: 600;
  display: inline-flex; align-items: center; gap: 4px;
  margin-bottom: 4px;
}
.local__desc {
  font-size: 13px; color: var(--c-muted);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 4px;
}
.local__meta {
  display: flex; gap: 10px; flex-wrap: wrap;
  font-size: 11px; color: var(--c-muted);
}
.local__meta span { display: inline-flex; align-items: center; gap: 3px; }
.badge {
  display: inline-flex; align-items: center; gap: 3px;
  background: #fef3c7; color: #92400e;
  font-size: 10px; font-weight: 700; padding: 2px 7px;
  border-radius: var(--r-pill);
  text-transform: uppercase;
  letter-spacing: .03em;
}
.badge--premium { background: #dbeafe; color: #1e40af; }
.badge--destacado { background: #fef3c7; color: #92400e; }
.badge--verificado { background: #dcfce7; color: #166534; }

/* --- 8. Banner (publicidad) ------------------------------------------- */
.banner {
  display: block;
  background: var(--c-surface);
  border: 1px dashed var(--c-line);
  border-radius: var(--r-md);
  padding: 14px 16px;
  text-align: center;
  color: var(--c-muted);
  font-size: 12px;
  text-decoration: none;
  margin: 16px 0;
}
.banner--solid {
  background: linear-gradient(90deg, var(--c-accent) 0%, #fb923c 100%);
  color: #fff; border: 0;
  font-weight: 600;
}

/* --- 9. Página de local (ficha) ---------------------------------------- */
.local-hero {
  position: relative;
  background: var(--c-surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 16px;
  box-shadow: var(--sh-1);
}
.local-hero__img {
  width: 100%; height: 220px; object-fit: cover;
  background: #ddd;
}
.local-hero__body { padding: 16px; }
.local-hero__cat {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 12px; color: var(--c-muted);
  margin-bottom: 6px;
}
.local-hero h1 {
  margin: 0 0 8px;
  font-size: 22px; line-height: 1.2;
}
.local-hero__desc {
  margin: 0; color: var(--c-muted); font-size: 14px;
}

.local-info {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: 4px 0;
  margin-bottom: 16px;
  box-shadow: var(--sh-1);
}
.local-info__row {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 14px 16px;
  border-bottom: 1px solid var(--c-line);
}
.local-info__row:last-child { border-bottom: 0; }
.local-info__icon {
  flex: 0 0 32px;
  font-size: 20px; line-height: 1;
  margin-top: 2px;
}
.local-info__label {
  font-size: 11px; color: var(--c-muted);
  text-transform: uppercase; font-weight: 700;
  letter-spacing: .04em;
  margin-bottom: 2px;
}
.local-info__value { font-size: 15px; }
.local-info__value a { color: var(--c-text); font-weight: 600; }

.local-actions {
  display: grid; grid-template-columns: 1fr 1fr; gap: 10px;
  margin-bottom: 16px;
}
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 14px 18px; border-radius: var(--r-md);
  font-size: 15px; font-weight: 700;
  letter-spacing: -0.01em;
  text-decoration: none; border: 0;
  cursor: pointer;
  transition: all var(--t-fast);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn svg { width: 18px; height: 18px; flex-shrink: 0; }
.btn--primary {
  background: var(--g-primary);
  color: #fff;
  box-shadow: 0 4px 12px rgba(79,70,229,0.30);
}
.btn--primary:hover {
  background: var(--c-primary-2);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(79,70,229,0.40);
}
.btn--wa { background: var(--c-whatsapp); color: #fff; box-shadow: 0 4px 12px rgba(37,211,102,0.30); }
.btn--wa:hover { background: #1ebe57; text-decoration: none; transform: translateY(-1px); }
.btn--ghost {
  background: var(--c-surface);
  color: var(--c-text);
  border: 1px solid var(--c-line);
  box-shadow: var(--sh-1);
}
.btn--ghost:hover {
  background: var(--c-bg-2);
  text-decoration: none;
  border-color: #cbd5e1;
  transform: translateY(-1px);
}

.local-map {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--sh-1);
  margin-bottom: 16px;
}
.local-map iframe { display: block; border: 0; width: 100%; height: 260px; }

/* --- 10. Datos útiles -------------------------------------------------- */
.util {
  background: var(--c-surface);
  border-radius: var(--r-md);
  padding: 16px;
  margin-bottom: 10px;
  box-shadow: var(--sh-1);
  display: flex; gap: 12px; align-items: center;
  text-decoration: none; color: var(--c-text);
}
.util:hover { box-shadow: var(--sh-2); text-decoration: none; }
.util__icon {
  flex: 0 0 48px; width: 48px; height: 48px;
  border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  font-size: 24px;
  background: #f1f5f9;
}
.util__body { flex: 1; min-width: 0; }
.util__name { font-size: 15px; font-weight: 700; line-height: 1.2; }
.util__desc { font-size: 12px; color: var(--c-muted); margin-top: 2px; }
.util__cta {
  font-size: 12px; color: var(--c-primary); font-weight: 700;
  background: #dbeafe; padding: 6px 10px; border-radius: var(--r-pill);
  white-space: nowrap;
}

/* --- 11. Banner CTA emergency ----------------------------------------- */
.emergency-cta {
  background: linear-gradient(135deg, #dc2626 0%, #b91c1c 100%);
  color: #fff;
  border-radius: var(--r-lg);
  padding: 20px;
  margin-bottom: 16px;
  text-align: center;
  box-shadow: var(--sh-2);
}
.emergency-cta h2 { margin: 0 0 4px; font-size: 18px; }
.emergency-cta p { margin: 0 0 14px; opacity: .9; font-size: 13px; }
.emergency-cta__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px;
}
.emergency-cta__btn {
  background: rgba(255,255,255,.18);
  color: #fff; padding: 12px 6px;
  border-radius: var(--r-md);
  font-weight: 700; font-size: 18px;
  text-decoration: none;
}
.emergency-cta__btn small { display: block; font-size: 10px; font-weight: 500; opacity: .9; margin-top: 2px; }
.emergency-cta__btn:hover { background: rgba(255,255,255,.28); text-decoration: none; }

/* Brigada CDLV — botón full-width, fuera del grid, layout horizontal */
.brigada-btn {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 10px;
  padding: 12px 14px;
  background: #7c3aed;
  color: #fff;
  border-radius: var(--r-md);
  text-decoration: none;
  font-weight: 700;
  box-shadow: 0 2px 6px rgba(124,58,237,.4);
  white-space: nowrap;
}
.brigada-btn:hover { background: #6d28d9; color: #fff; text-decoration: none; }
.brigada-btn__icon { font-size: 28px; flex-shrink: 0; }
.brigada-btn__text { display: flex; flex-direction: column; line-height: 1.2; min-width: 0; }
.brigada-btn__text strong { font-size: 16px; }
.brigada-btn__text small { font-size: 12px; font-weight: 500; opacity: .92; margin-top: 2px; }

/* --- 12. Bottom tab bar ----------------------------------------------- */
.tabbar {
  position: fixed; inset: auto 0 0 0;
  height: calc(var(--tabbar-h) + var(--safe-bottom));
  padding-bottom: var(--safe-bottom);
  background: rgba(255,255,255,0.92);
  backdrop-filter: saturate(180%) blur(16px);
  -webkit-backdrop-filter: saturate(180%) blur(16px);
  border-top: 1px solid rgba(15,23,42,0.06);
  display: grid; grid-template-columns: repeat(4, 1fr);
  z-index: 50;
  box-shadow: 0 -1px 0 rgba(15,23,42,0.02);
}
.tabbar__item {
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 3px;
  color: var(--c-muted);
  text-decoration: none;
  font-size: 10.5px; font-weight: 600;
  position: relative;
  padding: 6px 4px;
  transition: color var(--t-fast);
}
.tabbar__icon { line-height: 1; display: flex; transition: transform var(--t-fast); }
.tabbar__item.is-active { color: var(--c-primary); }
.tabbar__item.is-active .tabbar__icon { transform: translateY(-1px); }
.tabbar__item.is-active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  background: var(--g-primary);
  border-radius: 0 0 3px 3px;
}
.tabbar__item:hover { text-decoration: none; color: var(--c-text); }
.tabbar__item:active { transform: scale(0.96); }

/* --- 13. FAB WhatsApp -------------------------------------------------- */
.fab-wa {
  position: fixed; right: 14px; bottom: calc(var(--tabbar-h) + 14px + var(--safe-bottom));
  width: 56px; height: 56px;
  background: #25d366;
  color: #fff;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 8px 24px rgba(37,211,102,0.45), 0 2px 6px rgba(0,0,0,0.15);
  z-index: 40;
  text-decoration: none;
  transition: all var(--t-fast);
}
.fab-wa:hover { background: #1ebe57; text-decoration: none; transform: translateY(-2px) scale(1.05); box-shadow: 0 12px 32px rgba(37,211,102,0.55); }
.fab-wa:active { transform: translateY(0) scale(0.95); }

/* --- 14. Footer -------------------------------------------------------- */
.app-footer {
  margin-top: 32px;
  margin-bottom: 80px; /* espacio para el FAB de WhatsApp */
  background: var(--c-surface);
  border-top: 1px solid var(--c-line);
  padding: 20px 16px 28px;
  text-align: center;
  font-size: 12px; color: var(--c-muted);
}
.app-footer__inner p { margin: 4px 0; }
.app-footer__legal a { color: var(--c-muted); margin: 0 4px; }
.app-footer__copy { font-size: 11px; opacity: .7; }

/* --- 15. Empty state --------------------------------------------------- */
.empty {
  text-align: center; padding: 40px 16px;
  color: var(--c-muted);
}
.empty__icon { font-size: 48px; margin-bottom: 8px; }

/* --- 16. Búsqueda simple ---------------------------------------------- */
.search-page {
  margin-bottom: 16px;
}
.search-page input {
  width: 100%;
  padding: 14px 16px;
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  font: inherit;
  background: var(--c-surface);
  outline: none;
}
.search-page input:focus { border-color: var(--c-primary); }

/* --- 17. Install prompt (PWA) ----------------------------------------- */
.install-prompt {
  position: fixed; inset: auto 16px 16px 16px;
  background: var(--c-text); color: #fff;
  border-radius: var(--r-lg);
  padding: 14px 16px;
  display: flex; gap: 12px; align-items: center;
  box-shadow: var(--sh-3);
  z-index: 60;
  font-size: 13px;
  transform: translateY(150%);
  transition: transform .3s ease;
}
.install-prompt.is-visible { transform: translateY(0); }
.install-prompt__icon { font-size: 24px; }
.install-prompt__body { flex: 1; }
.install-prompt__body strong { display: block; font-size: 14px; }
.install-prompt__body small { opacity: .8; }
.install-prompt__actions { display: flex; gap: 6px; }
.install-prompt__btn {
  border: 0; padding: 8px 12px; border-radius: var(--r-pill);
  font-size: 12px; font-weight: 700;
  background: var(--c-primary); color: #fff;
}
.install-prompt__btn--ghost {
  background: transparent; color: #fff;
  border: 1px solid rgba(255,255,255,.3);
}

/* --- 18. Form card (login, registro, verificación) ------------------ */
.form-card {
  background: var(--c-surface);
  border-radius: var(--r-xl);
  padding: 26px 22px;
  margin-bottom: 16px;
  box-shadow: var(--sh-2);
  border: 1px solid rgba(15,23,42,0.04);
  text-align: center;
}
.form-card__title {
  margin: 0 0 4px;
  font-size: 24px;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.025em;
  background: var(--g-primary);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.form-card__subtitle {
  margin: 0 0 12px;
  font-size: 16px;
  font-weight: 700;
  text-align: left;
  letter-spacing: -0.015em;
}
.form-card__sub {
  margin: 0 0 16px;
  color: var(--c-muted);
  font-size: 14px;
  line-height: 1.5;
}
.form-card__alt {
  margin: 16px 0 0;
  font-size: 14px;
}
.form-card__alt--muted { color: var(--c-muted); font-size: 13px; }

.form { text-align: left; }
.form-label {
  display: block;
  margin-bottom: 14px;
}
.form-label > span:first-child {
  display: block;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--c-text);
  letter-spacing: -0.005em;
}
.form-label input,
.form-label select,
.form-label textarea {
  display: block;
  width: 100%;
  padding: 13px 14px;
  border: 1.5px solid var(--c-line);
  border-radius: var(--r-md);
  font: inherit;
  background: #fff;
  color: var(--c-text);
  outline: none;
  transition: all var(--t-fast);
}
.form-label input:hover,
.form-label select:hover,
.form-label textarea:hover {
  border-color: #cbd5e1;
}
.form-label input:focus,
.form-label select:focus,
.form-label textarea:focus {
  border-color: var(--c-primary-3);
  box-shadow: var(--sh-focus);
}
.form-label textarea { resize: vertical; min-height: 80px; }
.form-hint {
  display: block;
  margin-top: 6px;
  color: var(--c-muted);
  font-size: 12px;
  line-height: 1.4;
}
.form-check {
  display: flex; align-items: flex-start; gap: 8px;
  font-size: 13px; color: var(--c-muted);
  margin-bottom: 14px;
}
.form-check input { margin-top: 3px; }
.form-check a { color: var(--c-primary); }

.btn--block { display: flex; width: 100%; }

.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%;
  padding: 13px 16px;
  border: 1.5px solid #dadce0;
  border-radius: var(--r-md);
  background: #fff;
  color: #1f1f1f;
  font-size: 15px;
  font-weight: 600;
  text-decoration: none;
  margin-bottom: 8px;
  transition: all var(--t-fast);
  box-shadow: var(--sh-1);
}
.btn-google:hover {
  background: #f8f9fa;
  box-shadow: var(--sh-2);
  text-decoration: none;
  border-color: #c4c7c5;
  transform: translateY(-1px);
}
.btn-google__icon { display:inline-flex; }

.form-divider {
  display: flex; align-items: center; gap: 10px;
  margin: 18px 0 14px;
  color: var(--c-muted);
  font-size: 12px;
  text-transform: uppercase;
  letter-spacing: .04em;
}
.form-divider::before, .form-divider::after {
  content: ''; flex: 1; height: 1px; background: var(--c-line);
}

/* --- 19. Alerts ----------------------------------------------------- */
.alert {
  padding: 12px 14px;
  border-radius: var(--r-md);
  font-size: 14px;
  margin-bottom: 14px;
  text-align: left;
}
.alert--ok   { background: #dcfce7; color: #166534; }
.alert--err  { background: #fee2e2; color: #991b1b; }
.alert--warn { background: #fef3c7; color: #92400e; }

/* --- 20. Admin ----------------------------------------------------- */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 16px 0;
}
@media (max-width: 480px) { .stats-grid { grid-template-columns: repeat(2, 1fr); } }
.stat {
  background: var(--c-bg);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 12px 8px;
  text-align: center;
}
.stat__n { font-size: 22px; font-weight: 800; line-height: 1.1; }
.stat__l { font-size: 11px; color: var(--c-muted); margin-top: 2px; }
.stat--warn { background: #fef3c7; }
.stat--warn .stat__n { color: #92400e; }
.stat--ok { background: #dcfce7; }
.stat--ok .stat__n { color: #166534; }

.admin-item {
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  padding: 12px;
  margin-bottom: 10px;
  background: #fafbfc;
}
.admin-item__head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 8px; margin-bottom: 8px;
}
.admin-item__body {
  font-size: 13px; color: var(--c-text);
  background: #fff; padding: 8px 10px; border-radius: var(--r-sm);
  margin-bottom: 8px;
}
.admin-item__body > div { margin: 2px 0; }
.admin-item__actions {
  display: flex; gap: 8px; flex-wrap: wrap;
}
.admin-item__actions .btn {
  flex: 1; min-width: 110px; padding: 10px 12px; font-size: 14px;
}

/* --- 21. Marketplace ------------------------------------------------ */
.mk-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}
@media (min-width: 480px) { .mk-grid { grid-template-columns: repeat(3, 1fr); } }
@media (min-width: 720px) { .mk-grid { grid-template-columns: repeat(4, 1fr); } }

.mk {
  display: block;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-md);
  overflow: hidden;
  text-decoration: none;
  color: var(--c-text);
  box-shadow: var(--sh-1);
  transition: box-shadow .12s, transform .12s;
}
.mk:hover { box-shadow: var(--sh-2); transform: translateY(-1px); text-decoration: none; }
.mk__img {
  width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #e2e8f0;
  display: block;
}
.mk__body { padding: 10px; }
.mk__title {
  font-size: 13px; font-weight: 600; line-height: 1.25;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 32px;
  margin-bottom: 4px;
}
.mk__precio {
  font-size: 16px; font-weight: 800; color: var(--c-primary);
}
.mk__precio--free { color: var(--c-success); font-size: 14px; }
.mk__cat {
  font-size: 10px; color: var(--c-muted); font-weight: 600;
  text-transform: uppercase; letter-spacing: .03em;
  margin-top: 4px;
}
.mk__badge { position: absolute; margin-left: 6px; }
.mk__wrap { position: relative; }
.mk__wrap .badge { position: absolute; top: 6px; right: 6px; z-index: 1; }

.mk-filters {
  display: flex; gap: 6px; flex-wrap: wrap;
  margin-bottom: 14px;
  padding: 8px 0;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
}
.mk-filters::-webkit-scrollbar { display: none; }
.mk-chip {
  flex: 0 0 auto;
  padding: 6px 12px;
  background: var(--c-surface);
  border: 1px solid var(--c-line);
  border-radius: var(--r-pill);
  font-size: 12px; font-weight: 600;
  color: var(--c-text);
  text-decoration: none;
}
.mk-chip.is-active { background: var(--c-primary); color: #fff; border-color: var(--c-primary); }
.mk-chip:hover { background: #f1f5f9; text-decoration: none; }
.mk-chip.is-active:hover { background: var(--c-primary-2); }

/* Producto ficha */
.prod-gallery {
  position: relative;
  background: #000;
  border-radius: var(--r-lg);
  overflow: hidden;
  margin-bottom: 14px;
}
.prod-gallery__main {
  width: 100%; aspect-ratio: 4/3; object-fit: contain;
  background: #fff;
}
.prod-gallery__nav {
  position: absolute; inset: 0 0 auto 0;
  padding: 10px;
  display: flex; justify-content: space-between; align-items: center;
  pointer-events: none;
}
.prod-gallery__nav .btn { pointer-events: auto; padding: 8px 10px; font-size: 18px; min-width: 40px; }
.prod-thumbs {
  display: flex; gap: 6px;
  margin-top: 8px;
  overflow-x: auto;
  padding: 4px 2px;
  scrollbar-width: thin;
}
.prod-thumbs img {
  flex: 0 0 64px; width: 64px; height: 64px;
  object-fit: cover; border-radius: var(--r-sm);
  border: 2px solid transparent;
  cursor: pointer;
}
.prod-thumbs img.is-active { border-color: var(--c-primary); }

.prod-info {
  background: var(--c-surface);
  border-radius: var(--r-lg);
  padding: 16px;
  margin-bottom: 14px;
  box-shadow: var(--sh-1);
}
.prod-precio {
  font-size: 28px; font-weight: 800; color: var(--c-primary);
  margin: 8px 0;
}
.prod-precio--free { color: var(--c-success); }
.prod-desc {
  font-size: 14px; line-height: 1.55;
  color: var(--c-text);
  white-space: pre-wrap;
  margin: 12px 0;
}
.prod-meta {
  font-size: 12px; color: var(--c-muted);
  display: flex; flex-wrap: wrap; gap: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--c-line);
}
.prod-meta span { display: inline-flex; align-items: center; gap: 4px; }

.disclaimer {
  background: #fef3c7;
  border: 1px solid #fde68a;
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 12px;
  color: #92400e;
  margin-bottom: 14px;
  line-height: 1.45;
}
.disclaimer strong { display: block; margin-bottom: 4px; font-size: 13px; }

/* --- Toast (PWA install feedback) --- */
.cdlv-toast {
  position: fixed; left: 50%; top: 24px;
  transform: translateX(-50%) translateY(-100px);
  background: #1f2937; color: #fff;
  padding: 10px 16px; border-radius: 999px;
  font-size: 14px; font-weight: 600;
  box-shadow: 0 4px 12px rgba(0,0,0,.25);
  z-index: 10000;
  opacity: 0; pointer-events: none;
  transition: transform .3s ease, opacity .3s ease;
}
.cdlv-toast.is-visible {
  transform: translateX(-50%) translateY(0);
  opacity: 1;
  pointer-events: auto;
}
.cdlv-toast--ok { background: #16a34a; }
.cdlv-toast--err { background: #dc2626; }

/* --- Botones de mapa (Waze, Google Maps) --- */
.btn--waze { background: #0ea5e9 !important; color: #fff !important; }
.btn--gmaps { background: #16a34a !important; color: #fff !important; }
.local-map-block { margin: 16px 0; }
.local-map-block__iframe {
  width: 100%; height: 300px; border: 0; border-radius: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.1);
}
.local-map-block__placeholder {
  background: #f1f5f9; border-radius: 12px; padding: 40px 20px;
  text-align: center; color: #64748b;
  font-size: 14px;
}
.local-map-block__placeholder span { font-size: 48px; display: block; margin-bottom: 8px; }
.local-map-block__nav { display: flex; gap: 8px; margin-top: 8px; }
.local-map-block__nav .btn { flex: 1; }
