/* ─────────────────────────────────────────────────────────────────────────────
   Cup — restaurant page (CroxyStore-style, plain CSS, scoped under .rp-store)
   ────────────────────────────────────────────────────────────────────────── */

body { background: #FFFFFF; }

.rp-store {
  --bg:         #FFFFFF;
  --surface:    #FFFFFF;
  --surface-2:  #FAFAFA;
  --surface-3:  #F5F5F5;
  --input-bg:   #EFEFEF;
  --ink:        #000000;
  --ink-2:      #262626;
  --muted:      #5E5E5E;
  --muted-2:    #AFAFAF;
  --border:     #E2E2E2;
  --border-2:   #F3F3F3;
  --success:    #16A34A;
  --success-bg: #F0FDF4;
  --success-bd: #BBF7D0;
  --danger:     #EF4444;
  --warning-bg: #FFFBEB;
  --warning-bd: #FDE68A;
  --warning-fg: #92400E;

  --radius-card:  16px;
  --radius-input:  8px;
  --radius-pill: 999px;

  --shadow-sm: 0 1px 2px rgba(0,0,0,.06);
  --shadow-md: 0 4px 12px rgba(0,0,0,.08);
  --shadow-lg: 0 12px 32px rgba(0,0,0,.18);

  --font: 'DM Sans', system-ui, -apple-system, 'Helvetica Neue', Arial, sans-serif;

  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.rp-store,
.rp-store *,
.rp-store *::before,
.rp-store *::after { box-sizing: border-box; }

.rp-store button { font-family: inherit; }

/* keyframes */
@keyframes rp-spin    { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@keyframes rp-pulse   { 0% { box-shadow: 0 0 0 0 rgba(0,0,0,.45); } 70% { box-shadow: 0 0 0 8px rgba(0,0,0,0); } 100% { box-shadow: 0 0 0 0 rgba(0,0,0,0); } }
@keyframes rp-fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ── Free-delivery banner ─────────────────────────────────────────────────── */
.rp-banner {
  position: sticky; top: 0; z-index: 30;
  background: var(--ink); color: #fff;
  font-size: 13px; font-weight: 500;
}
.rp-banner__inner {
  max-width: 1024px; margin: 0 auto;
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 11px 16px;
}
.rp-banner__inner strong { font-weight: 700; }

/* ── Page wrap ────────────────────────────────────────────────────────────── */
.rp-wrap { max-width: 1024px; margin: 0 auto; padding: 0 16px; }

/* ── Cover image ──────────────────────────────────────────────────────────── */
.rp-cover {
  width: 100%; height: 208px;
  background: var(--ink); overflow: hidden;
  position: relative;
  margin-top: 16px;
  border-radius: 6px;
}
.rp-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }

/* ── Store head (mobile) ──────────────────────────────────────────────────── */
.rp-store-head { padding: 16px 0 12px; position: relative; z-index: 1; }
.rp-store-head__top { display: flex; align-items: center; gap: 12px; }
.rp-store-head__logo {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--surface-3); overflow: hidden; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: var(--shadow-sm);
  font-weight: 700; color: var(--muted);
}
.rp-store-head__logo img { width: 100%; height: 100%; object-fit: cover; }
.rp-store-head__name { font-size: 22px; font-weight: 700; line-height: 1.2; margin: 0; }
.rp-store-head__addr { font-size: 13px; color: var(--muted); margin: 2px 0 0; }
.rp-store-head__row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 12px;
}

/* status pill */
.rp-status {
  display: inline-flex; align-items: center; gap: 6px;
  font-size: 13px; font-weight: 500;
}
.rp-status__dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--success); flex-shrink: 0;
}
.rp-status--closed { color: var(--danger); }
.rp-status--closed .rp-status__dot { background: var(--danger); }
.rp-status--open { color: var(--success); }

/* ── Mobile category tabs ─────────────────────────────────────────────────── */
.rp-cat-tabs {
  display: none; position: sticky; top: var(--banner-h, 0px); z-index: 20;
  background: #fff; border-bottom: 1px solid var(--border);
  margin: 0 -16px;
  overflow-x: auto; -ms-overflow-style: none; scrollbar-width: none;
  white-space: nowrap;
}
.rp-cat-tabs::-webkit-scrollbar { display: none; }
.rp-cat-tabs__inner { display: inline-flex; padding: 0 16px; min-width: 100%; }
.rp-cat-tab {
  flex-shrink: 0; background: none; border: none; cursor: pointer;
  padding: 14px 16px; font-size: 14px; color: var(--muted);
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
  white-space: nowrap;
}
.rp-cat-tab:hover { color: var(--ink); }
.rp-cat-tab--active { color: var(--ink); font-weight: 600; border-bottom-color: var(--ink); }

/* ── Layout columns ───────────────────────────────────────────────────────── */
.rp-cols { display: flex; align-items: flex-start; gap: 40px; padding: 32px 0 64px; }

