:root {
  --bg: #f0f5ff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #dbe3f1;
  --accent: #2563eb;
  --accent-dark: #1d4ed8;
  --accent-hover: #1e40af;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(160deg, #f0f6ff 0%, #e8efff 40%, #eef4ff 100%);
  font-family: "IBM Plex Sans", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.bg-glow {
  position: fixed;
  inset: -10% -20% auto -20%;
  height: 420px;
  pointer-events: none;
  background: radial-gradient(circle at 30% 30%, rgba(5, 105, 216, 0.2), transparent 55%);
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 11px 18px;
  border-bottom: 1px solid rgba(203, 213, 225, 0.7);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 1px 12px rgba(15, 23, 42, 0.06);
  gap: 10px;
  flex-wrap: wrap;
}

.back-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
  color: var(--accent);
  font-weight: 800;
  letter-spacing: -0.02em;
  font-family: "Space Grotesk", sans-serif;
  text-shadow: 0 1px 8px rgba(37, 99, 235, 0.15);
  transition: opacity 0.15s;
}

.back-link:hover {
  opacity: 0.8;
}

.brand-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: linear-gradient(135deg, #1d4ed8 0%, #3b82f6 100%);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: -0.03em;
  font-family: "Space Grotesk", sans-serif;
  box-shadow: 0 4px 12px rgba(29, 78, 216, 0.35);
  flex-shrink: 0;
}

.brand-wordmark {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: -0.04em;
  color: #0f172a;
  font-family: "Space Grotesk", sans-serif;
  margin-left: 8px;
  white-space: nowrap;
}

.brand-dot {
  color: #2563eb;
}

.lang-switch {
  display: flex;
  gap: 6px;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.message-top-btn {
  position: relative;
}

.message-top-badge {
  position: absolute;
  top: -6px;
  right: -6px;
  min-width: 18px;
  height: 18px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 18px;
  text-align: center;
  padding: 0 4px;
  border: 2px solid #fff;
  box-shadow: 0 2px 8px rgba(239, 68, 68, 0.35);
}

.profile-menu-wrap {
  position: relative;
}

.profile-btn {
  width: 38px;
  height: 38px;
  border: 1.5px solid #bfdbfe;
  border-radius: 999px;
  background: linear-gradient(135deg, #dbeafe, #eff6ff);
  cursor: pointer;
  font-size: 17px;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.15);
  transition: box-shadow 0.18s, border-color 0.18s;
}

.profile-btn:hover {
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  border-color: #93c5fd;
}

.profile-menu {
  position: absolute;
  top: 48px;
  right: 0;
  min-width: 230px;
  border: 1px solid #e2e8f0;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 20px 48px rgba(2, 6, 23, 0.16), 0 4px 16px rgba(2, 6, 23, 0.08);
  padding: 10px;
  display: grid;
  gap: 5px;
  z-index: 35;
}

.profile-menu[hidden] {
  display: none !important;
}

.profile-menu-wrap[hidden] {
  display: none !important;
}

.profile-name {
  font-size: 13px;
  font-weight: 700;
  color: #1d4ed8;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  padding: 0 4px 4px;
}

.profile-menu-link {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 600;
  color: #0f172a;
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 10px;
}

.profile-menu-link:hover {
  background: #eef4ff;
}

.profile-logout {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fafc;
  padding: 8px 10px;
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
  display: flex;
  align-items: center;
  gap: 10px;
  justify-content: flex-start;
}

.profile-menu-sep {
  height: 1px;
  background: var(--line);
  margin: 4px 4px;
}

.menu-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: #eef4ff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 32px;
}

.menu-icon img {
  width: 18px;
  height: 18px;
  object-fit: contain;
}

.auth-btn {
  padding-inline: 16px;
  font-weight: 700;
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%) !important;
  border-color: transparent !important;
  color: #ffffff !important;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.32);
}

.auth-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%) !important;
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.42) !important;
}

#authBtn[hidden] {
  display: none !important;
}

.lang-btn {
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 600;
  cursor: pointer;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.lang-btn:hover {
  background: #f0f6ff;
  border-color: #bfdbfe;
}

.lang-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: var(--accent);
  color: #fff;
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.3);
}

.dropdown-lang {
  position: relative;
}

.lang-globe {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
}

.lang-menu {
  position: absolute;
  top: 46px;
  right: 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 6px;
  display: grid;
  gap: 6px;
  min-width: 64px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.12);
  z-index: 30;
}

.lang-menu[hidden] {
  display: none !important;
}

.lang-menu-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fafc;
  padding: 6px 8px;
  font-weight: 700;
  cursor: pointer;
}

.shell {
  max-width: 1100px;
  margin: 0 auto;
  padding: 16px;
}

.hero {
  background: linear-gradient(135deg, #eaf2ff 0%, #f5f9ff 100%);
  border: 1px solid rgba(219, 227, 241, 0.8);
  border-radius: 18px;
  padding: 18px;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
}

.hero h1 {
  margin: 0;
}

.hero p {
  margin: 8px 0 0;
  color: var(--muted);
}

.hero-main {
  min-width: 0;
}

.hero-controls {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  min-width: 280px;
}

.filters-toolbar {
  margin-top: 14px;
  position: sticky;
  top: 62px;
  z-index: 18;
  padding: 6px 0 8px;
  background: linear-gradient(180deg, rgba(248, 251, 255, 0.96) 0%, rgba(248, 251, 255, 0.88) 100%);
  backdrop-filter: blur(4px);
}

.filter-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
}

.toolbar-actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.toolbar-search {
  min-width: 260px;
  flex: 1;
  border: 1.5px solid #e2e8f0;
  border-radius: 999px;
  padding: 10px 16px;
  min-height: 44px;
  background: #ffffff;
  display: flex;
  align-items: center;
  gap: 8px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.04);
  transition: border-color 0.18s, box-shadow 0.18s;
}

.toolbar-search:focus-within {
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1), 0 1px 4px rgba(15, 23, 42, 0.04);
}

.toolbar-search input {
  border: 0;
  outline: none;
  width: 100%;
  font: inherit;
  background: transparent;
}

.toolbar-search-icon {
  font-size: 16px;
  color: var(--muted);
}

.icon-btn {
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 0 12px;
}

.filter-btn-label {
  font-weight: 700;
}

.filter-toggle-icon {
  font-size: 14px;
}

.filters {
  margin-top: 18px;
  padding: 20px;
  border: 1px solid #e2e8f0;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  align-items: start;
  box-shadow: 0 8px 32px rgba(15, 23, 42, 0.1), 0 32px 64px rgba(15, 23, 42, 0.08);
  position: fixed;
  top: 80px;
  left: 50%;
  transform: translateX(-50%);
  width: min(920px, calc(100% - 32px));
  max-height: calc(100vh - 120px);
  overflow: auto;
  overflow-x: hidden;
  z-index: 41;
}

