/* Lokasyon ağacı dropdown (hero + listeleme) — UI only */

:root {
  --home-loc-accent: #f97316;
  --home-loc-line: #cbd5e1;
  --home-loc-line-soft: #e2e8f0;
  --home-loc-text: #0f172a;
  --home-loc-muted: #64748b;
}

/* Hero arama çubuğu — ikon rengi (hepsi turuncu) */
#home-search-form-root .home-search-inputs-group .home-search-field-icon {
  color: var(--home-loc-accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  line-height: 1 !important;
}

/* Hero arama — alan metni ve placeholder rengi */
#home-search-form-root .home-search-inputs-group .home-search-field-text,
#home-search-form-root .home-search-inputs-group input.home-search-field-text {
  color: var(--home-loc-muted);
  font-weight: 400;
}

#home-search-form-root .home-search-inputs-group input.home-search-field-text::placeholder {
  color: var(--home-loc-muted);
  opacity: 1;
  font-weight: 400;
}

#home-search-form-root .home-search-inputs-group input.home-search-field-text:not(:placeholder-shown) {
  color: var(--home-loc-text);
  font-weight: 500;
}

/* Hero arama çubuğu — ikon + metin dikey hizası (masaüstü) */
@media (min-width: 1024px) {
  #home-search-form-root .home-search-inputs-group .home-search-field-icon {
    font-size: 1.125rem !important;
    width: 1.125rem;
    height: 1.125rem;
    overflow: visible;
    vertical-align: middle;
    translate: 0 -1px;
  }

  #home-search-form-root .home-search-inputs-group input[type="text"],
  #home-search-form-root .home-search-inputs-group #guestCountButton,
  #home-search-form-root .home-search-inputs-group #homeVillaOptionsButton {
    line-height: 1.375rem;
  }
}

/* Tetikleyici alan */
#home-search-form-root .home-location-field [data-location-trigger] .home-search-field-icon {
  display: inline-flex;
}

/* Kişi sayısı — +/- ikon hizası */
#home-search-form-root #guestCountDropdown button[id^="decrease"],
#home-search-form-root #guestCountDropdown button[id^="increase"] {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

#home-search-form-root #guestCountDropdown button .material-symbols-outlined {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  font-size: 1.125rem !important;
  width: 1.125rem;
  height: 1.125rem;
  line-height: 1 !important;
  margin: 0;
  translate: 0 0;
}

/* Mobil hero arama — iOS odak zoom'unu önlemek için min 16px */
@media (max-width: 1023px) {
  #home-search-form-root .home-search-date-input,
  #home-search-form-root #guestCountButton,
  #home-search-form-root #homeVillaOptionsButton,
  #home-search-form-root #guestCountDisplay,
  #home-search-form-root #homeVillaOptionsDisplay {
    font-size: 16px;
    line-height: 1.25rem;
  }

  #home-search-form-root .home-search-field-icon {
    font-size: 1.125rem !important;
    width: 1.125rem;
    height: 1.125rem;
  }
}

#home-search-form-root .home-location-field #location-search-input {
  font-weight: inherit;
  color: inherit;
}

#home-search-form-root .home-location-field #location-search-input::placeholder {
  color: var(--home-loc-muted);
  font-weight: 400;
}

@media (min-width: 1024px) {
  #home-search-form-root #location-search-field-anchor.rounded-b-none {
    background: #fff;
    border-color: #e2e8f0 !important;
    box-shadow: 0 1px 0 #e2e8f0;
  }

  #home-search-form-root #location-search-field-anchor.rounded-b-none [data-location-trigger] {
    border-bottom-color: #f1f5f9 !important;
  }
}

/* Body portal dropdown — yalnızca ana sayfa (filtre paneli inline, gölge istemez) */
#location-tree-dropdown-location-search-input {
  border: 1px solid #e2e8f0 !important;
  border-top: none !important;
  border-radius: 0 0 1rem 1rem !important;
  background: #fff !important;
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14) !important;
}

.dark #location-tree-dropdown-location-search-input {
  background: #0f172a !important;
  border-color: #334155 !important;
}

