/* ============================================================
   ServiHome Pro — Design System (marketplace local)
   Limpio, tipográfico, sin “look IA”
   ============================================================ */

:root {
  --bg-primary: #f4f1eb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-glass: #ffffff;
  --border: #e5e0d8;
  --border-strong: #cfc8bc;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #8a8580;
  --accent: #0d7377;
  --accent-hover: #095c5f;
  --accent-soft: rgba(13, 115, 119, 0.1);
  --amber: #e07a2f;
  --amber-soft: rgba(224, 122, 47, 0.12);
  --danger: #c0392b;
  --success: #2d8a4e;
  --warning: #d4a017;
  --shadow: 0 1px 2px rgba(26,26,26,0.06), 0 4px 12px rgba(26,26,26,0.04);
  --shadow-lg: 0 8px 28px rgba(26,26,26,0.08);
  --radius: 10px;
  --radius-sm: 6px;
  --font: 'DM Sans', system-ui, -apple-system, sans-serif;
  --font-display: 'DM Sans', system-ui, sans-serif;
  --transition: 0.18s ease;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg-primary: #121212;
    --bg-secondary: #1c1c1c;
    --bg-card: #1c1c1c;
    --bg-glass: #1c1c1c;
    --border: #2e2e2e;
    --border-strong: #3d3d3d;
    --text-primary: #f5f5f5;
    --text-secondary: #b0b0b0;
    --text-muted: #777;
    --accent: #2bb3b8;
    --accent-hover: #3fc4c9;
    --accent-soft: rgba(43, 179, 184, 0.15);
    --amber: #f0a05a;
    --amber-soft: rgba(240, 160, 90, 0.15);
    --shadow: 0 1px 3px rgba(0,0,0,0.4);
    --shadow-lg: 0 8px 24px rgba(0,0,0,0.45);
  }
}

[data-theme="light"] {
  --bg-primary: #f4f1eb;
  --bg-secondary: #ffffff;
  --bg-card: #ffffff;
  --bg-glass: #ffffff;
  --border: #e5e0d8;
  --border-strong: #cfc8bc;
  --text-primary: #1a1a1a;
  --text-secondary: #4a4a4a;
  --text-muted: #8a8580;
  --accent: #0d7377;
  --accent-hover: #095c5f;
  --accent-soft: rgba(13, 115, 119, 0.1);
  --amber: #e07a2f;
  --amber-soft: rgba(224, 122, 47, 0.12);
  --shadow: 0 1px 2px rgba(26,26,26,0.06), 0 4px 12px rgba(26,26,26,0.04);
  --shadow-lg: 0 8px 28px rgba(26,26,26,0.08);
}

[data-theme="dark"] {
  --bg-primary: #121212;
  --bg-secondary: #1c1c1c;
  --bg-card: #1c1c1c;
  --bg-glass: #1c1c1c;
  --border: #2e2e2e;
  --border-strong: #3d3d3d;
  --text-primary: #f5f5f5;
  --text-secondary: #b0b0b0;
  --text-muted: #777;
  --accent: #2bb3b8;
  --accent-hover: #3fc4c9;
  --accent-soft: rgba(43, 179, 184, 0.15);
  --amber: #f0a05a;
  --amber-soft: rgba(240, 160, 90, 0.15);
  --shadow: 0 1px 3px rgba(0,0,0,0.4);
  --shadow-lg: 0 8px 24px rgba(0,0,0,0.45);
}

/* Reset & Base */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior-y: none; /* prevents pull-to-refresh rubberbanding */
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
ul, ol { list-style: none; }