.filters-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  grid-column: 1 / -1;
  margin: -20px -20px 4px -20px;  /* bleed to panel edges */
  padding: 14px 20px;
  background: #f8fafc;
  border-bottom: 1px solid #f1f5f9;
  border-radius: 24px 24px 0 0;
  position: sticky;
  top: -20px;
  z-index: 2;
}

.filters-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  grid-column: 1 / -1;
}

.filters.collapsed {
  display: none;
}

.geo-tools {
  display: grid;
  grid-template-columns: 1fr 120px;
  gap: 8px;
}

.distance-tools {
  display: grid;
  grid-template-columns: 240px;
  gap: 8px;
  grid-column: 1 / -1;
}

.distance-tools .ghost-btn {
  padding: 11px 12px;
  font-weight: 600;
}

.location-picker-card {
  width: min(920px, 100%);
}

.location-picker-top {
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 8px;
}

.location-picker-hint {
  font-size: 13px;
  color: var(--muted);
}

.location-picker-radius {
  display: grid;
  grid-template-columns: 80px 1fr;
  align-items: center;
  gap: 8px;
}

.location-picker-radius select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 8px 10px;
  background: #fff;
}

#clientLocationMap {
  width: 100%;
  height: min(56vh, 460px);
  background: #e2e8f0;
}

/* Map view: fullscreen container */
.map-view-fullscreen {
  position: fixed;
  inset: 0;
  z-index: 65;
  display: block;
}

/* Floating toolbar — always rendered above the Mapbox canvas */
.map-view-toolbar {
  position: absolute;
  top: 12px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 9999;
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid #e2e8f0;
  border-radius: 16px;
  padding: 8px 10px;
  box-shadow: 0 4px 24px rgba(15, 23, 42, 0.18);
  pointer-events: auto;
}

.map-view-select {
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  padding: 7px 10px;
  min-height: 38px;
  background: #fff;
  font-weight: 600;
  font-size: 13px;
  color: #334155;
  cursor: pointer;
}

.map-view-close {
  width: 38px;
  height: 38px;
  border-radius: 10px;
  border: 1.5px solid #e2e8f0;
  background: #fff;
  font-size: 20px;
  font-weight: 700;
  color: #334155;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
  flex-shrink: 0;
}

.map-view-close:hover {
  background: #fee2e2;
  border-color: #fca5a5;
  color: #dc2626;
  box-shadow: 0 2px 8px rgba(220,38,38,0.15);
}

/* Map fills the whole screen */
#mapViewMap {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  background: #e2e8f0;
}

/* Legacy modal-card override (kept for safety) */
#mapViewModal .modal-card,
#mapViewModal .location-picker-card {
  display: none;
}

#mapViewModal {
  z-index: 60;
  padding: 0;           /* map fills full screen, no padding */
  background: none;     /* fullscreen container handles bg */
  pointer-events: none; /* pass through to map-view-fullscreen */
}

#mapViewModal.hidden {
  display: none !important;
}

/* Enable interaction on the actual map container */
#mapViewModal .map-view-fullscreen {
  pointer-events: auto;
}

.mapbox-branch-marker {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid #cbd5e1;
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.25);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mapbox-branch-marker img {
  width: 20px;
  height: 20px;
  object-fit: contain;
}

.location-picker-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 10px 12px 12px;
}

.price-range {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  grid-column: 1 / -1;
}

/* ── PRICE RANGE SLIDER ── */
.price-slider-wrap {
  position: relative;
  grid-column: 1 / -1;
  height: 44px;               /* fixed height: track(6) + thumb(24) + labels */
  margin-bottom: 28px;        /* room for labels below */
  padding: 0 2px;
}

/* grey background track */
.range-track-bg {
  position: absolute;
  top: 9px;
  left: 11px;
  right: 11px;
  height: 6px;
  background: #e2e8f0;
  border-radius: 999px;
  pointer-events: none;
}

/* blue filled track between thumbs */
.range-track-fill {
  position: absolute;
  top: 9px;
  height: 6px;
  background: linear-gradient(90deg, #2563eb, #1d4ed8);
  border-radius: 999px;
  pointer-events: none;
  left: 0%;
  right: 0%;
  margin-left: 11px;
  margin-right: 11px;
  /* actual left/right set dynamically via JS */
}

/* both range inputs overlap */
.price-slider-wrap input[type="range"] {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 24px;
  margin: 0;
  -webkit-appearance: none;
  appearance: none;
  background: transparent;
  pointer-events: none;
  outline: none;
}

#priceMinRange { z-index: 3; }
#priceMaxRange { z-index: 2; }

/* hide the default track — we draw our own */
.price-slider-wrap input[type="range"]::-webkit-slider-runnable-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

.price-slider-wrap input[type="range"]::-moz-range-track {
  height: 6px;
  border-radius: 999px;
  background: transparent;
}

/* thumb */
.price-slider-wrap input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  margin-top: -8px;
  pointer-events: auto;
  cursor: pointer;
  transition: box-shadow 0.15s, transform 0.1s;
}

.price-slider-wrap input[type="range"]::-webkit-slider-thumb:hover {
  box-shadow: 0 0 0 6px rgba(37, 99, 235, 0.14), 0 2px 8px rgba(37, 99, 235, 0.35);
  transform: scale(1.1);
}

.price-slider-wrap input[type="range"]::-moz-range-thumb {
  width: 20px;
  height: 20px;
  border-radius: 50%;
  background: #ffffff;
  border: 2.5px solid #2563eb;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.35);
  pointer-events: auto;
  cursor: pointer;
}

/* labels below the track */
.price-slider-labels {
  position: absolute;
  bottom: -26px;
  left: 0;
  right: 0;
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  font-weight: 600;
  color: #475569;
  padding: 0 4px;
}

.filter-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  grid-column: 1 / -1;
  position: sticky;
  bottom: -20px;
  margin: 0 -20px -20px -20px;
  padding: 12px 20px 16px;
  background: rgba(255, 255, 255, 0.97);
  border-top: 1px solid #f1f5f9;
  backdrop-filter: blur(8px);
}

