:root {
    --plum: #3a1f3d;
    --plum-deep: #2a1530;
    --blush: #fbeaf0;
    --rose: #d94f70;
    --gold: #c9973f;
    --ink: #2b2230;
    --muted: #8a7d8f;
    --white: #fffdfb;
    --radius: 14px;
    --shadow: 0 8px 24px rgba(58, 31, 61, 0.12);
}

* { box-sizing: border-box; }

body {
    margin: 0;
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(180deg, var(--blush) 0%, #fff 240px);
    color: var(--ink);
    padding-bottom: 90px;
}

.app-wrap {
    max-width: 960px;
    margin: 0 auto;
    padding: 32px 20px 20px;
}

.app-header {
    text-align: center;
    margin-bottom: 24px;
}
.app-header h1 {
    font-size: 2rem;
    margin: 0 0 6px;
    color: var(--plum);
    letter-spacing: 0.3px;
}
.app-header .subtitle {
    margin: 0;
    color: var(--muted);
    font-size: 0.95rem;
}

/* ===== Progress track (matches reference image) ===== */

/* ===== Progress track (monochrome, icon-based, matches reference image) ===== */
.progress-track {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    position: relative;
    max-width: 900px;
    margin: 0 auto 30px;
    gap: 4px;
}

.progress-step {
    position: relative;
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    z-index: 2;
    background: transparent;
    border: none;
    padding: 0;
    cursor: pointer;
}

/* connecting line between circles */
.progress-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 23px;
    left: 50%;
    width: 100%;
    height: 2px;
    background: #e0e0e0;
    z-index: -1;
}
.progress-step.done:not(:last-child)::after {
    background: #000;
}

.progress-step .dot {
    width: 46px;
    height: 46px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 12px;
    background: #fff;
    border: 2px solid #e0e0e0;
    color: #d0d0d0;
    font-size: 1.2rem;
    flex-shrink: 0;
    transition: background .2s ease, border-color .2s ease, color .2s ease;
}

/* Done step: solid black circle with white checkmark */
.progress-step.done .dot {
    background: #000;
    border-color: #000;
    color: #fff;
}

/* Active step: black outline, black icon, white fill */
.progress-step.active .dot {
    background: #fff;
    border-color: #000;
    color: #000;
}

.progress-step .label {
    font-size: 0.85rem;
    font-weight: 700;
    color: #c9c9c9;
    line-height: 1.35;
    max-width: 110px;
}

.progress-step.done .label,
.progress-step.active .label {
    color: #1a1a1a;
}

.progress-step .dot svg,
.progress-step .dot i {
    width: 20px;
    height: 20px;
    font-size: 1.1rem;
    line-height: 1;
}

@media (max-width: 600px) {
    .progress-step .dot { width: 38px; height: 38px; }
    .progress-step:not(:last-child)::after { top: 19px; }
    .progress-step .label { font-size: 0.68rem; max-width: 80px; }
}




/* Steps container */
.steps-container { min-height: 300px; }
.loading {
    text-align: center;
    color: var(--muted);
    padding: 60px 0;
    font-size: 1rem;
}

.step-panel { display: none; animation: fadeIn .3s ease; }
.step-panel.active { display: block; }

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: translateY(0); }
}

.step-title {
    text-align: center;
    font-size: 1.3rem;
    color: var(--plum);
    margin-bottom: 4px;
}
.step-hint {
    text-align: center;
    color: var(--muted);
    font-size: 0.85rem;
    margin-bottom: 20px;
}

.item-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
    gap: 16px;
}

.item-card {
    background: var(--white);
    border: 2px solid #f0e4e9;
    border-radius: var(--radius);
    overflow: hidden;
    cursor: pointer;
    transition: transform .18s ease, border-color .18s ease, box-shadow .18s ease;
    position: relative;
}
.item-card:hover {
    transform: translateY(-3px);
    box-shadow: var(--shadow);
}
.item-card.selected {
    border-color: var(--rose);
    box-shadow: 0 0 0 3px rgba(217,79,112,0.15);
}

/* ===== Increased product image size ===== */
.item-card img {
    width: 100%;
    height: 260px;      /* was 150px */
    /*object-fit: cover;*/
    display: block;
    background: #f5eef1;
}