.rp-sidebar { width: 256px; flex-shrink: 0; position: sticky; top: calc(var(--banner-h, 0px) + 24px); }
.rp-sidebar__head { padding: 0 0 16px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.rp-sidebar__logo {
  width: 56px; height: 56px; border-radius: 50%;
  background: var(--surface-3); overflow: hidden;
  display: flex; align-items: center; justify-content: center;
  border: 2px solid #fff; box-shadow: var(--shadow-sm);
  font-weight: 700; color: var(--muted); margin-bottom: 12px;
}
.rp-sidebar__logo img { width: 100%; height: 100%; object-fit: cover; }
.rp-sidebar__name { font-size: 20px; font-weight: 700; line-height: 1.25; margin: 0 0 4px; }
.rp-sidebar__addr { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.rp-sidebar__actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; }

/* category nav (sidebar) */
.rp-cat-nav { display: flex; flex-direction: column; }
.rp-cat-btn {
  display: block; width: 100%; text-align: left;
  background: none; border: none; cursor: pointer;
  padding: 11px 16px; font-size: 15px; color: var(--muted);
  border-radius: 10px;
  transition: color .15s, background .15s;
  font-family: inherit;
}
.rp-cat-btn:hover { color: var(--ink); }
.rp-cat-btn--active {
  color: var(--ink); font-weight: 600;
  background: var(--surface-3);
}

/* ── Main column ──────────────────────────────────────────────────────────── */
.rp-main { flex: 1; min-width: 0; }
.rp-main__top { display: flex; justify-content: flex-end; margin-bottom: 12px; }

/* search */
.rp-search { position: relative; }
.rp-search__icon {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: var(--muted-2); display: inline-flex; pointer-events: none;
}
.rp-search input {
  width: 100%; padding: 10px 12px 10px 38px;
  background: var(--input-bg); border: 1px solid transparent;
  border-radius: var(--radius-input); font: inherit; font-size: 14px;
  color: var(--ink);
  transition: border-color .15s, background .15s;
}
.rp-search input::placeholder { color: var(--muted-2); }
.rp-search input:focus { outline: none; border-color: var(--ink); background: #fff; }

/* alert */
.rp-alert {
  display: flex; gap: 12px; align-items: flex-start;
  padding: 12px 16px; border-radius: var(--radius-card);
  margin-bottom: 16px;
}
.rp-alert__icon { flex-shrink: 0; margin-top: 1px; }
.rp-alert--warning {
  background: var(--warning-bg);
  border: 1px solid var(--warning-bd);
  color: var(--warning-fg);
}
.rp-alert p { margin: 0; font-size: 14px; line-height: 1.5; }

/* loading */
.rp-loading {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  color: var(--muted); font-size: 14px; padding: 48px 0;
}
.rp-loading__icon { width: 18px; height: 18px; animation: rp-spin 1s linear infinite; }

/* empty */
.rp-empty-state {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted); padding: 48px 16px; text-align: center;
}
.rp-empty-state p { margin: 0; }

/* ── Section / product grid ───────────────────────────────────────────────── */
.rp-section { margin-bottom: 8px; scroll-margin-top: 96px; }
.rp-section + .rp-section { padding-top: 16px; margin-top: 24px; }
.rp-section__title {
  font-size: 20px; font-weight: 700; color: var(--ink);
  margin: 0 0 8px; padding-top: 8px;
}

.rp-products-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 24px; }
@media (max-width: 767px) { .rp-products-grid { grid-template-columns: 1fr; } }

/* product card */
.rp-product-card {
  display: flex; align-items: flex-start; gap: 16px;
  padding: 20px 12px; margin: 0 -12px;
  border-radius: 12px;
  cursor: pointer;
  transition: background .15s;
}
.rp-product-card:hover { background: var(--surface-2); }
.rp-product-card--inactive { cursor: default; opacity: .55; }
.rp-product-card--inactive:hover { background: none; }

.rp-product-card__body { flex: 1; min-width: 0; }
.rp-product-card__name { font-size: 16px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.rp-product-card__desc {
  font-size: 14px; color: var(--muted); line-height: 1.55;
  margin-top: 2px;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
.rp-product-card__price { font-size: 16px; font-weight: 700; color: var(--ink); margin-top: 10px; }

.rp-product-card__img-wrap {
  position: relative; flex-shrink: 0;
  width: 112px; height: 112px;
  border-radius: 12px; overflow: hidden;
  background: var(--input-bg);
}
.rp-product-card__img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-product-card__img-placeholder {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2);
}
.rp-product-card__add {
  position: absolute; bottom: 8px; right: 8px;
  width: 32px; height: 32px; border-radius: 50%;
  background: #fff; color: var(--ink); border: none; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm);
  transition: transform .12s, background .12s;
}
.rp-product-card__add:hover { background: var(--surface-3); transform: scale(1.05); }

/* ── Buttons (scoped) ─────────────────────────────────────────────────────── */
.rp-store .btn,
.rp-store button.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  background: var(--ink); color: #fff;
  padding: 13px 22px; border-radius: var(--radius-pill);
  font-family: inherit; font-weight: 600; font-size: 15px;
  border: none; cursor: pointer; line-height: 1;
  transition: background .15s, transform .05s;
}
.rp-store .btn:hover { background: var(--ink-2); }
.rp-store .btn:active { transform: scale(.98); }
.rp-store .btn:disabled { opacity: .65; cursor: not-allowed; }

