/* ============================================================
   Wise Wear — Order Received / Teşekkür Sayfası Stilleri
   ------------------------------------------------------------
   Kullanıldığı yerler:
     • /odeme/siparis-alindi/{order_id}/?key=...   (checkout endpoint)
     • /hesabim/siparisler/{id}/                  (view order endpoint)
   İkisi de şu WooCommerce template'lerini basar:
     checkout/thankyou.php
     order/order-details.php
     order/order-details-item.php
     order/order-details-customer.php

   Bu dosya checkout.css'ten BİLEREK AYRIDIR, çünkü view-order
   sayfası checkout değildir — checkout.css yalnız is_checkout()
   için yüklenir. Burada hiçbir WooCommerce/payment iş mantığı yoktur,
   sadece sunum katmanı.
   ============================================================ */

.ww-thx *,
.ww-thx *::before,
.ww-thx *::after {
    box-sizing: border-box;
}

/* ── Lean shell (checkout yapısı) ── */
.ww-thx-shell {
    min-height: 0;
}

.ww-thx-shell .ww-pay__notices {
    margin-bottom: 0;
}

/* ── Kapsayıcı ── */
.ww-thx {
    max-width: 1280px;
    margin: 0 auto;
    padding: 24px 32px 80px;
    width: 100%;
    min-width: 0;
    color: #111;
}

/* ── Native order-received mesajı: kutu değil, sade bir alt metin ── */
.ww-thx .woocommerce-thankyou-order-received {
    background: none;
    border: 0;
    padding: 0;
    margin: 0 0 18px;
    font-size: 13px;
    color: #666;
    text-align: center;
}

/* ── Failed order notice'leri korunur, sadece kutu görünümü verilir ── */
.ww-thx .woocommerce-notice--error {
    background: #fff;
    border: 1px solid #e5e5e5;
    border-left: 3px solid #c1272d;
    border-radius: 6px;
    padding: 14px 16px;
    font-size: 13px;
    color: #111;
}

/* ── Başarı Başlığı ── */
.ww-thx__head {
    text-align: center;
    padding: 12px 0 26px;
}

.ww-thx__tick {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 48px;
    height: 48px;
    border-radius: 50%;
    background: #111;
    color: #fff;
    margin-bottom: 14px;
}

.ww-thx__title {
    font-size: 22px;
    font-weight: 800;
    letter-spacing: 1.4px;
    text-transform: uppercase;
    color: #111;
    margin: 0 0 6px;
    line-height: 1.2;
}

.ww-thx__lead {
    font-size: 14px;
    color: #555;
    margin: 0;
}

/* ── Sipariş Özeti Kartı ── */
.ww-thx__meta {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1px;
    list-style: none;
    margin: 0 0 16px;
    padding: 0;
    background: #e8e8e8;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    overflow: hidden;
}

.ww-thx__meta-item {
    background: #fff;
    padding: 16px 18px;
    min-width: 0;
}

.ww-thx__meta-key {
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: #888;
    margin-bottom: 6px;
}

.ww-thx__meta-val {
    display: block;
    font-size: 15px;
    font-weight: 700;
    color: #111;
    word-break: break-word;
}

/* ── Genel Bölüm Kartı ── */
.ww-thx__section {
    background: #fff;
    border: 1px solid #e8e8e8;
    border-radius: 10px;
    padding: 24px 26px;
    margin: 0 0 16px;
    min-width: 0;
}

.ww-thx__h2 {
    font-size: 12px;
    font-weight: 800;
    letter-spacing: 1.2px;
    text-transform: uppercase;
    color: #111;
    margin: 0 0 18px;
    line-height: 1.3;
}

/* ── BACS / Ödeme Bilgileri Kartı ── */
.ww-thx__pay-lead {
    font-size: 13px;
    color: #555;
    margin: -6px 0 16px;
    max-width: 62ch;
}

/* Gateway'in "instructions" metni (içindeki 30 dk uyarısı dahil).
   Metin ve mantık DOKUNULMAZ; yalnız daha kompakt bir bilgi kutusu. */
.ww-thx__pay-body > p {
    font-size: 12.5px;
    line-height: 1.5;
    color: #111;
    background: #fafafa;
    border: 1px solid #ececec;
    border-left: 2px solid #111;
    border-radius: 6px;
    padding: 9px 12px;
    margin: 0 0 12px;
}

.ww-thx__pay-body > p:last-child {
    margin-bottom: 0;
}