.item-card .item-body {
    padding: 12px 14px 14px;
}
.item-card .item-name {
    font-weight: 700;
    font-size: 0.95rem;
    margin: 0 0 4px;
    color: var(--ink);
}
.item-card .item-desc {
    font-size: 0.78rem;
    color: var(--muted);
    margin: 0 0 8px;
    min-height: 28px;
}
.item-card .item-price {
    font-weight: 700;
    color: var(--rose);
    font-size: 0.95rem;
}
.item-card .check-badge {
    position: absolute;
    top: 10px; right: 10px;
    width: 24px; height: 24px;
    border-radius: 50%;
    background: var(--rose);
    color: #fff;
    display: none;
    align-items: center;
    justify-content: center;
    font-size: 0.85rem;
}
.item-card.selected .check-badge { display: flex; }

.login-notice {
    margin: 14px auto 0;
    max-width: 480px;
    background: #fff4e8;
    border: 1px solid #f0d3a8;
    color: #7a5a1e;
    font-size: 0.85rem;
    padding: 10px 16px;
    border-radius: 10px;
}
.login-notice a {
    color: var(--rose);
    font-weight: 700;
    text-decoration: underline;
}

.summary-left {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-size: 0.85rem;
}
.summary-left span { color: #d8c7de; }
.summary-left strong { font-size: 1.1rem; color: var(--gold); }
.summary-right { display: flex; gap: 10px; }

.summary-bar {
    display: flex;
    justify-content: space-around;
    box-shadow: 0 -6px 18px rgba(0,0,0,0.15);
    align-items: center;
    margin: 20px auto;
    background: var(--plum);
    color: #fff;
    padding: 15px;
}

.btn {
    border: none;
    padding: 11px 22px;
    border-radius: 999px;
    font-size: 0.9rem;
    font-weight: 700;
    cursor: pointer;
    transition: opacity .2s ease, transform .15s ease;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
    background: var(--rose);
    color: #fff;
}
.btn-primary:disabled {
    background: #6c5570;
    cursor: not-allowed;
    opacity: 0.7;
}
.btn-secondary {
    background: transparent;
    color: #fff;
    border: 1px solid rgba(255,255,255,0.4);
}
.btn-block { width: 100%; margin-top: 10px; }

/* Modal */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(42, 21, 48, 0.55);
    align-items: center;
    justify-content: center;
    z-index: 100;
    padding: 16px;
}
.modal-overlay.open { display: flex; }

.modal-box {
    background: #fff;
    border-radius: var(--radius);
    max-width: 480px;
    width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    padding: 28px;
    position: relative;
}
.modal-close {
    position: absolute;
    top: 14px; right: 16px;
    background: none;
    border: none;
    font-size: 1.4rem;
    cursor: pointer;
    color: var(--muted);
}
.modal-box h2 {
    margin-top: 0;
    color: var(--plum);
    font-size: 1.3rem;
}

.review-list {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-bottom: 12px;
}
.review-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    padding: 8px 0;
    border-bottom: 1px dashed #eee;
}
.review-row .rlabel { color: var(--muted); }
.review-row .rname { font-weight: 600; }
.review-total {
    text-align: right;
    font-size: 1.05rem;
    margin-bottom: 18px;
    color: var(--plum);
}

#checkoutForm { display: flex; flex-direction: column; gap: 12px; }
#checkoutForm label {
    font-size: 0.82rem;
    color: var(--muted);
    display: flex;
    flex-direction: column;
    gap: 4px;
}
#checkoutForm input {
    padding: 10px 12px;
    border: 1px solid #e3d8de;
    border-radius: 8px;
    font-size: 0.9rem;
    color: var(--ink);
}
#checkoutForm input:focus {
    outline: 2px solid var(--rose);
    outline-offset: 1px;
}

#orderResult {
    margin-top: 14px;
    font-size: 0.9rem;
    text-align: center;
}
#orderResult.success { color: #1c7a3e; }
#orderResult.error { color: #b3261e; }

@media (max-width: 600px) {
    .app-header h1 { font-size: 1.5rem; }
    .item-card img { height: 200px; }
    .summary-bar { flex-direction: row; padding: 12px 14px; }
}