.rp-store .btn-primary { background: var(--ink); color: #fff; }
.rp-store .btn-primary:hover { background: var(--ink-2); }

.rp-store .btn-ghost,
.rp-store button.btn-ghost {
  background: #fff; color: var(--ink);
  border: 1px solid var(--border);
  padding: 9px 16px; font-size: 14px; font-weight: 500;
}
.rp-store .btn-ghost:hover { background: var(--border-2); }

/* ── FAB ──────────────────────────────────────────────────────────────────── */
.rp-cart-fab {
  position: fixed; bottom: 24px; right: 24px; z-index: 40;
  background: var(--ink); color: #fff;
  border: none; cursor: pointer;
  display: flex; align-items: center; gap: 10px;
  padding: 14px 22px; border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  font-family: inherit; font-size: 15px; font-weight: 500;
  transition: background .15s, transform .05s;
}
.rp-cart-fab:hover { background: var(--ink-2); }
.rp-cart-fab:active { transform: scale(.97); }
.rp-cart-fab__badge {
  min-width: 26px; height: 22px; padding: 0 8px;
  background: #fff; color: var(--ink);
  font-size: 13px; font-weight: 700; line-height: 1;
  border-radius: var(--radius-pill);
  display: inline-flex; align-items: center; justify-content: center;
}

/* ── Toasts ───────────────────────────────────────────────────────────────── */
.rp-toast-container {
  position: fixed; bottom: 96px; right: 24px; z-index: 60;
  display: flex; flex-direction: column; gap: 8px; pointer-events: none;
}
.rp-toast {
  background: var(--ink); color: #fff;
  padding: 11px 18px; border-radius: var(--radius-pill);
  box-shadow: var(--shadow-lg);
  font-size: 14px; font-weight: 500;
  opacity: 0; transform: translateY(8px);
  transition: opacity .2s ease, transform .2s ease;
  pointer-events: auto; white-space: nowrap;
}
.rp-toast--show { opacity: 1; transform: translateY(0); }

/* ── Footer ───────────────────────────────────────────────────────────────── */
.rp-footer {
  padding: 32px 0 48px; margin-top: 16px;
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted); font-size: 14px;
}
.rp-footer__logo {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--surface-3); overflow: hidden; margin-bottom: 4px;
}
.rp-footer__logo img { width: 100%; height: 100%; object-fit: cover; }
.rp-footer__name { color: var(--ink); font-weight: 600; }
.rp-footer__phone { color: var(--ink); text-decoration: none; font-weight: 500; }
.rp-footer__phone:hover { text-decoration: underline; }
.rp-footer__socials { display: flex; gap: 8px; margin-top: 8px; }
.rp-footer__social {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border); color: var(--ink);
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.rp-footer__social:hover { background: var(--border-2); }

/* ── Powered-by bar ───────────────────────────────────────────────────────── */
.rp-powered-bar {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  padding: 14px 16px calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border);
  background: var(--surface-2);
  color: var(--muted-2); font-size: 13px; text-decoration: none;
  transition: color .15s;
}
.rp-powered-bar:hover { color: var(--muted); }
.rp-powered-bar__brand { color: var(--muted); font-weight: 600; }
.rp-powered-bar:hover .rp-powered-bar__brand { color: var(--ink); }

/* ── Dialogs (shared) ─────────────────────────────────────────────────────── */
.rp-store dialog {
  border: none; padding: 0;
  color: var(--ink); font-family: inherit;
  max-width: 100vw; max-height: 100vh;
}
.rp-store dialog::backdrop { background: rgba(0,0,0,.5); }
.rp-modal {
  margin: auto;
  width: min(560px, 94vw);
  background: var(--surface);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
}
.rp-modal[open] { animation: rp-fade-in .15s ease both; }

/* generic modal layout (checkout, my-orders, tracking) */
.rp-modal-standard {
  display: flex; flex-direction: column;
  max-height: 88vh;
}
.rp-modal-standard__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.rp-modal-standard__body {
  flex: 1; overflow-y: auto;
  padding: 20px 22px 24px;
}
.rp-modal__title { margin: 0; font-size: 18px; font-weight: 700; color: var(--ink); }
.rp-tracking-id { margin: 2px 0 0; font-size: 13px; color: var(--muted); }

.rp-modal__close {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border);
  color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.rp-modal__close:hover { background: var(--border-2); }

/* ── Product modal (left: image/name/desc/price · right: options + qty/add row) ── */
.rp-product-modal { width: min(920px, 94vw); }

