/* --- CART.CSS (GÜNCELLENMİŞ) --- */

/* Sayfa Başlığı ve Sayaç */
.page-header {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 2rem;
    margin-bottom: 2rem;
    flex-wrap: wrap;
}

.page-title {
    font-size: 2rem;
    font-weight: 800;
    color: var(--text-main);
    letter-spacing: -0.5px;
    margin: 0;
    line-height: 1.2;
}

.cart-count-badge {
    background-color: var(--bg-body);
    color: var(--text-muted);
    padding: 0.35rem 0.85rem;
    border-radius: 99px;
    font-size: 0.85rem;
    font-weight: 700;
    border: 1px solid var(--border-color);
    display: inline-block;
}

/* Sepet Container Yapısı */
.cart-container {
    display: flex;
    flex-wrap: wrap;
    gap: 2rem;
    margin-bottom: 5rem;
    align-items: flex-start;
}

/* SOL TARAF: Ürün Listesi */
.cart-items-section {
    flex: 2;
    min-width: 320px;
}

.cart-table-wrapper {
    background-color: var(--bg-card);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    overflow: hidden; 
}

/* Tablo Temel */
.cart-table {
    width: 100%;
    border-collapse: collapse;
}

.cart-table th {
    background-color: #f9fafb;
    text-align: left;
    padding: 1rem 1.2rem;
    font-weight: 700;
    font-size: 0.85rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 1px solid var(--border-color);
}

.cart-table td {
    padding: 1.5rem 1.2rem;
    vertical-align: middle;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-main);
}

.cart-table tr:last-child td {
    border-bottom: none;
}

/* Sütun Genişlikleri */
.col-product { width: 100px; }
.col-detail { width: auto; }
.col-price { width: 15%; }
.col-qty { width: 15%; }
.col-total { width: 15%; }
.col-action { width: 50px; text-align: right; }

/* Ürün Görseli */
.product-img-cell {
    text-align: center;
}

.img-link {
    display: block;
    width: 80px;
    height: 80px;
    border-radius: var(--radius);
    overflow: hidden;
    border: 1px solid var(--border-color);
    background-color: #f9fafb;
}

.cart-product-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.3s ease;
}

.img-link:hover .cart-product-img {
    transform: scale(1.08);
}

.no-image-placeholder {
    width: 100%;
    height: 100%;
    background-color: var(--bg-body);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-muted);
    font-size: 1.5rem;
}

/* Ürün İsmi */
.cart-product-name {
    font-weight: 700;
    font-size: 1.05rem;
    color: var(--text-main);
    text-decoration: none;
    transition: color 0.2s;
    line-height: 1.4;
    display: block;
}

.cart-product-name:hover {
    color: var(--primary-color);
}

/* Fiyat ve Toplam */
.price-text {
    color: var(--text-muted);
    font-weight: 500;
    font-size: 0.95rem;
}

.total-text {
    font-weight: 800;
    color: var(--text-main);
    font-size: 1.1rem;
}

/* Adet Göstergesi */
.qty-display {
    display: inline-block;
    padding: 0.4rem 1rem;
    background-color: var(--bg-body);
    border-radius: 6px;
    font-weight: 600;
    font-size: 0.95rem;
    border: 1px solid var(--border-color);
    color: var(--text-main);
}

/* Sil Butonu */
.btn-remove {
    color: var(--text-muted);
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 1.2rem;
    transition: all 0.2s;
    padding: 0.6rem;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.btn-remove:hover {
    color: #ef4444; 
    background-color: #fee2e2;
}

.mobile-text {
    display: none; 
}

/* SAĞ TARAF: Özet Kartı */
.cart-summary-section {
    flex: 1;
    min-width: 300px;
}

.summary-card {
    background-color: var(--bg-card);
    padding: 2rem;
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    border: 1px solid var(--border-color);
    position: sticky;
    top: 2rem;
}

.summary-title {
    font-size: 1.4rem;
    font-weight: 800;
    margin: 0 0 1.5rem 0;
    color: var(--text-main);
    letter-spacing: -0.5px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 1rem;
    font-size: 1rem;
    color: var(--text-muted);
}

.summary-row.shipping-row {
    font-size: 0.95rem;
}

.summary-divider {
    height: 1px;
    background-color: var(--border-color);
    margin: 1.5rem 0;
}

.summary-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 2rem;
    font-size: 1.1rem;
    font-weight: 700;
}

.total-amount {
    font-size: 1.8rem;
    font-weight: 800;
    color: var(--primary-color);
}