/* Utilities */
.container { width: 100%; max-width: 1280px; margin: 0 auto; padding: 0 1.25rem; }
.flex { display: flex; }
.flex-col { flex-direction: column; }
.items-center { align-items: center; }
.justify-between { justify-content: space-between; }
.justify-center { justify-content: center; }
.gap-1 { gap: 0.25rem; }
.gap-2 { gap: 0.5rem; }
.gap-3 { gap: 0.75rem; }
.gap-4 { gap: 1rem; }
.gap-6 { gap: 1.5rem; }
.gap-8 { gap: 2rem; }
.w-full { width: 100%; }
.hidden { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

/* Glass Card */
.glass {
  background: var(--bg-card);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.glass-strong {
  background: var(--bg-glass);
  backdrop-filter: blur(24px);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
}

/* Gradient border effect */
.gradient-border {
  position: relative;
  background: var(--bg-card);
  border-radius: var(--radius);
}
.gradient-border::before {
  content: '';
  position: absolute;
  inset: 0;
  padding: 1px;
  border-radius: inherit;
  background: linear-gradient(135deg, var(--accent), var(--amber), var(--accent));
  -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  pointer-events: none;
  opacity: 0.6;
}

/* Bento Grid */
.bento {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
}
.bento-2 { grid-template-columns: repeat(2, 1fr); }
.bento-3 { grid-template-columns: repeat(3, 1fr); }
.bento-4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 900px) {
  .bento-2, .bento-3, .bento-4 { grid-template-columns: 1fr; }
}
@media (min-width: 901px) and (max-width: 1100px) {
  .bento-4 { grid-template-columns: repeat(2, 1fr); }
  .bento-3 { grid-template-columns: repeat(2, 1fr); }
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.35rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.95rem;
  border: none;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
}
.btn-primary:hover {
  background: var(--accent-hover);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(16, 185, 129, 0.45);
  background: linear-gradient(135deg, var(--accent-hover), #047857);
}
.btn-amber {
  background: linear-gradient(135deg, var(--amber), #d97706);
  color: #fff;
  box-shadow: 0 4px 14px rgba(245, 158, 11, 0.35);
}
.btn-amber:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(245, 158, 11, 0.45);
}
.btn-ghost {
  background: transparent;
  border: 1px solid var(--border-strong);
  color: var(--text-primary);
}
.btn-ghost:hover {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}
.btn-danger {
  background: var(--danger);
  color: #fff;
}
.btn-sm { padding: 0.45rem 0.9rem; font-size: 0.85rem; }
.btn-icon {
  width: 42px; height: 42px; padding: 0;
  border-radius: 12px;
}

/* Forms */
.form-group { margin-bottom: 1.1rem; }
.form-label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  margin-bottom: 0.35rem;
}
.form-input, .form-select, .form-textarea {
  width: 100%;
  padding: 0.75rem 1rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  color: var(--text-primary);
  transition: border-color var(--transition), box-shadow var(--transition);
}
.form-input:focus, .form-select:focus, .form-textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.form-textarea { min-height: 100px; resize: vertical; }

/* Badge */
.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.badge-emerald { background: var(--accent-soft); color: var(--accent); }
.badge-amber { background: var(--amber-soft); color: var(--amber); }
.badge-danger { background: rgba(239,68,68,0.15); color: var(--danger); }
.badge-muted { background: var(--border); color: var(--text-muted); }

/* Stars */
.stars { color: var(--amber); letter-spacing: 1px; }

/* Header / Nav */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border);
  padding: 0.65rem 0;
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.logo {
  font-weight: 800;
  font-size: 1.35rem;
  background: linear-gradient(135deg, var(--accent), var(--amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
}
.nav-links { display: flex; align-items: center; gap: 0.5rem; }
@media (max-width: 768px) {
  .nav-links .btn:not(.btn-primary):not(.btn-icon) { display: none; }
}

/* Hero */
.hero {
  padding: 2.5rem 0 1.5rem;
  background: var(--bg-primary);
}
.hero::before {
  content: '';
  position: absolute;
  top: -40%;
  left: 50%;
  transform: translateX(-50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, var(--accent-soft) 0%, transparent 70%);
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(1.75rem, 4.5vw, 2.75rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.02em;
  max-width: 18ch;
  margin-bottom: 0.75rem;
}
.hero h1 span {
  color: var(--accent);
}
.hero p {
  font-size: 1.15rem;
  color: var(--text-secondary);
  max-width: 560px;
  margin: 0 auto 2rem;
}

/* Search bar */
.search-box {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 1.5rem;
  padding: 0.5rem;
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  max-width: 720px;
}
.search-box input, .search-box select {
  flex: 1;
  min-width: 140px;
  border: none;
  background: transparent;
  padding: 0.7rem 1.1rem;
  outline: none;
  color: var(--text-primary);
}
.search-box .btn { border-radius: 999px; }

/* Stats */
.stats-bar {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1rem;
  margin: 3rem 0;
}
@media (max-width: 700px) {
  .stats-bar { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  text-align: center;
  padding: 1.5rem 1rem;
}
.stat-card .num {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent), var(--amber));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}
.stat-card .label {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-top: 0.25rem;
}

/* Business Card */
.biz-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.65rem;
  transition: border-color var(--transition), box-shadow var(--transition);
  box-shadow: none;
}
.biz-card:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow);
}
.biz-card.featured {
  border: 1px solid transparent;
  background: linear-gradient(var(--bg-card), var(--bg-card)) padding-box,
              linear-gradient(135deg, var(--accent), var(--amber)) border-box;
}
.biz-header {
  display: flex;
  align-items: flex-start;
  gap: 0.9rem;
}
.biz-logo {
  width: 56px; height: 56px;
  border-radius: 14px;
  object-fit: cover;
  background: var(--accent-soft);
  flex-shrink: 0;
}
.biz-logo.placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.5rem;
  font-weight: 700;
  color: var(--accent);
}
.biz-name { font-weight: 700; font-size: 1.05rem; }
.biz-meta { font-size: 0.8rem; color: var(--text-muted); }
.biz-desc {
  font-size: 0.9rem;
  color: var(--text-secondary);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.biz-actions {
  display: flex;
  gap: 0.5rem;
  margin-top: auto;
  flex-wrap: wrap;
}

/* Tabs (Dashboard) */
.tabs {
  display: flex;
  gap: 0.35rem;
  border-bottom: 1px solid var(--border);
  margin-bottom: 1.5rem;
  overflow-x: auto;
}
.tab {
  padding: 0.75rem 1.2rem;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-muted);
  border-bottom: 2px solid transparent;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  background: none;
  border-top: none;
  border-left: none;
  border-right: none;
}
.tab:hover { color: var(--text-primary); }
.tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}
.tab-panel { display: none; }
.tab-panel.active { display: block; animation: fadeIn 0.3s ease; }

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* Table */
.table-wrap { overflow-x: auto; }
table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9rem;
}
th, td {
  padding: 0.85rem 1rem;
  text-align: left;
  border-bottom: 1px solid var(--border);
}
th {
  font-weight: 600;
  color: var(--text-muted);
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}
tr:hover td { background: var(--accent-soft); }

