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

:root {
    --bg:        #f8f8f6;
    --surface:   #ffffff;
    --border:    #e8e8e5;
    --text:      #1a1a18;
    --muted:     #76766f;
    --primary:   #1a1a18;
    --radius:    10px;
    --radius-lg: 14px;
    --shadow:    0 1px 4px rgba(0,0,0,0.07);
    --shadow-md: 0 4px 16px rgba(0,0,0,0.10);
    --success:   #1d9e75;
    --danger:    #e24b4a;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Inter", sans-serif;
    font-size: 15px;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    line-height: 1.6;
}

/* ── Store layout ─────────────────────────────────────────────────────────── */
.store-layout { min-height: 100vh; display: flex; flex-direction: column; }
.store-main   { flex: 1; max-width: 1100px; margin: 0 auto; width: 100%; padding: 32px 24px; }
.store-footer { text-align: center; padding: 24px; font-size: 12px; color: var(--muted); border-top: 1px solid var(--border); margin-top: 60px; }

/* ── Header ──────────────────────────────────────────────────────────────── */
.store-header { background: var(--surface); border-bottom: 1px solid var(--border); position: sticky; top: 0; z-index: 10; }
.store-header-inner { max-width: 1100px; margin: 0 auto; padding: 0 24px; height: 64px; display: flex; align-items: center; justify-content: space-between; }
.store-brand { display: flex; align-items: center; gap: 10px; }
.store-logo  { height: 32px; width: auto; border-radius: 6px; }
.store-name  { font-size: 18px; font-weight: 600; letter-spacing: -0.3px; }

/* ── Cart button ─────────────────────────────────────────────────────────── */
.cart-btn {
    display: flex; align-items: center; gap: 8px;
    background: var(--primary); color: #fff;
    border: none; padding: 8px 16px; border-radius: var(--radius);
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: opacity 0.15s;
}
.cart-btn:hover { opacity: 0.85; }
.cart-count {
    background: #fff; color: var(--primary);
    font-size: 11px; font-weight: 700;
    width: 20px; height: 20px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
}
.cart-total { font-size: 13px; opacity: 0.8; }

/* ── Banner ──────────────────────────────────────────────────────────────── */
.store-banner {
    background: var(--primary); color: #fff;
    text-align: center; padding: 10px 24px;
    font-size: 13px; font-weight: 500;
}

/* ── Hero ────────────────────────────────────────────────────────────────── */
.store-hero { margin-bottom: 36px; }
.store-hero h1 { font-size: 32px; font-weight: 700; letter-spacing: -0.5px; margin-bottom: 8px; }
.store-description { color: var(--muted); font-size: 16px; max-width: 600px; }

/* ── Products grid ───────────────────────────────────────────────────────── */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
    gap: 24px;
}

.product-card {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: box-shadow 0.2s, transform 0.2s;
}
.product-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.product-image {
    width: 100%; height: 200px;
    background: var(--bg);
    overflow: hidden;
    display: flex; align-items: center; justify-content: center;
}
.product-image img { width: 100%; height: 100%; object-fit: cover; }
.product-image-placeholder { color: var(--border); }