/* Ortak ağaç stili — hero + listeleme */
[data-location-tree-dropdown] > div:first-of-type {
  border-bottom: 1px solid #f1f5f9 !important;
  padding: 0.75rem 1rem !important;
}

[data-location-tree-dropdown] > div:first-of-type label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--home-loc-text);
}

.dark [data-location-tree-dropdown] > div:first-of-type {
  border-bottom-color: #1e293b !important;
}

.dark [data-location-tree-dropdown] > div:first-of-type label {
  color: #f8fafc;
}

/* Checkbox — turuncu dolu kare */
[data-location-tree-dropdown] input[type="checkbox"] {
  appearance: none;
  -webkit-appearance: none;
  width: 1.125rem;
  height: 1.125rem;
  flex-shrink: 0;
  margin: 0;
  border-radius: 0.3rem;
  border: 1.5px solid #cbd5e1;
  background: #fff;
  cursor: pointer;
  display: inline-grid;
  place-content: center;
}

[data-location-tree-dropdown] input[type="checkbox"]:checked {
  background: var(--home-loc-accent);
  border-color: var(--home-loc-accent);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='white'%3E%3Cpath d='M12.207 4.793a1 1 0 0 1 0 1.414l-5 5a1 1 0 0 1-1.414 0l-2.5-2.5a1 1 0 0 1 1.414-1.414L6.5 9.086l4.293-4.293a1 1 0 0 1 1.414 0z'/%3E%3C/svg%3E");
  background-size: 0.75rem;
  background-repeat: no-repeat;
  background-position: center;
}

[data-location-tree-dropdown] input[type="checkbox"]:focus {
  outline: none;
  box-shadow: 0 0 0 2px rgba(249, 115, 22, 0.25);
}

/* Liste */
[data-location-tree-dropdown] [data-role="tree-scroll-list"] {
  padding: 0.25rem 0 0.5rem;
}

[data-location-tree-dropdown] [data-role="tree-scroll-list"] > div {
  border-bottom: 1px solid #f8fafc !important;
  padding: 0.625rem 1rem !important;
}

[data-location-tree-dropdown] [data-role="tree-scroll-list"] > div:last-child {
  border-bottom: none !important;
}

/* Şehir satırı */
[data-location-tree-dropdown] [data-role="tree-scroll-list"] > div > .flex.items-center.justify-between > label {
  font-size: 0.9375rem;
  font-weight: 600;
  color: var(--home-loc-text);
  gap: 0.625rem;
}

[data-location-tree-dropdown] [data-role="tree-scroll-list"] .material-symbols-outlined {
  color: var(--home-loc-accent);
  font-size: 1.125rem;
  line-height: 1;
}

/* İl / ilçe adı — genişletme düğmesi */
[data-location-tree-dropdown] button[data-role="expand-city"],
[data-location-tree-dropdown] button[data-role="expand-district"] {
  font: inherit;
  line-height: inherit;
  color: inherit;
}

[data-location-tree-dropdown] button[data-role="expand-city"]:hover,
[data-location-tree-dropdown] button[data-role="expand-district"]:hover {
  color: var(--home-loc-text);
}

/* Genişlet / daralt — kapalı gri, açık turuncu (expand_less içeren satır) */
[data-location-tree-dropdown] button[data-role="toggle-city"],
[data-location-tree-dropdown] button[data-role="toggle-district"] {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 9999px;
  transition: background-color 0.15s ease, color 0.15s ease;
}

[data-location-tree-dropdown] button[data-role="toggle-city"]:has(.material-symbols-outlined),
[data-location-tree-dropdown] button[data-role="toggle-district"]:has(.material-symbols-outlined) {
  color: #94a3b8;
}

[data-location-tree-dropdown] button[data-role="toggle-city"]:hover,
[data-location-tree-dropdown] button[data-role="toggle-district"]:hover {
  background: #fff7ed;
  color: var(--home-loc-accent);
}

/* Ağaç bağlantı çizgileri (L şekli, noktalı) */
[data-location-tree-dropdown] .home-loc-tree-children {
  --home-loc-tree-line-x: 0.5625rem;
  position: relative;
  margin-top: 0.375rem;
}

