/* 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: 1.05rem;
  height: 1.05rem;
  transform: translateY(-50%);
  pointer-events: none;
  background-color: #176873;
  opacity: 0.72;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  /* Clear magnifying-glass (decorative only; input remains the interactive control). */
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath stroke-linecap='round' d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' stroke-width='2'%3E%3Ccircle cx='11' cy='11' r='7'/%3E%3Cpath stroke-linecap='round' d='M20 20l-3.5-3.5'/%3E%3C/svg%3E");
}

.location-picker-search {
  min-height: 42px;
  padding-left: 2.5rem;
  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-group {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin: 0.45rem 0 0.2rem;
  /* Match .location-picker-option visible height (min-height + box model). */
  box-sizing: border-box;
  min-height: 46px;
  height: 46px;
  /* Horizontal padding matches options; vertical space comes from flex centering. */
  padding: 0 1.15rem;
  list-style: none;
  /* Same corner radius as .location-picker-option */
  border-radius: 10px;
  /* ~1–2px larger than .location-picker-option (1rem) for hierarchy */
  font-size: calc(1rem + 2px);
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  line-height: 1.25;
  color: #fff;
  background-color: #176873;
  /* Underline belongs to the heading bar, not a separator between groups. */
  border-bottom: 1px solid rgba(255, 255, 255, 0.35);
  pointer-events: none;
  user-select: none;
}

.location-picker-group-label {
  color: inherit;
  font-weight: inherit;
  font-size: inherit;
  letter-spacing: inherit;
}

.location-picker-group:first-child {
  margin-top: 0.1rem;
}

.location-picker-group-icon {
  /* ~3–4px larger than prior 1.05rem for clearer group icons */
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: calc(1.05rem + 3.5px);
  height: calc(1.05rem + 3.5px);
  flex-shrink: 0;
  background-color: #fff;
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
  -webkit-mask-position: center;
  mask-position: center;
  -webkit-mask-size: contain;
  mask-size: contain;
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' 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");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' 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");
}

/* Custom uploaded raster icons: no CSS mask; <img> only from sanitized /uploads path. */
.location-picker-group-icon.is-custom {
  background-color: transparent;
  -webkit-mask-image: none;
  mask-image: none;
}

.location-picker-group-icon-img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
}

/* Legacy "city" key still maps to map-pin for any older markup. */
.location-picker-group-icon[data-icon="city"],
.location-picker-group-icon[data-icon="pin"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' 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");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' 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");
}

/* Clearer airplane silhouette for Airports (IconKey remains "airport"). */
.location-picker-group-icon[data-icon="airport"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' stroke-width='1.7'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M10.18 9 21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5z'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' stroke-width='1.7'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M10.18 9 21 16v-2l-8-5V3.5a1.5 1.5 0 0 0-3 0V9l-8 5v2l8-2.5V19l-2 1.5V22l3.5-1 3.5 1v-1.5L13 19v-5.5z'/%3E%3C/svg%3E");
}

.location-picker-group-icon[data-icon="border"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4 4v16M12 4v16M20 4v16M4 12h16'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M4 4v16M12 4v16M20 4v16M4 12h16'/%3E%3C/svg%3E");
}

.location-picker-group-icon[data-icon="port"],
.location-picker-group-icon[data-icon="ferry"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 18c1.5-1 3-1 4.5 0s3 1 4.5 0 3-1 4.5 0 3 1 4.5 0M4 14l8-9 8 9H4zm4 0v-3h8v3'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 18c1.5-1 3-1 4.5 0s3 1 4.5 0 3-1 4.5 0 3 1 4.5 0M4 14l8-9 8 9H4zm4 0v-3h8v3'/%3E%3C/svg%3E");
}

.location-picker-group-icon[data-icon="train"],
.location-picker-group-icon[data-icon="bus"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M7 3h10a3 3 0 0 1 3 3v8a4 4 0 0 1-4 4H8a4 4 0 0 1-4-4V6a3 3 0 0 1 3-3zm-1 18h2m8 0h2M8 18l-1.5 3M16 18l1.5 3M6 10h12M6 13h12'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M7 3h10a3 3 0 0 1 3 3v8a4 4 0 0 1-4 4H8a4 4 0 0 1-4-4V6a3 3 0 0 1 3-3zm-1 18h2m8 0h2M8 18l-1.5 3M16 18l1.5 3M6 10h12M6 13h12'/%3E%3C/svg%3E");
}

.location-picker-group-icon[data-icon="hotel"],
.location-picker-group-icon[data-icon="landmark"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 21h18M5 21V10l7-5 7 5v11M9 21v-5h6v5M9 13h.01M15 13h.01'/%3E%3C/svg%3E");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' stroke-width='1.8'%3E%3Cpath stroke-linecap='round' stroke-linejoin='round' d='M3 21h18M5 21V10l7-5 7 5v11M9 21v-5h6v5M9 13h.01M15 13h.01'/%3E%3C/svg%3E");
}

.location-picker-group-icon[data-icon="other"] {
  -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' 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");
  mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' fill='none' viewBox='0 0 24 24' stroke='%23000' 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");
}

.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;
}

@media (max-width: 576px) {
  .location-picker-search-icon {
    width: 1rem;
    height: 1rem;
    left: 0.75rem;
  }

  .location-picker-search {
    padding-left: 2.35rem;
  }

  .location-picker-group {
    font-size: calc(1rem + 1px);
  }
}

/* ── 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;
}

html[dir="rtl"] .location-picker-search-icon {
  left: auto;
  right: 0.85rem;
}

html[dir="rtl"] .location-picker-search {
  padding-left: 0.85rem;
  padding-right: 2.5rem;
}