/* Gateway'in kendi "Our bank details" başlığı gizlenir; kart başlığı zaten var.
   Metin kaldırılmaz — yalnız görsel tekrardır. */
.ww-thx__pay .wc-bacs-bank-details-heading {
    display: none;
}

/*
   Gateway'in dinamik çıktısı:
     <section class="woocommerce-bacs-bank-details">
       <h2 class="wc-bacs-bank-details-heading">Our bank details</h2>  → gizli
       <h3 class="wc-bacs-bank-details-account-name">Doğuş Mete:</h3>
       <ul class="wc-bacs-bank-details order_details bacs_details">
         <li class="bank_name">Bank: <strong>Garanti</strong></li>
         <li class="account_number">Account number: <strong>…</strong></li>
         <li class="sort_code">Sort code: <strong>…</strong></li>
         <li class="iban">IBAN: <strong>…</strong></li>
       </ul>
     </section>

   AMAÇ: hepsi TEK bir kompakt kart, hesap sahibi de ayrı satır değil.
   Çözüm: <ul> display:contents → <li> öğeleri doğrudan section'ın grid
   çocukları olur. <h3> zaten section'ın ilk çocuğu, yani grid'in ilk
   hücresi. Akış sırası: Hesap Sahibi | Banka / Hesap No | Sıralama Kodu /
   IBAN (tam genişlik). Hiçbir veri değişmez, yalnız yerleşim.
*/
.ww-thx__pay .woocommerce-bacs-bank-details {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px 24px;
    align-items: start;
    border: 1px solid #e8e8e8;
    border-radius: 8px;
    background: #fff;
    padding: 15px 17px;
    margin: 0;
}

.ww-thx__pay ul.wc-bacs-bank-details {
    display: contents;
}

/* Hesap sahibi: gateway yalnız değeri verir ("Doğuş Mete:").
   JS metni nokta işaretinden arındırıp .ww-thx__copy-name içine yazar,
   etiketi CSS ile eklenir. Düzen aynı kalır (grid'in 1. hücresi). */
.ww-thx__pay .wc-bacs-bank-details-account-name {
    margin: 0;
    min-width: 0;
    overflow-wrap: anywhere;
}

.ww-thx__pay .wc-bacs-bank-details-account-name::before {
    content: 'HESAP SAHİBİ';
    display: block;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #888;
    line-height: 1.3;
    margin-bottom: 3px;
}

.ww-thx__pay .wc-bacs-bank-details li {
    min-width: 0;
    font-size: 10px;
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
    color: #888;
    line-height: 1.3;
}

/* Gateway biçimi: "Banka: <strong>Garanti</strong>" → etiket + değer ayrılır. */
.ww-thx__pay .wc-bacs-bank-details li strong {
    display: block;
    margin-top: 3px;
    font-size: 14px;
    font-weight: 700;
    letter-spacing: 0;
    text-transform: none;
    color: #111;
    overflow-wrap: anywhere;
    word-break: break-word;
    font-variant-numeric: tabular-nums;
}

/* IBAN ve hesap numarası tam genişlik kaplasın. */
.ww-thx__pay .wc-bacs-bank-details li.iban,
.ww-thx__pay .wc-bacs-bank-details li.account_number {
    grid-column: 1 / -1;
}

/* ── Kopyalama düğmesi (order-received.js ile eklenir) ──
   Gateway'in <strong> değerini JS flex sarmalayıcıya taşır; düğme
   value'nun sağında, dikeyde ortalanmış durur. */
.ww-thx__value {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 3px;
}

/* Not: `.ww-thx__pay .wc-bacs-bank-details li strong` (2 sınıf + 2 öğe)
   daha yüksek specificity'ye sahip; kazanması için burada da
   .ww-thx__pay ile kapsam genişletildi. */
.ww-thx__pay .ww-thx__value > strong {
    margin-top: 0;
    min-width: 0;
    /* Değer kısalınca düğmeye yer bırak. */
    flex: 0 1 auto;
}

/* Hesap sahibi adı: <li> değil <h3> içinde olduğu için aynı değer
   tipografisini burada veriyoruz. */
.ww-thx__pay .ww-thx__value > .ww-thx__copy-name {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    line-height: 1.35;
    min-width: 0;
    overflow-wrap: anywhere;
    /* Ad uzunsa düğmeye yer bırak. */
    flex: 0 1 auto;
}

