:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #5f6368;
  --accent: #1a73e8;
  --border: #e0e0e0;
  --card: #f8f9fa;
  --max-width: 640px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--fg);
  background: var(--bg);
  line-height: 1.5;
}

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 24px 16px 48px;
}

.site-header {
  border-bottom: 1px solid var(--border);
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.site-header .brand {
  font-size: 20px;
  font-weight: bold;
  color: var(--accent);
  text-decoration: none;
}

.locale-switcher select {
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 13px;
  background: var(--bg);
  color: var(--fg);
  max-width: 180px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Right-to-left support (Arabic, Persian, Urdu, …). */
[dir="rtl"] .site-header,
[dir="rtl"] .result-meta,
[dir="rtl"] .pagination { flex-direction: row-reverse; }
[dir="rtl"] .search-form,
[dir="rtl"] .results,
[dir="rtl"] .categories { text-align: right; }

.site-footer {
  border-top: 1px solid var(--border);
  padding: 16px;
  text-align: center;
  color: var(--muted);
  font-size: 13px;
}

.hero { max-width: 640px; }
.hero h1 { font-size: 28px; margin-bottom: 4px; }
.hero p { color: var(--muted); margin-top: 0; }

.intro {
  max-width: 640px;
  margin: 24px 0;
  padding: 20px 24px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--fg);
  line-height: 1.7;
  text-align: justify;
  hyphens: auto;
}
.intro p { margin: 0 0 12px; }
.intro p:last-child { margin-bottom: 0; }

.how-to {
  max-width: 640px;
  margin: 24px 0;
  padding: 16px 20px;
  background: #eef3fe;
  border-left: 4px solid var(--accent);
  border-radius: 6px;
  line-height: 1.7;
  text-align: justify;
  hyphens: auto;
}
.how-to strong { color: var(--fg); }

.search-form {
  display: grid;
  gap: 20px;
  max-width: 640px;
  margin: 64px 0;
  padding: 28px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

/* min-width:0 lets the flex fields shrink below their intrinsic width so the
   inputs never overflow the card on narrow (mobile) viewports. */
.search-form .field { display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.search-form .field-row { display: flex; gap: 16px; }
.search-form .field-row .field { flex: 1; }

.search-form label { font-size: 13px; font-weight: bold; color: var(--muted); }

.search-form input,
.search-form select {
  width: 100%;
  max-width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
}

.type-field, .city-field { position: relative; }

.type-search-input {
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 6px;
  font-size: 15px;
  width: 100%;
}

.type-search-list {
  position: absolute;
  left: 0;
  right: 0;
  top: 100%;
  z-index: 20;
  margin: 4px 0 0;
  padding: 4px 0;
  list-style: none;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 6px;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.12);
  max-height: 280px;
  overflow-y: auto;
}

.type-search-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  padding: 8px 12px;
  cursor: pointer;
}

.type-search-list li.active,
.type-search-list li:hover {
  background: #eef3fe;
}

.type-search-list .ts-group {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 14px;
  font-size: 16px;
  font-weight: bold;
  cursor: pointer;
}

.categories { margin-top: 32px; max-width: 640px; }
.categories ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
}
.categories a { color: var(--accent); text-decoration: none; font-size: 14px; }

.results { display: grid; gap: 16px; margin-top: 16px; max-width: 640px; }

.result-card {
  border: 1px solid var(--border);
  background: var(--card);
  border-radius: 8px;
  padding: 16px;
}

.result-name { margin: 0 0 4px; font-size: 18px; }
.result-desc { margin: 0 0 4px; color: var(--muted); }
.result-address { margin: 0 0 8px; font-size: 14px; }
.result-phone { margin: 0 0 8px; font-size: 14px; }
.result-phone a { color: var(--accent); text-decoration: none; }
.result-name a { color: var(--accent); text-decoration: none; }
.result-meta { display: flex; gap: 16px; font-size: 14px; margin: 0; }
.result-meta .rating { color: #b06000; font-weight: bold; }

.result-count { color: var(--muted); }

.pagination {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 24px;
}
.pagination .next-page-form { margin-left: auto; }

.next-page,
.prev-page {
  display: inline-block;
  padding: 10px 16px;
  border: 1px solid var(--accent);
  border-radius: 6px;
  background: transparent;
  color: var(--accent);
  text-decoration: none;
  font-weight: bold;
  font-size: 15px;
  cursor: pointer;
}

.recaptcha-prompt { color: var(--fg); font-weight: bold; }
.recaptcha-failed { color: #c5221f; }
.recaptcha-branding {
  margin-top: 16px;
  color: var(--muted);
  font-size: 12px;
}
.recaptcha-branding a { color: var(--muted); }
.error { color: #c5221f; }
.empty, .hint { color: var(--muted); }