/* Modal */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.55);
  backdrop-filter: blur(4px);
  z-index: 200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  opacity: 0;
  visibility: hidden;
  transition: all 0.25s ease;
}
.modal-overlay.open {
  opacity: 1;
  visibility: visible;
}
.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow-y: auto;
  padding: 1.75rem;
  box-shadow: var(--shadow-lg);
  transform: scale(0.95);
  transition: transform 0.25s ease;
}
.modal-overlay.open .modal { transform: scale(1); }
.modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.25rem;
}
.modal-header h3 { font-size: 1.2rem; font-weight: 700; }
.modal-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-muted);
  line-height: 1;
}

/* Footer */
.footer {
  margin-top: 4rem;
  padding: 2.5rem 0;
  border-top: 1px solid var(--border);
  text-align: center;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.footer a { color: var(--accent); }
.footer a:hover { text-decoration: underline; }

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 300;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}
.toast {
  padding: 0.9rem 1.3rem;
  border-radius: var(--radius-sm);
  background: var(--bg-secondary);
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-lg);
  font-size: 0.9rem;
  animation: slideIn 0.3s ease;
  max-width: 360px;
}
.toast.success { border-left: 3px solid var(--success); }
.toast.error { border-left: 3px solid var(--danger); }
@keyframes slideIn {
  from { opacity: 0; transform: translateX(40px); }
  to { opacity: 1; transform: translateX(0); }
}

/* Empty state */
.empty {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--text-muted);
}
.empty svg { margin: 0 auto 1rem; opacity: 0.4; }

