/* Cart Page Improvements - Ürün İsmi ve Genel İyileştirmeler */

/* Cart Table Genişlik Düzenlemeleri */
.cart-table {
    width: 100%;
    table-layout: fixed; /* Sabit tablo düzeni */
}

/* Column Genişlikleri - Ürün ismi için daha geniş alan */
.cart-table .tb-col-product {
    width: 45%; /* Ürün kolonu genişletildi */
    min-width: 300px;
}

.cart-table .tb-col-price {
    width: 12%;
    min-width: 100px;
}

.cart-table .tb-col-quantity {
    width: 15%;
    min-width: 120px;
}

.cart-table .tb-col-total {
    width: 15%;
    min-width: 120px;
}

.cart-table .tb-col-remove {
    width: 8%;
    min-width: 60px;
}

/* Product Info Layout İyileştirmeleri */
.cart-product-info {
    display: flex;
    align-items: flex-start;
    gap: 15px;
    padding: 15px 10px;
}

.product-image {
    flex-shrink: 0;
    width: 90px; /* Resim boyutu biraz büyütüldü */
}

.cart-product-img {
    width: 85px;
    height: 85px;
    object-fit: cover;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.cart-product-img:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
}

/* Product Details - Genişletilmiş Alan */
.product-details {
    flex: 1;
    min-width: 0; /* Overflow için */
    padding-right: 10px;
}

/* Product Name Styling - Daha Geniş ve Okunabilir */
.product-details .product-name {
    margin-bottom: 8px;
    line-height: 1.4;
}

.product-details .product-name a {
    font-size: 15px; /* Font boyutu artırıldı */
    font-weight: 600;
    color: #2d3748;
    text-decoration: none;
    display: -webkit-box;
    -webkit-line-clamp: 3; /* 3 satıra izin verildi */
    -webkit-box-orient: vertical;
    overflow: hidden;
    line-height: 1.4;
    max-height: 4.2em; /* 3 satır için yükseklik */
    transition: color 0.3s ease;
}

.product-details .product-name a:hover {
    color: #667eea;
    text-decoration: none;
}

/* Product Info List Styling */
.product-info-list {
    margin-top: 8px;
}

.product-info-list > div {
    margin-bottom: 5px;
}

.product-details .product-code,
.product-details .product-variant {
    font-size: 12px;
    color: #718096;
    line-height: 1.3;
}

.product-details .product-code .fw-medium,
.product-details .product-variant .fw-medium {
    color: #4a5568;
    font-weight: 600;
}

.product-details .product-variant .text-primary {
    color: #667eea !important;
    font-weight: 600;
}

