/* static/css/cart.css */

/* General Cart Container */
.cart-container {
    background: linear-gradient(135deg, #F0F8FF 0%, #E0F6FF 50%, #F8FDFF 100%);
    min-height: 100vh;
    padding: 80px 0;
    position: relative;
    overflow: hidden;
}

.cart-container::before {
    content: '';
    position: absolute;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(135, 206, 235, 0.05) 0%, transparent 70%);
    animation: floatBg 20s ease-in-out infinite;
    z-index: 1;
}

.cart-container::after {
    content: '';
    position: absolute;
    bottom: -50%;
    right: -50%;
    width: 200%;
    height: 200%;
    background: radial-gradient(circle, rgba(173, 216, 230, 0.05) 0%, transparent 70%);
    animation: floatBg 25s ease-in-out infinite reverse;
    z-index: 1;
}

@keyframes floatBg {
    0%, 100% { transform: translateY(0px) rotate(0deg); }
    50% { transform: translateY(-30px) rotate(180deg); }
}

/* Cart Title Box */
.cart-title-box {
    text-align: center;
    margin-bottom: 40px;
    position: relative;
    z-index: 2;
}

.cart-title-box h2 {
    font-size: 3rem;
    font-weight: 700;
    color: #4682B4;
    text-shadow: 0 4px 8px rgba(70, 130, 180, 0.1);
    background: linear-gradient(135deg, #87CEEB, #4682B4);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    position: relative;
    display: inline-block;
}

.cart-title-box h2::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 0;
    width: 100%;
    height: 3px;
    background: linear-gradient(90deg, #87CEEB, #4682B4);
    border-radius: 2px;
}

/* Cart Content Area */
.cart-content {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    box-shadow: 0 15px 35px rgba(135, 206, 235, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
}

/* Alert Messages */
.alert {
    border-radius: 10px;
    font-size: 1rem;
    padding: 15px 20px;
    margin-bottom: 20px;
}
.alert-success { background-color: #d4edda; color: #155724; border-color: #c3e6cb; }
.alert-danger { background-color: #f8d7da; color: #721c24; border-color: #f5c6cb; }
.alert-warning { background-color: #fff3cd; color: #856404; border-color: #ffeeba; }

.alert .close {
    font-size: 1.5rem;
    font-weight: bold;
    line-height: 1;
    color: #000;
    text-shadow: 0 1px 0 #fff;
    opacity: .5;
    background: none;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* Cart Table */
.cart-table .table {
    margin-bottom: 0;
    border-collapse: separate;
    border-spacing: 0 10px; /* Add space between rows */
}

.cart-table .table thead {
    background: linear-gradient(135deg, #4682B4, #87CEEB);
    color: white;
    border-radius: 15px 15px 0 0;
}

.cart-table .table th {
    padding: 15px;
    font-weight: 600;
    text-transform: uppercase;
    font-size: 0.9rem;
    border: none;
    vertical-align: middle;
}

.cart-table .table tbody tr {
    background-color: #fff;
    border-radius: 15px;
    box-shadow: 0 5px 15px rgba(0,0,0,0.05);
    transition: all 0.3s ease;
}

.cart-table .table tbody tr:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(0,0,0,0.1);
}

.cart-table .table td {
    padding: 15px;
    vertical-align: middle;
    border-top: none; /* Remove default border-top */
    border-bottom: none; /* Remove default border-bottom */
    font-size: 0.95rem;
}

/* Product Image in Cart */
.cart-table .product-image {
    width: 100px; /* Diperbesar */
    height: 100px; /* Diperbesar */
    object-fit: cover;
    border-radius: 10px;
    box-shadow: 0 2px 5px rgba(0,0,0,0.1);
    transition: transform 0.3s ease;
}

.cart-table .product-image:hover {
    transform: scale(1.05);
}

.cart-table .product-name {
    font-weight: bold;
    color: #4682B4;
    text-decoration: none;
    transition: color 0.3s ease;
}

.cart-table .product-name:hover {
    color: #87CEEB;
}

.cart-table .price-text,
.cart-table .total-price {
    font-weight: 600;
    color: #333;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #ddd;
    border-radius: 20px;
    overflow: hidden;
    width: 120px; /* Lebar total kontrol kuantitas */
    margin: 0 auto; /* Pusatkan */
}

.quantity-btn {
    background-color: #f0f0f0;
    border: none;
    padding: 8px 12px;
    cursor: pointer;
    font-size: 1rem;
    font-weight: bold;
    color: #555;
    transition: background-color 0.3s ease;
}

.quantity-btn:hover:not(:disabled) {
    background-color: #e0e0e0;
}

.quantity-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.quantity-input {
    width: 40px; /* Lebar input kuantitas */
    text-align: center;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    color: #333;
    background-color: white;
    -moz-appearance: textfield; /* Hide arrows in Firefox */
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* Remove Button */
.remove-btn {
    background: none;
    border: none;
    color: #dc3545;
    font-size: 1.2rem;
    cursor: pointer;
    transition: color 0.3s ease, transform 0.3s ease;
}

.remove-btn:hover {
    color: #c82333;
    transform: scale(1.1);
}

/* Order Summary */
.order-summary {
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    padding: 30px;
    margin-top: 30px;
    box-shadow: 0 15px 35px rgba(135, 206, 235, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    position: relative;
    z-index: 2;
}

.order-summary h3 {
    font-size: 1.8rem;
    font-weight: 700;
    color: #4682B4;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #e0f6ff;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 15px;
    font-size: 1.1rem;
    color: #555;
}

.summary-row .summary-label {
    font-weight: 500;
}

.summary-row .summary-value {
    font-weight: 600;
    color: #333;
}

.summary-row.grand-total {
    font-size: 1.3rem;
    font-weight: bold;
    color: #4682B4;
    padding-top: 15px;
    border-top: 1px dashed #e0f6ff;
}

/* Action Buttons */
.action-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 40px;
    margin-bottom: 50px;
    position: relative;
    z-index: 2;
}

.action-btn {
    background: linear-gradient(135deg, #4682B4 0%, #87CEEB 100%);
    color: white;
    border: none;
    padding: 15px 30px;
    border-radius: 30px;
    font-size: 1.1rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(135, 206, 235, 0.3);
    text-decoration: none;
    display: inline-block;
}

.action-btn:hover {
    transform: translateY(-3px);
    box-shadow: 0 8px 20px rgba(135, 206, 235, 0.4);
    color: white;
    text-decoration: none;
}

.action-btn.secondary {
    background: #6c757d;
    box-shadow: 0 5px 15px rgba(108, 117, 125, 0.3);
}

.action-btn.secondary:hover {
    background: #5a6268;
    box-shadow: 0 8px 20px rgba(108, 117, 125, 0.4);
}

/* Empty Cart State */
.empty-cart {
    text-align: center;
    padding: 50px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(135, 206, 235, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.3);
    margin-top: 30px;
}

.empty-cart h3 {
    font-size: 2rem;
    color: #4682B4;
    margin-bottom: 15px;
}

.empty-cart p {
    font-size: 1.1rem;
    color: #666;
    margin-bottom: 30px;
}

/* Responsive adjustments */
/* Tambahkan atau pastikan ini ada di cart.css */
.table-responsive {
    overflow-x: auto; /* Tambahkan scroll horizontal jika tabel melebihi lebar container */
    -webkit-overflow-scrolling: touch; /* Untuk scrolling yang lebih halus di iOS */
}

@media (max-width: 991.98px) {
    .cart-content, .order-summary {
        padding: 20px;
    }
    .cart-table .table th, .cart-table .table td {
        padding: 10px;
        font-size: 0.9rem;
    }
    .cart-table .product-image {
        width: 80px;
        height: 80px;
    }
    .quantity-controls {
        width: 100px;
    }
    .quantity-btn {
        padding: 6px 10px;
    }
    .quantity-input {
        width: 30px;
    }
    .action-buttons {
        flex-direction: column;
        gap: 15px;
    }
    .action-btn {
        padding: 12px 25px;
        font-size: 1rem;
    }
    .cart-title-box h2 {
        font-size: 2.5rem;
    }
    .order-summary h3 {
        font-size: 1.5rem;
    }
    .summary-row {
        font-size: 1rem;
    }
    .summary-row.grand-total {
        font-size: 1.1rem;
    }
}

@media (max-width: 767.98px) {
    .cart-container {
        padding: 40px 0;
    }
    .cart-title-box h2 {
        font-size: 2rem;
    }
    /* Sesuaikan padding dan font-size untuk sel tabel pada layar kecil agar lebih ringkas */
    .cart-table .table th,
    .cart-table .table td {
        padding: 6px 8px; /* Kurangi padding lebih lanjut */
        font-size: 0.75rem; /* Kurangi ukuran font */
    }
    .cart-table .product-image {
        width: 50px; /* Sesuaikan ukuran gambar produk */
        height: 50px;
    }
    .quantity-controls {
        width: 70px; /* Kurangi lebar kontrol kuantitas */
    }
    .quantity-btn {
        padding: 4px 6px;
        font-size: 0.9rem;
    }
    .quantity-input {
        width: 18px;
        font-size: 0.8rem;
    }
    .remove-btn {
        font-size: 0.9rem; /* Sesuaikan ukuran ikon hapus */
        /* Opsional: Beri lebar minimal pada kolom "Remove" jika masih terpotong */
        min-width: 40px; /* Contoh, sesuaikan sesuai kebutuhan */
    }
    .empty-cart h3 {
        font-size: 1.5rem;
    }
    .empty-cart p {
        font-size: 0.9rem;
    }
}