.rp-product-modal__inner {
  position: relative;
  max-height: 88vh;
  background: var(--surface);
  outline: none;
}

.rp-product-modal .rp-modal__close {
  position: absolute; top: 14px; right: 14px; z-index: 5;
  background: rgba(255,255,255,.95); backdrop-filter: blur(4px);
  border-color: var(--border);
}

.rp-modal__scroll {
  display: flex; flex-direction: row;
  max-height: 88vh; overflow: hidden;
}

/* LEFT: square image, name, description, price */
.rp-modal__left {
  width: 42%; flex-shrink: 0;
  padding: 28px;
  display: flex; flex-direction: column;
  overflow-y: auto;
}
.rp-modal__img-panel {
  width: 100%; aspect-ratio: 1 / 1;
  border-radius: var(--radius-card);
  background: var(--input-bg); position: relative; overflow: hidden;
  margin-bottom: 18px;
}
.rp-modal__product-img { width: 100%; height: 100%; object-fit: cover; display: block; }
.rp-modal__img-placeholder {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2);
}
.rp-modal__product-name { font-size: 22px; font-weight: 700; color: var(--ink); margin: 0 0 8px; line-height: 1.25; }
.rp-modal__product-desc { font-size: 14px; color: var(--muted); line-height: 1.55; margin: 0 0 12px; }
.rp-modal__product-price { font-size: 18px; font-weight: 700; color: var(--ink); margin: 0; }

/* RIGHT: options (scrolls independently) + qty/add row (pinned to bottom of column) */
.rp-modal__right {
  flex: 1; min-width: 0;
  display: flex; flex-direction: column;
  overflow: hidden;
}
.rp-modal__options-scroll { flex: 1; overflow-y: auto; padding: 64px 26px 8px; }

.rp-modal__bottom-row {
  display: flex; align-items: center; gap: 14px;
  padding: 16px 26px 20px;
  background: var(--surface);
  flex-shrink: 0;
}
.rp-qty-row { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.rp-qty-label { font-size: 14px; font-weight: 500; color: var(--ink); }
.rp-qty {
  display: inline-flex; align-items: center; gap: 4px;
  border: 1px solid var(--border); border-radius: var(--radius-pill);
  padding: 2px;
}
.rp-qty__btn {
  width: 36px; height: 36px; border-radius: 50%;
  background: none; border: none; cursor: pointer;
  color: var(--ink); font-size: 18px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .12s;
}
.rp-qty__btn:hover { background: var(--surface-3); }
.rp-qty__val { min-width: 28px; text-align: center; font-size: 15px; font-weight: 700; }
.rp-qty__btn--sm { width: 28px; height: 28px; font-size: 15px; }

.rp-modal__footer-bar { flex: 1; min-width: 0; }
.rp-modal__add-btn { width: 100%; padding: 16px; font-size: 16px; }

/* option groups */
.rp-opt-group { padding-top: 16px; margin-top: 16px; border-top: 1px solid var(--border-2); }
.rp-opt-group:first-child { padding-top: 0; margin-top: 0; border-top: none; }
.rp-opt-group__header { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 6px; }
.rp-opt-group__title { font-weight: 600; font-size: 15px; color: var(--ink); }
.rp-opt-group__subtitle { font-size: 13px; color: var(--muted); margin: 0 0 10px; }
.rp-opt-required-badge {
  font-size: 11px; font-weight: 600;
  padding: 3px 10px; border-radius: var(--radius-pill);
  background: var(--border-2); color: var(--muted);
  border: 1px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.rp-opt-required-badge.is-complete {
  background: var(--success-bg); color: var(--success); border-color: var(--success-bd);
}

.rp-opt-err {
  display: none; font-size: 12px; color: var(--danger); margin: 4px 0 8px;
}
.rp-opt-err.is-visible { display: block; }

.rp-opt-list { display: flex; flex-direction: column; gap: 8px; }
.rp-opt-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 12px; border-radius: 8px;
  border: 1px solid var(--border);
  cursor: pointer; transition: background .12s, border-color .12s;
}
.rp-opt-row:hover { background: var(--surface-2); }
.rp-opt-row.is-checked { background: var(--surface-3); border-color: var(--ink); }
.rp-opt-row.is-error { background: #FEF2F2; }
.rp-opt-row__name { flex: 1; font-size: 14px; color: var(--ink); }
.rp-opt-row__price { font-size: 13px; color: var(--muted); margin-right: 4px; }

/* custom checkbox / radio for option inputs */
.rp-opt-input {
  appearance: none; -webkit-appearance: none;
  width: 18px; height: 18px; flex-shrink: 0;
  border: 1.5px solid #D1D5DB; background: #fff;
  border-radius: 4px; cursor: pointer; margin: 0;
  transition: border-color .15s, background .15s;
  position: relative;
}
input.rp-opt-input[type="radio"] { border-radius: 50%; }
.rp-opt-input:checked {
  background-color: var(--ink); border-color: var(--ink);
}
input.rp-opt-input[type="checkbox"]:checked {
  background-image: url("data:image/svg+xml;utf8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 16 16' fill='none' stroke='white' stroke-width='2.5' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='3.5 8.5 6.5 11.5 12.5 5'/%3E%3C/svg%3E");
  background-size: 13px; background-repeat: no-repeat; background-position: center;
}
input.rp-opt-input[type="radio"]:checked::after {
  content: ""; position: absolute; inset: 4px; border-radius: 50%; background: #fff;
}

/* ── Cart drawer (non-dialog overlay) ─────────────────────────────────────── */
.rp-cart-overlay {
  position: fixed; inset: 0; z-index: 50;
  display: flex;
  opacity: 0; transition: opacity .25s ease;
}
.rp-cart-overlay.is-open { opacity: 1; }
.rp-cart-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }

.rp-cart-drawer {
  position: relative; margin-left: auto;
  width: 440px; max-width: 100vw; height: 100vh;
  background: var(--surface);
  display: flex; flex-direction: column;
  box-shadow: var(--shadow-lg);
  transform: translateX(100%);
  transition: transform .3s ease;
}
.rp-cart-overlay.is-open .rp-cart-drawer { transform: translateX(0); }

.rp-cart-drawer__header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 18px 22px;
  border-bottom: 1px solid var(--border);
}
.rp-cart-drawer__close {
  width: 36px; height: 36px; border-radius: 50%;
  background: #fff; border: 1px solid var(--border);
  color: var(--ink); cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  transition: background .15s;
}
.rp-cart-drawer__close:hover { background: var(--border-2); }
.rp-cart-drawer__body { flex: 1; overflow-y: auto; padding: 10px 22px; }
.rp-cart-drawer__footer { padding: 16px 22px 22px; border-top: 1px solid var(--border); background: var(--surface); }
.rp-cart-footer__subtotal {
  display: flex; justify-content: space-between; align-items: center;
  font-size: 15px; font-weight: 700; margin-bottom: 12px;
}

