/**
 * Meander Ferry Insurance - Checkout Styles v2.0
 * Premium design matching the mockup
 */

/* woocommerce checkout page */

/* ================================================================
   WOOCOMMERCE CHECKOUT - MODERN TASARIM GÜNCELLEMESİ
   Hedef: Samosaferibot Özel Tasarımı
================================================================ */

/* 1. Genel Yapı ve Konteyner */
.woocommerce-checkout {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    color: #333;
    font-size: 14px;
    line-height: 1.5;
}

/* Sütunları %100 genişliğe al (Yan yana durmasını engelle) */
.woocommerce-checkout .col2-set {
    width: 100%;
}

.woocommerce-checkout .col2-set .col-1,
.woocommerce-checkout .col2-set .col-2 {
    width: 100%;
    max-width: 100%;
    float: none;
    padding: 0;
}

/* 2. Kupon Alanı (Modern Görünüm) */
.woocommerce-form-coupon-toggle .woocommerce-info {
    background: transparent;
    border: none;
    padding: 0;
    color: #333;
    margin-bottom: 24px;
    font-size: 13px;
}

.woocommerce-form-coupon-toggle .woocommerce-info::before {
    display: none;
    /* Standart woo ikonunu gizle */
}

.woocommerce-form-coupon-toggle .woocommerce-info a {
    color: #0073aa;
    text-decoration: none;
    font-weight: normal;
}

.woocommerce-form-coupon {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 16px;
    margin-bottom: 24px;
}

/* 3. Beyaz Kutu Seksiyonları (Fatura, Sipariş Özeti vb.) */
.woocommerce-billing-fields,
.woocommerce-additional-fields,
.woocommerce-checkout-review-order {
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 16px;
}

/* Başlıklar (Adım Numarası Formatı) */
.woocommerce-billing-fields h3,
.woocommerce-additional-fields h3,
#order_review_heading {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 16px 0;
    color: #0a3d5c;
    border: none;
    padding: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    line-height: 1.3;
}

/* Adım rozetleri (1 ve 3) */
.woocommerce-billing-fields h3::before,
#order_review_heading::before {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: linear-gradient(135deg, #0a8f4f 0%, #0b7a44 100%);
    color: #fff;
    border-radius: 50%;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(10, 143, 79, 0.25);
}

.woocommerce-billing-fields h3::before {
    content: "1";
}

#order_review_heading::before {
    content: "3";
}

/* 4. Form Alanları (Grid Yapısı ve Input Stilleri) */
.woocommerce-billing-fields__field-wrapper,
.woocommerce-additional-fields__field-wrapper {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}

.woocommerce form .form-row {
    margin: 0;
    padding: 0;
    width: 100%;
    float: none;
    display: flex;
    flex-direction: column;
}

/* Tam genişlik kaplaması gereken alanlar */
.woocommerce form .form-row-wide,
#billing_company_field,
#billing_country_field,
#billing_address_1_field,
#billing_address_2_field,
#billing_postcode_field,
#billing_city_field,
#billing_state_field,
#order_comments_field {
    grid-column: span 2;
}

/* Input ve Label Stilleri */
.woocommerce form .form-row label {
    font-size: 12px;
    color: #666;
    margin-bottom: 4px;
    line-height: 1.2;
    font-weight: normal;
}

.woocommerce form .form-row input.input-text,
.woocommerce form .form-row select,
.woocommerce form .form-row textarea {
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    background-color: #fff;
    width: 100%;
    box-sizing: border-box;
    box-shadow: none;
}

.woocommerce form .form-row input.input-text:focus,
.woocommerce form .form-row textarea:focus {
    outline: none;
    border-color: #0073aa;
    box-shadow: 0 0 0 1px #0073aa;
}

/* Select2 (Ülke/Şehir Seçimi) Özel Stili */
.woocommerce .select2-container--default .select2-selection--single {
    height: auto;
    padding: 8px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
}

.woocommerce .select2-container--default .select2-selection--single .select2-selection__arrow {
    top: 10px;
    right: 8px;
}

