/* ===== CART PAGE STYLING ===== */
/* CSS lengkap untuk halaman keranjang belanja */

/* Main Cart Container */
.cart-main {
    min-height: 100vh;
    background: linear-gradient(135deg, #f8f9fa 0%, #e9ecef 100%);
    padding: 2rem 0;
    margin-top: 70px;
}

.cart-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 2rem;
}

/* Cart Header */
.cart-header {
    text-align: center;
    margin-bottom: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.cart-header h1 {
    color: var(--hijau);
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1rem;
}

.cart-header h1 i {
    color: var(--padi);
    font-size: 2.2rem;
}

.cart-header p {
    color: var(--hijau2);
    font-size: 1.1rem;
    margin: 0;
}

/* Cart Layout */
.cart-layout {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 2rem;
    align-items: start;
}

/* Cart Items Section */
.cart-items-section {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.section-header {
    margin-bottom: 2rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--sage);
}

.section-header h2 {
    color: var(--coklat);
    font-size: 1.8rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.section-header h2 i {
    color: var(--hijau);
    font-size: 1.6rem;
}

/* Cart Items List */
.cart-items-list {
    display: flex;
    flex-direction: column;
    gap: 1.5rem;
}

/* Individual Cart Item */
.cart-item {
    display: flex;
    align-items: center;
    gap: 1.5rem;
    padding: 1.5rem;
    border: 2px solid #f1f3f4;
    border-radius: 12px;
    background: #fafbfc;
    transition: all 0.3s ease;
    position: relative;
}

.cart-item:hover {
    border-color: var(--sage);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.08);
    transform: translateY(-2px);
}

/* Cart Item Image */
.cart-item-image {
    flex-shrink: 0;
    width: 80px;
    height: 80px;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #e9ecef;
    position: relative;
}

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

.cart-item-image:hover img {
    transform: scale(1.05);
}

/* Cart Item Info */
.cart-item-info {
    flex: 1;
    min-width: 0;
    padding-right: 1rem;
}

.cart-item-name {
    color: var(--coklat);
    font-size: 1.3rem;
    font-weight: 600;
    margin-bottom: 0.5rem;
    line-height: 1.2;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.cart-item-price {
    color: var(--hijau);
    font-weight: 600;
    font-size: 1.1rem;
    margin-bottom: 0.3rem;
}

.cart-item-weight {
    color: #6c757d;
    font-size: 0.9rem;
    margin: 0;
    font-style: italic;
}

/* Cart Item Actions */
.cart-item-actions {
    display: flex;
    align-items: center;
    gap: 1rem;
    flex-shrink: 0;
}

/* Quantity Controls */
.quantity-controls {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    background: white;
    border: 2px solid var(--sage);
    border-radius: 25px;
    padding: 0.3rem;
}

.quantity-btn {
    background: var(--hijau);
    color: white;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    cursor: pointer;
    font-weight: bold;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.8rem;
}

.quantity-btn:hover {
    background: var(--hijau2);
    transform: scale(1.1);
}

.quantity-btn:active {
    transform: scale(0.95);
}

.quantity-btn.minus {
    background: #dc3545;
}

.quantity-btn.minus:hover {
    background: #c82333;
}

.quantity-display {
    font-weight: bold;
    min-width: 40px;
    text-align: center;
    color: var(--coklat);
    font-size: 1.1rem;
    padding: 0 0.5rem;
}

/* Item Total */
.item-total {
    text-align: right;
    min-width: 120px;
}

.item-total-price {
    font-weight: bold;
    color: var(--hijau);
    font-size: 1.2rem;
    margin: 0;
}

/* Remove Button */
.remove-btn {
    background: linear-gradient(135deg, #dc3545, #c82333);
    color: white;
    border: none;
    padding: 0.6rem;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
    min-width: 40px;
    min-height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.remove-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

.remove-btn:active {
    transform: translateY(0);
}

/* Empty Cart State */
.empty-cart-state {
    text-align: center;
    padding: 4rem 2rem;
    color: var(--hijau2);
}

.empty-icon {
    font-size: 4rem;
    color: var(--sage);
    margin-bottom: 1.5rem;
}

.empty-cart-state h3 {
    color: var(--coklat);
    font-size: 1.8rem;
    margin-bottom: 1rem;
}

.empty-cart-state p {
    font-size: 1.1rem;
    margin-bottom: 2rem;
    line-height: 1.6;
}

.btn-primary {
    background: linear-gradient(135deg, var(--hijau), var(--hijau2));
    color: white;
    padding: 1rem 2rem;
    border-radius: 25px;
    text-decoration: none;
    font-weight: 600;
    display: inline-flex;
    align-items: center;
    gap: 0.8rem;
    transition: all 0.3s ease;
    border: none;
    cursor: pointer;
}

.btn-primary:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 80, 22, 0.3);
    color: white;
    text-decoration: none;
}

/* Cart Summary Section */
.cart-summary-section {
    position: sticky;
    top: 100px;
}

.summary-card {
    background: white;
    border-radius: 15px;
    padding: 2rem;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
    border: 2px solid var(--sage);
}

.summary-header {
    margin-bottom: 1.5rem;
    padding-bottom: 1rem;
    border-bottom: 2px solid var(--sage);
}

.summary-header h2 {
    color: var(--coklat);
    font-size: 1.6rem;
    font-weight: 600;
    margin: 0;
    display: flex;
    align-items: center;
    gap: 0.8rem;
}

.summary-header h2 i {
    color: var(--hijau);
    font-size: 1.4rem;
}

/* Summary Details */
.summary-details {
    margin-bottom: 1.5rem;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.8rem 0;
    border-bottom: 1px solid #f1f3f4;
}

.summary-row:last-child {
    border-bottom: none;
}

.summary-label {
    color: var(--hijau2);
    font-size: 1rem;
}

.summary-value {
    color: var(--coklat);
    font-weight: 600;
    font-size: 1.1rem;
}

/* Summary Total */
.summary-total {
    border-top: 2px solid var(--sage);
    padding-top: 1.5rem;
}

.total-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 1.5rem;
    padding: 1rem;
    background: linear-gradient(135deg, var(--latte), #f8f9fa);
    border-radius: 8px;
}

.total-row span:first-child {
    color: var(--coklat);
    font-size: 1.2rem;
    font-weight: 600;
}

.total-amount {
    color: var(--hijau);
    font-size: 1.5rem;
    font-weight: 700;
}

/* Checkout Button */
.btn-checkout {
    width: 100%;
    background: linear-gradient(135deg, var(--hijau), var(--hijau2));
    color: white;
    border: none;
    padding: 1.2rem 2rem;
    border-radius: 25px;
    font-size: 1.1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0.8rem;
}

.btn-checkout:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(45, 80, 22, 0.3);
}

.btn-checkout:disabled {
    background: #6c757d;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

/* Payment Section */
.payment-section {
    margin-top: 3rem;
    padding: 2rem;
    background: white;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
}

.button-row {
    display: flex;
    gap: 1rem;
    justify-content: center;
}

.button-row button {
    padding: 1rem 2rem;
    border: none;
    border-radius: 25px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    min-width: 180px;
}

#back-btn {
    background: var(--sage);
    color: var(--coklat);
}

#back-btn:hover {
    background: var(--latte);
    transform: translateY(-2px);
}