.rp-cart-empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--muted); padding: 56px 16px; text-align: center;
}
.rp-cart-empty p { margin: 0; }

.rp-cart-item {
  display: flex; gap: 12px; padding: 12px 0;
}
.rp-cart-item__img,
.rp-cart-item__img-placeholder {
  width: 56px; height: 56px; border-radius: 8px;
  flex-shrink: 0; object-fit: cover;
  background: var(--input-bg);
}
.rp-cart-item__img-placeholder {
  display: flex; align-items: center; justify-content: center;
  color: var(--muted-2);
}
.rp-cart-item__info { flex: 1; min-width: 0; }
.rp-cart-item__name { font-size: 14px; font-weight: 600; color: var(--ink); line-height: 1.35; }
.rp-cart-item__opts { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rp-cart-item__price { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 6px; }
.rp-cart-item__controls { display: flex; flex-direction: column; align-items: flex-end; justify-content: flex-end; }

/* ── Checkout modal ───────────────────────────────────────────────────────── */
.rp-checkout-modal { width: min(640px, 94vw); }
.rp-co-section { padding: 16px 0; border-top: 1px solid var(--border-2); }
.rp-co-section:first-child { padding-top: 0; border-top: none; }
.rp-co-section__title {
  font-size: 11px; font-weight: 700; color: var(--muted);
  letter-spacing: .08em; text-transform: uppercase;
  margin: 0 0 10px;
}
.rp-co-fields { display: flex; flex-direction: column; gap: 8px; }

.rp-store .form-input,
.rp-store .form-textarea {
  width: 100%; padding: 11px 14px;
  background: var(--input-bg);
  border: 1px solid transparent;
  border-radius: var(--radius-input);
  font-family: inherit; font-size: 14px; color: var(--ink);
  transition: border-color .15s, background .15s;
}
.rp-store .form-textarea { min-height: 88px; resize: vertical; line-height: 1.5; }
.rp-store .form-input::placeholder,
.rp-store .form-textarea::placeholder { color: var(--muted-2); }
.rp-store .form-input:focus,
.rp-store .form-textarea:focus { outline: none; border-color: var(--ink); background: #fff; }

.rp-field-error { display: none; font-size: 12px; color: var(--danger); margin-top: -2px; }
.rp-field-error.is-visible { display: block; }

/* delivery / pickup toggle */
.rp-delivery-toggle { display: flex; gap: 8px; margin-bottom: 14px; }
.rp-deliv-btn {
  flex: 1; display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 14px; border-radius: var(--radius-pill);
  background: #fff; color: var(--ink); border: 1.5px solid var(--border);
  cursor: pointer; font-family: inherit; font-size: 14px; font-weight: 500;
  transition: background .15s, border-color .15s, color .15s;
}
.rp-deliv-btn:hover { background: var(--border-2); }
.rp-deliv-btn--active { background: var(--ink); color: #fff; border-color: var(--ink); }
.rp-deliv-btn--active:hover { background: var(--ink-2); }

/* location search */
.rp-location-wrap { position: relative; margin-bottom: 10px; z-index: 20; }
.rp-location-results {
  position: absolute; left: 0; right: 0; top: calc(100% + 4px); z-index: 5;
  background: #fff; border: 1px solid var(--border); border-radius: var(--radius-input);
  box-shadow: var(--shadow-md); max-height: 240px; overflow-y: auto;
}
.rp-location-result {
  padding: 10px 14px; font-size: 13px; cursor: pointer;
  border-bottom: 1px solid var(--border-2);
  transition: background .12s;
}
.rp-location-result:last-child { border-bottom: none; }
.rp-location-result:hover { background: var(--surface-2); }

/* explicit low z-index so Leaflet's internal panes/controls (up to z-index 1000)
   stay contained in their own stacking context and never sit above the dropdown above */
.rp-map { width: 100%; height: 220px; border-radius: var(--radius-input); border: 1px solid var(--border); margin-bottom: 10px; position: relative; z-index: 1; }

.rp-pickup-info {
  display: flex; gap: 10px; align-items: flex-start;
  background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-input);
  padding: 12px 14px; font-size: 13px; color: var(--ink);
}
.rp-pickup-info i { color: var(--ink); margin-top: 1px; flex-shrink: 0; }

.rp-delivery-fee-chip {
  display: none; margin-top: 10px;
  font-size: 13px; padding: 8px 12px; border-radius: var(--radius-input);
  background: var(--surface-2); color: var(--ink); border: 1px solid var(--border);
}
.rp-delivery-fee-chip.is-visible { display: block; }
.rp-delivery-fee-chip--free { background: var(--success-bg); color: var(--success); border-color: var(--success-bd); }
.rp-delivery-fee-chip--out  { background: #FEF2F2; color: #991B1B; border-color: #FECACA; }

/* promo msg */
.rp-co-msg { font-size: 13px; color: var(--muted); }
.rp-co-msg--success { color: var(--success); }
.rp-co-msg--error { color: var(--danger); }

/* summary */
.rp-co-summary { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--radius-input); padding: 14px 16px; }
.rp-co-summary__items { display: flex; flex-direction: column; gap: 8px; padding-bottom: 10px; border-bottom: 1px solid var(--border); margin-bottom: 10px; }
.rp-co-summary__items:empty { display: none; }
.rp-co-summary__item { display: flex; justify-content: space-between; gap: 12px; font-size: 13px; }
.rp-co-summary__item-name { color: var(--ink); font-weight: 500; }
.rp-co-summary__item-qty { font-size: 12px; color: var(--muted); }
.rp-co-summary__item-price { font-size: 13px; font-weight: 700; color: var(--ink); margin-top: 2px; }
.rp-co-summary__totals { display: flex; flex-direction: column; gap: 6px; }
.rp-co-summary__row { display: flex; justify-content: space-between; align-items: center; font-size: 13px; color: var(--muted); }
.rp-co-summary__row--total { font-size: 16px; font-weight: 700; color: var(--ink); margin-top: 6px; padding-top: 10px; border-top: 1px solid var(--border); }

/* upsell strip */
.rp-co-upsell-list {
  display: flex; gap: 10px; overflow-x: auto; padding-bottom: 2px;
  -ms-overflow-style: none; scrollbar-width: none;
}
.rp-co-upsell-list::-webkit-scrollbar { display: none; }
.rp-upsell-card {
  flex: 0 0 112px; width: 112px; cursor: pointer;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-input);
  padding: 8px; position: relative; transition: box-shadow .15s, border-color .15s;
}
.rp-upsell-card:hover { box-shadow: var(--shadow-sm); border-color: var(--border-2); }
.rp-upsell-card__img,
.rp-upsell-card__img-placeholder {
  width: 100%; height: 72px; border-radius: 6px; object-fit: cover;
  background: var(--input-bg); display: block;
}
.rp-upsell-card__img-placeholder { display: flex; align-items: center; justify-content: center; color: var(--muted-2); }
.rp-upsell-card__name {
  font-size: 12px; font-weight: 600; color: var(--ink); line-height: 1.3;
  margin-top: 6px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.rp-upsell-card__price { font-size: 12px; font-weight: 700; color: var(--ink); margin-top: 4px; }
.rp-upsell-card__add {
  position: absolute; top: 22px; right: 12px;
  width: 24px; height: 24px; border-radius: 50%;
  background: var(--ink); color: #fff; border: none;
  display: flex; align-items: center; justify-content: center;
  box-shadow: var(--shadow-sm); cursor: pointer;
}

.rp-co-error {
  display: none; margin-top: 12px;
  background: #FEF2F2; border: 1px solid #FECACA; color: #991B1B;
  padding: 10px 14px; border-radius: var(--radius-input); font-size: 13px;
}
.rp-co-error.is-visible { display: block; }

.rp-place-order-btn { width: 100%; margin-top: 16px; padding: 15px; font-size: 16px; }

/* order success */
.rp-order-success {
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  padding: 28px 8px; text-align: center;
}
.rp-order-success__icon {
  width: 60px; height: 60px; border-radius: 50%;
  background: var(--success-bg); color: var(--success);
  display: flex; align-items: center; justify-content: center;
  margin-bottom: 4px;
}
.rp-order-success__title { font-size: 20px; font-weight: 700; margin: 0; }
.rp-order-success__num { font-size: 14px; color: var(--muted); margin: 0; }
.rp-order-success__num strong { color: var(--ink); }

/* ── My orders modal ──────────────────────────────────────────────────────── */
.rp-my-orders-modal { width: min(560px, 94vw); }
#my-orders-list {
  max-height: 480px;
  overflow-y: auto;
  padding-right: 4px;
}
.rp-my-order-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 16px; cursor: pointer;
  border: 1px solid var(--border); border-radius: var(--radius-input);
  margin-bottom: 8px;
  transition: background .12s, border-color .12s;
}
.rp-my-order-row:hover { background: var(--surface-2); border-color: var(--ink); }
.rp-my-order-row__left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.rp-my-order-row__num { font-size: 14px; font-weight: 600; color: var(--ink); }
.rp-my-order-row__date { font-size: 12px; color: var(--muted); }
.rp-my-order-row__right { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.rp-my-order-row__total { font-size: 14px; font-weight: 700; color: var(--ink); }

/* ── Tracking modal ───────────────────────────────────────────────────────── */
.rp-tracking-modal { width: min(560px, 94vw); }
.rp-tracking-message { font-size: 14px; color: var(--muted); margin: 0 0 16px; line-height: 1.5; }

.rp-timeline { display: flex; flex-direction: column; margin: 16px 0; }
.rp-timeline-step { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.rp-timeline-step:last-child { padding-bottom: 0; }
.rp-timeline-step__dot-col { display: flex; flex-direction: column; align-items: center; padding-top: 2px; }
.rp-timeline-step__dot {
  width: 18px; height: 18px; border-radius: 50%;
  background: var(--border);
  flex-shrink: 0;
}
.rp-timeline-step__line { flex: 1; width: 2px; background: var(--border); margin-top: 2px; }
.rp-timeline-step:last-child .rp-timeline-step__line { display: none; }
.rp-timeline-step--done .rp-timeline-step__dot {
  background: var(--success); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.rp-timeline-step--done .rp-timeline-step__dot::after { content: "✓"; }
.rp-timeline-step--done .rp-timeline-step__line { background: var(--success); }
.rp-timeline-step--active .rp-timeline-step__dot { background: var(--ink); animation: rp-pulse 1.8s ease infinite; }
.rp-timeline-step--cancelled .rp-timeline-step__dot { background: var(--danger); }
.rp-timeline-step__content { padding-top: 1px; }
.rp-timeline-step__label { font-size: 14px; font-weight: 600; color: var(--ink); }
.rp-timeline-step:not(.rp-timeline-step--done):not(.rp-timeline-step--active) .rp-timeline-step__label { color: var(--muted); }

.rp-driver-card {
  display: flex; gap: 12px; align-items: center;
  background: var(--surface-2); border: 1px solid var(--border);
  border-radius: var(--radius-card); padding: 14px;
  margin-bottom: 16px;
}
.rp-driver-card__avatar {
  width: 40px; height: 40px; border-radius: 50%;
  background: var(--ink); color: #fff;
  display: flex; align-items: center; justify-content: center;
}
.rp-driver-card__label { font-size: 11px; color: var(--muted); text-transform: uppercase; letter-spacing: .08em; margin: 0; }
.rp-driver-card__name { font-size: 15px; font-weight: 700; color: var(--ink); margin: 2px 0 0; }

.rp-tracking-items {
  margin-top: 12px; border: 1px solid var(--border); border-radius: var(--radius-input);
  background: var(--surface-2);
}
.rp-tracking-items > summary {
  list-style: none; cursor: pointer; padding: 12px 14px;
  font-size: 14px; font-weight: 600; color: var(--ink);
  display: flex; justify-content: space-between; align-items: center;
}
.rp-tracking-items > summary::-webkit-details-marker { display: none; }
.rp-tracking-items > summary::after { content: "▾"; color: var(--muted); transition: transform .15s; }
.rp-tracking-items[open] > summary::after { transform: rotate(180deg); }
.rp-tracking-items > div#tr-items-list { padding: 0 14px 12px; }
.rp-tracking-item {
  display: flex; justify-content: space-between; gap: 12px;
  padding: 8px 0; border-top: 1px solid var(--border-2);
}
.rp-tracking-item:first-child { border-top: none; }
.rp-tracking-item__name { font-size: 14px; color: var(--ink); }
.rp-tracking-item__opts { font-size: 12px; color: var(--muted); margin-top: 2px; }
.rp-tracking-item__price { font-size: 14px; font-weight: 700; color: var(--ink); white-space: nowrap; }

/* status badges */
.rp-status-badge {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 4px 12px; border-radius: var(--radius-pill);
  font-size: 12px; font-weight: 500;
  background: var(--border-2); color: var(--muted);
  border: 1px solid transparent;
}
.rp-status-badge__dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; flex-shrink: 0; }
.rp-status-badge--pulse .rp-status-badge__dot { animation: rp-pulse 1.8s ease infinite; }

.rp-status-badge--pending          { background: #F3F4F6; color: #4B5563; }
.rp-status-badge--confirmed        { background: #DBEAFE; color: #1E40AF; }
.rp-status-badge--preparing        { background: #FEF3C7; color: #92400E; }
.rp-status-badge--ready            { background: #E0E7FF; color: #3730A3; }
.rp-status-badge--out_for_delivery { background: #FFEDD5; color: #9A3412; }
.rp-status-badge--delivered        { background: var(--success-bg); color: var(--success); }
.rp-status-badge--cancelled        { background: #FEE2E2; color: #991B1B; }
.rp-status-badge--refunded         { background: #E5E7EB; color: #374151; }

/* ── Responsive (mobile) ──────────────────────────────────────────────────── */
@media (max-width: 639px) {
  .rp-store-head--mobile { display: block; }
  .rp-sidebar { display: none; }
  .rp-cat-tabs { display: block; }
  .rp-cols { flex-direction: column; gap: 0; padding: 16px 0 80px; }
  .rp-cover { height: 160px; margin-top: 16px; }

  .rp-store-head { padding: 0 0 12px; }
  .rp-store-head__top {
    flex-direction: column; align-items: center; text-align: center;
    gap: 8px; margin-top: -32px;
  }
  .rp-store-head__logo { width: 72px; height: 72px; }
  .rp-store-head__addr { text-align: center; }
  .rp-store-head__row {
    flex-direction: column; align-items: center; justify-content: center;
  }

  .rp-main { width: 100%; padding-top: 8px; }
  .rp-main__top { display: none; }
  .rp-search { margin-bottom: 16px; }
  .rp-section__title { font-size: 18px; }

  /* product modal: full-screen, single scroll column, only the add-to-cart button is sticky */
  .rp-store dialog.rp-product-modal {
    width: 100vw; max-width: 100vw; height: 100vh;
    height: 100dvh; max-height: 100dvh;
    border-radius: 0;
  }
  .rp-product-modal__inner { max-height: none; height: 100%; }

  .rp-modal__scroll {
    flex-direction: column;
    max-height: none; height: 100%;
    overflow-y: auto; -webkit-overflow-scrolling: touch;
  }

  .rp-modal__left { width: 100%; overflow: visible; padding: 64px 20px 4px; }
  .rp-modal__img-panel { margin-bottom: 14px; }

  .rp-modal__right { border-left: none; overflow: visible; }
  .rp-modal__options-scroll { flex: 0 0 auto; overflow: visible; padding: 8px 20px 0; }

  /* unwrap the row: qty-row becomes normal scrolling content, button alone stays sticky */
  .rp-modal__bottom-row { display: contents; }
  .rp-qty-row {
    justify-content: center;
    padding: 16px 20px 28px;
  }
  .rp-modal__footer-bar {
    flex: 0 0 auto;
    position: sticky; bottom: 0; z-index: 4;
    margin-top: auto;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
    background: var(--surface);
    border-top: 1px solid var(--border);
  }

  /* generic modals: bottom sheet */
  .rp-store dialog.rp-checkout-modal,
  .rp-store dialog.rp-my-orders-modal,
  .rp-store dialog.rp-tracking-modal {
    margin: auto auto 0; width: 100vw; max-width: 100vw;
    max-height: 95vh; border-radius: var(--radius-card) var(--radius-card) 0 0;
  }
  .rp-modal-standard { max-height: 95vh; }

  /* cart drawer: bottom sheet */
  .rp-cart-overlay { flex-direction: column; }
  .rp-cart-backdrop { position: relative; flex: 1; }
  .rp-cart-drawer {
    margin-left: 0; width: 100%; height: auto; max-height: 90vh;
    border-radius: var(--radius-card) var(--radius-card) 0 0;
    transform: translateY(100%);
  }
  .rp-cart-overlay.is-open .rp-cart-drawer { transform: translateY(0); }

  .rp-cart-fab { bottom: 16px; right: 16px; padding: 12px 18px; }
  .rp-toast-container { right: 16px; bottom: 80px; left: 16px; align-items: center; }
  .rp-toast { white-space: normal; text-align: center; }
}

@media (min-width: 640px) {
  .rp-store-head--mobile { display: none; }
  .rp-main__top { display: flex; }
  .rp-search { max-width: 280px; }
  #search-mobile-wrap { display: none; }
}