/* Loading spinner */
.spinner {
  width: 28px; height: 28px;
  border: 3px solid var(--border);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
  margin: 2rem auto;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Sidebar dashboard */
.dash-layout {
  display: grid;
  grid-template-columns: 240px 1fr;
  min-height: calc(100vh - 64px);
}
@media (max-width: 800px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
  .dash-sidebar.mobile-open { display: block; position: fixed; inset: 0; z-index: 150; background: var(--bg-secondary); }
}
.dash-sidebar {
  background: var(--bg-secondary);
  border-right: 1px solid var(--border);
  padding: 1.5rem 1rem;
}
.dash-sidebar .nav-item {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.7rem 1rem;
  border-radius: var(--radius-sm);
  color: var(--text-secondary);
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 0.25rem;
}
.dash-sidebar .nav-item:hover,
.dash-sidebar .nav-item.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.dash-content { padding: 1.75rem; }

/* Status pills */
.status {
  display: inline-block;
  padding: 0.2rem 0.65rem;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
}
.status-pendiente { background: var(--amber-soft); color: var(--amber); }
.status-confirmada, .status-activo, .status-pagado { background: var(--accent-soft); color: var(--accent); }
.status-completada { background: rgba(34,197,94,0.15); color: var(--success); }
.status-cancelada, .status-suspendido, .status-eliminado, .status-vencido { background: rgba(239,68,68,0.15); color: var(--danger); }
.status-en_camino { background: rgba(59,130,246,0.15); color: #3b82f6; }

/* Legal pages */
.legal {
  max-width: 760px;
  margin: 0 auto;
  padding: 3rem 1.25rem;
}
.legal h1 { font-size: 2rem; margin-bottom: 0.5rem; }
.legal h2 { font-size: 1.25rem; margin: 2rem 0 0.75rem; color: var(--accent); }
.legal p, .legal li { color: var(--text-secondary); margin-bottom: 0.75rem; }
.legal ul { padding-left: 1.25rem; list-style: disc; }
.legal .updated { font-size: 0.85rem; color: var(--text-muted); margin-bottom: 2rem; }

/* Wizard registro */
.wizard-steps {
  display: flex;
  gap: 0.35rem;
  margin-bottom: 1.25rem;
  flex-wrap: wrap;
}
.wstep {
  flex: 1;
  text-align: center;
  font-size: 0.75rem;
  font-weight: 600;
  padding: 0.45rem 0.35rem;
  border-radius: 999px;
  background: var(--border);
  color: var(--text-muted);
  min-width: 70px;
}
.wstep.active {
  background: var(--accent-soft);
  color: var(--accent);
}
.form-hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin-bottom: 1rem;
}
@media (max-width: 640px) {
  .hide-mobile { display: none !important; }
  .modal { max-height: 92vh; border-radius: 20px 20px 12px 12px; }
  .search-box { border-radius: 16px; flex-direction: column; }
  .search-box input, .search-box select { width: 100%; }
  .header { padding-top: env(safe-area-inset-top); }
  .btn { min-height: 44px; }
}

/* PWA standalone mode — hide browser chrome artifacts */
@media (display-mode: standalone) {
  .header { border-bottom-width: 0.5px; }
  .bottom-nav { display: flex; }
  /* En modo standalone el padding ya lo cubre el bloque @media (max-width: 768px),
     pero lo repetimos aquí por si acaso el viewport es mayor en iPad/standalone */
  body.page-home { padding-bottom: calc(60px + env(safe-area-inset-bottom, 16px)); }
}


/* marketplace polish */
body {
  background-image: none;
}
.logo {
  font-weight: 800;
  letter-spacing: -0.03em;
  font-size: 1.15rem;
}
.logo span { color: var(--accent); }
.stat-card {
  background: var(--bg-card) !important;
  border: 1px solid var(--border);
  box-shadow: none !important;
  backdrop-filter: none !important;
}
.stat-card .num {
  font-variant-numeric: tabular-nums;
  color: var(--text-primary);
}
.biz-logo {
  border-radius: 8px;
  background: var(--bg-primary);
  border: 1px solid var(--border);
}
.biz-name {
  font-size: 1.05rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.section-title {
  font-size: 1.35rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin-bottom: 0.25rem;
}
.section-sub {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin-bottom: 1.25rem;
}
.hero-kicker {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--amber);
  margin-bottom: 0.5rem;
}
.active-cat {
  background: var(--text-primary) !important;
  color: var(--bg-secondary) !important;
  border-color: var(--text-primary) !important;
}
.footer {
  border-top: 1px solid var(--border);
  background: var(--bg-secondary);
}


/* search-first landing */
.hero {
  padding-bottom: 0.75rem;
}
.hero p {
  margin-bottom: 0;
}
#directorio .section-title {
  font-size: 1.1rem;
}
.search-box {
  margin-bottom: 0;
}


