/* ------------------------------------------------------------------
   Sipariş teslim kodları
   Üye siparişleri, üyeliksiz sipariş sorgu, hesabım ve ilan pazarı
   sipariş ekranlarında ortak kullanılır.
   ------------------------------------------------------------------ */

.teslim-kodlari {
    margin: 10px 0 6px;
    padding: 12px;
    border: 1px solid rgba(255, 255, 255, .10);
    border-radius: 10px;
    background: rgba(255, 255, 255, .03);
}

.teslim-kodlari__ust {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 10px;
    flex-wrap: wrap;
}

.teslim-kodlari__baslik {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    font-weight: 700;
    letter-spacing: .4px;
    text-transform: uppercase;
    color: #3ddc84;
}

.teslim-kodlari__baslik i {
    font-size: 11px;
}

.teslim-kodlari__kopyala {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 12px;
    border: 1px solid rgba(255, 255, 255, .14);
    border-radius: 7px;
    background: rgba(255, 255, 255, .06);
    color: #e8e8e8;
    font-size: 12px;
    font-weight: 600;
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.teslim-kodlari__kopyala:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(255, 255, 255, .24);
    color: #fff;
}

.teslim-kodlari__liste {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.teslim-kodu {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 12px;
    border: 1px solid rgba(255, 255, 255, .08);
    border-radius: 8px;
    background: rgba(255, 255, 255, .07);
    cursor: pointer;
    transition: background .15s ease, border-color .15s ease;
}

.teslim-kodu:hover {
    background: rgba(255, 255, 255, .12);
    border-color: rgba(61, 220, 132, .45);
}

.teslim-kodu__metin {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
    font-size: 13px;
    line-height: 1.45;
    color: #f1f1f1;
    word-break: break-all;
    text-align: left;
}

.teslim-kodu__ikon {
    flex: 0 0 auto;
    font-size: 12px;
    color: rgba(255, 255, 255, .45);
}

.teslim-kodu:hover .teslim-kodu__ikon {
    color: #3ddc84;
}

/* Kopyalandı geri bildirimi */
.teslim-kodu.kopyalandi,
.teslim-kodlari__kopyala.kopyalandi {
    border-color: #3ddc84;
    background: rgba(61, 220, 132, .16);
}

.teslim-kodu.kopyalandi .teslim-kodu__ikon {
    color: #3ddc84;
}

/* Açık tema */
body.light .teslim-kodlari,
.light-theme .teslim-kodlari {
    border-color: rgba(0, 0, 0, .10);
    background: rgba(0, 0, 0, .02);
}

body.light .teslim-kodu,
.light-theme .teslim-kodu {
    border-color: rgba(0, 0, 0, .08);
    background: rgba(0, 0, 0, .04);
}

body.light .teslim-kodu__metin,
.light-theme .teslim-kodu__metin {
    color: #1d1d1d;
}

body.light .teslim-kodlari__kopyala,
.light-theme .teslim-kodlari__kopyala {
    border-color: rgba(0, 0, 0, .12);
    background: rgba(0, 0, 0, .04);
    color: #1d1d1d;
}

@media (max-width: 575px) {
    .teslim-kodlari {
        padding: 10px;
    }

    .teslim-kodu__metin {
        font-size: 12px;
    }
}


/* ------------------------------------------------------------------
   Çok sayıda kod

   Bazı siparişlerde 5-10 kod geliyor; liste modalı aşırı uzatmasın
   diye kendi içinde kayıyor.
   ------------------------------------------------------------------ */

.teslim-kodlari__liste {
    max-height: 300px;
    overflow-y: auto;
    padding-right: 2px;
}

.teslim-kodlari__liste::-webkit-scrollbar {
    width: 6px;
}

.teslim-kodlari__liste::-webkit-scrollbar-thumb {
    background: rgba(255, 255, 255, .18);
    border-radius: 999px;
}


/* ------------------------------------------------------------------
   Mobil: ürün satırı tam genişlik

   Kodlar sipariş detay tablosunun ilk hücresinde. Mobilde 5 sütun
   sıkışınca o hücre daralıyor ve kod harf harf alt alta iniyordu.
   Satırı ızgaraya çevirip ilk hücreyi tam genişlik yapıyoruz:
   ürün + kodlar üstte tam satır, adet/fiyat bilgileri altta ikişerli.
   Tablo genişlemediği için modal da taşmıyor.
   ------------------------------------------------------------------ */

@media (max-width: 767.98px) {

    .siparis-urun-tablo thead {
        display: none;
    }

    .siparis-urun-tablo,
    .siparis-urun-tablo tbody {
        display: block;
        width: 100%;
    }

    .siparis-urun-tablo tr {
        display: grid;
        grid-template-columns: 1fr 1fr;
        gap: 2px 8px;
        padding: 10px 0 14px;
        border-bottom: 1px solid rgba(255, 255, 255, .08);
    }

    .siparis-urun-tablo tr:last-child {
        border-bottom: 0;
    }

    .siparis-urun-tablo td {
        display: block;
        width: auto;
        padding: 3px 12px;
        border: 0;
        font-size: 13px;
    }

    /* Ürün adı + kodlar: tam satır */
    .siparis-urun-tablo td:first-child {
        grid-column: 1 / -1;
    }

    .teslim-kodlari {
        min-width: 0;
        width: 100%;
    }

    .teslim-kodu__metin {
        word-break: normal;
        overflow-wrap: anywhere;
        font-size: 12px;
    }
}

@media (max-width: 400px) {
    .teslim-kodu__metin {
        font-size: 11.5px;
        letter-spacing: -.2px;
    }
}

/* ------------------------------------------------------------------
   Mobil: sipariş detayı sabit alt menünün altında kalmasın

   .mobileFixed 991px altında görünüyor, 90px yükseklikte ve
   z-index: 999. Modalı onun üstüne alıp alt boşluk bırakıyoruz ki
   "Kapat" ve son kodlar menünün arkasında kalmasın.
   ------------------------------------------------------------------ */

@media (max-width: 991.98px) {

    .modal {
        z-index: 1060;
    }

    .modal-backdrop {
        z-index: 1055;
    }

    .modal-dialog {
        margin-bottom: 104px;
    }

    .modal-content {
        max-height: calc(100vh - 120px);
        overflow-y: auto;
    }
}