#checkout {
    display: none;
    padding: 20px 0;
    background: #0b111a;
    border-radius: 20px;
    border: 1px solid #2c3037;
    box-shadow: 0px 20px 100px #00000080
}

#backBtn {
    background: #0b111a;
    border-radius: 20px;
    border: 1px solid #2c3037;
    box-shadow: 0px 20px 100px #00000080;
    color: white;
    margin: 0 0 5px 0;
}

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

:root {
    --cream: #f7f3ee;
    --ink: #1a1714;
    --warm-mid: #8c7b6b;
    --accent: #c4622d;
    --accent-light: #f0ddd1;
    --border: #e0d8cf;
    --card-bg: #ffffff;
    --shadow: 0 2px 12px rgba(26,23,20,0.07);
    --shadow-hover: 0 8px 32px rgba(26,23,20,0.13);
}

body {
    font-family: 'DM Sans', sans-serif;
    background-color: var(--cream);
    color: var(--ink);
    min-height: 100vh;
}

h1 {
    font-family: 'Playfair Display', serif;
    font-size: clamp(1.8rem, 4vw, 2.8rem);
    font-weight: 700;
    letter-spacing: -0.02em;
    margin-bottom: 6px;
}

.subtitle {
    color: var(--warm-mid);
    font-size: 0.95rem;
    font-weight: 300;
    margin-bottom: 36px;
}

.layout {
    max-width: 1100px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 320px;
    gap: 32px;
    align-items: start;
    /* Specifically for checkout */
    padding: 20px 20px;
    background: #0b111a;
    border-radius: 20px;
    border: 1px solid #2c3037;
    box-shadow: 0px 20px 100px #00000080
}

/* ── PRODUCT LIST ── */
.product-list {
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.product-card {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 14px;
    padding: 18px 20px;
    display: grid;
    grid-template-columns: auto 72px 1fr auto auto;
    align-items: center;
    gap: 16px;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
    user-select: none;
}

.product-card:hover {
    box-shadow: var(--shadow-hover);
    transform: translateY(-2px);
}

.product-card.selected {
    border-color: var(--accent);
    background: #fffaf7;
}

/* Custom checkbox */
.check-wrap {
    width: 22px;
    height: 22px;
    border: 2px solid var(--border);
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, border-color 0.2s;
    flex-shrink: 0;
}

.product-card.selected .check-wrap {
    background: var(--accent);
    border-color: var(--accent);
}

.check-wrap svg {
    opacity: 0;
    transform: scale(0.5);
    transition: opacity 0.15s, transform 0.15s;
}

.product-card.selected .check-wrap svg {
    opacity: 1;
    transform: scale(1);
}

/* Product image placeholder */
.product-img {
    width: 72px;
    height: 72px;
    border-radius: 10px;
    overflow: hidden;
    flex-shrink: 0;
    background: var(--accent-light);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.8rem;
}

.product-info { flex: 1; min-width: 0; }

.product-name {
    font-family: 'Playfair Display', serif;
    font-size: 1.05rem;
    font-weight: 500;
    margin-bottom: 3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.product-desc {
    font-size: 0.82rem;
    color: var(--warm-mid);
    font-weight: 300;
}

.product-tag {
    font-size: 0.7rem;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    padding: 3px 9px;
    border-radius: 20px;
    background: var(--accent-light);
    color: var(--accent);
    white-space: nowrap;
}

.product-price {
    font-size: 1.05rem;
    font-weight: 500;
    color: var(--ink);
    white-space: nowrap;
    min-width: 60px;
    text-align: right;
}

/* Qty stepper (only shows when selected) */
.qty-wrap {
    display: flex;
    align-items: center;
    gap: 6px;
    overflow: hidden;
    max-width: 0;
    opacity: 0;
    transition: max-width 0.3s ease, opacity 0.25s ease;
}

.product-card.selected .qty-wrap {
    max-width: 100px;
    opacity: 1;
}

.qty-btn {
    width: 26px;
    height: 26px;
    border: 1.5px solid var(--border);
    background: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1rem;
    color: var(--ink);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.15s, border-color 0.15s;
}

.qty-btn:hover { background: var(--accent-light); border-color: var(--accent); }

.qty-num {
    font-size: 0.9rem;
    font-weight: 500;
    min-width: 18px;
    text-align: center;
}

/* ── CART PANEL ── */
.cart-panel {
    background: var(--card-bg);
    border: 2px solid var(--border);
    border-radius: 18px;
    padding: 28px 24px;
    position: sticky;
    top: 30px;
}

.cart-title {
    font-family: 'Playfair Display', serif;
    font-size: 1.3rem;
    margin-bottom: 20px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.cart-badge {
    background: var(--accent);
    color: #fff;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.75rem;
    font-weight: 500;
    padding: 2px 8px;
    border-radius: 20px;
}

.cart-items { margin-bottom: 20px; min-height: 40px; }

.cart-empty {
    color: var(--warm-mid);
    font-size: 0.88rem;
    font-style: italic;
    text-align: center;
    padding: 16px 0;
}

.cart-item {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: 8px 0;
    border-bottom: 1px dashed var(--border);
    font-size: 0.9rem;
    animation: slideIn 0.2s ease;
}

@keyframes slideIn {
    from { opacity: 0; transform: translateX(8px); }
    to   { opacity: 1; transform: translateX(0); }
}

.cart-item-name { color: var(--ink); font-weight: 400; }
.cart-item-qty  { color: var(--warm-mid); font-size: 0.8rem; margin-left: 4px; }
.cart-item-price { font-weight: 500; }

.cart-divider {
    border: none;
    border-top: 2px solid var(--border);
    margin: 16px 0 12px;
}

.cart-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.88rem;
    color: var(--warm-mid);
    margin-bottom: 6px;
}

.cart-total {
    display: flex;
    justify-content: space-between;
    font-size: 1.1rem;
    font-weight: 500;
    color: var(--ink);
    margin-bottom: 20px;
}

.btn-checkout {
    width: 100%;
    padding: 14px;
    background: var(--accent);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-family: 'DM Sans', sans-serif;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    letter-spacing: 0.03em;
    transition: background 0.2s, transform 0.15s;
}

.btn-checkout:hover { background: #a84e23; transform: translateY(-1px); }
.btn-checkout:disabled { background: var(--border); color: var(--warm-mid); cursor: default; transform: none; }

/* ── RESPONSIVE ── */
@media (max-width: 720px) {
    .layout { grid-template-columns: 1fr; }
    .cart-panel { position: static; }
    .product-card { grid-template-columns: auto 56px 1fr; grid-template-rows: auto auto; }
    .product-tag, .qty-wrap { grid-column: 3; }
    .product-price { grid-column: 3; text-align: left; }
}