/**
 * WooCommerce İlçe Eklentisi - Frontend Stilleri
 * Yapımcı: Hetra.com.tr
 */

/* =============================================
   İlçe Select Alanı - Genel Stiller
   ============================================= */

.hetra-ilce-select-field {
    position: relative;
}

.hetra-city-select {
    width: 100% !important;
}

/* Select2 ile uyumlu stiller */
.hetra-ilce-select-field .select2-container {
    width: 100% !important;
}

.hetra-ilce-select-field .select2-container--default .select2-selection--single {
    height: 42px;
    border: 1px solid #d3ced2;
    border-radius: 4px;
    padding: 0 8px;
    line-height: 42px;
    background-color: #fff;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.hetra-ilce-select-field .select2-container--default .select2-selection--single:hover {
    border-color: #a46497;
}

.hetra-ilce-select-field .select2-container--default.select2-container--focus .select2-selection--single {
    border-color: #a46497;
    box-shadow: 0 0 0 2px rgba(164, 100, 151, 0.15);
    outline: none;
}

.hetra-ilce-select-field .select2-container--default .select2-selection--single .select2-selection__rendered {
    line-height: 42px;
    color: #515151;
    padding-left: 4px;
}

.hetra-ilce-select-field .select2-container--default .select2-selection--single .select2-selection__arrow {
    height: 40px;
    top: 1px;
    right: 8px;
}

/* =============================================
   Yükleme Animasyonu
   ============================================= */

.hetra-ilce-loading {
    position: relative;
}

.hetra-ilce-loading::after {
    content: '';
    position: absolute;
    right: 40px;
    top: 50%;
    transform: translateY(-50%);
    width: 16px;
    height: 16px;
    border: 2px solid #e0d8de;
    border-top-color: #a46497;
    border-radius: 50%;
    animation: hetra-spin 0.6s linear infinite;
    pointer-events: none;
    z-index: 10;
}

@keyframes hetra-spin {
    to { transform: translateY(-50%) rotate(360deg); }
}

/* =============================================
   Eski Değer Uyarı Stili
   ============================================= */

.hetra-old-value-notice {
    display: block;
    margin-top: 4px;
    padding: 6px 10px;
    background: #fff8e1;
    border-left: 3px solid #f9a825;
    border-radius: 0 4px 4px 0;
    font-size: 0.82em;
    color: #7a5c00;
    line-height: 1.4;
}

.hetra-old-value-notice strong {
    display: block;
    font-size: 1em;
    margin-bottom: 2px;
}

/* =============================================
   Select2 Dropdown Özelleştirme
   ============================================= */

.select2-dropdown.hetra-dropdown {
    border: 1px solid #a46497;
    border-radius: 4px;
    box-shadow: 0 4px 16px rgba(0,0,0,0.10);
    overflow: hidden;
}

.select2-container--default .select2-results__option--highlighted[aria-selected] {
    background-color: #a46497;
}

.select2-container--default .select2-search--dropdown .select2-search__field {
    border: 1px solid #d3ced2;
    border-radius: 3px;
    padding: 6px 10px;
    font-size: 0.9em;
}

.select2-container--default .select2-search--dropdown .select2-search__field:focus {
    border-color: #a46497;
    outline: none;
    box-shadow: 0 0 0 2px rgba(164,100,151,0.12);
}

/* İlk option (placeholder) rengi */
.select2-container--default .select2-results__option[value=""] {
    color: #999;
    font-style: italic;
}

/* Eski değer option stili */
.select2-results__option.hetra-old-value-option {
    background: #fff8e1 !important;
    color: #7a5c00 !important;
    font-size: 0.88em;
}

/* =============================================
   Responsive
   ============================================= */

@media (max-width: 600px) {
    .hetra-ilce-select-field .select2-container--default .select2-selection--single {
        height: 46px;
        line-height: 46px;
    }
    .hetra-ilce-select-field .select2-container--default .select2-selection--single .select2-selection__rendered {
        line-height: 46px;
    }
    .hetra-ilce-select-field .select2-container--default .select2-selection--single .select2-selection__arrow {
        height: 44px;
    }
}

/* =============================================
   Devre dışı durumu
   ============================================= */

.hetra-city-select:disabled + .select2-container .select2-selection {
    background-color: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.hetra-city-select[disabled] + .select2-container .select2-selection--single {
    background-color: #f5f5f5;
}
