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

body {
    font-family: -apple-system, 'Segoe UI', sans-serif;
    background: #f5f6fa;
    color: #2c3e50;
    padding-bottom: 80px;
}

/* Header */
.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 100;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.logo {
    font-size: 24px;
    font-weight: bold;
}

.logo span {
    font-size: 28px;
}

.admin-link {
    background: rgba(255,255,255,0.2);
    padding: 6px 15px;
    border-radius: 20px;
    text-decoration: none;
    color: white;
    font-size: 14px;
}

/* Navigation */
.nav {
    background: white;
    padding: 10px 20px;
    display: flex;
    gap: 10px;
    border-bottom: 1px solid #e0e0e0;
    position: sticky;
    top: 70px;
    z-index: 90;
}

.nav-btn {
    flex: 1;
    padding: 10px;
    border: none;
    background: transparent;
    font-size: 16px;
    font-weight: 600;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
}

.nav-btn.active {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
}

/* Container */
.container {
    display: none;
    padding: 20px;
    animation: fadeIn 0.3s;
}

.container.active {
    display: block;
}

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

/* Product Grid */
.product-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
    gap: 15px;
}

.product-card {
    background: white;
    border-radius: 15px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    transition: transform 0.2s;
}

.product-card:active {
    transform: scale(0.98);
}

.product-image {
    height: 140px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 60px;
    background: linear-gradient(135deg, #667eea15 0%, #764ba215 100%);
}

.product-info {
    padding: 12px;
}

.product-name {
    font-weight: 600;
    font-size: 14px;
    margin-bottom: 5px;
}

.product-price {
    color: #667eea;
    font-weight: bold;
    font-size: 16px;
    margin-bottom: 5px;
}

.product-stock {
    font-size: 11px;
    color: #27ae60;
    margin-bottom: 10px;
}

.add-cart {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 8px;
    width: 100%;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
    font-size: 13px;
}

.add-cart:active {
    opacity: 0.8;
}

/* Cart Items */
.cart-item {
    background: white;
    border-radius: 15px;
    padding: 12px;
    margin-bottom: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}

.cart-item-info h4 {
    font-size: 14px;
    margin-bottom: 5px;
}

.cart-price {
    color: #667eea;
    font-weight: 600;
    font-size: 14px;
}

.cart-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.qty-btn {
    width: 30px;
    height: 30px;
    border: none;
    background: #e0e0e0;
    border-radius: 8px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
}

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

.remove-btn {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 12px;
    border-radius: 8px;
    cursor: pointer;
}

/* Cart Summary */
.cart-summary {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: white;
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 -2px 15px rgba(0,0,0,0.1);
    z-index: 80;
}

.total {
    font-weight: bold;
    color: #667eea;
    font-size: 18px;
}

.checkout-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 25px;
    border-radius: 25px;
    font-weight: 600;
    cursor: pointer;
}

/* Admin Panel */
.admin-form {
    background: white;
    border-radius: 15px;
    padding: 20px;
    margin-bottom: 20px;
}

.form-group {
    margin-bottom: 15px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    font-size: 14px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 10px;
    border: 2px solid #e0e0e0;
    border-radius: 10px;
    font-size: 14px;
}

.form-group input:focus {
    outline: none;
    border-color: #667eea;
}

.btn-primary {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 12px;
    width: 100%;
    border-radius: 10px;
    font-weight: 600;
    cursor: pointer;
}

.product-list-admin {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.admin-item {
    background: white;
    padding: 12px;
    border-radius: 12px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.btn-delete {
    background: #e74c3c;
    color: white;
    border: none;
    padding: 5px 15px;
    border-radius: 8px;
    cursor: pointer;
}

/* Modal */
.modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0,0,0,0.5);
    z-index: 1000;
    align-items: center;
    justify-content: center;
}

.modal.show {
    display: flex;
}

.modal-content {
    background: white;
    border-radius: 20px;
    padding: 25px;
    max-width: 400px;
    width: 90%;
    max-height: 80vh;
    overflow-y: auto;
}

.modal-header {
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
}

/* Toast */
.toast {
    position: fixed;
    bottom: 100px;
    left: 50%;
    transform: translateX(-50%);
    background: #2c3e50;
    color: white;
    padding: 10px 20px;
    border-radius: 25px;
    z-index: 1000;
    animation: slideUp 0.3s;
}

/* Wilayah Select Styles */
.wilayah-group {
    margin-bottom: 15px;
}

.wilayah-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #2c3e50;
    font-size: 14px;
}

.wilayah-group select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    background: white;
    cursor: pointer;
    transition: all 0.3s;
}

.wilayah-group select:focus {
    outline: none;
    border-color: #667eea;
}

.wilayah-group select:disabled {
    background: #f5f5f5;
    cursor: not-allowed;
    opacity: 0.7;
}

.address-detail {
    margin-top: 15px;
}

.address-detail textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    resize: vertical;
    font-family: inherit;
}

.loading-select {
    position: relative;
}

.loading-select::after {
    content: "⏳";
    position: absolute;
    right: 15px;
    top: 50%;
    transform: translateY(-50%);
}

/* Ongkir Styles */
.ongkir-info {
    background: #e8f4f8;
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
}

.ongkir-row {
    display: flex;
    justify-content: space-between;
    padding: 8px 0;
    border-bottom: 1px dashed #c8e4ed;
}

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

.ongkir-label {
    font-weight: 600;
    color: #2c3e50;
}

.ongkir-value {
    color: #667eea;
    font-weight: bold;
}

.total-with-shipping {
    background: linear-gradient(135deg, #667eea20 0%, #764ba220 100%);
    border-radius: 12px;
    padding: 15px;
    margin-top: 15px;
}

.total-grand {
    font-size: 20px;
    font-weight: bold;
    color: #667eea;
}

.shipping-select {
    width: 100%;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 12px;
    font-size: 14px;
    margin-top: 10px;
}

.weight-badge {
    font-size: 11px;
    color: #7f8c8d;
    margin-top: 3px;
}

.weight-badge span {
    background: #f0f0f0;
    padding: 2px 8px;
    border-radius: 20px;
}



/* Loading indicator untuk select */
select option:first-child {
    color: #999;
}

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

.empty-cart {
    text-align: center;
    padding: 40px;
    color: #7f8c8d;
}

/* Responsive */
@media (max-width: 480px) {
    .product-grid {
        grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
        gap: 12px;
    }
    
    .product-image {
        height: 120px;
        font-size: 50px;
    }
}