#clear-cart-btn {
    background: #dc3545;
    color: white;
}

#clear-cart-btn:hover {
    background: #c82333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(220, 53, 69, 0.3);
}

/* Responsive Design */
@media (max-width: 992px) {
    .cart-layout {
        grid-template-columns: 1fr;
        gap: 2rem;
    }
    
    .cart-summary-section {
        position: static;
        order: -1;
    }
}

@media (max-width: 768px) {
    .cart-main {
        padding: 1rem 0;
    }
    
    .cart-container {
        padding: 0 1rem;
    }
    
    .cart-header {
        padding: 1.5rem;
        margin-bottom: 2rem;
    }
    
    .cart-header h1 {
        font-size: 2rem;
        flex-direction: column;
        gap: 0.5rem;
    }
    
    .cart-items-section,
    .summary-card {
        padding: 1.5rem;
    }
    
    .cart-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 1rem;
        padding: 1rem;
    }
    
    .cart-item-image {
        width: 60px;
        height: 60px;
        align-self: flex-start;
    }
    
    .cart-item-info {
        width: 100%;
        padding-right: 0;
    }
    
    .cart-item-name {
        font-size: 1.1rem;
        white-space: normal;
        overflow: visible;
        text-overflow: unset;
    }
    
    .cart-item-actions {
        width: 100%;
        justify-content: space-between;
        flex-wrap: wrap;
        gap: 1rem;
    }
    
    .quantity-controls {
        flex: 1;
        justify-content: center;
        min-width: 120px;
    }
    
    .item-total {
        flex: 1;
        text-align: center;
        min-width: auto;
    }
    
    .remove-btn {
        flex-shrink: 0;
        width: 44px;
        height: 44px;
    }
    
    .button-row {
        flex-direction: column;
        gap: 1rem;
    }
    
    .button-row button {
        min-width: auto;
        width: 100%;
    }
}

@media (max-width: 480px) {
    .cart-header h1 {
        font-size: 1.8rem;
    }
    
    .cart-item {
        padding: 0.8rem;
    }
    
    .cart-item-image {
        width: 50px;
        height: 50px;
    }
    
    .cart-item-name {
        font-size: 1rem;
    }
    
    .quantity-btn {
        width: 28px;
        height: 28px;
        font-size: 0.7rem;
    }
    
    .quantity-display {
        font-size: 1rem;
        min-width: 35px;
    }
    
    .item-total-price {
        font-size: 1rem;
    }
    
    .remove-btn {
        width: 40px;
        height: 40px;
        font-size: 0.9rem;
    }
}

/* Loading States */
.cart-item.loading {
    opacity: 0.6;
    pointer-events: none;
}

.cart-item.loading::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20px;
    height: 20px;
    border: 2px solid var(--hijau);
    border-top: 2px solid transparent;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    transform: translate(-50%, -50%);
}

@keyframes spin {
    0% { transform: translate(-50%, -50%) rotate(0deg); }
    100% { transform: translate(-50%, -50%) rotate(360deg); }
}

/* Accessibility */
.cart-item:focus-within {
    outline: 2px solid var(--hijau);
    outline-offset: 2px;
}

.quantity-btn:focus,
.remove-btn:focus,
.btn-checkout:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}

/* Print Styles */
@media print {
    .cart-item-actions {
        display: none;
    }
    
    .payment-section {
        display: none;
    }
    
    .cart-item {
        break-inside: avoid;
        border: 1px solid #000;
        margin-bottom: 1rem;
    }
}