/* /assets/cart.css */

/* --- LAYOUT --- */
body { background-color: #f4f6f9; }

.cart-container { 
    max-width: 1200px; 
    margin: 30px auto; 
    padding: 0 15px; 
    display: flex; 
    gap: 30px; 
    flex-wrap: wrap; 
}

/* Left Column: Table */
.cart-left { flex: 2; min-width: 0; }

/* Right Column: Checkout Form */
.cart-right { flex: 1; min-width: 300px; }

/* --- CART TABLE --- */
.cart-table { 
    width: 100%; 
    border-collapse: collapse; 
    background: #fff; 
    border-radius: 8px; 
    overflow: hidden; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
}
.cart-table th { 
    background: #f8f9fa; 
    padding: 15px; 
    text-align: left; 
    font-weight: bold; 
    color: #555; 
    border-bottom: 2px solid #eee;
}
.cart-table td { 
    padding: 15px; 
    border-bottom: 1px solid #eee; 
    vertical-align: middle; 
}
.cart-img img { 
    width: 60px; 
    height: 60px; 
    object-fit: contain; 
    border: 1px solid #eee; 
    border-radius: 4px; 
}
.cart-name a {
    text-decoration: none;
    color: #333;
    font-weight: 500;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}
.cart-name a:hover { color: #d0021b; }

/* --- QUANTITY CONTROLS --- */
.qty-control { 
    display: flex; 
    align-items: center; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    width: max-content; 
}
.qty-control button { 
    border: none; 
    background: #f8f8f8; 
    width: 30px; 
    height: 30px; 
    cursor: pointer; 
    font-weight: bold; 
    transition: 0.2s;
}
.qty-control button:hover { background: #eee; }
.qty-control input { 
    border: none; 
    width: 40px; 
    text-align: center; 
    font-size: 14px; 
    outline: none; 
    font-weight: bold;
}

/* --- CHECKOUT BOX --- */
.checkout-box { 
    background: #fff; 
    padding: 25px; 
    border-radius: 8px; 
    box-shadow: 0 1px 3px rgba(0,0,0,0.1); 
    position: sticky; 
    top: 20px; 
}
.checkout-box h3 { 
    margin-top: 0; 
    border-bottom: 1px solid #eee; 
    padding-bottom: 15px; 
    font-size: 18px;
    color: #333;
}
.form-group { margin-bottom: 15px; }
.form-group label { 
    display: block; 
    margin-bottom: 6px; 
    font-weight: 600; 
    font-size: 13px; 
    color: #555;
}
.form-control { 
    width: 100%; 
    padding: 10px; 
    border: 1px solid #ddd; 
    border-radius: 4px; 
    box-sizing: border-box; 
    font-size: 14px;
}
.form-control:focus { border-color: #2f80ed; outline: none; }

/* --- TOTAL & ACTIONS --- */
.total-row { 
    display: flex; 
    justify-content: space-between; 
    font-size: 18px; 
    font-weight: bold; 
    margin: 20px 0; 
    padding-top: 15px;
    border-top: 1px dashed #eee;
    color: #333;
}
.total-price { color: #d0021b; font-size: 22px; }

.btn-checkout { 
    width: 100%; 
    background: linear-gradient(90deg, #d0021b, #f00); 
    color: #fff; 
    padding: 15px; 
    border: none; 
    border-radius: 4px; 
    font-size: 16px; 
    font-weight: bold; 
    cursor: pointer; 
    text-transform: uppercase; 
    transition: 0.3s;
}
.btn-checkout:hover { opacity: 0.9; box-shadow: 0 4px 10px rgba(208, 2, 27, 0.3); }

/* --- REMOVE BUTTON --- */
.cart-remove button { border: none; background: none; color: #aaa; cursor: pointer; font-size: 16px; }
.cart-remove button:hover { color: #d0021b; }

/* --- RESPONSIVE --- */
.mobile-price { display: none; font-weight: bold; color: #d0021b; font-size: 14px; margin-top: 6px; }

@media (max-width: 768px) {
    .desktop-only { display: none; }
    .cart-container { flex-direction: column; }
    .mobile-price { display: block; }
    .cart-img img { width: 50px; height: 50px; }
    .cart-table th { font-size: 13px; padding: 10px; }
    .cart-table td { padding: 10px; font-size: 13px; }
}

/* --- PAYMENT MODAL STYLES --- */

/* The Dark Overlay Background */
#payment-modal {
    position: fixed;       /* Stay in place even if scrolled */
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6); /* Semi-transparent black */
    z-index: 9999;         /* Sit on top of everything including header */
    
    /* Flexbox Magic for Centering */
    display: none;         /* Hidden by default, JS toggles to 'flex' */
    justify-content: center; /* Center Horizontally */
    align-items: center;     /* Center Vertically */
}

/* The White Box */
#payment-modal .search-box {
    background: #fff;
    padding: 30px;
    border-radius: 12px;
    width: 90%;            /* Responsive width */
    max-width: 420px;      /* Max width for desktop */
    text-align: center;
    box-shadow: 0 10px 25px rgba(0,0,0,0.2);
    position: relative;
    animation: slideDown 0.3s ease-out; /* Smooth entrance */
}

/* Smooth Entrance Animation */
@keyframes slideDown {
    from { opacity: 0; transform: translateY(-20px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Buttons inside the modal */
#payment-modal button {
    transition: 0.2s;
    font-weight: 500;
}
#payment-modal button:hover {
    transform: translateY(-2px);
    opacity: 0.9;
}