/* Certificate Badge */
.product-details .product-certificate .badge {
    font-size: 10px;
    padding: 4px 8px;
    border-radius: 12px;
    background: linear-gradient(135deg, #17a2b8, #138496);
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.product-details .product-certificate .badge i {
    margin-right: 3px;
    font-size: 9px;
}

/* Price Column Styling */
.cart-item-price {
    font-size: 16px;
    font-weight: 600;
    color: #28a745;
    white-space: nowrap;
}

/* Quantity Controls Modern Styling */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    margin-bottom: 10px;
}

.quantity-btn {
    width: 35px;
    height: 35px;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    background: linear-gradient(135deg, #f8f9fa, #e9ecef);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    color: #495057;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: linear-gradient(135deg, #667eea, #764ba2);
    color: white;
    border-color: #667eea;
    transform: scale(1.05);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-input {
    width: 65px;
    height: 35px;
    text-align: center;
    border: 2px solid #e1e8ed;
    border-radius: 6px;
    font-weight: 600;
    color: #2d3748;
    transition: all 0.3s ease;
    background: white;
}

.quantity-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
    outline: none;
}

.quantity-input.quantity-changed {
    border-color: #ffc107;
    background-color: #fffbf0;
    box-shadow: 0 0 0 3px rgba(255, 193, 7, 0.1);
}

/* Update Buttons Styling */
.quantity-update-buttons {
    margin-top: 8px;
    display: flex;
    gap: 5px;
    justify-content: center;
}

.btn-update-quantity,
.btn-cancel-quantity {
    padding: 5px 12px;
    font-size: 11px;
    border-radius: 4px;
    border: none;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-update-quantity {
    background: linear-gradient(135deg, #28a745, #20c997);
    color: white;
    box-shadow: 0 2px 8px rgba(40, 167, 69, 0.3);
}

.btn-update-quantity:hover {
    background: linear-gradient(135deg, #20c997, #17a2b8);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.4);
}

.btn-cancel-quantity {
    background: linear-gradient(135deg, #6c757d, #495057);
    color: white;
    box-shadow: 0 2px 8px rgba(108, 117, 125, 0.3);
}

.btn-cancel-quantity:hover {
    background: linear-gradient(135deg, #495057, #343a40);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(108, 117, 125, 0.4);
}

/* Total Price Styling */
.cart-item-total {
    font-size: 16px;
    font-weight: 700;
    color: #2d3748;
    white-space: nowrap;
}

/* Remove Button Styling */
.btn-remove-item {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    cursor: pointer;
    font-size: 14px;
    box-shadow: 0 2px 8px rgba(220, 53, 69, 0.3);
}

.btn-remove-item:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.5);
}

.btn-remove-item:active {
    transform: scale(0.95);
}

/* Clear Cart Button - Büyütülmüş */
#btn-clear-cart {
    padding: 15px 30px; /* Padding artırıldı */
    font-size: 16px; /* Font boyutu artırıldı */
    font-weight: 600;
    border-radius: 8px;
    background: linear-gradient(135deg, #dc3545, #c82333);
    border: none;
    color: white;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(220, 53, 69, 0.3);
    min-width: 180px; /* Minimum genişlik */
}

#btn-clear-cart:hover {
    background: linear-gradient(135deg, #c82333, #bd2130);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(220, 53, 69, 0.4);
    color: white;
}

#btn-clear-cart .btn-inner {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

#btn-clear-cart .btn-icon {
    font-size: 16px;
}

/* Table Header Styling */
.cart-table thead th {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    font-weight: 600;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    padding: 15px 10px;
    border: none;
}

/* Table Row Styling */
.cart-table tbody tr {
    border-bottom: 2px solid #f1f3f4;
    transition: all 0.3s ease;
}

.cart-table tbody tr:hover {
    background: linear-gradient(135deg, #f8f9fa, #f1f3f4);
    transform: scale(1.001);
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.cart-table tbody td {
    padding: 15px 10px;
    vertical-align: middle;
    border-bottom: none;
}

/* Responsive Improvements */
@media (max-width: 1200px) {
    .cart-table .tb-col-product {
        width: 40%;
        min-width: 250px;
    }

    .cart-table .tb-col-price,
    .cart-table .tb-col-total {
        width: 14%;
    }

    .cart-table .tb-col-quantity {
        width: 18%;
    }
}

@media (max-width: 992px) {
    .cart-table .tb-col-product {
        width: 50%;
        min-width: 200px;
    }

    .product-details .product-name a {
        font-size: 14px;
        -webkit-line-clamp: 2;
        max-height: 2.8em;
    }
}

@media (max-width: 768px) {
    /* Mobile stacking layout */
    .cart-table,
    .cart-table thead,
    .cart-table tbody,
    .cart-table th,
    .cart-table td,
    .cart-table tr {
        display: block;
        width: 100%;
    }

    .cart-table thead {
        display: none;
    }

    .cart-table tbody tr {
        border: 2px solid #e9ecef;
        border-radius: 12px;
        margin-bottom: 20px;
        padding: 15px;
        background: white;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.08);
    }

    .cart-table tbody td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 10px 0;
        border-bottom: 1px solid #f1f3f4;
        position: relative;
    }

    .cart-table tbody td:last-child {
        border-bottom: none;
        justify-content: center;
        margin-top: 10px;
    }

    .cart-table tbody td::before {
        content: attr(data-label);
        font-weight: 600;
        color: #495057;
        font-size: 12px;
        text-transform: uppercase;
        letter-spacing: 0.5px;
    }

    .tb-col-product {
        flex-direction: column;
        align-items: flex-start !important;
    }

    .tb-col-product::before {
        display: none;
    }

    .cart-product-info {
        flex-direction: row;
        width: 100%;
    }

    .product-details .product-name a {
        -webkit-line-clamp: 3;
        max-height: 4.2em;
    }

    .quantity-controls {
        justify-content: flex-end;
    }

    #btn-clear-cart {
        width: 100%;
        margin-top: 15px;
        text-align: center;
    }
}

@media (max-width: 480px) {
    .cart-product-info {
        flex-direction: column;
        text-align: center;
        align-items: center;
    }

    .product-image {
        width: auto;
    }

    .cart-product-img {
        width: 100px;
        height: 100px;
    }

    .product-details {
        padding-right: 0;
        text-align: center;
        width: 100%;
    }

    .product-details .product-name a {
        font-size: 15px;
    }

    .quantity-btn {
        width: 40px;
        height: 40px;
    }

    .quantity-input {
        width: 70px;
        height: 40px;
    }
}

/* Loading States */
.cart-item.updating {
    opacity: 0.7;
    pointer-events: none;
}

.cart-item.updating::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 30px;
    height: 30px;
    border: 3px solid #f3f3f3;
    border-top: 3px solid #667eea;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    z-index: 1000;
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Animation for row removal */
@keyframes fadeOutAndSlide {
    0% {
        opacity: 1;
        transform: translateX(0);
    }
    100% {
        opacity: 0;
        transform: translateX(100px);
        height: 0;
        padding: 0;
        margin: 0;
    }
}

.cart-item.removing {
    animation: fadeOutAndSlide 0.5s ease forwards;
}

/* Success feedback animations */
.cart-item.success-update {
    background: linear-gradient(135deg, #d4edda, #c3e6cb);
    animation: successPulse 0.6s ease;
}

@keyframes successPulse {
    0%, 100% {
        background: white;
    }
    50% {
        background: linear-gradient(135deg, #d4edda, #c3e6cb);
    }
}