/* google-search header */
.header-search .nav-search {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  flex-wrap: wrap;
}
.top-search {
  flex: 1 1 280px;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  max-width: 640px;
  margin: 0 auto;
  padding: 0.35rem 0.45rem 0.35rem 0.75rem;
  background: var(--bg-primary);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  box-shadow: var(--shadow);
}
.top-search input[type="text"],
.top-search select {
  border: none;
  background: transparent;
  outline: none;
  font-size: 0.9rem;
  padding: 0.35rem 0.25rem;
  min-width: 0;
}
.top-search #searchQ { flex: 1 1 120px; }
.top-search #searchPais { max-width: 8.5rem; color: var(--text-secondary); }
.top-search #searchCiudad { max-width: 6.5rem; }
.top-search .btn { border-radius: 999px; flex-shrink: 0; }
.hero-compact {
  padding: 1.25rem 0 0.75rem;
}
.hero-compact h1 {
  font-size: clamp(1.35rem, 3.5vw, 1.85rem);
  max-width: 22ch;
}
.vista-lista {
  display: flex !important;
  flex-direction: column;
  gap: 0.65rem;
}
.biz-row {
  display: flex;
  gap: 0.85rem;
  padding: 0.85rem 1rem;
  align-items: flex-start;
}
.biz-row:hover {
  border-color: var(--accent);
}
@media (max-width: 768px) {
  /* Search becomes a full-width strip fused to the header bottom */
  .top-search {
    order: 3;
    flex: 1 1 100%;
    max-width: none;
    margin: 0 -1.25rem;   /* bleed past container padding */
    border-radius: 0;
    border: none;
    border-top: 1px solid var(--border);
    box-shadow: none;
    background: var(--bg-secondary);
    padding: 0.5rem 1rem;
    gap: 0.5rem;
  }
  .top-search #searchQ {
    flex: 1;
    font-size: 1rem;
    padding: 0.4rem 0.5rem;
  }
  /* Pill search button — larger tap target */
  .top-search .btn {
    min-width: 44px;
    min-height: 44px;
    border-radius: 999px;
  }
  .header-search .nav-search {
    justify-content: space-between;
    padding-bottom: 0;
    gap: 0.4rem;
  }
  .header-search { padding-bottom: 0; }
  /* Keep nav row height natural */
  .header-search .nav { height: auto; min-height: 52px; }
  .top-search #searchPais, .top-search #searchCiudad { display: none; }
  /* Bento: always single column on mobile */
  .bento { grid-template-columns: 1fr; }
  /* Business cards: more comfortable */
  .biz-card { padding: 1rem; }
  /* No horizontal overflow on the page */
  body { overflow-x: hidden; }
}

/* ============================================================
   LANGUAGE SWITCHER — pastilla ES/EN en el header
   ============================================================ */
.lang-switcher {
  display: inline-flex;
  align-items: center;
  background: var(--bg-secondary);
  border: 1.5px solid var(--border-strong);
  border-radius: 999px;
  padding: 3px;
  flex-shrink: 0;
  box-shadow: var(--shadow);
}
.lang-btn {
  background: transparent;
  border: none;
  border-radius: 999px;
  padding: 0.28rem 0.7rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--text-secondary);
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
  line-height: 1.5;
  letter-spacing: 0.05em;
  white-space: nowrap;
  min-width: 32px;
  text-align: center;
}
.lang-btn:hover {
  color: var(--text-primary);
  background: var(--accent-soft);
}
.lang-btn.active,
.lang-btn[aria-pressed="true"] {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px rgba(13,115,119,0.3);
}