.ww-thx__copy {
    flex-shrink: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    /* Dokunma hedefi ~40x40px. */
    min-width: 40px;
    min-height: 40px;
    margin: -8px -8px -8px 0;
    padding: 0;
    background: none;
    border: 0;
    border-radius: 6px;
    color: #8a8a8a;
    cursor: pointer;
    -webkit-appearance: none;
    appearance: none;
    transition: color .15s ease, background-color .15s ease;
}

.ww-thx__copy:hover {
    color: #111;
    background: #f2f2f2;
}

/* Klavye ile gezinirken görünür odak halkası. */
.ww-thx__copy:focus-visible {
    outline: 2px solid #111;
    outline-offset: 2px;
    color: #111;
}

/* Eski tarayıcı fallback'i (focus-visible desteklemeyenler). */
.ww-thx__copy:focus {
    outline: 2px solid #111;
    outline-offset: 2px;
}

.ww-thx__copy:focus:not(:focus-visible) {
    outline: none;
}

.ww-thx__copy-icon {
    display: block;
    flex-shrink: 0;
}

/* Check ikonu ve "Kopyalandı" yazısı normalde gizli. */
.ww-thx__copy-icon--check,
.ww-thx__copy-text {
    display: none;
}

.ww-thx__copy.is-copied {
    color: #111;
    background: transparent;
    /* "Kopyalandı" yazısı sığsın; 40x40 dokunma hedefi korunur. */
    min-width: 40px;
    padding-right: 4px;
    gap: 5px;
}

.ww-thx__copy.is-copied .ww-thx__copy-icon--copy {
    display: none;
}

.ww-thx__copy.is-copied .ww-thx__copy-icon--check {
    display: block;
}

.ww-thx__copy.is-copied .ww-thx__copy-text {
    display: inline;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: #111;
    white-space: nowrap;
}

/* ── Sipariş Satırları (tablo yok, CSS grid satır) ── */
.ww-thx__items {
    display: flex;
    flex-direction: column;
}

