/**
 * DesiDukaan Cart Page UI Improvements
 * Fixes layout issues and improves visual appearance
 */

/* Cart Table Improvements */
.tf-table-page-cart {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.tf-table-page-cart thead {
    background: #f8f9fa;
}

.tf-table-page-cart th {
    padding: 16px 12px;
    font-weight: 600;
    text-align: left;
    color: #333;
    font-size: 14px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border-bottom: 2px solid #e9ecef;
}

.tf-table-page-cart th:nth-child(2),
.tf-table-page-cart th:nth-child(3),
.tf-table-page-cart th:nth-child(4) {
    text-align: center;
}

.tf-table-page-cart td {
    padding: 16px 12px;
    vertical-align: middle;
    border-bottom: 1px solid #f0f0f0;
}

.tf-cart-item:hover {
    background-color: #fafbfc;
}

/* Product Cell */
.tf-cart-item_product {
    display: flex;
    align-items: center;
    gap: 16px;
}

.tf-cart-item_product .img-box {
    flex-shrink: 0;
    width: 90px;
    height: 90px;
    border-radius: 10px;
    overflow: hidden;
    background: #f5f5f5;
    border: 1px solid #e9ecef;
}

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

.tf-cart-item_product .img-box:hover img {
    transform: scale(1.05);
}

.tf-cart-item_product .cart-info {
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.tf-cart-item_product .cart-title {
    font-size: 15px;
    font-weight: 600;
    color: #333;
    text-decoration: none;
    line-height: 1.4;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.tf-cart-item_product .cart-title:hover {
    color: #28a745;
}

.tf-cart-item_product .cart-attribute {
    font-size: 13px;
    color: #666;
}

/* Price Cell */
.tf-cart-item_price {
    text-align: center;
}

.tf-cart-item_price .cart-price {
    font-size: 16px;
    font-weight: 600;
    color: #28a745;
}

/* Quantity Cell */
.tf-cart-item_quantity {
    text-align: center;
}

.tf-cart-item_quantity .wg-quantity {
    display: inline-flex;
    align-items: center;
    background: #f8f9fa;
    border-radius: 8px;
    overflow: hidden;
    border: 1px solid #e9ecef;
}

.tf-cart-item_quantity .btn-quantity {
    width: 36px;
    height: 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 18px;
    font-weight: 500;
    color: #666;
    transition: all 0.2s ease;
}

.tf-cart-item_quantity .btn-quantity:hover {
    background: #28a745;
    color: #fff;
}

.tf-cart-item_quantity .quantity-product {
    width: 50px;
    height: 36px;
    text-align: center;
    border: none;
    background: transparent;
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

/* Total Cell */
.tf-cart-item_total {
    text-align: center;
}

.tf-cart-item_total .cart-total {
    font-size: 16px;
    font-weight: 700;
    color: #333;
}

/* Remove Cell */
.remove-cart {
    text-align: center;
}

.remove-cart .remove {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #fff5f5;
    color: #dc3545;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.2s ease;
    border: 1px solid #ffebee;
}

.remove-cart .remove:hover {
    background: #dc3545;
    color: #fff;
    border-color: #dc3545;
}

/* Order Summary Box */
.box-order {
    background: #fff;
    border-radius: 12px;
    padding: 24px;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.08);
}

.box-order .title {
    font-size: 18px;
    font-weight: 700;
    color: #333;
    margin-bottom: 20px;
    padding-bottom: 12px;
    border-bottom: 2px solid #f0f0f0;
}

.box-order .order-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f5f5f5;
}

.box-order .order-item:last-child {
    border-bottom: none;
}

.box-order .order-item .label {
    color: #666;
    font-size: 14px;
}

.box-order .order-item .total {
    font-weight: 600;
    color: #333;
    font-size: 15px;
}

.box-order .total-order {
    margin-top: 16px;
    padding-top: 16px;
    border-top: 2px solid #333;
}

.box-order .total-order .label {
    font-weight: 700;
    font-size: 16px;
    color: #333;
}

.box-order .total-order .total {
    font-size: 20px;
    font-weight: 700;
    color: #28a745;
}

/* Free Shipping Progress */
.notification-progress {
    background: linear-gradient(135deg, #f8fff8 0%, #e8f5e9 100%);
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 20px;
    border: 1px solid #c8e6c9;
}

.notification-progress .progress-cart {
    height: 8px;
    background: #e0e0e0;
    border-radius: 4px;
    margin-top: 10px;
    overflow: hidden;
}

.notification-progress .progress-cart .value {
    height: 100%;
    background: linear-gradient(90deg, #28a745, #4caf50);
    border-radius: 4px;
    transition: width 0.5s ease;
}

#progress-text {
    font-size: 14px;
    color: #2e7d32;
}

/* Checkout Button */
.tf-btn.btn-fill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    background: linear-gradient(135deg, #28a745 0%, #218838 100%);
    color: #fff;
    font-size: 16px;
    font-weight: 600;
    border: none;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-decoration: none;
    width: 100%;
    margin-top: 20px;
}

.tf-btn.btn-fill:hover {
    background: linear-gradient(135deg, #218838 0%, #1e7e34 100%);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(40, 167, 69, 0.3);
}

/* Empty Cart Message */
.empty-cart-message {
    text-align: center;
    padding: 40px 20px;
}

.empty-cart-message h4 {
    color: #333;
    margin: 16px 0 8px;
}

.empty-cart-message p {
    color: #666;
    margin-bottom: 24px;
}

/* Mobile Responsive */
@media (max-width: 992px) {
    .tf-table-page-cart thead {
        display: none;
    }

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

    .tf-cart-item {
        padding: 16px;
        margin-bottom: 12px;
        border: 1px solid #e9ecef;
        border-radius: 12px;
        background: #fff;
    }

    .tf-cart-item td {
        display: flex;
        justify-content: space-between;
        align-items: center;
        padding: 8px 0;
        border-bottom: 1px solid #f5f5f5;
    }

    .tf-cart-item td:before {
        content: attr(data-cart-title);
        font-weight: 600;
        color: #666;
        font-size: 13px;
    }

    .tf-cart-item_product {
        flex-direction: column;
        align-items: flex-start !important;
        gap: 12px;
    }

    .tf-cart-item_product .img-box {
        width: 100%;
        height: 200px;
    }

    .tf-cart-item_product .cart-title {
        font-size: 16px;
    }

    .tf-cart-item_price,
    .tf-cart-item_quantity,
    .tf-cart-item_total,
    .remove-cart {
        text-align: right !important;
    }

    .remove-cart {
        justify-content: flex-end;
    }
}

@media (max-width: 576px) {
    .box-order {
        padding: 16px;
    }

    .tf-cart-item_product .img-box {
        height: 150px;
    }
}

/* Animation for item removal */
@keyframes fadeOut {
    from {
        opacity: 1;
        transform: translateX(0);
    }
    to {
        opacity: 0;
        transform: translateX(-20px);
    }
}

.tf-cart-item.removing {
    animation: fadeOut 0.3s ease forwards;
}

/* Coupon Section */
.group-discount {
    margin-top: 20px;
}

.coupon-card {
    background: #fff;
    border: 1px dashed #28a745;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: all 0.2s ease;
}

.coupon-card:hover {
    border-color: #218838;
    background: #f8fff8;
}

.coupon-card.applied {
    background: #e8f5e9;
    border-style: solid;
}

.coupon-code {
    font-weight: 700;
    color: #28a745;
    font-size: 14px;
    background: #e8f5e9;
    padding: 4px 12px;
    border-radius: 4px;
    display: inline-block;
    margin-bottom: 8px;
}

.coupon-description {
    font-size: 13px;
    color: #666;
}