/* Checkout Butonu */
.btn-checkout {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.8rem;
    width: 100%;
    background-color: var(--primary-color);
    color: #ffffff; /* Beyaz yazı rengi garantilendi */
    padding: 1rem;
    border-radius: var(--radius);
    font-weight: 700;
    font-size: 1.1rem;
    text-decoration: none;
    transition: all 0.2s ease;
    box-shadow: 0 4px 10px rgba(220, 38, 38, 0.2);
    border: none;
    cursor: pointer;
}

.btn-checkout:hover {
    background-color: var(--primary-hover);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(220, 38, 38, 0.3);
}

.continue-shopping {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1.2rem;
    font-size: 0.95rem;
    color: var(--text-muted);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.2s;
}

.continue-shopping:hover {
    color: var(--primary-color);
}

/* Güvenlik Rozetleri */
.security-badges {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px dashed var(--border-color);
    text-align: center;
}

.badge-item {
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    color: #059669; /* Koyu yeşil */
    font-size: 0.85rem;
    font-weight: 600;
    background-color: #ecfdf5;
    padding: 0.5rem 1rem;
    border-radius: 99px;
    margin: 0 0.5rem; /* Yan yana dururken boşluk */
}

/* --- BOŞ SEPET DURUMU --- */
.empty-cart-state {
    text-align: center;
    padding: 5rem 1.5rem;
    background-color: var(--bg-card);
    border-radius: var(--radius);
    border: 1px solid var(--border-color);
    box-shadow: var(--shadow);
    max-width: 600px;
    margin: 3rem auto;
}

.empty-cart-icon {
    font-size: 4rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    opacity: 0.4;
}

.empty-cart-title {
    font-size: 1.8rem;
    font-weight: 800;
    margin-bottom: 1rem;
    color: var(--text-main);
}

.empty-cart-text {
    color: var(--text-muted);
    margin-bottom: 2.5rem;
    max-width: 420px;
    margin-left: auto;
    margin-right: auto;
    line-height: 1.6;
}

/* --- MOBİL UYUMLULUK (Responsive Tables) --- */
@media (max-width: 900px) {
    .cart-container {
        flex-direction: column;
    }
    
    .cart-items-section, 
    .cart-summary-section {
        width: 100%;
        min-width: 100%;
    }
}

@media (max-width: 768px) {
    /* Mobilde Tabloyu Karta Dönüştürme */
    .cart-table thead {
        display: none; 
    }

    .cart-table, .cart-table tbody, .cart-table tr, .cart-table td {
        display: block;
        width: 100%;
    }

    .cart-table tr {
        margin-bottom: 1.5rem;
        background-color: #fff;
        border: 1px solid var(--border-color);
        border-radius: var(--radius);
        padding: 1.2rem;
        position: relative;
        box-shadow: 0 2px 4px rgba(0,0,0,0.02);
    }

    .cart-table td {
        padding: 0.8rem 0;
        border: none;
        border-bottom: 1px solid #f3f4f6;
        text-align: right;
        display: flex;
        justify-content: space-between;
        align-items: center;
    }

    .cart-table td:last-child {
        border-bottom: none;
    }

    .cart-table td::before {
        content: attr(data-label);
        font-weight: 600;
        color: var(--text-muted);
        font-size: 0.9rem;
        text-align: left;
    }

    .cart-table td.product-img-cell {
        justify-content: center;
        border-bottom: none;
        padding-bottom: 0.8rem;
        margin-bottom: 0.5rem;
    }

    .cart-table td.product-img-cell::before {
        display: none; 
    }

    .img-link {
        width: 100px;
        height: 100px;
    }

    .cart-table td[data-label="Detay"] {
        justify-content: center;
        text-align: center;
        border-bottom: none;
        padding-top: 0;
    }
    .cart-table td[data-label="Detay"]::before {
        display: none;
    }
    
    .cart-product-name {
        font-size: 1.2rem;
    }

    .btn-remove {
        background-color: #fff1f2;
        color: #e11d48;
        width: 100%;
        display: flex;
        justify-content: center;
        align-items: center;
        gap: 0.5rem;
        padding: 0.8rem;
        border-radius: var(--radius);
        margin-top: 0.8rem;
        font-weight: 600;
        border: 1px solid #fecdd3;
    }
    
    .btn-remove:hover {
        background-color: #ffe4e6;
    }
    
    .mobile-text {
        display: inline;
    }
}