.filters input,
.filters select {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 14px;
  padding: 11px 12px;
  background: #fff;
  min-height: 46px;
  font: inherit;
  color: #0f172a;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.filters input:focus,
.filters select:focus {
  outline: none;
  border-color: #93c5fd;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.filter-actions .solid-btn,
.filter-actions .ghost-btn {
  min-height: 48px;
  border-radius: 999px;
  font-weight: 700;
}

#searchInput {
  grid-column: 1 / -1;
  display: block;
}

.solid-btn,
.ghost-btn {
  border-radius: 14px;
  border: 1px solid transparent;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, box-shadow 0.18s, transform 0.12s;
}

.solid-btn:active,
.ghost-btn:active {
  transform: scale(0.97);
}

.solid-btn {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #fff;
  font-weight: 700;
  padding: 10px 16px;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.28);
}

.solid-btn:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.38);
}

.ghost-btn {
  background: #f0f5ff;
  color: #1e3a8a;
  border-color: #c7d8f5;
  padding: 8px 12px;
}

.ghost-btn:hover {
  background: #e6efff;
  border-color: #a5c0ee;
}

.cards {
  margin-top: 14px;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(270px, 1fr));
  gap: 12px;
}

.pagination {
  margin: 18px 0 28px;
  display: flex;
  justify-content: center;
  gap: 8px;
  flex-wrap: wrap;
}

.page-btn {
  min-width: 38px;
  height: 38px;
  border-radius: 999px;
  border: 1.5px solid #e2e8f0;
  background: #ffffff;
  font-weight: 700;
  color: #1e3a8a;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.18s, border-color 0.18s, box-shadow 0.18s;
}

.page-btn:hover:not(:disabled):not(.active) {
  background: #eff6ff;
  border-color: #bfdbfe;
}

.page-btn.active {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.page-btn:disabled {
  opacity: 0.4;
  cursor: default;
}

.branch-card {
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 22px;
  overflow: hidden;
  box-shadow: 0 2px 8px rgba(10, 23, 55, 0.05), 0 14px 32px rgba(10, 23, 55, 0.08);
  transition: transform 0.18s ease, box-shadow 0.2s ease;
}

.branch-card:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(10, 23, 55, 0.1), 0 24px 48px rgba(10, 23, 55, 0.1);
}

.branch-photo {
  width: 100%;
  height: 200px;
  object-fit: cover;
  background: #dbe3f1;
}

.branch-photo-wrap {
  position: relative;
}

.branch-photo-wrap::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 60px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0) 0%, rgba(15, 23, 42, 0.12) 100%);
  pointer-events: none;
}

.hotel-stars {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 12px;
  color: #dc2626;
  box-shadow: 0 4px 12px rgba(15, 23, 42, 0.15);
}

.rating-badge {
  position: absolute;
  bottom: 10px;
  left: 10px;
  background: rgba(255, 255, 255, 0.95);
  color: #b45309;
  border-radius: 999px;
  padding: 4px 10px;
  font-weight: 700;
  font-size: 12px;
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.16);
}

.branch-body {
  padding: 14px 14px 16px;
  display: grid;
  gap: 8px;
}

.branch-top {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.branch-chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 2px 0 4px;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  border: 1px solid var(--line);
  background: #f8fbff;
  color: #0f2b67;
}

.chip-prepay {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
  white-space: normal;
  width: 100%;
  justify-content: flex-start;
  line-height: 1.2;
  font-size: 11px;
  font-weight: 700;
}