/* 5. Ekstra Hizmetler Sigorta Alanı (#mfi-insurance-wrapper) */
#mfi-insurance-wrapper {
    background: linear-gradient(135deg, #f0f7fc 0%, #e8f5f0 100%);
    border: 2px solid #0073aa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 16px;
    box-sizing: border-box;
}

.mfi-header {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 6px;
}

/* Adım rozeti stili (Mevcut html'de div.mfi-step-badge kullanılmış) */
.mfi-step-badge {
    width: 24px;
    height: 24px;
    background: #0073aa;
    color: white;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    font-weight: 600;
    flex-shrink: 0;
}

.mfi-title {
    font-size: 17px;
    font-weight: 600;
    color: #0c5a8a;
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    border: none;
}

.mfi-subtitle {
    font-size: 13px;
    color: #5a7a8a;
    margin: 0 0 16px 0;
}

.mfi-subtitle strong {
    color: #0073aa;
}

.mfi-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.mfi-option {
    background: white;
    border: 2px solid #d0dfe8;
    border-radius: 10px;
    padding: 14px 18px;
    cursor: pointer;
    transition: all 0.2s ease;
    display: block;
    margin: 0;
}

.mfi-option:hover {
    border-color: #a0c8d8;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.08);
}

/* Seçili Kart Stili (Modern CSS :has seçicisi ile) */
.mfi-option:has(input:checked) {
    border-color: #0073aa;
    background: linear-gradient(135deg, #f0f9ff 0%, #e6f7f2 100%);
    box-shadow: 0 2px 12px rgba(0, 115, 170, 0.12);
}

.mfi-checkbox {
    display: none;
}

.mfi-option-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mfi-option-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
}

.mfi-option-icon {
    width: 22px;
    height: 22px;
    border: 2px solid #b8c9d4;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: white;
    color: transparent;
    transition: all 0.15s;
    flex-shrink: 0;
}

.mfi-option:has(input:checked) .mfi-option-icon {
    background: #0073aa;
    border-color: #0073aa;
    color: white;
}

.mfi-option-info {
    flex: 1;
    min-width: 0;
}

.mfi-option-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #1a3a4f;
    margin-bottom: 2px;
}

.mfi-option-desc {
    display: block;
    font-size: 12px;
    color: #6a7a87;
}

.mfi-option-right {
    text-align: right;
    flex-shrink: 0;
}

.mfi-option-price {
    display: block;
    font-size: 20px;
    font-weight: 700;
    color: #0073aa;
    line-height: 1;
}

.mfi-option-unit {
    display: block;
    font-size: 12px;
    color: #7a8a97;
    margin-top: 2px;
}


/* 6. Sipariş Özeti Tablosu */
.woocommerce table.shop_table {
    border: none;
    border-collapse: collapse;
    width: 100%;
    font-size: 13px;
    border-radius: 0;
    margin: 0;
}

.woocommerce table.shop_table th,
.woocommerce table.shop_table td {
    border: none;
    padding: 12px 0;
    background: transparent;
    vertical-align: top;
}

.woocommerce table.shop_table thead tr {
    border-bottom: 1px solid #e0e0e0;
}

.woocommerce table.shop_table thead th {
    text-align: left;
    padding: 8px 0;
    font-weight: 500;
    color: #666;
}

.woocommerce table.shop_table thead th.product-total {
    text-align: right;
}

.woocommerce table.shop_table tbody tr {
    border-bottom: 1px solid #f0f0f0;
}

.woocommerce table.shop_table tbody td.product-total {
    text-align: right;
    font-weight: 500;
}

.woocommerce table.shop_table tfoot tr {
    border-bottom: 1px solid #e0e0e0;
}

.woocommerce table.shop_table tfoot th {
    text-align: left;
    font-weight: 500;
}

.woocommerce table.shop_table tfoot td {
    text-align: right;
}

.woocommerce table.shop_table tfoot tr.order-total th,
.woocommerce table.shop_table tfoot tr.order-total td {
    font-weight: 700;
    font-size: 16px;
    color: #0073aa;
    border-bottom: none;
    padding-top: 12px;
}

