* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    margin-bottom: 30px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.header p {
    font-size: 1.1em;
    opacity: 0.9;
}

/* Main Content */
.main-content {
    display: grid;
    grid-template-columns: 1fr 350px;
    gap: 30px;
    margin-bottom: 30px;
}

/* Produk Section */
.products-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.products-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
    gap: 20px;
}

.product-card {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 12px;
    padding: 15px;
    text-align: center;
    color: white;
    cursor: pointer;
    transition: transform 0.3s, box-shadow 0.3s;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
}

.product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.product-icon {
    font-size: 3em;
    margin-bottom: 10px;
}

.product-name {
    font-size: 1em;
    font-weight: bold;
    margin-bottom: 8px;
}

.product-price {
    font-size: 1.3em;
    font-weight: bold;
    margin-bottom: 10px;
    color: #ffeb3b;
}

.btn-add {
    background: white;
    color: #667eea;
    border: none;
    padding: 8px 15px;
    border-radius: 8px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    font-size: 0.9em;
}

.btn-add:hover {
    background: #ffeb3b;
    color: #333;
}

/* Keranjang Section */
.cart-section {
    background: white;
    padding: 25px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
    height: fit-content;
    position: sticky;
    top: 20px;
}

.cart-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.3em;
}

.cart-items {
    max-height: 300px;
    overflow-y: auto;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 15px;
}

.empty-cart,
.empty-history {
    text-align: center;
    color: #999;
    padding: 20px 10px;
    font-style: italic;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #eee;
    background: linear-gradient(90deg, #f5f7fa 0%, #fff 100%);
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 8px;
}

.cart-item-info {
    flex: 1;
}

.cart-item-name {
    font-weight: bold;
    color: #333;
    margin-bottom: 4px;
}

.cart-item-detail {
    font-size: 0.85em;
    color: #666;
}

.cart-item-remove {
    background: #ff6b6b;
    color: white;
    border: none;
    padding: 5px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 0.8em;
    transition: background 0.3s;
    margin-left: 10px;
}

.cart-item-remove:hover {
    background: #ff5252;
}

/* Cart Summary */
.cart-summary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    padding: 15px;
    border-radius: 10px;
    color: white;
    margin-bottom: 15px;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    margin-bottom: 8px;
    font-size: 0.95em;
}

.summary-row.total {
    border-top: 2px solid rgba(255, 255, 255, 0.3);
    padding-top: 8px;
    font-size: 1.2em;
    font-weight: bold;
}

/* Buttons */
.btn-checkout,
.btn-clear {
    width: 100%;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
    margin-bottom: 10px;
}

.btn-checkout {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.btn-checkout:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

.btn-checkout:disabled {
    background: #ccc;
    cursor: not-allowed;
    opacity: 0.6;
}

.btn-clear {
    background: #f0f0f0;
    color: #333;
}

.btn-clear:hover {
    background: #e0e0e0;
}

/* History Section */
.history-section {
    background: white;
    padding: 30px;
    border-radius: 15px;
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.1);
}

.history-section h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.5em;
}

.history-list {
    display: grid;
    gap: 10px;
}

.history-item {
    background: linear-gradient(90deg, #f5f7fa 0%, #fff 100%);
    padding: 15px;
    border-radius: 10px;
    border-left: 4px solid #667eea;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.history-item-info {
    flex: 1;
}

.history-item-time {
    font-size: 0.85em;
    color: #999;
    margin-bottom: 4px;
}

.history-item-details {
    color: #333;
    font-weight: 500;
}

.history-item-total {
    font-size: 1.2em;
    font-weight: bold;
    color: #4CAF50;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: fadeIn 0.3s;
}

.modal.show {
    display: flex;
    justify-content: center;
    align-items: center;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.modal-content {
    background: white;
    padding: 30px;
    border-radius: 15px;
    text-align: center;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: slideUp 0.3s;
    max-width: 400px;
}

@keyframes slideUp {
    from {
        transform: translateY(50px);
        opacity: 0;
    }
    to {
        transform: translateY(0);
        opacity: 1;
    }
}

.modal-content h3 {
    color: #333;
    margin-bottom: 15px;
    font-size: 1.5em;
}

.modal-content p {
    color: #666;
    margin-bottom: 10px;
}

.modal-total {
    font-size: 2em;
    font-weight: bold;
    color: #4CAF50;
    margin-bottom: 20px;
}

.modal-actions {
    display: flex;
    gap: 10px;
}

.btn-cancel,
.btn-confirm {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 1em;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s;
}

.btn-cancel {
    background: #f0f0f0;
    color: #333;
}

.btn-cancel:hover {
    background: #e0e0e0;
}

.btn-confirm {
    background: linear-gradient(135deg, #4CAF50 0%, #45a049 100%);
    color: white;
}

.btn-confirm:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(76, 175, 80, 0.3);
}

/* Responsive */
@media (max-width: 768px) {
    .main-content {
        grid-template-columns: 1fr;
    }

    .cart-section {
        position: static;
    }

    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    }

    .header h1 {
        font-size: 1.8em;
    }
}