.product-info    { padding: 16px; }
.product-name    { font-size: 16px; font-weight: 600; margin-bottom: 6px; }
.product-desc    { font-size: 13px; color: var(--muted); margin-bottom: 14px; line-height: 1.5; }
.product-footer  { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.product-price   { font-size: 18px; font-weight: 700; letter-spacing: -0.3px; }

/* ── Buttons ─────────────────────────────────────────────────────────────── */
.btn-add-cart {
    background: var(--primary); color: #fff;
    border: none; padding: 8px 16px; border-radius: 8px;
    font-size: 13px; font-weight: 500; cursor: pointer;
    transition: opacity 0.15s;
    white-space: nowrap;
}
.btn-add-cart:hover { opacity: 0.85; }

.btn-store-primary {
    background: var(--primary); color: #fff;
    border: none; padding: 12px 24px; border-radius: var(--radius);
    font-size: 15px; font-weight: 500; cursor: pointer;
    transition: opacity 0.15s; width: 100%;
}
.btn-store-primary:hover { opacity: 0.85; }
.btn-store-primary:disabled { opacity: 0.45; cursor: not-allowed; }

.btn-back {
    background: none; border: none; color: var(--muted);
    font-size: 14px; cursor: pointer; padding: 0;
    margin-bottom: 16px; display: inline-flex; align-items: center; gap: 4px;
}
.btn-back:hover { color: var(--text); }

/* ── Toast ───────────────────────────────────────────────────────────────── */
.toast {
    position: fixed; bottom: 24px; right: 24px;
    background: var(--primary); color: #fff;
    padding: 12px 20px; border-radius: var(--radius);
    font-size: 14px; display: flex; align-items: center; gap: 12px;
    box-shadow: var(--shadow-md); z-index: 100;
    animation: slideIn 0.3s ease;
}
.toast button {
    background: rgba(255,255,255,0.2); border: none; color: #fff;
    padding: 4px 10px; border-radius: 6px; cursor: pointer; font-size: 13px;
}
@keyframes slideIn { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

/* ── Cart page ───────────────────────────────────────────────────────────── */
.cart-page   { max-width: 700px; margin: 0 auto; }
.cart-header { margin-bottom: 24px; }
.cart-header h1 { font-size: 26px; font-weight: 700; }
.cart-empty  { text-align: center; padding: 60px 0; color: var(--muted); }
.cart-empty p { margin-bottom: 20px; }

.cart-items  { display: flex; flex-direction: column; gap: 1px; background: var(--border); border: 1px solid var(--border); border-radius: var(--radius-lg); overflow: hidden; margin-bottom: 24px; }
.cart-item   { display: flex; align-items: center; gap: 16px; padding: 16px 20px; background: var(--surface); flex-wrap: wrap; }
.cart-item-info   { flex: 1; min-width: 0; }
.cart-item-name   { font-weight: 600; display: block; }
.cart-item-price  { font-size: 13px; color: var(--muted); }
.cart-item-controls { display: flex; align-items: center; gap: 8px; }
.cart-item-total  { font-weight: 600; min-width: 80px; text-align: right; }

.qty-btn {
    width: 30px; height: 30px; border: 1px solid var(--border);
    background: var(--surface); border-radius: 6px;
    font-size: 16px; cursor: pointer; display: flex;
    align-items: center; justify-content: center;
    transition: background 0.15s;
}
.qty-btn:hover { background: var(--bg); }
.qty-value { min-width: 24px; text-align: center; font-weight: 500; }

.btn-remove {
    background: none; border: none; color: var(--muted);
    font-size: 12px; cursor: pointer; padding: 4px 6px;
    border-radius: 4px; transition: color 0.15s, background 0.15s;
}
.btn-remove:hover { color: var(--danger); background: #fcebeb; }

.cart-summary      { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 20px; }
.cart-total-row    { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; font-size: 16px; }
.cart-total-amount { font-size: 22px; font-weight: 700; letter-spacing: -0.3px; }
.btn-checkout      { margin-top: 8px; }

/* ── Checkout ─────────────────────────────────────────────────────────────── */
.checkout-page    { max-width: 900px; margin: 0 auto; }
.checkout-header  { margin-bottom: 28px; display: flex; align-items: center; gap: 16px; }
.checkout-header h1 { font-size: 26px; font-weight: 700; }
.checkout-layout  { display: grid; grid-template-columns: 1fr 340px; gap: 32px; align-items: start; }
.checkout-section { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; margin-bottom: 16px; }
.checkout-section h2 { font-size: 16px; font-weight: 600; margin-bottom: 18px; display: flex; align-items: baseline; gap: 6px; }

/* Required / optional markers */
.req  { color: #c0392b; font-weight: 700; font-size: 13px; }
.field-opt { font-size: 11px; font-weight: 400; color: var(--muted); text-transform: none; letter-spacing: 0; }

/* Form rows */
.form-row   { margin-bottom: 16px; }
.form-row:last-child { margin-bottom: 0; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.form-row-3 { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 12px; }

/* Form fields */
.form-field label {
    display: block; font-size: 12px; font-weight: 600;
    color: var(--muted); text-transform: uppercase;
    letter-spacing: 0.3px; margin-bottom: 6px;
    display: flex; align-items: center; gap: 4px;
}
.form-field input, .form-field textarea, .form-field select {
    width: 100%; padding: 11px 13px;
    border: 1.5px solid var(--border); border-radius: var(--radius);
    font-size: 15px; background: var(--surface); color: var(--text);
    transition: border-color 0.15s, box-shadow 0.15s;
    min-height: 44px; /* touch target */
    -webkit-appearance: none;
}
.form-field input:focus, .form-field textarea:focus, .form-field select:focus {
    outline: none; border-color: var(--primary);
    box-shadow: 0 0 0 3px rgba(0,0,0,0.08);
}
.form-field input::placeholder, .form-field textarea::placeholder { color: #b0b0a8; }
.form-field textarea { resize: vertical; min-height: 80px; }

/* Inline validation */
.field-has-error { }
.input-invalid {
    border-color: #c0392b !important;
    background: #fff8f8 !important;
}
.input-invalid:focus {
    box-shadow: 0 0 0 3px rgba(192,57,43,0.12) !important;
}
.field-error {
    display: block; color: #c0392b; font-size: 12px;
    margin-top: 5px; font-weight: 500;
}

/* Error summary banner */
.checkout-error-summary {
    display: flex; align-items: center; gap: 10px;
    background: #fcebeb; color: #c0392b;
    border: 1px solid #f09595; border-radius: var(--radius);
    padding: 12px 16px; font-size: 14px; font-weight: 500;
    margin-bottom: 16px;
}

/* Submit error (API failure) */
.checkout-submit-error {
    background: #fcebeb; color: #c0392b;
    border: 1px solid #f09595; border-radius: var(--radius);
    padding: 10px 14px; font-size: 13px;
    margin-bottom: 12px;
}

/* Order summary sidebar */
.checkout-summary { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 24px; position: sticky; top: 80px; }
.checkout-summary h2 { font-size: 16px; font-weight: 600; margin-bottom: 16px; }

.summary-items { border-top: 1px solid var(--border); padding-top: 12px; margin-bottom: 12px; display: flex; flex-direction: column; gap: 10px; }
.summary-item { display: flex; justify-content: space-between; align-items: flex-start; font-size: 14px; gap: 8px; }
.summary-item-name { flex: 1; min-width: 0; }
.summary-qty { color: var(--muted); }
.summary-subtotal { display: flex; justify-content: space-between; font-size: 13px; color: var(--muted); padding: 8px 0 4px; }
.summary-fee-line { display: flex; justify-content: space-between; font-size: 13px; color: var(--text); padding: 3px 0; }
.summary-total { display: flex; justify-content: space-between; font-size: 16px; font-weight: 700; border-top: 1px solid var(--border); padding-top: 12px; margin-bottom: 16px; margin-top: 4px; }

/* ── Checkout fees ───────────────────────────────────────────────────────── */
.checkout-fees {
    border-top: 1px solid var(--border);
    padding-top: 12px;
    margin-bottom: 4px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.fee-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 10px;
    border-radius: var(--radius);
    border: 1.5px solid var(--border);
    background: var(--surface);
    cursor: pointer;
    transition: border-color 0.15s, background 0.15s;
    gap: 10px;
}

.fee-row:hover { border-color: var(--primary); }

.fee-row-selected {
    border-color: var(--primary);
    background: color-mix(in srgb, var(--primary) 6%, var(--surface));
}

.fee-row-mandatory {
    cursor: default;
    background: var(--bg);
    border-style: dashed;
}

.fee-row-mandatory:hover { border-color: var(--border); }

.fee-toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex: 1;
}

.fee-name {
    font-size: 14px;
    font-weight: 500;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.fee-desc {
    font-size: 12px;
    font-weight: 400;
    color: var(--muted);
}

.fee-required-badge {
    font-size: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    color: var(--muted);
    background: var(--border);
    border-radius: 3px;
    padding: 1px 5px;
    margin-left: 6px;
    vertical-align: middle;
}

.fee-price {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    white-space: nowrap;
}

/* Place order button — prominent, shows total */
.btn-place-order {
    font-size: 16px; padding: 15px;
    display: flex; align-items: center; justify-content: center; gap: 8px;
    border-radius: var(--radius); font-weight: 600;
}

/* Spinner inside button */
.btn-spinner {
    width: 16px; height: 16px;
    border: 2px solid rgba(255,255,255,0.4);
    border-top-color: #fff;
    border-radius: 50%;
    animation: spin 0.7s linear infinite;
    display: inline-block;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* Required fields note */
.checkout-required-note { font-size: 11px; color: var(--muted); text-align: center; margin-top: 10px; }

.checkout-note { font-size: 13px; color: var(--muted); margin-bottom: 16px; line-height: 1.5; padding: 10px 14px; background: var(--bg); border-radius: var(--radius); }
.checkout-note.cash { background: #faeeda; color: #854f0b; border: 1px solid #fac775; }

/* Payment choice label */
.payment-choice { margin-bottom: 16px; }
.payment-choice-label { font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 8px; }

/* ── Success page ─────────────────────────────────────────────────────────── */
.success-page { display: flex; align-items: center; justify-content: center; min-height: 60vh; }
.success-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 48px 40px; max-width: 500px; width: 100%; text-align: center; box-shadow: var(--shadow-md); }
.success-icon-wrap { width: 72px; height: 72px; background: #e1f5ee; border-radius: 50%; display: flex; align-items: center; justify-content: center; margin: 0 auto 24px; color: var(--success); }
.success-card h1   { font-size: 26px; font-weight: 700; margin-bottom: 8px; }
.success-card p    { color: var(--muted); margin-bottom: 20px; }

.payment-link-box { background: #e1f5ee; border: 1px solid #9fe1cb; border-radius: var(--radius); padding: 20px; margin: 20px 0; }
.payment-link-box p { color: var(--text); margin-bottom: 12px; font-size: 14px; }
.btn-pay-now { display: inline-block; background: var(--success); color: #fff; padding: 12px 28px; border-radius: var(--radius); font-weight: 600; text-decoration: none; font-size: 15px; transition: opacity 0.15s; }
.btn-pay-now:hover { opacity: 0.85; }
.payment-link-note { font-size: 12px; color: var(--muted); margin-top: 12px; }
.payment-link-note code { font-size: 11px; word-break: break-all; background: rgba(0,0,0,0.05); padding: 2px 6px; border-radius: 4px; }

.manual-payment-note { background: #faeeda; border: 1px solid #fac775; border-radius: var(--radius); padding: 16px; margin: 20px 0; }
.manual-payment-note p { color: #854f0b; font-size: 14px; }

.btn-back-to-shop { display: inline-block; margin-top: 8px; background: none; border: 1px solid var(--border); padding: 10px 24px; border-radius: var(--radius); font-size: 14px; cursor: pointer; color: var(--muted); transition: all 0.15s; }
.btn-back-to-shop:hover { background: var(--bg); color: var(--text); }

/* ── Error / loading states ───────────────────────────────────────────────── */
.store-loading { text-align: center; padding: 80px; color: var(--muted); }
.store-error   { text-align: center; padding: 80px; }
.store-error h1 { font-size: 24px; margin-bottom: 8px; }
.store-error p  { color: var(--muted); }
.store-empty   { text-align: center; padding: 60px; color: var(--muted); }
.not-found     { text-align: center; padding: 80px; }

/* ── Search + filter controls ─────────────────────────────────────────────── */
.store-controls { margin-bottom: 28px; display: flex; flex-direction: column; gap: 14px; }

.search-wrap {
    position: relative; display: flex; align-items: center;
    max-width: 420px;
}
.search-icon {
    position: absolute; left: 12px; color: var(--muted); pointer-events: none;
}
.search-input {
    width: 100%; padding: 10px 36px 10px 36px;
    border: 1px solid var(--border); border-radius: var(--radius);
    font-size: 14px; background: var(--surface); color: var(--text);
    transition: border-color 0.15s;
}
.search-input:focus { outline: none; border-color: #aaa; box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }
.search-clear {
    position: absolute; right: 10px; background: none; border: none;
    font-size: 18px; color: var(--muted); cursor: pointer; line-height: 1;
    padding: 2px 4px;
}
.search-clear:hover { color: var(--text); }

.category-filter {
    display: flex; flex-wrap: wrap; gap: 8px; align-items: center;
}
.cat-btn {
    padding: 6px 14px; border: 1.5px solid var(--border);
    border-radius: 20px; font-size: 13px; font-weight: 500;
    background: var(--surface); color: var(--text);
    cursor: pointer; transition: all 0.15s; white-space: nowrap;
}
.cat-btn:hover { border-color: var(--primary); }
.cat-btn.active { background: var(--primary); color: #fff; border-color: var(--primary); }
.cat-btn-sub { font-size: 12px; padding: 4px 12px; color: var(--muted); }
.cat-btn-sub.active { background: var(--primary); color: #fff; border-color: var(--primary); }

.btn-clear-filters {
    margin-top: 12px; background: none; border: 1px solid var(--border);
    padding: 8px 18px; border-radius: var(--radius); cursor: pointer;
    font-size: 14px; color: var(--muted); transition: all 0.15s;
}
.btn-clear-filters:hover { color: var(--text); background: var(--bg); }

/* ── Product category label ───────────────────────────────────────────────── */
.product-category {
    display: inline-block; font-size: 11px; font-weight: 600;
    color: var(--muted); text-transform: uppercase; letter-spacing: 0.4px;
    margin-bottom: 4px;
}

/* ── Track order page ─────────────────────────────────────────────────────── */
.track-page { display: flex; align-items: flex-start; justify-content: center; min-height: 60vh; padding-top: 40px; }
.track-card { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-lg); padding: 40px; max-width: 520px; width: 100%; box-shadow: var(--shadow-md); }
.track-card h1 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
.track-intro { color: var(--muted); font-size: 14px; margin-bottom: 28px; }
.track-form { display: flex; flex-direction: column; gap: 16px; margin-bottom: 20px; }
.track-form .form-field label { display: block; font-size: 12px; font-weight: 600; color: var(--muted); text-transform: uppercase; letter-spacing: 0.3px; margin-bottom: 6px; }
.track-form .form-field input { width: 100%; padding: 10px 13px; border: 1px solid var(--border); border-radius: var(--radius); font-size: 14px; background: var(--surface); color: var(--text); }
.track-form .form-field input:focus { outline: none; border-color: #aaa; box-shadow: 0 0 0 3px rgba(0,0,0,0.06); }
.track-error { background: #fcebeb; color: var(--danger); padding: 10px 14px; border-radius: var(--radius); font-size: 13px; border: 1px solid #f09595; }
.track-result { margin-bottom: 20px; }
.track-ref-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.track-ref { font-size: 18px; font-weight: 700; font-family: monospace; }
.track-meta { display: flex; flex-direction: column; gap: 2px; font-size: 12px; color: var(--muted); margin-bottom: 20px; }
.track-items { border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; margin-bottom: 16px; }
.track-item { display: flex; justify-content: space-between; padding: 10px 14px; font-size: 14px; border-bottom: 1px solid var(--border); }
.track-item:last-child { border-bottom: none; }
.track-total { font-weight: 700; background: var(--bg); }
.track-status-msg { border-radius: var(--radius); padding: 14px 16px; margin-bottom: 16px; font-size: 14px; }
.track-status-msg.success { background: #e1f5ee; border: 1px solid #9fe1cb; color: #0f6e56; }
.track-status-msg.cash { background: #faeeda; border: 1px solid #fac775; color: #854f0b; }
.track-status-msg.pending { background: #fafafa; border: 1px solid var(--border); color: var(--text); }
.track-status-msg p { margin-bottom: 10px; }
.track-status-msg p:last-child { margin-bottom: 0; }
.btn-track-reset { background: none; border: none; color: var(--muted); font-size: 13px; cursor: pointer; text-decoration: underline; margin-bottom: 12px; display: block; }
.btn-track-order { display: inline-block; margin-top: 12px; margin-right: 12px; background: none; border: 1px solid var(--border); padding: 9px 20px; border-radius: var(--radius); font-size: 14px; cursor: pointer; color: var(--muted); text-decoration: none; transition: all 0.15s; }
.btn-track-order:hover { background: var(--bg); color: var(--text); }

/* ── Status badges ────────────────────────────────────────────────────────── */
.status-badge { display: inline-block; padding: 3px 10px; border-radius: 12px; font-size: 12px; font-weight: 600; }
.status-badge.status-pending  { background: #faeeda; color: #854f0b; }
.status-badge.status-paid     { background: #e1f5ee; color: #0f6e56; }
.status-badge.status-delivered { background: #e8f0fe; color: #1a56db; }
.status-badge.status-cancelled { background: #fcebeb; color: var(--danger); }

/* ── Footer track link ────────────────────────────────────────────────────── */
.store-footer { display: flex; align-items: center; justify-content: center; gap: 8px; }
.footer-track-link { color: var(--muted); font-size: 12px; text-decoration: none; }
.footer-track-link:hover { color: var(--text); }
.footer-sep { color: var(--border); }

/* ── Responsive ───────────────────────────────────────────────────────────── */
@media (max-width: 768px) {
    .store-main { padding: 20px 16px; }
    .store-header-inner { padding: 0 16px; height: 56px; }
    .store-hero h1 { font-size: 24px; }
    .checkout-layout { grid-template-columns: 1fr; }
    .checkout-summary { position: static; order: -1; } /* summary above form on mobile */
    .form-row-2, .form-row-3 { grid-template-columns: 1fr; }
    .checkout-header { margin-bottom: 16px; }
    .checkout-section { padding: 18px 16px; }
    .btn-place-order { font-size: 15px; padding: 14px; }
    .products-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 14px; }
    .product-image { height: 160px; }
    .product-info { padding: 12px; }
    .product-name { font-size: 14px; }
    .product-price { font-size: 16px; }
    .btn-add-cart { padding: 7px 12px; font-size: 12px; }
    .search-wrap { max-width: 100%; }
    .category-filter { overflow-x: auto; flex-wrap: nowrap; padding-bottom: 4px; -webkit-overflow-scrolling: touch; }
    .success-card { padding: 32px 20px; }
    .track-card { padding: 28px 20px; }
    .cart-btn .cart-label { display: none; }
    .checkout-page { padding: 0; }
    .checkout-header { margin-bottom: 16px; }
}

/* ── Cash payment note — append to store.css ─────────────────────────────── */
.cash-payment-note {
    background: #faeeda;
    border: 1px solid #fac775;
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
    text-align: left;
}

    .cash-payment-note p:first-child {
        font-weight: 600;
        color: #854f0b;
        margin-bottom: 6px;
        font-size: 15px;
    }

.cash-amount {
    color: #854f0b;
    font-size: 14px;
    margin: 0 !important;
}

    .cash-amount strong {
        font-size: 18px;
    }


/* ── Payment success note — append to store.css ──────────────────────────── */
.payment-success-note {
    background: #e1f5ee;
    border: 1px solid #9fe1cb;
    border-radius: var(--radius);
    padding: 20px;
    margin: 20px 0;
    text-align: center;
}

    .payment-success-note p:first-child {
        font-weight: 600;
        color: #0f6e56;
        font-size: 16px;
        margin-bottom: 4px;
    }

/* ── Payment options at checkout — append to store.css ───────────────────── */
.payment-options {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 8px;
}

.payment-option {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px 16px;
    border: 1.5px solid var(--border);
    border-radius: var(--radius);
    cursor: pointer;
    transition: all 0.15s;
}

    .payment-option:hover {
        border-color: var(--primary);
        background: var(--surface);
    }

    .payment-option.selected {
        border-color: var(--primary);
        background: var(--surface);
    }

    .payment-option input[type="radio"] {
        width: 18px;
        height: 18px;
        accent-color: var(--primary);
        flex-shrink: 0;
    }

.payment-option-content {
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.payment-option-title {
    font-weight: 500;
    font-size: 14px;
    color: var(--text);
}

.payment-option-desc {
    font-size: 12px;
    color: var(--muted);
}

/* ── Settings box ─────────────────────────────────────────────────────────── */
.settings-box {
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius);
    padding: 16px;
    margin-bottom: 16px;
}

.settings-box-title {
    font-weight: 500;
    font-size: 14px;
    display: block;
    margin-bottom: 4px;
}

.toggle-label {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    font-size: 14px;
}

    .toggle-label input[type="checkbox"] {
        width: 16px;
        height: 16px;
        accent-color: var(--primary);
    }

.field-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

    .field-hint.success {
        color: var(--success, #0f6e56);
    }

/* ── Product card — open_details mode ─────────────────────────────────────── */
.product-card-clickable { cursor: pointer; }
.product-card-clickable:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.btn-quick-add {
    width: 36px; height: 36px;
    background: var(--primary); color: #fff;
    border: none; border-radius: 8px;
    font-size: 22px; font-weight: 300; line-height: 1;
    cursor: pointer; display: flex; align-items: center; justify-content: center;
    flex-shrink: 0; transition: opacity 0.15s;
}
.btn-quick-add:hover { opacity: 0.8; }

/* ── Product details modal ─────────────────────────────────────────────────── */
.product-modal-backdrop {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.45);
    z-index: 300;
    display: flex; align-items: center; justify-content: center;
    padding: 16px;
    animation: fadeIn 0.15s ease;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.product-modal {
    background: var(--surface);
    border-radius: var(--radius-lg);
    box-shadow: 0 20px 60px rgba(0,0,0,0.25);
    max-width: 520px; width: 100%;
    max-height: 90vh;
    overflow-y: auto;
    position: relative;
    animation: modalIn 0.2s ease;
}
@keyframes modalIn { from { transform: translateY(16px); opacity: 0; } to { transform: translateY(0); opacity: 1; } }

.modal-close {
    position: absolute; top: 12px; right: 14px;
    background: var(--bg); border: none;
    width: 32px; height: 32px; border-radius: 50%;
    font-size: 20px; line-height: 1; cursor: pointer;
    color: var(--muted); display: flex; align-items: center; justify-content: center;
    z-index: 1; transition: background 0.15s, color 0.15s;
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-image {
    width: 100%; height: 260px;
    background: var(--bg); overflow: hidden;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
}
.modal-image img { width: 100%; height: 100%; object-fit: cover; }

.modal-body { padding: 24px; }

.modal-product-name {
    font-size: 22px; font-weight: 700;
    letter-spacing: -0.4px; margin: 8px 0 12px;
}
.modal-product-desc {
    font-size: 14px; color: var(--muted);
    line-height: 1.65; margin-bottom: 20px;
    white-space: pre-wrap;
}
.modal-price {
    font-size: 26px; font-weight: 700;
    letter-spacing: -0.5px; margin-bottom: 20px;
}

.modal-qty-row {
    display: flex; align-items: center; gap: 16px; margin-bottom: 20px;
}
.modal-qty-label { font-size: 14px; font-weight: 500; color: var(--muted); }
.modal-qty {
    display: flex; align-items: center; gap: 10px;
    background: var(--bg); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 4px 8px;
}

/* ── Sizes / variants ─────────────────────────────────────────────────────── */
.modal-sizes { margin-bottom: 20px; }
.modal-sizes-label {
    display: block; font-size: 13px; font-weight: 600;
    color: var(--muted); text-transform: uppercase;
    letter-spacing: 0.3px; margin-bottom: 10px;
}
.modal-size-error { color: var(--danger); font-weight: 500; text-transform: none; letter-spacing: 0; }

.modal-size-options { display: flex; flex-wrap: wrap; gap: 8px; }

.size-btn {
    padding: 7px 16px;
    border: 1.5px solid var(--border);
    background: var(--surface);
    border-radius: var(--radius);
    font-size: 14px; font-weight: 500; cursor: pointer;
    transition: border-color 0.15s, background 0.15s, color 0.15s;
    min-width: 44px; min-height: 44px;
}
.size-btn:hover { border-color: var(--primary); }
.size-btn.selected {
    border-color: var(--primary);
    background: var(--primary); color: #fff;
}
.size-btn .variant-price {
    display: block;
    font-size: 12px; font-weight: 400; opacity: 0.8;
    margin-top: 2px;
}
.size-btn.selected .variant-price { opacity: 0.9; }

/* ── Additional info block ─────────────────────────────────────────────────── */
.modal-additional-info {
    background: var(--bg);
    border-radius: var(--radius);
    padding: 12px 14px;
    font-size: 13px; color: var(--muted);
    line-height: 1.6;
    margin-bottom: 20px;
    white-space: pre-wrap;
}

/* ── Track page size label ─────────────────────────────────────────────────── */
.track-item-size { color: var(--muted); font-size: 13px; }

/* ── Mobile modal ──────────────────────────────────────────────────────────── */
@media (max-width: 540px) {
    .product-modal-backdrop { align-items: flex-end; padding: 0; }
    .product-modal {
        max-width: 100%; border-radius: var(--radius-lg) var(--radius-lg) 0 0;
        max-height: 85vh;
    }
    .modal-image { height: 200px; border-radius: var(--radius-lg) var(--radius-lg) 0 0; }
}