.chip-rating {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.chip-address {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.chip-price {
  background: #fef3c7;
  color: #92400e;
  border-color: #fcd34d;
}

.chip-distance {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.branch-info {
  display: grid;
  gap: 4px;
  color: #1e3a8a;
  font-weight: 600;
  font-size: 13px;
}

.branch-title {
  margin: 0;
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  font-size: 1.35rem;
  color: #0f172a;
  font-family: "Space Grotesk", sans-serif;
}

.branch-address {
  margin: 0;
  color: var(--muted);
  font-size: inherit;
  line-height: inherit;
}

.price-line {
  font-weight: inherit;
  color: inherit;
  font-size: inherit;
  padding-top: 2px;
}

.price-label {
  color: inherit;
  font-weight: inherit;
  margin-right: 4px;
}

.price-value {
  font-weight: 800;
  color: #1e3a8a;
  letter-spacing: 0.01em;
}

.amenities-row {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-top: 2px;
}

.amenity-pill {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: 1px solid #dbe3f1;
  background: #f7faff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
}

.amenity-more {
  font-size: 12px;
  font-weight: 700;
  color: #1d4ed8;
  background: #eef4ff;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid #c7d8f5;
}

.branch-meta {
  margin-top: 10px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 8px;
  flex-wrap: wrap;
  color: #1e3a8a;
  font-weight: 600;
  font-size: 13px;
}

.distance-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  padding: 4px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #f8fbff;
  color: #0f3e8a;
  font-weight: 600;
}

.branch-actions {
  margin-top: 6px;
  display: grid;
  grid-template-columns: 46px 46px 46px;
  gap: 8px;
}

.branch-actions button {
  min-width: 0;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-direction: row;
}

.branch-actions a {
  min-width: 0;
  text-align: center;
  text-decoration: none;
  display: block;
  padding: 8px 10px;
  font-size: 13px;
  line-height: 1.2;
  white-space: normal;
  word-break: break-word;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  flex-direction: row;
}

.branch-action-main {
  border-radius: 14px !important;
  font-weight: 700;
  justify-content: center;
  gap: 8px;
  min-height: 40px;
  padding: 0 !important;
  font-size: 14px;
  letter-spacing: 0.1px;
}

.branch-action-icon {
  border-radius: 12px !important;
  padding: 0 !important;
}

.branch-action-icon .action-text {
  display: none;
}

.action-icon {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eaf2ff;
  box-shadow: inset 0 0 0 1px #cfe0ff;
  flex: 0 0 24px;
}

.action-icon img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.branch-actions > * {
  transition: background-color 0.18s ease, color 0.18s ease, border-color 0.18s ease, box-shadow 0.18s ease, transform 0.12s ease;
}

.branch-actions > *:active {
  transform: translateY(1px);
}

/* Secondary style (Foto / Xabar) */
.branch-action-icon {
  background: #f8fbff;
  color: #17366f;
  border-color: #c9d8f5;
  width: 40px;
  height: 40px;
  padding: 0 !important;
  border-radius: 14px !important;
}

.branch-action-icon:hover {
  background: #eef5ff;
  border-color: #b6cbf0;
}

/* Sweeter modern primary info button */
.branch-action-info {
  background: linear-gradient(180deg, #e9f1ff 0%, #dce9ff 100%);
  color: #1d4ed8;
  border-color: #bfd3ff;
  box-shadow: 0 8px 18px rgba(59, 130, 246, 0.16);
}

.branch-action-info:hover {
  background: linear-gradient(180deg, #e3edff 0%, #d5e4ff 100%);
  border-color: #a9c3ff;
  box-shadow: 0 10px 20px rgba(59, 130, 246, 0.2);
}

.branch-action-info .action-icon {
  background: rgba(59, 130, 246, 0.14);
  box-shadow: inset 0 0 0 1px rgba(59, 130, 246, 0.2);
}

.branch-action-info .action-icon img {
  width: 15px;
  height: 15px;
}

/* Primary style (Batafsil) */
.branch-action-main {
  background: linear-gradient(135deg, #2563eb 0%, #1d4ed8 100%);
  color: #ffffff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(37, 99, 235, 0.3);
}

.branch-action-main:hover {
  background: linear-gradient(135deg, #1d4ed8 0%, #1e40af 100%);
  box-shadow: 0 6px 20px rgba(37, 99, 235, 0.4);
}

.branch-action-main .action-icon {
  background: rgba(255, 255, 255, 0.2);
  box-shadow: none;
}

.branch-action-main .action-icon img {
  filter: brightness(0) invert(1);
  width: 18px;
  height: 18px;
}

.branch-action-main .action-icon {
  background: rgba(59, 130, 246, 0.18);
  box-shadow: none;
}

.branch-action-main .action-icon img {
  width: 18px;
  height: 18px;
}

.small-btn {
  border-radius: 10px;
  font-weight: 700;
}

.btn-ico {
  width: 20px;
  height: 20px;
  object-fit: contain;
  flex: 0 0 20px;
}

.rating-stars {
  color: #f59e0b;
  letter-spacing: 0.4px;
}

.rating-stars b {
  color: #1e3a8a;
}

.empty {
  padding: 22px;
  border-radius: 14px;
  border: 1px dashed var(--line);
  text-align: center;
  color: var(--muted);
  background: #fff;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 14px;
  z-index: 70;
}

.hidden {
  display: none;
}

.filters-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.5);
  z-index: 40;
}

.modal-card {
  width: min(920px, 100%);
  max-height: 92vh;
  overflow: auto;
  border-radius: 24px;
  background: #fff;
  border: 1px solid #e2e8f0;
  box-shadow: 0 24px 80px rgba(10, 23, 55, 0.2);
}

.amenities-card {
  width: min(420px, 100%);
}

.amenities-list {
  padding: 12px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.amenity-chip {
  background: #f8fafc;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 700;
  color: #1e293b;
}

.details-amenities .amenity-chip {
  padding: 4px 10px;
  font-size: 11px;
}

.modal-head {
  position: sticky;
  top: 0;
  z-index: 5;
  background: #f8fafc;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f1f5f9;
}

.modal-head h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  letter-spacing: -0.01em;
  font-size: 16px;
  font-weight: 700;
  color: #0f172a;
}

.map-view-controls {
  display: flex;
  align-items: center;
  gap: 8px;
}

#mapViewDistance {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 6px 10px;
  min-height: 36px;
  background: #fff;
  font-weight: 600;
  font-size: 13px;
}

.modal-head .ghost-btn {
  min-width: 42px;
  min-height: 42px;
  border-radius: 14px;
  font-weight: 700;
}

.gallery-slider {
  display: grid;
  grid-template-columns: 44px 1fr 44px;
  align-items: center;
  gap: 8px;
  padding: 12px;
}

.gallery-main {
  width: 100%;
  height: min(56vh, 480px);
  object-fit: cover;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: #e2e8f0;
}

.gallery-nav {
  min-width: 44px;
  min-height: 44px;
  border-radius: 12px;
  font-size: 22px;
  font-weight: 700;
}

.gallery-thumbs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
  gap: 8px;
  padding: 0 12px 12px;
}

.gallery-thumb {
  width: 100%;
  height: 70px;
  object-fit: cover;
  border-radius: 10px;
  border: 2px solid transparent;
  cursor: pointer;
}

.gallery-thumb.active {
  border-color: #2f6de0;
}

.report-form {
  padding: 12px;
  display: grid;
  gap: 10px;
}

.details-body {
  padding: 0;
  display: grid;
  gap: 0;
}

.details-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 7;
  overflow: hidden;
  background: #1e3a8a;
}

.details-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.details-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(10,20,60,.72) 0%, rgba(10,20,60,.08) 55%, transparent 100%);
}

.details-hero-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  background: rgba(255,255,255,.18);
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.3);
  border-radius: 999px;
  padding: 4px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

.details-header {
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 14px 16px;
  display: grid;
  gap: 10px;
}

.details-title-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
  flex-wrap: wrap;
}

.details-title {
  font-weight: 800;
  font-size: 18px;
  color: #0f172a;
  line-height: 1.3;
}

.details-stars {
  background: #fff;
  border-radius: 999px;
  padding: 4px 10px;
  border: 1px solid var(--line);
  font-weight: 700;
  color: #dc2626;
  width: fit-content;
}

.details-rating {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.details-chip {
  border-radius: 999px;
  padding: 6px 10px;
  background: #eef2ff;
  font-weight: 700;
  font-size: 12px;
  color: #1e3a8a;
  border: 1px solid #dbe3f1;
}

.details-chip.accent {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fed7aa;
}

.details-contact-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.details-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 10px;
  border-radius: 12px;
  background: #fff;
  border: 1px solid var(--line);
  font-weight: 700;
  color: #1e3a8a;
  text-decoration: none;
  font-size: 13px;
}

.details-ico {
  min-width: 32px;
  height: 28px;
  border-radius: 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #eef2ff;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.4px;
}

.details-amenities {
  display: flex;
  flex-wrap: nowrap;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.details-prepay {
  font-weight: 700;
  color: #047857;
  font-size: 13px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  border-radius: 8px;
  padding: 6px 10px;
  width: fit-content;
}

.details-address {
  color: var(--muted);
  font-size: 13px;
}

.details-actions {
  display: flex;
  justify-content: flex-start;
}

.details-top {
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f8fbff;
}

.details-room {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
  box-shadow: 0 2px 10px rgba(8,15,52,.06);
}

.details-rooms-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  padding: 14px;
}

.details-room-media {
  position: relative;
  z-index: 0;
}

.details-room-media .details-room-photo {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  border-bottom: 1px solid var(--line);
  background: #e2e8f0;
  cursor: pointer;
}

.details-room-media .room-status-chip {
  position: absolute;
  top: 10px;
  right: 10px;
}

.details-room-meta {
  display: grid;
  gap: 6px;
  font-size: 13px;
  padding: 12px 12px 0;
}

.details-room-bottom {
  padding: 10px 12px 12px;
  display: grid;
  gap: 8px;
}

.details-room-bottom .room-book-btn {
  width: 100%;
}

