/**
 * WooCommerce Türkiye Adres, Fatura & Sözleşmeler Stilleri
 */

/* ==========================================================================
   1. POSTA KODU ALANINI GİZLE
   ========================================================================== */
#billing_postcode_field,
#shipping_postcode_field,
.wc-tr-hidden-postcode {
    display: none !important;
}

/* ==========================================================================
   2. MÜŞTERİ TİPİ RADYO BUTONLARI (BİREYSEL / KURUMSAL)
   ========================================================================== */
.wc-tr-customer-type-field .woocommerce-input-wrapper {
    display: flex;
    gap: 15px;
    margin-top: 6px;
}

.wc-tr-customer-type-field label.radio {
    display: inline-flex !important;
    align-items: center;
    padding: 10px 18px;
    background: #f8f9fa;
    border: 2px solid #e2e8f0;
    border-radius: 8px;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    color: #334155;
    transition: all 0.2s ease;
    user-select: none;
    margin: 0 !important;
}

.wc-tr-customer-type-field label.radio:hover {
    background: #f1f5f9;
    border-color: #cbd5e1;
}

.wc-tr-customer-type-field input[type="radio"] {
    margin-right: 8px !important;
    accent-color: #2271b1;
    width: 18px;
    height: 18px;
}

.wc-tr-customer-type-field input[type="radio"]:checked + label,
.wc-tr-customer-type-field label.radio:has(input[type="radio"]:checked) {
    background: #eff6ff;
    border-color: #2271b1;
    color: #1e40af;
}

/* ==========================================================================
   3. KADEMELİ DROPDOWN VE YÜKLEME SPINNER'I
   ========================================================================== */
.wc-tr-loading .select2-container,
.wc-tr-loading select,
.wc-tr-loading input {
    opacity: 0.5;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.wc-tr-loading {
    position: relative;
}

.wc-tr-loading::after {
    content: '';
    position: absolute;
    top: 50%;
    right: 35px;
    margin-top: -10px;
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top-color: #2271b1;
    border-radius: 50%;
    animation: wc-tr-spin 0.8s linear infinite;
    z-index: 10;
}

@keyframes wc-tr-spin {
    to {
        transform: rotate(360deg);
    }
}

#billing_neighborhood_field,
#shipping_neighborhood_field {
    clear: both;
    width: 100%;
}

/* ==========================================================================
   4. SÖZLEŞME ONAY KUTUSU VE LİNKLER
   ========================================================================== */
.wc-tr-agreements-wrapper {
    margin: 20px 0;
    padding: 14px 18px;
    background: #fbfbfb;
    border: 1px solid #e2e8f0;
    border-radius: 8px;
    line-height: 1.5;
}

.wc-tr-agreement-row a.wc-tr-open-agreement-modal {
    color: #2271b1;
    font-weight: 600;
    text-decoration: underline;
    transition: color 0.2s ease;
}

.wc-tr-agreement-row a.wc-tr-open-agreement-modal:hover {
    color: #135e96;
    text-decoration: none;
}

/* ==========================================================================
   5. KANUNİ SÖZLEŞMELER MODAL POPUP & TİPOGRAFİ
   ========================================================================== */
body.wc-tr-modal-open {
    overflow: hidden !important;
}

.wc-tr-modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(15, 23, 42, 0.7);
    backdrop-filter: blur(4px);
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    box-sizing: border-box;
}

.wc-tr-modal-container {
    background: #ffffff;
    width: 100%;
    max-width: 800px;
    max-height: 85vh;
    border-radius: 12px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.25);
    display: flex;
    flex-direction: column;
    animation: wc-tr-modal-in 0.25s ease-out forwards;
}

