:root {
  --primary: #211C17; --accent: #B8893F; --accent-text: #B8893F; --background: #FAF5E9;
  --text: #211C17; --surface: #FFFDF8; --muted: #8A8272; --line: #E5DFD3;
}
* { box-sizing: border-box; }
body { font-family: -apple-system, 'Segoe UI', sans-serif; background: var(--background); color: var(--text); margin: 0; }
.muted { color: var(--muted); font-size: 0.85rem; }
a { color: var(--accent-text); }

/* ---------- Store header ---------- */
.store-header { padding: 0 0 16px; }
.store-banner { width: 100%; max-height: 200px; object-fit: cover; display: block; }
.store-header-inner { display: flex; align-items: center; gap: 14px; padding: 16px; }
.store-logo { width: 64px; height: 64px; border-radius: 14px; object-fit: cover; border: 1px solid var(--line); background: var(--surface); }
.store-header-inner h1 { font-size: 1.3rem; margin: 0; }
.back-link { margin-left: auto; font-size: 0.82rem; text-decoration: none; white-space: nowrap; }

/* ---------- Category nav ---------- */
.cat-nav { display: flex; gap: 8px; overflow-x: auto; padding: 0 16px 12px; }
.cat-btn { flex-shrink: 0; padding: 7px 16px; border-radius: 999px; border: 1px solid var(--line); background: var(--surface); color: var(--text); font-size: 0.85rem; cursor: pointer; }
.cat-btn.active { background: var(--primary); color: var(--background); border-color: var(--primary); }

/* ---------- Item grid ---------- */
.item-grid { padding: 0 16px 90px; }
.cat-section h2 { font-size: 1.05rem; margin: 18px 0 10px; }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 14px; }
.item-card { background: var(--surface); border: 1px solid var(--line); border-radius: 14px; overflow: hidden; cursor: pointer; }
.item-card.unavailable { opacity: 0.5; cursor: default; }
.item-card-img { width: 100%; height: 130px; object-fit: cover; display: block; }
.item-card-body { padding: 10px 12px; }
.item-card-name { font-weight: 600; font-size: 0.92rem; }
.item-card-desc { font-size: 0.78rem; color: var(--muted); margin-top: 2px; }
.item-card-price { font-weight: 700; margin-top: 6px; font-size: 0.9rem; }
.oos-badge { font-size: 0.7rem; color: #A8412E; }

/* ---------- Floating cart button ---------- */
.floating-cart-btn { position: fixed; left: 16px; right: 16px; bottom: 16px; max-width: 420px; margin: 0 auto; background: var(--primary); color: var(--background); border: none; border-radius: 999px; padding: 13px 20px; font-weight: 700; font-size: 0.92rem; cursor: pointer; box-shadow: 0 6px 18px rgba(0,0,0,0.25); }

/* ---------- Modals ---------- */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.5); z-index: 50; align-items: flex-end; justify-content: center; }
.modal-backdrop.open { display: flex; }
.modal { background: var(--surface); width: 100%; max-width: 480px; max-height: 88vh; overflow-y: auto; border-radius: 18px 18px 0 0; padding: 20px; position: relative; }
@media (min-width: 600px) { .modal-backdrop { align-items: center; } .modal { border-radius: 18px; } }
.close-btn { position: absolute; top: 12px; right: 14px; background: none; border: none; font-size: 1.4rem; cursor: pointer; color: var(--muted); }
.modal-img { width: 100%; height: 160px; object-fit: cover; border-radius: 10px; margin-bottom: 10px; }
.option-group { margin-top: 16px; }
.option-group h4 { font-size: 0.88rem; margin: 0 0 8px; }
.required-tag { color: #A8412E; font-size: 0.7rem; font-weight: 600; margin-left: 6px; }
.option-row { display: flex; justify-content: space-between; align-items: center; border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin-bottom: 6px; cursor: pointer; font-size: 0.88rem; }
.option-group textarea { width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 8px; font-family: inherit; }
.modal-footer { display: flex; align-items: center; gap: 12px; margin-top: 18px; }
.qty-row { display: flex; align-items: center; gap: 10px; }
.qty-btn { width: 32px; height: 32px; border-radius: 50%; border: 1px solid var(--line); background: var(--background); cursor: pointer; font-size: 1rem; }
.btn-primary { flex: 1; padding: 12px; border: none; border-radius: 999px; background: var(--primary); color: var(--background); font-weight: 700; cursor: pointer; }

/* ---------- Cart ---------- */
.cart-line { display: grid; grid-template-columns: 1fr auto auto; gap: 10px; align-items: center; padding: 10px 0; border-bottom: 1px solid var(--line); }
.cart-line .name { font-weight: 600; font-size: 0.9rem; }
.cart-line .opts { font-size: 0.78rem; color: var(--muted); }
.remove-line { background: none; border: none; color: #A8412E; font-size: 0.75rem; padding: 0; cursor: pointer; }
.cart-total-row { display: flex; justify-content: space-between; font-weight: 700; padding-top: 12px; margin-top: 6px; border-top: 1px solid var(--line); }
#checkout-fields label { display: block; font-weight: 600; font-size: 0.82rem; margin: 12px 0 4px; }
#checkout-fields input, #checkout-fields select, #checkout-fields textarea { width: 100%; box-sizing: border-box; padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px; font-family: inherit; font-size: 0.88rem; background: var(--background); color: var(--text); }
.login-note { background: var(--background); border: 1px solid var(--line); border-radius: 10px; padding: 10px 12px; margin-top: 12px; font-size: 0.82rem; }