.details-room-meta .small-btn {
  margin-top: 6px;
  width: 100%;
}

.details-room-meta [data-book-room] {
  padding: 7px 10px;
  font-size: 13px;
  border-radius: 10px;
}

.details-room-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.price-tabs {
  margin-top: 6px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  padding: 6px;
}

.price-tab-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
  margin-bottom: 6px;
}

.price-tab-head .small-btn {
  padding: 6px 8px;
  font-size: 12px;
}

.price-tab-head .small-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.price-tab-panel {
  display: none;
  gap: 4px;
  font-size: 12px;
  color: #1e3a8a;
}

.price-tab-panel.active {
  display: grid;
}

.details-room-title {
  font-weight: 800;
  font-size: 16px;
  color: #0f172a;
}

.details-room-facts {
  display: grid;
  gap: 4px;
}

.details-fact {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  padding: 5px 0;
  border-bottom: 1px solid #f1f5f9;
}

.details-fact:last-child {
  border-bottom: none;
}

.details-fact span {
  color: var(--muted);
  font-size: 12px;
}

.details-fact b {
  margin-left: auto;
  text-align: right;
  font-weight: 700;
  color: #0f2b67;
  font-size: 13px;
}

.details-fact-label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

.details-fact-icon {
  width: 22px;
  height: 22px;
  border-radius: 8px;
  background: #f1f5ff;
  border: 1px solid #dbe3f1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.details-fact-icon img {
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.meta-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 22px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  border: 1px solid transparent;
  line-height: 1.2;
}

