/* ==========================================================================
   Select2 - Public site teması (açık / koyu mod: style.css değişkenlerini kullanır)
   contact.css içindeki eski select2 kurallarını ezer; Teklif Al sayfasında yüklenir.
   ========================================================================== */

/* Dış sarmalayıcı: kutu görünümü artık iç .select2-selection'da */
.select2-container.select2,
.select2-container {
  width: 100% !important;
}
.select2-container.select2 {
  height: auto !important;
  min-height: 0 !important;
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
}
.select2-container {
  font-size: 16px;
}

/* ---------- Kutu (çoklu ve tekli seçim) ---------- */
.select2-container--default .select2-selection--multiple,
.select2-container--default .select2-selection--single {
  min-height: 50px;
  background-color: var(--input-bg) !important;
  border: 1px solid var(--border-color) !important;
  border-radius: 10px !important;
  padding: 6px 42px 6px 10px;
  margin: 0 !important;
  cursor: text;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'><path fill='none' stroke='%2394a3b8' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5l5 5 5-5'/></svg>");
  background-repeat: no-repeat;
  background-position: right 16px center;
}
.select2-container--default .select2-selection--single {
  display: flex;
  align-items: center;
  cursor: pointer;
}
.select2-container--default .select2-selection--single .select2-selection__rendered {
  color: var(--text-color);
  padding: 0 8px;
  line-height: 1.5;
}
.select2-container--default .select2-selection--single .select2-selection__arrow {
  display: none;
}
.select2-container--default .select2-selection--multiple .select2-selection__rendered {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  padding: 0;
}

/* Odak / açık */
.select2-container--default.select2-container--focus .select2-selection--multiple,
.select2-container--default.select2-container--focus .select2-selection--single,
.select2-container--default.select2-container--open .select2-selection--multiple,
.select2-container--default.select2-container--open .select2-selection--single {
  border-color: var(--primary-color) !important;
  box-shadow: 0 0 0 0.25rem var(--primary-light);
  outline: 0;
}
.select2-container--default.select2-container--disabled .select2-selection--multiple,
.select2-container--default.select2-container--disabled .select2-selection--single {
  opacity: 0.6;
  cursor: not-allowed;
}

/* ---------- Seçilen etiketler ---------- */
.select2-container--default .select2-selection--multiple .select2-selection__choice {
  display: inline-flex;
  align-items: center;
  flex-direction: row-reverse;
  gap: 6px;
  margin: 0 !important;
  padding: 4px 10px;
  background-color: var(--primary-light) !important;
  border: 1px solid var(--primary-color) !important;
  border-radius: 8px;
  color: var(--text-color);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.3;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove {
  position: static;
  margin: 0;
  border: 0;
  background: transparent;
  color: var(--text-light);
  font-size: 1.1rem;
  line-height: 1;
  transition: color 0.2s ease;
}
.select2-container--default .select2-selection--multiple .select2-selection__choice__remove:hover {
  background: transparent;
  color: #ef4444;
}

/* Arama alanı: beyaz kalmasın */
.select2-container--default .select2-search--inline .select2-search__field {
  height: 30px;
  margin: 0;
  padding: 0 4px;
  background: transparent !important;
  border: 0 !important;
  outline: 0;
  box-shadow: none !important;
  color: var(--text-color);
  font-family: inherit;
  font-size: 16px;
  font-style: normal;
}
.select2-container--default .select2-search--inline .select2-search__field::placeholder {
  color: var(--text-light);
  opacity: 1;
}

/* ---------- Açılır liste ---------- */
.select2-container--default .select2-dropdown {
  background-color: var(--card-bg) !important;
  border: 1px solid var(--primary-color);
  border-radius: 10px;
  box-shadow: var(--shadow);
  overflow: hidden;
  z-index: 100000;
}
.select2-container--open .select2-dropdown--below {
  margin-top: 6px;
}
.select2-container--open .select2-dropdown--above {
  margin-bottom: 6px;
}
.select2-container--default .select2-results__options {
  padding: 6px;
  max-height: 280px;
  background-color: transparent;
}
.select2-container--default .select2-results__option {
  padding: 10px 14px;
  margin-bottom: 2px;
  border-radius: 8px;
  background: transparent;
  color: var(--text-color);
  transition: background-color 0.15s ease;
}
.select2-container--default .select2-results__option--highlighted[aria-selected],
.select2-container--default .select2-results__option--highlighted.select2-results__option--selectable {
  background: var(--primary-light);
  color: var(--text-color);
}
.select2-container--default .select2-results__option--selected,
.select2-container--default .select2-results__option[aria-selected="true"] {
  background: var(--primary-color);
  color: #ffffff;
  font-weight: 600;
}
.select2-container--default .select2-results__option--disabled {
  opacity: 0.5;
}
.select2-container--default .select2-results__message,
.select2-container--default .select2-results__option.loading-results {
  color: var(--text-light);
}

/* Bootstrap is-invalid / doğrulama hatası uyumu */
.is-invalid + .select2-container--default .select2-selection--multiple,
.is-invalid + .select2-container--default .select2-selection--single,
.input-validation-error + .select2-container--default .select2-selection--multiple {
  border-color: #ef4444 !important;
}

/* Mobil */
@media (max-width: 575.98px) {
  .select2-container {
    font-size: 15px;
  }
}