/* Thumbnail ortalanır, satır yüksekliği gereksiz büyümez. */
.ww-thx__item {
    display: grid;
    grid-template-columns: 64px minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.ww-thx__item:first-child { padding-top: 0; }
.ww-thx__item:last-child  { border-bottom: 0; padding-bottom: 0; }

.ww-thx__item-thumb {
    display: block;
    line-height: 0;
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 8px;
    overflow: hidden;
}

.ww-thx__item-thumb img {
    width: 100% !important;
    height: auto !important;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
    margin: 0 !important;
}

.ww-thx__item-body {
    min-width: 0;
}

/* Başlık + beden + adet tek grup, birbirine bitişik. */
.ww-thx__item-name {
    font-size: 13.5px;
    font-weight: 600;
    line-height: 1.35;
    color: #111;
}

.ww-thx__item-name a { color: inherit; text-decoration: none; }
.ww-thx__item-name a:hover { text-decoration: underline; }

.ww-thx__item-qty {
    display: block;
    margin-top: 2px;
    font-size: 12px;
    font-weight: 500;
    color: #888;
    white-space: nowrap;
}

/* Varyasyon / beden çıktısı (wc_display_item_meta) */
.ww-thx__item-body p,
.ww-thx__item-body dl {
    margin: 1px 0 0;
    font-size: 11.5px;
    line-height: 1.4;
    color: #666;
}

.ww-thx__item-body dt {
    display: inline;
    font-weight: 600;
}

.ww-thx__item-body p {
    font-weight: 400;
}

.ww-thx__item-body dd,
.ww-thx__item-body dd p {
    display: inline;
    margin: 0;
    color: #555;
}

.ww-thx__item-price {
    font-size: 14px;
    font-weight: 700;
    color: #111;
    white-space: nowrap;
    text-align: right;
}

.ww-thx__purchase-note {
    font-size: 12px;
    color: #666;
    padding: 10px 12px;
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 8px;
    margin: 0 0 12px;
}

.ww-thx__purchase-note p { margin: 0; }

/* ── Ara Toplam / Gönderim / Vergi / Toplam ── */
.ww-thx__totals {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 1px solid #ececec;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

/* Etiket ve değer birbirine yakın; blok sağa yaslı ve dar.
   Değerler $order->get_order_item_totals()'tan gelir — hesap değişmedi. */
.ww-thx__total-row {
    display: flex;
    align-items: baseline;
    justify-content: flex-end;
    gap: 18px;
    width: 100%;
    max-width: 340px;
    padding: 4px 0;
    font-size: 12.5px;
    color: #555;
}

.ww-thx__total-key { color: inherit; }

.ww-thx__total-val {
    color: #111;
    font-weight: 600;
    white-space: nowrap;
    margin-left: auto;
}

.ww-thx__total-row--grand {
    margin-top: 6px;
    padding-top: 11px;
    border-top: 1px solid #111;
    max-width: 100%;
    font-size: 14px;
    font-weight: 800;
    color: #111;
    text-transform: uppercase;
    letter-spacing: 0.6px;
}

.ww-thx__total-row--grand .ww-thx__total-val {
    font-size: 19px;
    font-weight: 800;
    letter-spacing: 0;
}

.ww-thx__note {
    width: 100%;
    max-width: 340px;
    margin-top: 12px;
    font-size: 12px;
    color: #666;
    text-align: right;
}

.ww-thx__note .ww-thx__total-key {
    display: block;
    font-weight: 700;
    color: #888;
    margin-bottom: 4px;
}

.ww-thx__actions {
    width: 100%;
    margin-top: 18px;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.ww-thx__actions .button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 44px;
    padding: 0 22px;
    background: #111;
    color: #fff;
    border: 1px solid #111;
    border-radius: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: 0.8px;
    text-transform: uppercase;
    text-decoration: none;
}

.ww-thx__actions .button:hover {
    background: #2c2c2c;
    border-color: #2c2c2c;
}

/* ── Fatura / Gönderim Adresleri ── */
.ww-thx__addresses {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    align-items: start;
}

.ww-thx__addr {
    min-width: 0;
    background: #fafafa;
    border: 1px solid #ececec;
    border-radius: 8px;
    padding: 13px 15px;
}

.ww-thx__addr-title {
    font-size: 9.5px;
    font-weight: 800;
    letter-spacing: 1.1px;
    text-transform: uppercase;
    color: #8a8a8a;
    margin: 0 0 8px;
}

.ww-thx__addr address {
    margin: 0;
    font-style: normal;
    font-size: 12.5px;
    line-height: 1.5;
    color: #111;
    overflow-wrap: anywhere;
}

.ww-thx__addr address br + br { display: none; }

.ww-thx__addr address p { margin: 4px 0 0; }

/* Telefon / e-posta: bir kademe geri çekilmiş, ikincil bilgi. */
.ww-thx__addr .woocommerce-customer-details--phone,
.ww-thx__addr .woocommerce-customer-details--email {
    font-size: 11.5px;
    line-height: 1.45;
    color: #8a8a8a;
    word-break: break-word;
}

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 960px) {
    .ww-thx {
        padding: 16px 16px 56px;
    }

    .ww-thx__meta {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .ww-thx__section {
        padding: 20px 16px;
        border-radius: 8px;
    }

    .ww-thx__item {
        grid-template-columns: 56px minmax(0, 1fr);
        gap: 12px;
        padding: 12px 0;
        align-items: start;
    }

    .ww-thx__item-thumb img { aspect-ratio: 1 / 1; }

    /* Fiyat kendi satırına insin — yatay tablo kaydırması olmaz. */
    .ww-thx__item-price {
        grid-column: 2;
        text-align: left;
        font-size: 13px;
    }

    /* Banka kartı mobilde tek kolona iner. */
    .ww-thx__pay .woocommerce-bacs-bank-details {
        grid-template-columns: 1fr;
        gap: 12px;
    }

    /* Uzun adlarda düğme sıkışmasın; dokunma hedefi 40px kalır. */
    .ww-thx__pay .ww-thx__value {
        flex-wrap: wrap;
    }

    .ww-thx__addresses {
        grid-template-columns: 1fr;
    }

    .ww-thx__totals { align-items: stretch; }

    .ww-thx__total-row,
    .ww-thx__total-row--grand {
        max-width: 100%;
    }

    .ww-thx__note { max-width: 100%; }
}

@media (max-width: 480px) {
    .ww-thx__title { font-size: 18px; letter-spacing: 1px; }
    .ww-thx__lead { font-size: 13px; }
    .ww-thx__meta { grid-template-columns: 1fr; }
    .ww-thx__meta-item { padding: 13px 15px; }
    .ww-thx__total-row--grand .ww-thx__total-val { font-size: 18px; }
}