.meta-badge.roomtype-family {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.meta-badge.roomtype-bed {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

.meta-badge.roomtype-other {
  background: #f1f5f9;
  color: #334155;
  border-color: #cbd5e1;
}

.meta-badge.bookingmode-full {
  background: #fef3c7;
  color: #b45309;
  border-color: #fcd34d;
}

.meta-badge.bookingmode-bed {
  background: #e0e7ff;
  color: #4338ca;
  border-color: #c7d2fe;
}

.room-status-chip {
  font-size: 11px;
  font-weight: 700;
  padding: 3px 8px;
  border-radius: 999px;
  border: 1px solid var(--line);
  white-space: nowrap;
}

.room-status-chip.status-free {
  background: #ecfdf5;
  color: #047857;
  border-color: #a7f3d0;
}

.room-status-chip.status-partial {
  background: #fff7ed;
  color: #c2410c;
  border-color: #fdba74;
}

.room-status-chip.status-full {
  background: #fef2f2;
  color: #b91c1c;
  border-color: #fca5a5;
}

.room-book-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.room-book-btn .btn-ico {
  width: 15px;
  height: 15px;
}

.report-form label {
  display: grid;
  gap: 6px;
  font-size: 13px;
  color: #334155;
}

.report-form label > span {
  font-size: 13px;
  font-weight: 600;
  color: #334155;
}

.report-form input,
.report-form textarea {
  width: 100%;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  padding: 10px 12px;
  font: inherit;
  background: #f8fafc;
  min-height: 46px;
  transition: border-color 0.18s, box-shadow 0.18s;
}

.report-form input:focus,
.report-form textarea:focus {
  outline: none;
  border-color: #93c5fd;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.booking-readonly-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.booking-readonly-item {
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f8fbff;
  padding: 8px 10px;
  display: grid;
  gap: 2px;
}

.booking-readonly-item span {
  font-size: 11px;
  color: var(--muted);
}

.booking-readonly-item b {
  font-size: 13px;
  color: #0f2b67;
}

.booking-prepay-note {
  border: 1px solid #3b82f6;
  background: linear-gradient(135deg, #e9f1ff 0%, #f5f9ff 100%);
  color: #0b3b92;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.35;
  box-shadow: 0 4px 10px rgba(37, 99, 235, 0.14);
  text-align: center;
}

@media (max-width: 760px) {
  .hero {
    grid-template-columns: 1fr;
  }

  .hero-controls {
    width: 100%;
    justify-content: flex-start;
  }

  .topbar {
    padding: 10px 12px;
  }

  .topbar-right {
    gap: 6px;
  }

  .lang-btn {
    padding: 6px 11px;
    font-size: 15px;
  }

  .auth-btn {
    padding-inline: 12px;
  }

  .shell {
    padding: 12px;
  }

  .hero h1 {
    font-size: clamp(24px, 7vw, 36px);
    line-height: 1.08;
  }

  .hero p {
    font-size: 15px;
    line-height: 1.4;
  }

  .filters {
    margin-top: 10px;
    padding: 10px;
    border-radius: 14px;
    gap: 10px;
  }

  .filters {
    grid-template-columns: 1fr;
  }

  .filters-row {
    grid-template-columns: 1fr;
  }

  .geo-tools {
    grid-template-columns: 1fr;
  }

  .distance-tools {
    grid-template-columns: 1fr;
  }

  .distance-tools .ghost-btn {
    min-height: 48px;
    font-size: 16px;
  }

  .location-picker-radius {
    grid-template-columns: 1fr;
  }

  .price-range {
    grid-template-columns: 1fr 1fr;
  }

  .filter-actions {
    grid-template-columns: 1fr;
  }

  .filter-actions .solid-btn,
  .filter-actions .ghost-btn {
    min-height: 50px;
    font-size: 16px;
  }

  .price-slider-wrap {
    margin-bottom: 32px;
  }

  .price-slider-labels {
    font-size: 12px;
    bottom: -28px;
  }

  .booking-readonly-grid {
    grid-template-columns: 1fr;
  }

  .filters-toolbar {
    top: 56px;
  }

  .filter-toggle-btn {
    width: 100%;
    justify-content: center;
  }

  .toolbar-actions {
    width: 100%;
    display: grid;
    grid-template-columns: 1fr;
  }

  .toolbar-search {
    width: 100%;
  }

  .cards {
    margin-top: 12px;
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .branch-card {
    border-radius: 16px;
  }

  .branch-photo {
    height: 200px;
  }

  .branch-body {
    padding: 14px;
  }

  .branch-title {
    font-size: 1.2rem;
    line-height: 1.2;
    font-weight: 800;
  }

  .branch-meta {
    font-size: 14px;
  }

  .branch-actions button,
  .branch-actions a {
    min-width: 0;
    min-height: 46px;
    font-size: 15px;
    border-radius: 12px;
  }

  .branch-actions {
    grid-template-columns: 50px 50px 50px;
    gap: 8px;
  }

  .branch-actions > *:last-child:nth-child(odd) {
    grid-column: 1 / -1;
  }

  .branch-actions button,
  .branch-actions a {
    justify-content: center;
    align-items: center;
    text-align: center;
  }

  .details-rooms-grid {
    grid-template-columns: 1fr;
    padding: 10px;
    gap: 10px;
  }

  .details-room-title {
    font-size: 15px;
  }

  .details-fact {
    grid-template-columns: 80px 1fr;
  }

  .details-fact span,
  .details-fact b {
    font-size: 12px;
    line-height: 1.3;
  }

  .details-hero {
    aspect-ratio: 16 / 6;
  }

  .modal {
    padding: 0;
    align-items: flex-end;
  }

  .modal-card {
    max-height: 95dvh;
    border-radius: 20px 20px 0 0;
    width: 100%;
  }

  #detailsModal .modal-card {
    border-radius: 20px 20px 0 0;
  }

  /* map toolbar: slightly smaller on mobile */
  .map-view-toolbar {
    padding: 7px 8px;
    gap: 8px;
    border-radius: 14px;
    top: 10px;
  }

  .map-view-select {
    font-size: 13px;
    min-height: 36px;
  }

  .map-view-close {
    width: 36px;
    height: 36px;
  }

  .modal-head {
    padding: 10px 10px 10px 12px;
  }

  .modal-head h3 {
    font-size: 20px;
    line-height: 1.15;
  }

  .report-form {
    gap: 12px;
  }

  .report-form input,
  .report-form textarea {
    border-radius: 12px;
  }

  .booking-prepay-note {
    font-size: 18px;
    border-radius: 14px;
  }
}

@media (max-width: 760px) {
  .filters {
    position: fixed;
    inset: auto 12px 12px 12px;
    max-height: calc(100vh - 96px);
    overflow: auto;
    z-index: 41;
    grid-template-columns: 1fr;
    border-radius: 18px;
  }

  .price-range,
  .price-slider-wrap,
  .distance-tools,
  .filter-actions {
    grid-column: 1 / -1;
  }

  .modal-card {
    width: 100%;
    max-height: 95dvh;
  }

  .modal-head {
    padding: 10px;
  }
}

@media (max-width: 1200px) {
  .filters {
    grid-template-columns: 1fr;
  }

  .distance-tools {
    grid-template-columns: 1fr 1fr;
  }
}

/* 560px overrides handled by 600px block above */

@media (min-width: 980px) {
  .branch-actions {
    grid-template-columns: 88px 46px 46px;
    justify-content: start;
  }
}
/* ── TOPBAR LAYOUT ─────────────────────────────────── */
.topbar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-start;
}

.topbar-search-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 560px;
}

.topbar-search-wrap .toolbar-search {
  flex: 1;
  min-width: 0;      /* kills the 260px min-width */
  max-width: none;
  width: 100%;
}

.topbar-search-wrap .filter-toggle-btn {
  white-space: nowrap;
  flex-shrink: 0;
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

/* ── GALLERY FIXES ─────────────────────────────────── */
.gallery-slider {
  grid-template-columns: 36px 1fr 36px;
  padding: 10px;
}
.gallery-main {
  height: min(46vh, 360px);
}

/* ── CARDS GRID (desktop) ───────────────────────────── */
@media (min-width: 980px) {
  .branch-actions {
    grid-template-columns: 88px 46px 46px;
    justify-content: start;
  }
}

/* ── TABLET: 2-col cards ────────────────────────────── */
@media (min-width: 540px) and (max-width: 900px) {
  .cards {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* ═══════════════════════════════════════════════════════
   MOBILE TOPBAR  ≤ 600px
   Row 1: [HMSUZ]  ←→  [map][login][lang]
   Row 2: [🔍 search ──────────────] [☰]
   ═══════════════════════════════════════════════════════ */
@media (max-width: 600px) {
  .topbar {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    padding: 10px 14px;
    gap: 0;
    row-gap: 8px;
    column-gap: 8px;
  }

  .back-link {
    flex: 0 0 auto;
    order: 1;
    font-size: 20px !important;
  }

  .brand-badge {
    width: 30px;
    height: 30px;
    font-size: 11px;
    border-radius: 8px;
  }

  .brand-wordmark {
    font-size: 15px;
  }

  .topbar-right {
    order: 2;
    margin-left: auto;
    gap: 6px;
    flex-wrap: nowrap;
  }

  /* Row 2: grid layout for rock-solid column sizing */
  .topbar-search-wrap {
    order: 3;
    display: grid;
    grid-template-columns: 1fr 44px;   /* search takes all, btn fixed 44px */
    align-items: center;
    gap: 8px;
    width: 100%;
    max-width: none;
    flex: 0 0 100%;
  }

  /* Search bar fills the 1fr column */
  .topbar-search-wrap .toolbar-search {
    width: 100%;
    min-width: 0;
    flex: none;
  }

  /* Filter button: icon only, exact 44×44 pill */
  .filter-btn-label {
    display: none;
  }

  #toggleFiltersBtn {
    width: 44px;
    height: 44px;
    min-width: 0;
    padding: 0;
    border-radius: 12px;
    justify-content: center;
  }

  .auth-btn {
    padding-inline: 14px;
    font-size: 13px;
    height: 36px;
  }

  .lang-btn {
    height: 36px;
    min-width: 36px;
  }

  .profile-btn {
    width: 36px;
    height: 36px;
  }
}

/* ═══════════════════════════════════════════════════════
   MOBILE FILTER PANEL  ≤ 760px
   Fix: transform, sticky offsets matching padding:10px
   ═══════════════════════════════════════════════════════ */
@media (max-width: 760px) {
  /* 1. Panel positioning & scroll */
  .filters {
    transform: none !important;
    left: 10px !important;
    right: 10px !important;
    bottom: 10px !important;
    top: auto !important;
    width: auto !important;
    max-height: calc(100svh - 80px);
    padding: 10px;
    border-radius: 20px;
    overflow-y: auto;
    overflow-x: visible;   /* must NOT be hidden — clips slider thumbs */
    -webkit-overflow-scrolling: touch;
  }

  /* 2. Sticky header */
  .filters-head {
    position: sticky;
    top: -10px;
    margin: -10px -10px 8px -10px;
    padding: 14px 16px 12px;
    background: #f8fafc;
    border-radius: 20px 20px 0 0;
    border-bottom: 1px solid #f1f5f9;
    z-index: 2;
  }

  /* 3. Sticky action buttons */
  .filter-actions {
    position: sticky;
    bottom: -10px;
    margin: 0 -10px -10px -10px;
    padding: 12px 14px 14px;
    background: rgba(255, 255, 255, 0.98);
    border-top: 1px solid #f1f5f9;
    backdrop-filter: blur(8px);
    border-radius: 0 0 20px 20px;
    grid-template-columns: 1fr 1fr;
    z-index: 2;
  }

  /* 4. Bigger touch targets for selects */
  .filters select,
  .filters input[type="text"] {
    font-size: 15px;
    min-height: 50px;
    padding: 12px 14px;
    border-radius: 12px;
  }

  /* 5. Each filter row: single column */
  .filters-row {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  /* 6. Distance tools full width */
  .distance-tools {
    grid-template-columns: 1fr;
  }

  /* 7. Price slider — labels above, track below, big thumbs */
  .price-slider-wrap {
    height: 76px;        /* 22px labels + 10px gap + 44px track+thumbs */
    margin-bottom: 8px;
    padding: 0 4px;
  }

  /* Labels: move from bottom to top */
  .price-slider-labels {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: auto;        /* override bottom: -26px */
    font-size: 13px;
    font-weight: 700;
    color: #1d4ed8;
    padding: 0 2px;
  }

  /* Track: shift down below labels */
  .price-slider-wrap .range-track-bg,
  .price-slider-wrap .range-track-fill {
    top: 42px;           /* 22px labels + 10px gap + 10px thumb offset */
  }

  /* Range inputs: shift down below labels */
  .price-slider-wrap input[type="range"] {
    top: 28px;           /* 22px labels + 6px gap */
    height: 32px;
  }

  /* Bigger, easy-to-tap thumbs */
  .price-slider-wrap input[type="range"]::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
    margin-top: -11px;
    border-width: 3px;
    box-shadow: 0 2px 10px rgba(37, 99, 235, 0.45);
  }

  .price-slider-wrap input[type="range"]::-moz-range-thumb {
    width: 26px;
    height: 26px;
  }

  /* 8. Search input full-width */
  #searchInput {
    grid-column: 1 / -1;
  }
}

/* ═══════════════════════════════════════════════════════
   DESKTOP POLISH
   ═══════════════════════════════════════════════════════ */

/* ── Shell: wider container + top breathing room ─────── */
.shell {
  max-width: 1240px;
  padding: 20px 20px 40px;
}

/* ── Page intro strip (shown above cards) ─────────────── */
.catalog-intro {
  margin-bottom: 6px;
}

/* ── Card grid: 3 cols on wide, 2 on medium ──────────── */
.cards {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}

/* ── Card: refined design ─────────────────────────────── */
.branch-card {
  border-radius: 20px;
  box-shadow: 0 2px 6px rgba(10,23,55,0.04), 0 10px 28px rgba(10,23,55,0.07);
  transition: transform 0.2s cubic-bezier(.22,.68,0,1.2),
              box-shadow 0.2s ease;
}

.branch-card:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: 0 12px 32px rgba(10,23,55,0.12), 0 32px 56px rgba(10,23,55,0.1);
}

/* ── Photo: consistent height, better placeholder ─────── */
.branch-photo {
  height: 210px;
  object-fit: cover;
  background: linear-gradient(135deg, #dbeafe 0%, #e0e7ff 100%);
  display: block;
}

/* Style the no-photo image as a subtle placeholder */
.branch-photo[src$="no_photo.png"] {
  object-fit: contain;
  padding: 32px;
  background: linear-gradient(135deg, #eff6ff 0%, #e8efff 50%, #eef4ff 100%);
  opacity: 0.55;
}

/* ── Photo overlay gradient ───────────────────────────── */
.branch-photo-wrap::after {
  height: 80px;
  background: linear-gradient(to bottom, transparent 0%, rgba(10,20,50,0.18) 100%);
}

/* ── Rating badge: cleaner look ──────────────────────── */
.rating-badge {
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
  background: rgba(255, 255, 255, 0.92);
  font-size: 11px;
  letter-spacing: 0.2px;
}

/* ── Card body: more padding, cleaner gaps ─────────────── */
.branch-body {
  padding: 16px 16px 14px;
  gap: 6px;
}

/* ── Title: slightly larger ───────────────────────────── */
.branch-title {
  font-size: 1.2rem;
  line-height: 1.25;
  letter-spacing: -0.025em;
  margin-bottom: 2px;
}

/* ── Prepay chip: pill with left icon ─────────────────── */
.chip-prepay {
  font-size: 12px;
  padding: 6px 12px;
  border-radius: 10px;
}

/* ── Address: muted, small ───────────────────────────── */
.branch-address {
  font-size: 12px;
  color: #64748b;
  line-height: 1.4;
  margin: 0;
}

/* ── Price line: bold, blue ───────────────────────────── */
.price-line {
  font-size: 15px;
  font-weight: 700;
  color: #1e3a8a;
  margin-top: 2px;
}

.price-label {
  font-size: 12px;
  font-weight: 500;
  color: #94a3b8;
}

/* ── Amenities row: neat pills ────────────────────────── */
.amenity-pill {
  width: 30px;
  height: 30px;
  font-size: 14px;
  background: #f0f6ff;
  border-color: #dbeafe;
}

/* ── Action buttons: proper labeled main button ─────────── */
.branch-actions {
  margin-top: 8px;
  gap: 8px;
  grid-template-columns: 1fr 40px 40px;
  align-items: center;
}

/* Main details button: labeled, full left column */
.branch-action-main {
  font-size: 13px;
  letter-spacing: 0.1px;
  min-height: 40px;
  border-radius: 12px !important;
  padding: 0 14px !important;
  display: inline-flex;
  gap: 8px;
}

/* Show text label on the main button */
.branch-action-main .action-text {
  display: inline !important;
  font-size: 13px;
  font-weight: 700;
}

/* Icon buttons: compact square */
.branch-action-icon {
  width: 40px;
  height: 40px;
  border-radius: 10px !important;
  flex-shrink: 0;
}

/* ── Topbar: max-width matches shell ─────────────────── */
.topbar {
  padding: 12px 20px;
}

/* ── Filter toggle: cleaner pill ─────────────────────── */
.filter-toggle-btn {
  border-radius: 12px;
  background: #f8fafc;
  border: 1.5px solid #e2e8f0;
  color: #334155;
  font-weight: 700;
  height: 44px;
  padding: 0 16px;
  gap: 8px;
  transition: background 0.15s, border-color 0.15s, box-shadow 0.15s;
}

.filter-toggle-btn:hover {
  background: #eff6ff;
  border-color: #bfdbfe;
  box-shadow: 0 2px 8px rgba(37,99,235,0.12);
}

/* Active filter state */
.filter-toggle-btn.filter-clear {
  background: linear-gradient(135deg, #eff6ff, #dbeafe);
  border-color: #93c5fd;
  color: #1d4ed8;
}

/* ── Card actions: on desktop show text in main btn ──── */
@media (min-width: 900px) {
  .branch-actions {
    grid-template-columns: 1fr 40px 40px;
  }
}

/* ── Pagination: bigger on desktop ───────────────────── */
.page-btn {
  min-width: 40px;
  height: 40px;
  font-size: 14px;
}

/* ── Mobile: icon-only main button ───────────────────── */
@media (max-width: 540px) {
  .branch-action-main .action-text {
    display: none !important;
  }
  .branch-actions {
    grid-template-columns: 46px 40px 40px;
  }
  .branch-action-main {
    padding: 0 !important;
    justify-content: center;
  }
}

/* ── Fix: price slider thumbs bleed over action buttons ── */
.filter-actions {
  z-index: 20;        /* must beat #priceMinRange z-index:3 */
  isolation: isolate; /* create stacking context so bg covers thumbs */
}

/* ── Fix: map view modal – close btn always visible ─────── */
#mapViewModal .modal-head {
  position: relative;
  z-index: 500;       /* above Mapbox GL canvas (z-index auto) */
  background: rgba(255, 255, 255, 0.97);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid #e2e8f0;
  flex-shrink: 0;
}

/* Floating close button – always on top even if header hidden */
#mapViewModal .map-view-controls {
  gap: 10px;
}

#closeMapView {
  flex-shrink: 0;
  z-index: 600;
  background: #fff !important;
  border: 1.5px solid #e2e8f0 !important;
  box-shadow: 0 2px 8px rgba(15,23,42,0.12);
  font-size: 20px !important;
  width: 40px !important;
  height: 40px !important;
  border-radius: 12px !important;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s, box-shadow 0.15s;
}

#closeMapView:hover {
  background: #f0f6ff !important;
  border-color: #bfdbfe !important;
  box-shadow: 0 4px 14px rgba(37,99,235,0.18);
}

