:root {
    --merah: #e63946;
    --kuning: #ffd166;
    --hijau: #2a9d8f;
    --biru: #1d3557;
    --biru-muda: #a8dadc;
    
    /* Light theme (default) */
    --bg-body: #f8f9fa;
    --bg-card: #ffffff;
    --text-primary: #2d3e50;
    --text-secondary: #6c757d;
    --border-color: #e0e0e0;
    --input-bg: #fafafa;
    --shadow-color: rgba(0,0,0,0.1);
    --shadow-hover: rgba(0,0,0,0.2);
    --navbar-bg: #ffffff;
    --step-bg: #e0e0e0;
}

[data-theme="dark"] {
    --merah: #ff6b6b;
    --kuning: #ffd166;
    --hijau: #4ecdc4;
    --biru: #33ffff;
    --biru-muda: #6c8b9c;
    
    --bg-body: #121212;
    --bg-card: #1e1e1e;
    --text-primary: #f8f9fa;
    --text-secondary: #b0b0b0;
    --border-color: #404040;
    --input-bg: #2d2d2d;
    --shadow-color: rgba(0,0,0,0.3);
    --shadow-hover: rgba(0,0,0,0.5);
    --navbar-bg: #1e1e1e;
    --step-bg: #404040;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-body);
    color: var(--text-primary);
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    transition: background-color 0.3s ease, color 0.3s ease;
}

/* Progress step */
.checkout-steps {
    display: flex;
    justify-content: center;
    margin: 2rem 0;
}
.step {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin: 0 1rem;
}
.step-icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: var(--step-bg);
    color: white;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 0.5rem;
}
.step.active .step-icon {
    background-color: var(--hijau);
}
.step.completed .step-icon {
    background-color: var(--kuning);
    color: #2d3e50;
}
.step-label {
    font-size: 0.9rem;
    color: var(--text-secondary);
}
.step.active .step-label {
    color: var(--biru);
    font-weight: 600;
}

/* Form container */
.checkout-container {
    background-color: var(--bg-card);
    border-radius: 20px;
    box-shadow: 0 15px 35px var(--shadow-color);
    padding: 2rem;
    margin-bottom: 2rem;
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.section-title {
    color: var(--biru);
    font-weight: 700;
    margin-bottom: 1.5rem;
    border-left: 5px solid var(--kuning);
    padding-left: 1rem;
}

/* Label berwarna */
.form-label {
    font-weight: 600;
}
.label-red { color: var(--merah); }
.label-green { color: var(--hijau); }
.label-blue { color: var(--biru); }

/* Form controls */
.form-control, .form-control:disabled, .form-select {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 0.75rem 1rem;
    transition: all 0.3s ease;
    background-color: var(--input-bg);
    color: var(--text-primary);
}
.form-control:focus, .form-select:focus {
    border-color: var(--biru-muda);
    background-color: var(--input-bg);
    color: var(--text-primary);
}

.form-control::placeholder {
    color: var(--text-primary);
    opacity: 50%;
}

/* Ringkasan pesanan */
.order-summary {
    background-color: var(--input-bg);
    border-radius: 16px;
    padding: .5rem;
    border: 2px solid var(--biru-muda);
}

.order-item .item-info, .order-item .price-total {
    width: 45%;
}

.remove {
    width: 10%;
}

.order-item:last-child {
    border-bottom: none;
}
.item-title {
    height: 20%;
    overflow: auto;
    font-weight: 600;
    color: var(--biru);
}

.item-title::-webkit-scrollbar {
    display: none;
}

.item-price {
    color: var(--hijau);
    font-weight: 700;
}
.qty-btn {
    width: 1.8rem;
    height: 1.8rem;
    border-radius: 50%;
    border: none;
    background-color: var(--biru);
    color: var(--biru-muda);
    font-weight: bold;
    font-size: 1.8rem;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
}
.qty-btn:hover {
    background-color: var(--biru);
    color: white;
}
.qty-input {
    min-width: 40%;
    text-align: center;
    border: 1px solid var(--border-color);
    border-radius: .6px;
    padding: 0.25rem;
    background-color: var(--input-bg);
    color: var(--text-primary);
}
.item-subtotal {
    font-weight: 700;
    color: var(--merah);
}
.total-price {
    font-size: 1.3rem;
    font-weight: 700;
    color: var(--merah);
}

/* Metode pengiriman & pembayaran */
.method-card {
    border: 2px solid var(--border-color);
    border-radius: 12px;
    padding: 1rem;
    margin-bottom: 1rem;
    transition: all 0.2s;
    cursor: pointer;
}
.method-card:hover {
    border-color: var(--hijau);
    background-color: rgba(42, 157, 143, 0.05);
}
.method-card input[type="radio"] {
    margin-right: 0.75rem;
    accent-color: var(--hijau);
}
.method-card label {
    color: var(--text-primary);
}

/* Tombol konfirmasi */
.btn-confirm {
    background-color: var(--hijau);
    border: none;
    padding: 1rem 2rem;
    font-weight: 600;
    font-size: 1.2rem;
    border-radius: 50px;
    color: white;
    width: 100%;
    transition: all 0.3s ease;
    box-shadow: 0 5px 15px rgba(42, 157, 143, 0.3);
}
.btn-confirm:hover {
    background-color: #21867a;
    transform: translateY(-3px);
    box-shadow: 0 10px 25px rgba(42, 157, 143, 0.4);
}

/* Tombol di navbar */
.btn-outline-primary {
    border-color: var(--biru) !important;
    color: var(--biru) !important;
}
.btn-outline-primary:hover {
    background-color: var(--biru) !important;
    color: white !important;
}

.footer {
    background-color: var(--bg-card);
}

/* loading saat simpan buku */
.spinner-loader-checkout {
    display: none;
    flex-shrink: 0;
    width: var(--bs-spinner-width);
    height: var(--bs-spinner-height);
    vertical-align: var(--bs-spinner-vertical-align);
    border-radius: 50%;
    animation: var(--bs-spinner-animation-speed) linear infinite var(--bs-spinner-animation-name);
}

.spinner-border-checkout {
    --bs-spinner-width: 1.2rem;
    --bs-spinner-height: 1.2rem;
    --bs-spinner-vertical-align: -0.125em;
    --bs-spinner-border-width: 0.2em;
    --bs-spinner-animation-speed: 0.75s;
    --bs-spinner-animation-name: spinner-border;
    border: var(--bs-spinner-border-width) solid currentcolor;
    border-right-color: transparent;
}

/* Responsif */
@media (max-width: 768px) {
    .checkout-steps {
        flex-wrap: wrap;
    }
    .theme-toggle {
        margin-left: 0.5rem;
    }
}