/* ============================================================
   MODALS — bottom-sheet en teléfonos
   ============================================================ */
@media (max-width: 480px) {
  .modal-overlay { align-items: flex-end; padding: 0; }
  .modal {
    max-height: 93vh;
    border-radius: 20px 20px 0 0;
    width: 100%;
    max-width: 100%;
  }
  .modal::before {
    content: '';
    display: block;
    width: 36px;
    height: 4px;
    background: var(--border-strong);
    border-radius: 99px;
    margin: 0 auto 1rem;
  }
}

/* ============================================================
   BOTTOM NAVIGATION BAR (móvil) — sensación de app iOS/Android
   ============================================================ */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0; left: 0; right: 0;
  z-index: 200;
  /* Fondo sólido opaco para que sea visible en dark mode */
  background: var(--bg-secondary);
  border-top: 1px solid var(--border);
  /* iPhone home indicator safe area */
  padding-bottom: env(safe-area-inset-bottom, 0px);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  box-shadow: 0 -1px 12px rgba(0,0,0,0.12);
}
@media (max-width: 768px) {
  .bottom-nav { display: flex; }
  /* Reservar espacio para el bottom nav en TODOS los iPhones,
     incluyendo los que tienen home indicator (safe area > 0)
     y los más antiguos con safe area = 0 */
  body.page-home {
    padding-bottom: calc(60px + env(safe-area-inset-bottom, 16px));
  }
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  /* padding-bottom respeta el home indicator */
  padding: 0.55rem 0.25rem;
  background: none;
  border: none;
  /* Color más visible en ambos modos (light y dark) */
  color: var(--text-secondary);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  transition: color 0.15s;
  position: relative;
  min-height: 56px;
  min-width: 44px;
  -webkit-tap-highlight-color: transparent;
}
.bottom-nav-item:active { opacity: 0.6; }
.bottom-nav-item.active { color: var(--accent); }
/* Active pill indicator above icon */
.bottom-nav-item.active::before {
  content: '';
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 28px;
  height: 3px;
  background: var(--accent);
  border-radius: 0 0 3px 3px;
}
.bottom-nav-badge {
  position: absolute;
  top: 8px;
  left: calc(50% + 6px);
  background: var(--danger);
  color: #fff;
  font-size: 0.6rem;
  font-weight: 700;
  min-width: 16px;
  height: 16px;
  border-radius: 999px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Dark mode: reforzar visibilidad del bottom nav */
[data-theme="dark"] .bottom-nav {
  background: #1c1c1c;
  border-top-color: #3d3d3d;
}
[data-theme="dark"] .bottom-nav-item {
  color: #b0b0b0;
}
[data-theme="dark"] .bottom-nav-item.active {
  color: var(--accent);
}
@media (prefers-color-scheme: dark) {
  .bottom-nav {
    background: #1c1c1c;
    border-top-color: #3d3d3d;
  }
  .bottom-nav-item {
    color: #b0b0b0;
  }
  .bottom-nav-item.active {
    color: var(--accent);
  }
}

/* ============================================================
   DASHBOARD — sidebar drawer + bottom nav en móvil
   ============================================================ */
@media (max-width: 800px) {
  .dash-layout { grid-template-columns: 1fr; }
  .dash-sidebar { display: none; }
  .dash-sidebar.mobile-open {
    display: block;
    position: fixed;
    top: 0; left: 0; bottom: 0;
    width: min(280px, 85vw);
    z-index: 300;
    overflow-y: auto;
    background: var(--bg-secondary);
    border-right: 1px solid var(--border);
    box-shadow: var(--shadow-lg);
    padding-top: 1rem;
  }
  .dash-content { padding: 1.25rem; }
  .table-wrap { -webkit-overflow-scrolling: touch; }
  table th, table td { padding: 0.75rem; }
}
.dash-bottom-nav { display: none; }
@media (max-width: 800px) { .dash-bottom-nav { display: flex; } }
.dash-bottom-nav .bottom-nav-item { font-size: 0.62rem; min-height: 52px; }