/* Bilet Detayları Formatlaması */
.woocommerce table.shop_table td.product-name {
    font-weight: 500;
}

.woocommerce table.shop_table ul.event-custom-price {
    list-style: none;
    padding: 0;
    margin: 4px 0 0 0;
    color: #666;
    font-size: 11px;
    line-height: 1.5;
    font-weight: normal;
}

.woocommerce table.shop_table ul.event-custom-price span[style*="font-weight:bold"] {
    display: block;
    margin-top: 6px;
    color: #0073aa;
    /* Vurgulu renk */
}


/* 7. Ödeme Alanı ve Sözleşme */
.woocommerce-checkout #payment {
    background: transparent;
    border-radius: 0;
}

.woocommerce-checkout #payment ul.payment_methods {
    background: #f8f9fa;
    border: 1px solid #e8e8e8;
    border-radius: 6px;
    padding: 12px;
    margin-bottom: 20px;
    border-bottom: none;
}

.woocommerce-checkout #payment ul.payment_methods li input {
    margin-right: 8px;
}

.woocommerce-checkout #payment ul.payment_methods li label {
    font-size: 13px;
    color: #333;
    font-weight: 600;
}

.woocommerce-checkout #payment div.payment_box {
    background: transparent;
    margin: 4px 0 0 24px;
    padding: 0;
    font-size: 11px;
    color: #888;
    box-shadow: none;
}

.woocommerce-checkout #payment div.payment_box::before {
    display: none;
}

/* Ok işaretini kaldır */

.woocommerce-checkout .form-row.privacy {
    margin-bottom: 20px;
    padding: 0;
}

.woocommerce-checkout .form-row.privacy label {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
}

.woocommerce-checkout .form-row.privacy label a {
    color: #0073aa;
    text-decoration: none;
}

.woocommerce-checkout .form-row.privacy label a:hover {
    text-decoration: underline;
}

.woocommerce-checkout .form-row.privacy input[type="checkbox"] {
    margin-top: 3px;
}

/* 8. Siparişi Onayla Butonu */
.woocommerce-checkout #place_order {
    width: 100%;
    background: linear-gradient(135deg, #0073aa 0%, #005a87 100%);
    color: white;
    border: none;
    padding: 16px;
    border-radius: 8px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0, 115, 170, 0.3);
    text-align: center;
    margin-top: 10px;
}

.woocommerce-checkout #place_order:hover {
    background: linear-gradient(135deg, #005a87 0%, #004a6e 100%);
    box-shadow: 0 4px 12px rgba(0, 115, 170, 0.4);
    transform: translateY(-1px);
}

/* 9. Mobil Uyumluluk */
@media (max-width: 600px) {

    .woocommerce-billing-fields__field-wrapper,
    .woocommerce-additional-fields__field-wrapper {
        grid-template-columns: 1fr;
    }

    .woocommerce form .form-row-wide {
        grid-column: span 1;
    }

    .mfi-option {
        padding: 12px 14px;
    }

    .mfi-option-name {
        font-size: 13px;
    }

    .mfi-option-desc {
        font-size: 11px;
    }

    .woocommerce-checkout {
        padding: 10px;
    }
}

