/* Premium searchable location picker (visual layer over #locationSelect) */

.location-picker {
  position: relative;
  width: 100%;
}

.location-picker.is-open {
  z-index: 10001;
}

.location-picker-native {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.location-picker-trigger {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  width: 100%;
  height: var(--search-control-height, 48px);
  min-height: var(--search-control-height, 48px);
  max-height: var(--search-control-height, 48px);
  box-sizing: border-box;
  padding: 0 1rem 0 2.75rem;
  text-align: left;
  cursor: pointer;
  border: 1.5px solid #e2e8f0;
  border-radius: 12px;
  background-color: #ffffff;
  background-repeat: no-repeat;
  background-position: left 0.85rem center;
  background-size: 1rem;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232563eb' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 21s7-4.35 7-11a7 7 0 1 0-14 0c0 6.65 7 11 7 11Z'/%3E%3Ccircle cx='12' cy='10' r='2.5'/%3E%3C/svg%3E");
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.location-picker-trigger:hover:not(:disabled) {
  border-color: #cbd5e1;
  background-color: #fafbfc;
}

.location-picker.is-open .location-picker-trigger,
.location-picker-trigger:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
  outline: none;
}

.location-picker[data-picker-kind="country"] .location-picker-trigger {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%232563eb' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M12 21a9 9 0 1 0 0-18 9 9 0 0 0 0 18Z'/%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3.6 9h16.8M12 3.6c-1.6 2.9-2.4 5.8-2.4 8.4s.8 5.5 2.4 8.4c1.6-2.9 2.4-5.8 2.4-8.4S13.6 6.5 12 3.6Z'/%3E%3C/svg%3E");
}

.location-picker-trigger-label {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.3;
  color: #000000;
}

.location-picker-trigger-label.is-placeholder {
  color: #000000;
  font-weight: 500;
}

.location-picker-chevron {
  width: 0.55rem;
  height: 0.55rem;
  flex-shrink: 0;
  border-right: 2px solid #2563eb;
  border-bottom: 2px solid #2563eb;
  transform: rotate(45deg) translateY(-1px);
  transition: transform 0.2s cubic-bezier(0.22, 1, 0.36, 1), border-color 0.2s cubic-bezier(0.22, 1, 0.36, 1);
}

.location-picker.is-open .location-picker-chevron {
  transform: rotate(225deg) translateY(1px);
  border-color: #2563eb;
}

.location-picker.is-disabled .location-picker-trigger {
  cursor: not-allowed;
  opacity: 0.72;
}

.location-picker-menu {
  position: absolute;
  top: calc(100% + 0.45rem);
  left: 0;
  right: 0;
  z-index: 10001;
  padding: 0.55rem;
  border: 1px solid rgba(15, 23, 42, 0.08);
  border-radius: 14px;
  background: #fff;
  box-shadow:
    0 18px 48px rgba(15, 23, 42, 0.14),
    0 6px 18px rgba(15, 23, 42, 0.08);
  animation: locationPickerIn 0.18s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes locationPickerIn {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.location-picker-search-wrap {
  position: relative;
  margin-bottom: 0.45rem;
}

.location-picker-search-icon {
  position: absolute;
  left: 0.85rem;
  top: 50%;
  width: 0.95rem;
  height: 0.95rem;
  transform: translateY(-50%);
  opacity: 0.55;
  pointer-events: none;
  background:
    radial-gradient(circle at 38% 38%, #64748b 0 38%, transparent 40%),
    linear-gradient(45deg, transparent 44%, #64748b 44%, #64748b 56%, transparent 56%);
}

.location-picker-search {
  min-height: 42px;
  padding-left: 2.35rem;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  font-size: 0.9375rem;
  box-shadow: none;
}

.location-picker-search:focus {
  border-color: #2563eb;
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.location-picker-list {
  list-style: none;
  margin: 0;
  padding: 0.25rem;
  max-height: 288px;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(100, 116, 139, 0.45) transparent;
}

.location-picker-list::-webkit-scrollbar {
  width: 8px;
}

.location-picker-list::-webkit-scrollbar-track {
  background: transparent;
}

.location-picker-list::-webkit-scrollbar-thumb {
  background: rgba(100, 116, 139, 0.35);
  border-radius: 999px;
}

.location-picker-list::-webkit-scrollbar-thumb:hover {
  background: rgba(100, 116, 139, 0.5);
}

.location-picker-option {
  display: flex;
  align-items: center;
  min-height: 46px;
  margin: 0.18rem 0;
  padding: 0.75rem 1.15rem;
  border-radius: 10px;
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.25;
  color: #0f172a;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  transition: background-color 0.18s ease, color 0.18s ease;
}

.location-picker-option:hover,
.location-picker-option.is-active {
  background: rgba(37, 99, 235, 0.08);
}

.location-picker-option.is-selected {
  color: #2563eb;
  font-weight: 600;
  background: rgba(37, 99, 235, 0.1);
}

.location-picker-option.is-selected:hover,
.location-picker-option.is-selected.is-active {
  background: rgba(37, 99, 235, 0.14);
}

.location-picker-empty {
  padding: 1rem 0.75rem;
  text-align: center;
  color: #64748b;
  font-size: 0.9375rem;
}

.hero-content .hero-search .location-picker-trigger {
  height: var(--search-control-height, 48px);
  min-height: var(--search-control-height, 48px);
  max-height: var(--search-control-height, 48px);
  box-sizing: border-box;
  padding: 0 1rem 0 3rem;
  background-position: left 1rem center;
  background-size: 1.15rem;
  border-radius: 12px;
}

.hero-content .hero-search .location-picker-trigger-label {
  font-size: 1rem;
  font-weight: 500;
}

.search-toolbar-card .location-picker-trigger {
  height: var(--search-control-height, 2.625rem);
  min-height: var(--search-control-height, 2.625rem);
  max-height: var(--search-control-height, 2.625rem);
  box-sizing: border-box;
  border-radius: var(--search-control-radius, 12px);
}

.search-toolbar-card .location-picker-trigger-label {
  font-size: 1rem;
  color: #000000;
}

html[dir="rtl"] .location-picker-trigger {
  padding: 0.75rem 2.75rem 0.75rem 1rem;
  background-position: right 0.85rem center;
}

html[dir="rtl"] .hero-content .hero-search .location-picker-trigger {
  padding-right: 3rem;
  background-position: right 1rem center;
}

html[dir="rtl"] .location-picker-search {
  padding-left: 0.75rem;
  padding-right: 2.35rem;
}

html[dir="rtl"] .location-picker-search-icon {
  left: auto;
  right: 0.85rem;
}

/* ── Dropdown layering (prevent hero/search clipping) ───── */

.search-box,
.search-box .card-body,
.search-box form .col-12,
.search-toolbar-card,
.search-page-top .search-results-shell {
  overflow: visible;
}

.search-box:has(.location-picker.is-open),
.search-box .card-body:has(.location-picker.is-open),
.search-box form .col-12:has(.location-picker.is-open),
.search-toolbar-card:has(.location-picker.is-open) {
  position: relative;
  z-index: 10001;
}

.page-home .hero-search:has(.location-picker.is-open),
.page-home .hero-content:has(.location-picker.is-open),
.page-home .hero-inner:has(.location-picker.is-open),
.page-home .hero-banner:has(.location-picker.is-open) {
  overflow: visible;
  position: relative;
  z-index: 10001;
}

.search-page-top:has(.location-picker.is-open),
.search-page-top .search-results-shell:has(.location-picker.is-open) {
  position: relative;
  z-index: 10001;
}

/* ── Location picker RTL text alignment (Arabic) ───────── */

html[dir="rtl"] .location-picker-trigger,
html[dir="rtl"] .location-picker-trigger-label,
html[dir="rtl"] .location-picker-option {
  text-align: right;
}