@keyframes wc-tr-modal-in {
    from {
        opacity: 0;
        transform: translateY(20px) scale(0.97);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.wc-tr-modal-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 18px 24px;
    border-bottom: 1px solid #e2e8f0;
    background: #f8fafc;
    border-top-left-radius: 12px;
    border-top-right-radius: 12px;
}

.wc-tr-modal-header h3 {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0f172a;
}

.wc-tr-modal-close {
    background: transparent;
    border: none;
    font-size: 28px;
    line-height: 1;
    color: #64748b;
    cursor: pointer;
    padding: 0 6px;
    transition: color 0.15s ease;
}

.wc-tr-modal-close:hover {
    color: #0f172a;
}

/* Modal İçerik Tipografisi (Düzenli Paragraf ve Başlık Yapısı) */
.wc-tr-modal-body {
    padding: 26px 30px;
    overflow-y: auto;
    flex: 1;
    font-size: 14px;
    line-height: 1.8;
    color: #334155;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
}

.wc-tr-modal-body h3 {
    font-size: 16px;
    font-weight: 700;
    margin-top: 24px;
    margin-bottom: 12px;
    padding-bottom: 6px;
    color: #0f172a;
    border-bottom: 1px solid #e2e8f0;
    text-transform: uppercase;
    letter-spacing: 0.3px;
}

.wc-tr-modal-body h3:first-child {
    margin-top: 0;
}

.wc-tr-modal-body h4 {
    font-size: 14.5px;
    font-weight: 700;
    margin-top: 16px;
    margin-bottom: 8px;
    color: #1e293b;
}

.wc-tr-modal-body p {
    margin-bottom: 16px;
    color: #334155;
}

.wc-tr-modal-body strong {
    color: #0f172a;
    font-weight: 600;
}

.wc-tr-modal-body table.wc-tr-agreement-table,
.wc-tr-modal-body table {
    width: 100%;
    margin: 18px 0;
    border-collapse: collapse;
    border: 1px solid #e2e8f0;
}

.wc-tr-modal-body table th {
    background: #f8fafc;
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    font-weight: 600;
    color: #1e293b;
}

.wc-tr-modal-body table td {
    padding: 10px 14px;
    border: 1px solid #e2e8f0;
    font-size: 13px;
    color: #334155;
}

/* Modal Footer */
.wc-tr-modal-footer {
    padding: 16px 24px;
    border-top: 1px solid #e2e8f0;
    display: flex;
    justify-content: flex-end;
    gap: 12px;
    background: #f8fafc;
    border-bottom-left-radius: 12px;
    border-bottom-right-radius: 12px;
}

.wc-tr-modal-footer .button {
    padding: 10px 20px !important;
    border-radius: 6px !important;
    font-weight: 600 !important;
    cursor: pointer;
}

.wc-tr-modal-accept-btn {
    background-color: #2271b1 !important;
    color: #fff !important;
    border-color: #2271b1 !important;
}

.wc-tr-modal-accept-btn:hover {
    background-color: #135e96 !important;
}

/* Custom Scrollbar */
.wc-tr-modal-body::-webkit-scrollbar {
    width: 8px;
}
.wc-tr-modal-body::-webkit-scrollbar-track {
    background: #f1f5f9;
}
.wc-tr-modal-body::-webkit-scrollbar-thumb {
    background: #cbd5e1;
    border-radius: 4px;
}
.wc-tr-modal-body::-webkit-scrollbar-thumb:hover {
    background: #94a3b8;
}

/* ==========================================================================
   6. WOODMART & GELİŞMİŞ TEMA UYUMLULUK YAMASI
   ========================================================================== */
.woocommerce-checkout select.wc-tr-select,
.woocommerce-address-fields select.wc-tr-select {
    width: 100% !important;
    min-height: 42px !important;
    border-radius: 4px !important;
}

/* WoodMart Checkout Fields Manager'ın alanları sıkıştırmasını engelle */
#billing_city_field,
#shipping_city_field,
#billing_neighborhood_field,
#shipping_neighborhood_field {
    display: block !important;
}

/* Select kutusu görünürlük ve tıklanabilirlik garantisi */
select.wc-tr-select {
    display: block !important;
    width: 100% !important;
    min-height: 44px !important;
    padding: 8px 12px !important;
    border: 1px solid #ccc !important;
    border-radius: 4px !important;
    background-color: #ffffff !important;
    color: #333333 !important;
    font-size: 14px !important;
    cursor: pointer !important;
    box-sizing: border-box !important;
}