/* Ana wrapper */
.mfi-insurance-section {
    background: linear-gradient(135deg, #f0f8ff 0%, #e6f2fc 100%);
    border: 1px solid #d0e4f5;
    border-radius: 16px;
    padding: 28px 28px 24px;
    margin: 28px 0;
    box-shadow: 0 2px 16px rgba(0, 115, 170, 0.07);
    position: relative;
}

/* Header */
.mfi-header {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 6px;
}

.mfi-step-badge {
    width: 32px;
    height: 32px;
    min-width: 32px;
    background: linear-gradient(135deg, #0a8f4f 0%, #0b7a44 100%);
    color: #fff;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    font-weight: 700;
    box-shadow: 0 2px 8px rgba(10, 143, 79, 0.25);
}

.mfi-header-icon {
    color: #0a7fb5;
    display: flex;
    align-items: center;
}

.mfi-header-icon svg {
    width: 22px;
    height: 22px;
}

/* Başlık */
.mfi-title {
    margin: 0;
    font-size: 18px;
    font-weight: 700;
    color: #0a3d5c;
    line-height: 1.3;
}

.mfi-subtitle {
    margin: 0 0 20px 0;
    color: #4a6a7d;
    font-size: 14px;
    padding-left: 44px;
}

.mfi-subtitle strong {
    color: #d64000;
    font-weight: 700;
}

/* Seçenekler container */
.mfi-options {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

/* Her bir seçenek */
.mfi-option {
    display: block;
    background: #ffffff;
    border: 2px solid #e2eaf0;
    border-radius: 12px;
    padding: 16px 20px;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.mfi-option:hover {
    border-color: #0a7fb5;
    box-shadow: 0 4px 16px rgba(10, 127, 181, 0.12);
    transform: translateY(-1px);
}

.mfi-option.selected {
    border-color: #0a7fb5;
    background: linear-gradient(135deg, #f5fbff 0%, #eaf6ff 100%);
    box-shadow: 0 4px 20px rgba(10, 127, 181, 0.15);
}

/* Checkbox gizle */
.mfi-option input[type="checkbox"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

/* Option içerik */
.mfi-option-content {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}

.mfi-option-left {
    display: flex;
    align-items: center;
    gap: 14px;
    flex: 1;
    min-width: 0;
}

/* Checkbox ikonu */
.mfi-option-icon {
    width: 26px;
    height: 26px;
    min-width: 26px;
    border: 2px solid #c5d3dc;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    transition: all 0.2s ease;
    flex-shrink: 0;
}

.mfi-option-icon svg {
    opacity: 0;
    transition: opacity 0.2s ease;
    color: #fff;
}

.mfi-option.selected .mfi-option-icon {
    background: #0a7fb5;
    border-color: #0a7fb5;
    box-shadow: 0 2px 6px rgba(10, 127, 181, 0.3);
}

.mfi-option.selected .mfi-option-icon svg {
    opacity: 1;
}

/* Bilgi alanı */
.mfi-option-info {
    display: flex;
    flex-direction: column;
    gap: 3px;
    min-width: 0;
}

/* Seçenek adı */
.mfi-option-name {
    font-size: 15px;
    font-weight: 600;
    color: #1a3a4f;
    line-height: 1.3;
}

/* Açıklama */
.mfi-option-desc {
    font-size: 13px;
    color: #6a8a9d;
    line-height: 1.4;
}

/* Sağ taraf - Fiyat */
.mfi-option-right {
    display: flex;
    align-items: baseline;
    gap: 2px;
    flex-shrink: 0;
    white-space: nowrap;
}

.mfi-option-price {
    font-size: 20px;
    font-weight: 700;
    color: #0a7fb5;
}

.mfi-option-unit {
    font-size: 13px;
    font-weight: 400;
    color: #6a8a9d;
}

/* Responsive */
@media (max-width: 600px) {
    .mfi-insurance-section {
        padding: 20px 16px;
        margin: 20px 0;
        border-radius: 12px;
    }

    .mfi-header {
        flex-wrap: wrap;
    }

    .mfi-title {
        font-size: 16px;
    }

    .mfi-subtitle {
        padding-left: 0;
    }

    .mfi-option {
        padding: 14px 16px;
    }

    .mfi-option-content {
        flex-wrap: wrap;
    }

    .mfi-option-left {
        flex-basis: 100%;
    }

    .mfi-option-right {
        padding-left: 40px;
        margin-top: 6px;
    }

    .mfi-option-name {
        font-size: 14px;
    }

    .mfi-option-desc {
        font-size: 12px;
    }
}

/* Loading state */
.mfi-insurance-section.loading {
    opacity: 0.6;
    pointer-events: none;
}

.mfi-insurance-section.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 28px;
    height: 28px;
    margin: -14px 0 0 -14px;
    border: 3px solid #0a7fb5;
    border-top-color: transparent;
    border-radius: 50%;
    animation: mfi-spin 0.7s linear infinite;
}

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