/* WooCommerce Global & Cart Styles */
.woocommerce .woocommerce-breadcrumb {
    display: block !important;
    font-size: 14px !important;
    width: 100% !important;
}

.woocommerce .woocommerce-breadcrumb a {
    font-size: 14px !important;
}

/* Sepetteki gönderim hedefi metnini gizler */
p.woocommerce-shipping-destination {
    display: none !important;
}

/* Sepetteki miktar belirleme kutusunu genişletir */
.woocommerce .quantity input.qty {
    width: 80px !important;
}

/* Sadece tablet ve masaüstü ekranlarda (768px ve üzeri) geçerli kupon kodu alanı */
@media (min-width: 768px) {
    .woocommerce-cart table.cart td.actions .coupon .input-text {
        width: 200px;
        margin-right: 10px;
    }
}


/* === MOBİL GÖRÜNÜM AYARLARI (768px Altı) === */
@media (max-width: 768px) {

    /* Ürün Satırları ve Çizgiler */
    .woocommerce-cart table.cart tr.cart_item {
        position: relative !important;
        border-bottom: 3px solid #6b6b6b !important;
    }
    .woocommerce-cart table.cart tr.cart_item:first-of-type {
        border-top: 3px solid #6b6b6b !important;
    }

    /* Ürün Görseli */
    .woocommerce-cart table.cart .product-thumbnail {
        display: block !important;
        text-align: center;
        margin-bottom: 0px;
    }
    .woocommerce-cart table.cart .product-thumbnail img {
        width: 150px !important;
        max-width: 100% !important;
        height: auto !important;
    }
    .woocommerce-cart table.shop_table_responsive tr td.product-thumbnail::before {
        display: none !important;
    }

    /* Çarpı (X) Butonu */
    .woocommerce-cart table.cart td.product-remove {
        position: absolute !important;
        left: 20px !important;
        right: auto !important;
        top: 25px !important;
        border: none !important;
    }

    /* Kupon ve Güncelleme Butonları (Yan Yana Alma İşlemi) */
    .woocommerce-cart table.cart td.actions {
        display: flex !important;
        flex-wrap: wrap !important;
        justify-content: space-between !important;
    }
    .woocommerce-cart table.cart td.actions .coupon {
        display: contents !important;
    }
    .woocommerce-cart table.cart td.actions .coupon .input-text {
        width: 100% !important;
        margin-bottom: 10px !important;
        order: 1 !important;
    }
    .woocommerce-cart table.cart td.actions .coupon .button {
        width: 48% !important;
        order: 2 !important;
    }
    .woocommerce-cart table.cart td.actions > .button {
        width: 48% !important;
        order: 3 !important;
        margin-top: 0 !important;
    }

    /* Butonların iç kenar boşluklarını daraltır ve yazıyı tek satıra sabitler */
    .woocommerce-cart table.cart td.actions .button {
        padding-left: 5px !important;
        padding-right: 5px !important;
        white-space: nowrap !important;
        font-size: 14px !important;
    }
}

/* Checkout Order Review Table Modernization & Fixes v8 (Mobile Zero Padding) */
.woocommerce-checkout-review-order-table {
    width: 100%;
    border-collapse: collapse;
}

.woocommerce-checkout-review-order-table thead {
    display: none !important;
}

/* 1. SATIRLARI FLEXBOX YAP */
.woocommerce-checkout-review-order-table tr {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center !important;
    justify-content: space-between !important;
    width: 100% !important;
    border-bottom: 1px solid #ebebeb !important;
}

.woocommerce-checkout-review-order-table tfoot tr:last-child {
    border-bottom: none !important;
}

/* 2. DIVI'NIN HÜCRE MANİPÜLASYONLARINI YOK ET */
.woocommerce-checkout-review-order-table th,
.woocommerce-checkout-review-order-table td {
    border: none !important;
    padding: 15px 0 !important;
    background: transparent !important;
    text-align: left !important;
}

.woocommerce-checkout-review-order-table td::before {
    display: none !important;
}

/* 3. SOL ALAN (Ürün) + MASAÜSTÜ SOL KENAR PAYI (20px) */
.woocommerce-checkout-review-order-table td.product-name {
    flex: 1 1 auto !important;
    min-width: 0 !important;
    display: grid !important;
    grid-template-columns: 70px 1fr !important;
    column-gap: 15px !important;
    align-items: center !important;
    padding-left: 20px !important;
}

.woocommerce-checkout-review-order-table tfoot th {
    flex: 1 1 auto !important;
    font-weight: 600 !important;
    color: #111 !important;
    padding-left: 20px !important;
}

/* 4. SAĞ ALAN (Fiyatlar) + MASAÜSTÜ SAĞ KENAR PAYI (20px) */
.woocommerce-checkout-review-order-table td.product-total {
    flex: 0 0 auto !important;
    width: auto !important;
    text-align: right !important;
    font-weight: 600 !important;
    font-size: 15px !important;
    color: #111 !important;
    white-space: nowrap !important;
    padding-left: 15px !important;
    padding-right: 20px !important;
}

.woocommerce-checkout-review-order-table tfoot td {
    flex: 0 0 auto !important;
    text-align: right !important;
    font-weight: 600 !important;
    color: #111 !important;
    padding-right: 20px !important;
}

/* --- GÖRSEL VE VARYASYON STİLLERİ --- */
.dpo-product-thumb {
    position: relative;
    width: 70px;
    height: 70px;
    grid-column: 1;
    grid-row: 1 / span 5;
}

.dpo-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 8px;
    border: 1px solid #ececec;
    background: #f9f9f9;
}

.dpo-qty-badge {
    position: absolute;
    top: -8px;
    right: -8px;
    background: #111;
    color: #fff;
    width: 22px;
    height: 22px;
    font-size: 11px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    z-index: 1;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.dpo-product-title {
    grid-column: 2;
    font-size: 14px;
    font-weight: 500;
    color: #333;
    margin-bottom: 4px;
    display: block;
}

.woocommerce-checkout-review-order-table td.product-name dl.variation {
    grid-column: 2;
    margin: 0;
    font-size: 12px;
    color: #777;
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
}

.woocommerce-checkout-review-order-table td.product-name dl.variation dt {
    font-weight: 600;
    margin: 0;
    clear: none;
}

.woocommerce-checkout-review-order-table td.product-name dl.variation dd {
    margin: 0 10px 0 0;
    clear: none;
}

.woocommerce-checkout-review-order-table td.product-name dl.variation p {
    margin: 0;
}

/* --- MOBİL OPTİMİZASYONU (Sıfır Pay) --- */
@media (max-width: 767px) {
    .woocommerce-checkout-review-order-table td.product-name {
        grid-template-columns: 55px 1fr !important;
        column-gap: 10px !important;
        padding-left: 0 !important;
    }

    .woocommerce-checkout-review-order-table tfoot th {
        padding-left: 0 !important;
    }

    .dpo-product-thumb {
        width: 55px;
        height: 55px;
    }

    .dpo-qty-badge {
        width: 18px;
        height: 18px;
        font-size: 9px;
        top: -6px;
        right: -6px;
    }

    .dpo-product-title {
        font-size: 13px !important;
        line-height: 1.3 !important;
    }

    .woocommerce-checkout-review-order-table td.product-name dl.variation {
        font-size: 11px !important;
        gap: 2px !important;
        line-height: 1.2 !important;
    }

    .woocommerce-checkout-review-order-table td.product-total {
        font-size: 14px !important;
        padding-left: 10px !important;
        padding-right: 0 !important;
    }

    .woocommerce-checkout-review-order-table tfoot td {
        padding-right: 0 !important;
    }
}