[data-location-tree-dropdown] .home-loc-tree-children--nested {
  --home-loc-tree-line-x: 0.5625rem;
  margin-top: 0.125rem;
  margin-left: 0;
  padding-left: 0 !important;
  border-left: none !important;
}

[data-location-tree-dropdown] .home-loc-tree-item {
  position: relative;
  padding-left: calc(var(--home-loc-tree-line-x) + 0.875rem);
}

[data-location-tree-dropdown] .home-loc-tree-children--nested .home-loc-tree-item {
  padding-left: calc(var(--home-loc-tree-line-x) + 0.75rem);
}

[data-location-tree-dropdown] .home-loc-tree-item::before {
  content: "";
  position: absolute;
  left: var(--home-loc-tree-line-x);
  top: 0;
  bottom: 0;
  border-left: 1px dotted var(--home-loc-line);
  pointer-events: none;
}

[data-location-tree-dropdown] .home-loc-tree-item:last-child::before {
  bottom: auto;
  height: 1.0625rem;
}

[data-location-tree-dropdown] .home-loc-tree-item::after {
  content: "";
  position: absolute;
  left: var(--home-loc-tree-line-x);
  top: 1.0625rem;
  width: 0.875rem;
  border-top: 1px dotted var(--home-loc-line);
  pointer-events: none;
}

[data-location-tree-dropdown] .home-loc-tree-children--nested .home-loc-tree-item::before,
[data-location-tree-dropdown] .home-loc-tree-children--nested .home-loc-tree-item::after {
  border-color: var(--home-loc-line-soft);
}

[data-location-tree-dropdown] .home-loc-tree-children--nested .home-loc-tree-item::after {
  width: 0.75rem;
  top: 1rem;
}

[data-location-tree-dropdown] .home-loc-tree-children--nested .home-loc-tree-item:last-child::before {
  height: 1rem;
}

[data-location-tree-dropdown] .home-loc-tree-row {
  position: relative;
  z-index: 1;
  background: #fff;
}

.dark [data-location-tree-dropdown] .home-loc-tree-row {
  background: #1f2937;
}

/* Listeleme paneli (inline) — satır arka planı filtre paneli ile aynı */
#filter-location-tree-host [data-location-tree-dropdown] .home-loc-tree-row {
  background: #fff;
}

.dark #filter-location-tree-host [data-location-tree-dropdown] .home-loc-tree-row {
  background: #1f2937;
}

/* İlçe satırı tipografi */
[data-location-tree-dropdown] .home-loc-tree-item--district > .home-loc-tree-row {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--home-loc-muted);
}

/* Mahalle satırı */
[data-location-tree-dropdown] .home-loc-tree-item--location > .home-loc-tree-row {
  font-size: 0.8125rem;
  font-weight: 500;
  color: #475569;
}

[data-location-tree-dropdown] .home-loc-tree-item--location .material-symbols-outlined {
  display: none;
}

/* Eski düz border kuralları kaldırıldı */
[data-location-tree-dropdown] [data-role="tree-scroll-list"] > div > .mt-2:not(.home-loc-tree-children) {
  margin-top: 0.5rem !important;
  margin-left: 0.35rem;
  padding-left: 0.85rem !important;
  border-left: 1px dotted var(--home-loc-line);
}

[data-location-tree-dropdown] [data-role="tree-scroll-list"] .space-y-1.pl-2:not(.home-loc-tree-children) {
  margin-left: 0.35rem;
  padding-left: 0.75rem !important;
  border-left: 1px dotted var(--home-loc-line-soft);
}

/* Mobil bottom sheet — ana sayfa portal */
@media (max-width: 1023.98px) {
  #location-tree-dropdown-location-search-input {
    border: none !important;
    border-radius: 1rem 1rem 0 0 !important;
    box-shadow: 0 -12px 40px rgba(15, 23, 42, 0.18) !important;
  }

  #location-tree-dropdown-location-search-input > div:first-of-type {
    padding: 0.875rem 1rem !important;
  }
}