/* Ensure mapbox canvas never overflows its container */
#mapViewMap .mapboxgl-canvas-container,
#mapViewMap .mapboxgl-canvas {
  position: absolute !important;
}

#mapViewMap {
  position: relative;
  overflow: hidden;
  flex: 1;
}

/* Make map view modal use flex column so header doesn't get covered */
#mapViewModal .modal-card {
  display: flex;
  flex-direction: column;
}

/* ═══════════════════════════════════════════════════════
   AIRBNB-STYLE MOBILE REDESIGN  ≤ 600px
   Bottom nav + clean cards + refined topbar
   ═══════════════════════════════════════════════════════ */

/* ── Bottom Navigation Bar: hidden on desktop ─────────── */
.mobile-bottom-nav {
  display: none;
}

@media (max-width: 600px) {
  /* ── Bottom nav ─────────────────────────────────────── */
  .mobile-bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 32;
    background: rgba(255, 255, 255, 0.97);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-top: 1px solid #e2e8f0;
    padding: 6px 4px calc(6px + env(safe-area-inset-bottom));
    box-shadow: 0 -4px 20px rgba(15, 23, 42, 0.08);
    justify-content: space-around;
    gap: 2px;
  }

  .mob-nav-item {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 5px 4px;
    border: none;
    background: none;
    cursor: pointer;
    color: #94a3b8;
    text-decoration: none;
    border-radius: 12px;
    transition: color 0.15s, background 0.15s;
    font-family: inherit;
    min-height: 50px;
  }

  .mob-nav-item.mob-nav-active,
  .mob-nav-item:hover {
    color: #2563eb;
    background: #eff6ff;
  }

  .mob-nav-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
  }

  .mob-nav-icon svg {
    width: 22px;
    height: 22px;
  }

  .mob-nav-label {
    font-size: 10px;
    font-weight: 600;
    line-height: 1;
    white-space: nowrap;
  }

  /* Push shell content above the nav bar */
  .shell {
    padding-bottom: calc(76px + env(safe-area-inset-bottom));
  }

  /* ── Hide topbar map button — it's now in bottom nav ── */
  #mapViewBtn {
    display: none;
  }
  #profileMenuWrap {
    display: none !important;
  }

  /* ── Airbnb-style cards ─────────────────────────────── */
  .cards {
    grid-template-columns: 1fr;
    gap: 16px;
    margin-top: 10px;
  }

  .branch-card {
    border-radius: 20px;
    border: none;
    background: #fff;
    box-shadow: 0 2px 10px rgba(10, 23, 55, 0.07), 0 8px 24px rgba(10, 23, 55, 0.06);
    overflow: hidden;
  }

  .branch-photo {
    height: 252px;
    border-radius: 0;
    object-fit: cover;
  }

  /* Rating badge: cleaner pill */
  .rating-badge {
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    background: rgba(255, 255, 255, 0.95);
    font-size: 12px;
    font-weight: 700;
    border-radius: 10px;
    padding: 4px 10px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.2);
    bottom: 12px;
    left: 12px;
  }

  /* Card body */
  .branch-body {
    padding: 12px 14px 14px;
    gap: 5px;
  }

  .branch-title {
    font-size: 15px;
    font-weight: 700;
    color: #0f172a;
    line-height: 1.3;
    letter-spacing: -0.01em;
  }

  .branch-address {
    font-size: 13px;
    color: #64748b;
    line-height: 1.35;
    margin: 0;
  }

  /* Price: Airbnb bold */
  .price-line {
    font-size: 15px;
    font-weight: 800;
    color: #0f172a;
    margin-top: 3px;
  }

  .price-label {
    font-size: 12px;
    font-weight: 500;
    color: #94a3b8;
  }

  .price-value {
    font-weight: 800;
    color: #0f172a;
  }

  /* Compact amenities */
  .amenity-pill {
    width: 28px;
    height: 28px;
    font-size: 13px;
  }

  .amenities-row {
    gap: 4px;
    margin-top: 2px;
  }

  /* Compact chips */
  .branch-chip-row {
    margin: 1px 0 2px;
    gap: 4px;
  }

  .chip {
    font-size: 11px;
    padding: 4px 8px;
  }

  /* Actions: labeled main button + 2 icon buttons */
  .branch-actions {
    margin-top: 10px;
    grid-template-columns: 1fr 42px 42px;
    gap: 8px;
    align-items: center;
  }

  .branch-action-main {
    min-height: 42px;
    font-size: 13px;
    border-radius: 12px !important;
    padding: 0 14px !important;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    justify-content: center;
  }

  /* Show text label on main button (override ≤540px hide) */
  .branch-action-main .action-text {
    display: inline !important;
    font-size: 13px;
    font-weight: 700;
  }

  .branch-action-icon {
    width: 42px;
    height: 42px;
    border-radius: 12px !important;
  }
}
