/*
 * components/products.css — admin Products (Menu → Item) list page
 *
 * Mobile-first: each item is a flex card that wraps its controls below the
 * name on narrow screens. Green = normal price, red = online price.
 */

.pr { max-width: none; }
.pr-head-act { display: inline-flex; gap: 10px; flex-wrap: wrap; }

/* Toolbar: select-all + search */
.pr-toolbar { display: flex; align-items: center; gap: 12px; margin: 4px 0 12px; flex-wrap: wrap; }
.pr-checkall { display: inline-flex; align-items: center; gap: 7px; font-size: 0.85rem; font-weight: 600; color: var(--color-text-muted); cursor: pointer; }
.pr-search { position: relative; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; max-width: 460px; border: 1px solid var(--color-border); border-radius: 10px; padding: 0 12px; background: #fff; color: var(--color-text-soft); }
.pr-search input { flex: 1; border: 0; outline: none; padding: 10px 0; font: inherit; font-size: 0.9rem; background: transparent; }
.pr-search__clear { color: var(--color-text-soft); text-decoration: none; font-size: 0.9rem; padding: 0 4px; }

/* Bulk action bar */
.pr-actionbar { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; padding: 10px 12px; margin-bottom: 12px; border: 1px solid var(--color-primary); border-radius: 12px; background: var(--color-primary-soft); }
.pr-actionbar__count { font-size: 0.85rem; font-weight: 700; color: var(--color-text-muted); }
.pr-actionbar__right { display: flex; align-items: center; gap: 10px; margin-left: auto; }
.pr-actionbar select { border: 1px solid var(--color-border); border-radius: 9px; padding: 7px 10px; font: inherit; font-size: 0.85rem; background: #fff; }

.pr-note { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 0.82rem; color: var(--color-text-muted); margin: 0 0 12px; }
.pr-dot { width: 12px; height: 12px; border-radius: 3px; display: inline-block; }
.pr-dot--green { background: #ccffe7; border: 1px solid #34d399; }
.pr-dot--red { background: #ffcccc; border: 1px solid #f87171; }
.pr-dot--blue { background: #d6e6ff; border: 1px solid #60a5fa; }

/* Filter (search + sort + page-size) */
.pr-filter { display: flex; align-items: center; gap: 10px; flex: 1; flex-wrap: wrap; }
.pr-filter-sel { border: 1px solid var(--color-border); border-radius: 10px; padding: 9px 10px; font: inherit; font-size: 0.86rem; background: #fff; }

/* Searchable category dropdown */
.pr-catdd { position: relative; }
.pr-catdd__btn { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; max-width: 200px; }
.pr-catdd__btn > span[data-catdd-label] { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-catdd__chev { color: var(--color-text-soft); font-size: 0.7rem; flex: 0 0 auto; margin-left: auto; }
.pr-catdd__panel { position: absolute; top: calc(100% + 6px); left: 0; width: 280px; max-width: 86vw; background: #fff; border: 1px solid var(--color-border); border-radius: 12px; box-shadow: var(--shadow-3, 0 20px 50px rgba(0,0,0,.2)); z-index: 50; overflow: hidden; }
.pr-catdd__search { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--color-border); color: var(--color-text-soft); }
.pr-catdd__search input { flex: 1; border: 0; outline: none; font: inherit; font-size: 0.88rem; background: transparent; min-width: 0; }
.pr-catdd__list { list-style: none; margin: 0; padding: 6px; max-height: 300px; overflow-y: auto; }
.pr-catdd__opt { display: block; width: 100%; text-align: left; border: 0; background: transparent; border-radius: 8px; padding: 9px 12px; font: inherit; font-size: 0.88rem; color: var(--color-text); cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pr-catdd__opt:hover { background: var(--color-bg-alt); }
.pr-catdd__opt.is-on { background: var(--color-primary-soft); color: var(--color-primary); font-weight: 700; }
.pr-catdd__empty { padding: 14px; text-align: center; color: var(--color-text-soft); font-size: 0.85rem; }

/* Bulk price control in the action bar */
.pr-bulkprice { display: inline-flex; align-items: center; gap: 6px; padding: 4px 6px; border: 1px solid var(--color-border); border-radius: 10px; background: #fff; }
.pr-bulkprice select { border: 0; background: transparent; font: inherit; font-size: 0.82rem; outline: none; }
.pr-bulkprice__cur { color: var(--color-text-soft); font-size: 0.82rem; }
.pr-bulkprice__in { width: 70px; border: 0; border-bottom: 1px solid var(--color-border); background: transparent; text-align: center; font: inherit; font-size: 0.85rem; padding: 4px 2px; outline: none; }

/* Pagination */
.pr-pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin: 16px 2px 4px; }
.pr-pager__info { color: var(--color-text-muted); font-size: 0.85rem; }
.pr-pager__nav { display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.pr-pager__btn { display: inline-flex; align-items: center; min-width: 34px; height: 34px; padding: 0 10px; justify-content: center; border: 1px solid var(--color-border); border-radius: 9px; background: #fff; color: var(--color-text); text-decoration: none; font-size: 0.85rem; font-weight: 600; }
.pr-pager__btn:hover { border-color: var(--color-primary); color: var(--color-primary); }
.pr-pager__btn.is-active { background: var(--color-primary); border-color: var(--color-primary); color: #fff; }
.pr-pager__btn.is-disabled { opacity: .45; pointer-events: none; }
.pr-pager__dots { color: var(--color-text-soft); padding: 0 2px; }

/* Infinite-scroll sentinel (mobile only — JS appends the next page here) */
.pr-infinite { display: flex; align-items: center; justify-content: center; padding: 18px 0; min-height: 20px; }
.pr-infinite__spin { width: 22px; height: 22px; border-radius: 50%; border: 3px solid var(--color-border); border-top-color: var(--color-primary); animation: pr-spin .7s linear infinite; opacity: 0; }
.pr-infinite.is-loading .pr-infinite__spin { opacity: 1; }
.pr-infinite__end { font-size: 0.8rem; color: var(--color-text-soft); }
@keyframes pr-spin { to { transform: rotate(360deg); } }

/* Item card */
.pr-list { display: flex; flex-direction: column; gap: 10px; }
.pr-item { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; padding: 10px 14px; border: 1px solid var(--color-border); border-radius: 14px; background: #fff; }
.pr-item__main { display: flex; align-items: center; gap: 12px; min-width: 0; flex: 1 1 240px; }
.pr-item__check input { width: 18px; height: 18px; }
.pr-item__img { width: 42px; height: 42px; flex: 0 0 auto; border-radius: 9px; overflow: hidden; background: var(--color-bg-alt); display: flex; align-items: center; justify-content: center; }
.pr-item__img img { width: 100%; height: 100%; object-fit: cover; }
.pr-item__noimg { font-size: 1.1rem; }
.pr-item__name { font-weight: 600; font-size: 0.92rem; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.pr-item__suffix { color: var(--color-text-soft); font-weight: 400; }

.pr-item__controls { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
/* Price chip: value box + a small label below (Normal / Online / Marketplace) */
.pr-price { display: inline-flex; flex-direction: column; align-items: center; gap: 3px; }
.pr-price__box { display: inline-flex; align-items: center; border-radius: 8px; padding: 3px 6px; }
.pr-price__cur { font-size: 0.8rem; color: var(--color-text-soft); }
.pr-price--normal .pr-price__box { background: #ccffe7; }
.pr-price--online .pr-price__box { background: #ffcccc; }
.pr-price--market .pr-price__box { background: #d6e6ff; }
.pr-price__lbl { font-size: 0.6rem; color: var(--color-text-soft); font-weight: 700; text-transform: uppercase; letter-spacing: .03em; }
.pr-priceinput { width: 60px; border: 0; background: transparent; text-align: center; font: inherit; font-size: 0.86rem; padding: 6px 2px; outline: none; }

/* Marketplace on/off switch (per row + responsive) */
.pr-mp { position: relative; display: inline-flex; flex-direction: column; align-items: center; gap: 4px; cursor: pointer; user-select: none; }
.pr-mp input { position: absolute; opacity: 0; width: 0; height: 0; }
.pr-mp__ui { position: relative; width: 40px; height: 22px; border-radius: 999px; background: #cbd2dd; transition: background .16s ease; flex: 0 0 auto; }
.pr-mp__ui::before { content: ""; position: absolute; left: 3px; top: 3px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .16s ease; box-shadow: 0 1px 2px rgba(0,0,0,.3); }
.pr-mp input:checked + .pr-mp__ui { background: var(--color-success); }
.pr-mp input:checked + .pr-mp__ui::before { transform: translateX(18px); }
.pr-mp__lbl { font-size: 0.6rem; color: var(--color-text-soft); font-weight: 700; text-transform: uppercase; }

.pr-statuswrap { display: flex; flex-direction: column; gap: 2px; }
.pr-status { border: 1px solid var(--color-border); border-radius: 9px; padding: 7px 8px; font: inherit; font-size: 0.82rem; background: #fff; max-width: 160px; }
.pr-until { font-size: 0.7rem; color: var(--color-text-soft); }
.pr-item__act { display: inline-flex; gap: 6px; }
.ly-iconbtn--view:hover { border-color: var(--color-primary); color: var(--color-primary); }

/* Filters group + per-card "more" — desktop shows them inline; the mobile
   filter button, sheet chrome and the kebab are hidden until ≤720px. */
.pr-filters { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.pr-filters__head, .pr-filters__done { display: none; }
.pr-filterbtn { display: none; }
.pr-filters__backdrop { position: fixed; inset: 0; background: rgba(15, 23, 42, .5); z-index: 65; }
/* Desktop: View sits inline in the controls (far right); the top-of-card View
   is mobile-only. Status + marketplace are an inline group. */
.pr-item__act--top { display: none; }
.pr-item__row2 { display: inline-flex; align-items: center; gap: 10px; }

/* Modals */
.pr-modal { position: fixed; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(15, 23, 42, 0.5); }
.pr-modal__panel { width: 460px; max-width: 100%; max-height: 88vh; overflow-y: auto; background: #fff; border-radius: 16px; padding: 22px; box-shadow: var(--shadow-2, 0 20px 50px rgba(0,0,0,.3)); }
.pr-modal__panel--sm { width: 360px; text-align: center; }
.pr-modal__icon { font-size: 42px; }
.pr-modal__title { font-size: 1.1rem; font-weight: 800; margin: 0 0 12px; }
.pr-modal__msg { font-size: 0.9rem; color: var(--color-text-muted); margin: 0 0 14px; }
.pr-modal__foot { display: flex; justify-content: flex-end; gap: 10px; margin-top: 16px; }
.pr-modal__foot--center { justify-content: center; }
.pr-field { display: flex; flex-direction: column; gap: 6px; font-size: 0.85rem; font-weight: 600; color: var(--color-text-muted); }
.pr-field input, .pr-field select { border: 1px solid var(--color-border); border-radius: 10px; padding: 10px 12px; font: inherit; background: #fff; }
.pr-tp-preview { max-height: 46vh; overflow-y: auto; border: 1px solid var(--color-border); border-radius: 10px; margin-top: 6px; }
.pr-tp-row { display: grid; grid-template-columns: 1fr 70px 80px; gap: 8px; padding: 7px 10px; font-size: 0.82rem; border-bottom: 1px solid var(--color-border-soft); }
.pr-tp-row--head { font-weight: 700; color: var(--color-text-muted); position: sticky; top: 0; background: var(--color-bg-alt); }
.pr-tp-row span:nth-child(2), .pr-tp-row span:nth-child(3) { text-align: right; }
body.pr-modal-open, body.filters-open { overflow: hidden; }

/* ── Product detail (View) ── */
.pv-headact { display: inline-flex; gap: 8px; flex-wrap: wrap; }
.pv-tabs { display: flex; gap: 6px; margin: 4px 0 14px; overflow-x: auto; }
.pv-tabs::-webkit-scrollbar { height: 0; }
.pv-tab { flex: 0 0 auto; border: 1.5px solid var(--color-border); background: #fff; border-radius: 999px; padding: 8px 16px; font-size: 0.85rem; font-weight: 700; color: var(--color-text-muted); cursor: pointer; white-space: nowrap; }
.pv-tab.is-on { background: var(--color-primary-soft); border-color: var(--color-primary); color: var(--color-primary); }
.pv-head { display: flex; align-items: center; gap: 16px; margin-bottom: 16px; }
.pv-img { width: 84px; height: 84px; flex: 0 0 auto; border-radius: 14px; overflow: hidden; background: var(--color-bg-alt); display: flex; align-items: center; justify-content: center; font-size: 2rem; }
.pv-img img { width: 100%; height: 100%; object-fit: cover; }
.pv-name { font-size: 1.15rem; font-weight: 800; margin-bottom: 8px; }
.pv-suffix { color: var(--color-text-soft); font-weight: 400; font-size: 0.9rem; }
.pv-rows { display: grid; grid-template-columns: repeat(2, 1fr); gap: 1px; background: var(--color-border-soft); border: 1px solid var(--color-border-soft); border-radius: 12px; overflow: hidden; }
.pv-row { display: flex; flex-direction: column; gap: 3px; padding: 11px 14px; background: #fff; }
.pv-row--full { grid-column: 1 / -1; }
.pv-k { font-size: 0.72rem; color: var(--color-text-soft); font-weight: 700; text-transform: uppercase; letter-spacing: .02em; }
.pv-v { font-size: 0.92rem; color: var(--color-text); word-break: break-word; }
.pv-subtitle { font-size: 0.9rem; font-weight: 800; margin: 18px 0 10px; }
.pv-chips { display: flex; flex-wrap: wrap; gap: 8px; }
.pv-chip { display: inline-flex; align-items: center; gap: 5px; border: 1px solid var(--color-border); border-radius: 999px; padding: 6px 12px; font-size: 0.8rem; font-weight: 600; color: var(--color-text-muted); background: #fff; }
.pv-chip.is-on { border-color: var(--color-success); color: var(--color-success); background: #eafff4; }
.pv-chip--warn { border-color: #f59e0b; color: #b45309; background: #fffbeb; }

/* Modifier groups with their options (deep) */
.pv-mods { display: flex; flex-direction: column; gap: 12px; }
.pv-mod { border: 1px solid var(--color-border); border-radius: 12px; overflow: hidden; }
.pv-mod__head { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; padding: 11px 14px; background: var(--color-primary-soft); }
.pv-mod__name { font-size: 0.92rem; font-weight: 800; color: var(--color-primary); }
.pv-mod__meta { font-size: 0.74rem; font-weight: 700; color: var(--color-text-muted); }
.pv-mod__opts { list-style: none; margin: 0; padding: 0; }
.pv-mod__opt { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 9px 14px; border-top: 1px solid var(--color-border-soft); font-size: 0.88rem; }
.pv-mod__opt:first-child { border-top: none; }
.pv-mod__optname { color: var(--color-text); min-width: 0; word-break: break-word; }
.pv-mod__optprice { flex: 0 0 auto; font-weight: 700; color: var(--color-text-muted); }
.pv-mod__opts .pv-mod__opt:nth-child(even) { background: var(--color-bg-alt); }

@media (max-width: 560px) { .pv-rows { grid-template-columns: 1fr; } .pv-head { flex-direction: column; align-items: flex-start; } }

/* Add / edit form */
.pr-req { color: var(--color-danger, #e11d48); }
.pr-form textarea { width: 100%; resize: vertical; border: 1px solid var(--color-border); border-radius: 10px; padding: 9px 11px; font: inherit; font-size: 0.9rem; }
.pr-form textarea:focus { outline: none; border-color: var(--color-primary); box-shadow: 0 0 0 4px var(--color-primary-soft); }
.pr-flags { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 10px 18px; }
.pr-days { display: flex; flex-wrap: wrap; gap: 8px 16px; margin-top: 8px; }
.pr-imgrow { display: flex; align-items: flex-start; gap: 16px; flex-wrap: wrap; }
.pr-imgprev { width: 140px; height: 110px; flex: 0 0 auto; border: 1.5px dashed var(--color-border); border-radius: 12px; overflow: hidden; display: flex; align-items: center; justify-content: center; background: var(--color-bg-alt); }
.pr-imgprev img { width: 100%; height: 100%; object-fit: cover; }
.pr-imgprev__ph { color: var(--color-text-soft); font-size: 0.82rem; }
.pr-imgupload { flex: 1; min-width: 200px; }
.pr-imgupload input { font-size: 0.85rem; }

/* ── Marketplace categories ── */
.mpc-icon { display: inline-flex; align-items: center; justify-content: center; }
.mpc-emoji { font-size: 1.5rem; line-height: 1; }
.mpc-sub { display: block; font-size: 0.76rem; color: var(--color-text-soft); font-weight: 400; margin-top: 2px; }
.mpc-sortcell { font-size: 0.8rem; color: var(--color-text-muted); font-weight: 700; min-width: 34px; text-align: center; }
/* Emoji icon picker */
.mpc-iconhead { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.mpc-iconhead__lbl { font-size: 0.82rem; color: var(--color-text-muted); font-weight: 600; }
.mpc-iconhead__cur { font-size: 1.6rem; line-height: 1; min-width: 28px; }
.mpc-iconpick { display: grid; grid-template-columns: repeat(auto-fill, minmax(46px, 1fr)); gap: 6px; max-height: 240px; overflow-y: auto; padding: 8px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg-alt); }
.mpc-iconbtn { display: inline-flex; align-items: center; justify-content: center; height: 44px; border: 1.5px solid transparent; border-radius: 10px; background: #fff; font-size: 1.4rem; line-height: 1; cursor: pointer; transition: border-color .12s ease, transform .12s ease; }
.mpc-iconbtn:hover { border-color: var(--color-primary); transform: translateY(-1px); }
.mpc-iconbtn.is-on { border-color: var(--color-primary); background: var(--color-primary-soft); box-shadow: 0 0 0 3px var(--color-primary-soft); }
@media (max-width: 720px) { .mpc-sortcell { order: -1; } }

/* Slug + clickable restaurant count (under the name) */
.mpc-sub { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 8px; }
.mpc-sub__slug { color: var(--color-text-soft); }
.mpc-count { border: 1px solid var(--color-border); background: var(--color-bg-alt); color: var(--color-primary); font: inherit; font-size: 0.72rem; font-weight: 700; padding: 1px 8px; border-radius: 999px; cursor: pointer; transition: background .12s ease, border-color .12s ease; }
.mpc-count:hover { background: var(--color-primary-soft); border-color: var(--color-primary); }
.mpc-count--static { cursor: default; }
.mpc-count--static:hover { background: var(--color-bg-alt); border-color: var(--color-border); }

/* Drag-to-reorder */
.mpc-draghint { margin: 0 0 6px; font-size: 0.78rem; color: var(--color-text-muted); }
.mpc-drag { cursor: grab; color: var(--color-text-muted); font-size: 1.15rem; line-height: 1; padding: 0 4px; touch-action: none; user-select: none; align-self: center; }
.mpc-drag:active { cursor: grabbing; }
.mpc-list--dragging { user-select: none; }
.pr-item.is-dragging { opacity: .65; box-shadow: 0 6px 18px rgba(15, 23, 42, .14); background: var(--color-primary-soft); }

/* Restaurant autocomplete (filter + assign) */
.mpc-ac { position: relative; display: flex; align-items: center; }
.mpc-ac--filter { flex: 1 1 190px; min-width: 150px; max-width: 240px; border: 1px solid var(--color-border); border-radius: 10px; background: #fff; padding: 0 8px; }
.mpc-ac--filter .mpc-ac__input { border: none; padding: 9px 4px; }
.mpc-ac--assign { width: 100%; margin-bottom: 10px; border: 1px solid var(--color-border); border-radius: 10px; background: #fff; padding: 0 10px; }
.mpc-ac__ic { font-size: 0.9rem; opacity: .7; flex: 0 0 auto; }
.mpc-ac__input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 0.86rem; border: none; outline: none; background: transparent; padding: 10px 4px; }
.mpc-ac__clear { border: none; background: transparent; color: var(--color-text-muted); cursor: pointer; font-size: 0.85rem; padding: 2px 4px; }
.mpc-ac__clear:hover { color: var(--color-danger, #e11d48); }
.mpc-ac__panel { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; background: #fff; border: 1px solid var(--color-border); border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, .12); max-height: 260px; overflow-y: auto; padding: 4px; }
.mpc-ac__opt { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; border: none; background: transparent; font: inherit; padding: 8px 10px; border-radius: 8px; cursor: pointer; color: var(--color-text); }
.mpc-ac__opt:hover { background: var(--color-primary-soft); }
.mpc-ac__optname { font-size: 0.88rem; font-weight: 600; }
.mpc-ac__optsub { font-size: 0.72rem; color: var(--color-text-muted); }
.mpc-ac__empty { padding: 12px 10px; font-size: 0.84rem; color: var(--color-text-muted); }

/* Selected restaurants — proper list (assign modal) */
.mpc-sellist-head { font-size: 0.78rem; font-weight: 700; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .03em; margin-bottom: 6px; }
.mpc-sellist-head__n { display: inline-flex; min-width: 20px; height: 20px; padding: 0 6px; align-items: center; justify-content: center; background: var(--color-primary-soft); color: var(--color-primary); border-radius: 999px; font-size: 0.72rem; }
.mpc-sellist { max-height: 230px; overflow-y: auto; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg-alt); padding: 4px; margin-bottom: 12px; }
.mpc-sellist__empty { font-size: 0.82rem; color: var(--color-text-muted); padding: 14px 10px; text-align: center; }
.mpc-selrow { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 8px 10px; background: #fff; border-radius: 8px; margin-bottom: 4px; }
.mpc-selrow:last-child { margin-bottom: 0; }
.mpc-selrow__txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mpc-selrow__name { font-size: 0.86rem; font-weight: 600; color: var(--color-text); }
.mpc-selrow__sub { font-size: 0.72rem; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mpc-selrow__x { flex: 0 0 auto; border: none; background: rgba(0, 0, 0, .06); color: var(--color-text-muted); width: 22px; height: 22px; border-radius: 50%; cursor: pointer; font-size: 0.72rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.mpc-selrow__x:hover { background: var(--color-danger, #e11d48); color: #fff; }

/* Assign mode toggle + inline error */
.mpc-mode { display: flex; gap: 18px; margin-bottom: 12px; font-size: 0.85rem; }
.mpc-mode__opt { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.mpc-assign__err { color: var(--color-danger, #e11d48); font-size: 0.82rem; margin: 0 0 10px; }

/* Restaurants-of-a-category list */
.mpc-restlist { max-height: 340px; overflow-y: auto; margin: 4px 0 14px; border: 1px solid var(--color-border); border-radius: 12px; }
.mpc-restlist__ul { list-style: none; margin: 0; padding: 0; }
.mpc-restlist__li { display: flex; align-items: center; gap: 12px; padding: 10px 14px; font-size: 0.88rem; border-bottom: 1px solid var(--color-border); }
.mpc-restlist__li:last-child { border-bottom: none; }
.mpc-restlist__li:nth-child(odd) { background: var(--color-bg-alt); }
.mpc-restlist__no { flex: 0 0 auto; width: 24px; height: 24px; border-radius: 50%; background: var(--color-primary-soft); color: var(--color-primary); font-size: 0.72rem; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; }
.mpc-restlist__txt { display: flex; flex-direction: column; gap: 1px; min-width: 0; }
.mpc-restlist__name { font-weight: 600; color: var(--color-text); }
.mpc-restlist__sub { font-size: 0.72rem; color: var(--color-text-muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mpc-restlist__loading, .mpc-restlist__empty { font-size: 0.86rem; color: var(--color-text-muted); padding: 16px 14px; text-align: center; }

/* Sticky save-order bar (list page inline drag; the arrange page uses the
   top Save button instead) */
.mpc-reorderbar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 14px; background: var(--color-text, #0f172a); color: #fff; padding: 10px 14px; border-radius: 999px; box-shadow: 0 10px 28px rgba(15, 23, 42, .28); }
.mpc-reorderbar__msg { font-size: 0.85rem; font-weight: 600; }
.mpc-reorderbar__act { display: flex; gap: 8px; }

/* Arrange page — up/down move arrows + the moved-row flash */
.mpc-movewrap { display: inline-flex; flex-direction: column; gap: 3px; }
.mpc-move { width: 32px; height: 22px; border: 1px solid var(--color-border); background: #fff; border-radius: 7px; cursor: pointer; color: var(--color-text-muted); font-size: 0.66rem; line-height: 1; display: inline-flex; align-items: center; justify-content: center; }
.mpc-move:hover { border-color: var(--color-primary); color: var(--color-primary); background: var(--color-primary-soft); }
.mpc-move:active { transform: translateY(1px); }
.mpc-list--arrange .pr-item { transition: background .25s ease, box-shadow .25s ease; }
.mpc-list--arrange .pr-item.is-moved { background: var(--color-primary-soft); box-shadow: 0 0 0 2px var(--color-primary) inset; }

/* Mobile (PWA): compact cards + a filters bottom-sheet */
@media (max-width: 720px) {
    /* Toolbar: search fills the row, filter button sits beside it. */
    .pr-toolbar { gap: 10px; }
    .pr-filter { width: 100%; gap: 8px; flex-wrap: nowrap; }
    .pr-search { flex: 1 1 auto; max-width: none; }
    .pr-filterbtn { display: inline-flex; align-items: center; justify-content: center; position: relative; flex: 0 0 auto; width: 44px; height: 42px; border: 1px solid var(--color-border); border-radius: 10px; background: #fff; color: var(--color-text-muted); cursor: pointer; }
    .pr-filterbtn__dot { position: absolute; top: 6px; right: 6px; width: 8px; height: 8px; border-radius: 50%; background: var(--color-primary); }

    /* Filters open as a FULL-SCREEN sheet so the category dropdown has room. */
    .pr-filters { display: none; }
    .pr-filters.is-open { display: flex; flex-direction: column; align-items: stretch; gap: 14px; position: fixed; inset: 0; z-index: 66; background: #fff; padding: 18px 16px calc(18px + env(safe-area-inset-bottom, 0px)); overflow-y: auto; overflow-x: hidden; }
    .pr-filters__head { display: flex; align-items: center; justify-content: space-between; padding-bottom: 4px; border-bottom: 1px solid var(--color-border-soft); }
    .pr-filters__ttl { font-size: 1.15rem; font-weight: 800; }
    .pr-filters__x { border: none; background: var(--color-bg-alt); width: 34px; height: 34px; border-radius: 50%; cursor: pointer; font-size: 0.95rem; }
    .pr-filters__done { display: block; width: 100%; margin-top: auto; }
    .pr-filters .pr-catdd, .pr-filters .pr-filter-sel { width: 100%; }
    .pr-filter-sel { padding: 12px 12px; font-size: 0.95rem; }
    .pr-catdd__btn { max-width: none; width: 100%; justify-content: space-between; padding: 12px; font-size: 0.95rem; }
    /* Inside the full-screen sheet the category panel flows inline (no overlay)
       so it can never clip or break. */
    .pr-catdd__panel { position: static; width: auto; max-width: none; box-shadow: none; border: 1px solid var(--color-border); margin-top: 8px; }
    .pr-catdd__list { max-height: 46vh; }

    /* Action bar wraps; nothing pushed off-screen (price is a modal). */
    .pr-actionbar__right { margin-left: 0; width: 100%; flex-wrap: wrap; }
    .pr-actionbar__right > * { flex: 1 1 auto; }

    /* Mobile uses auto-scroll pagination instead of the bottom pager. */
    .pr-pager { display: none; }

    /* Compact product card: name row with a direct View (top-right), a tight
       3-price row, then a smaller status select with the marketplace switch
       beside it. */
    .pr-item { position: relative; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 12px; padding: 14px; border-radius: 16px; box-shadow: 0 1px 4px rgba(15, 23, 42, .05); }
    .pr-item__main { width: 100%; flex: 0 0 auto; align-items: center; padding-right: 40px; }
    .pr-item__name { font-size: 0.98rem; flex: 1 1 auto; }
    /* View as a direct icon button, top-right of the card. */
    .pr-item__act--inline { display: none; }
    .pr-item__act--top { display: inline-flex; position: absolute; top: 12px; right: 12px; }
    .pr-item__act--top .ly-iconbtn { width: 34px; height: 34px; border-radius: 9px; }
    .pr-item__controls { width: 100%; gap: 10px; align-items: flex-start; }
    /* Row 1 — the 3 prices (basis 30% so they fill the row and force row 2 down). */
    .pr-price { flex: 1 1 30%; min-width: 0; }
    .pr-price__box { width: 100%; justify-content: center; }
    .pr-priceinput { width: 100%; }
    .pr-price__lbl { font-size: 0.62rem; }
    /* Row 2 — status dropdown (grows) + marketplace switch, on their own line. */
    .pr-item__row2 { flex: 1 1 100%; display: flex; align-items: center; gap: 10px; }
    .pr-statuswrap { flex: 1 1 0; min-width: 0; }
    .pr-status { max-width: none; width: 100%; }
    .pr-mp { flex: 0 0 auto; padding: 4px 12px; border: 1px solid var(--color-border); border-radius: 12px; background: var(--color-bg-alt); }
    .pr-mp__lbl { font-size: 0.58rem; }
}
/* Modals open FULL-SCREEN on phones (assign / restaurants / price / etc). */
@media (max-width: 720px) {
    .pr-modal { align-items: stretch; padding: 0; }
    .pr-modal__panel { width: 100%; max-width: 100%; height: 100%; max-height: 100%; border-radius: 0; display: flex; flex-direction: column; }
    .pr-modal__panel { padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); }
    .pr-modal__foot { margin-top: auto; }
    /* The scrollable lists fill the taller screen. */
    .mpc-restlist { max-height: 62vh; }
    .mpc-sellist { max-height: 48vh; }
    /* Small confirm dialogs stay a centered compact card (full-screen would be odd). */
    .pr-modal__panel--sm { align-self: center; height: auto; max-height: 88vh; width: calc(100% - 32px); border-radius: 16px; margin: auto 16px; padding-bottom: 22px; }
    .pr-modal__panel--sm .pr-modal__foot { margin-top: 16px; }
}

/* ── Marketplace categories — mobile (PWA) ── */
@media (max-width: 720px) {
    /* Restaurant filter is a normal full-width row inside the (column) sheet.
       NOTE: flex-basis here is the COLUMN main axis (height) — never 100%, or
       the box stretches to the full screen height. */
    [data-mpc-root] .mpc-ac--filter, .pr-filters .mpc-ac--filter { flex: 0 0 auto; max-width: none; width: 100%; }
    /* AC results drop BELOW the input (full width). .mpc-ac is a flex row, so
       a static panel would sit beside the input — keep it absolute. */
    .pr-filters .mpc-ac__panel { position: absolute; top: calc(100% + 4px); left: 0; right: 0; max-height: 52vh; }
    /* No top-right View button on category cards → no reserved space. */
    [data-mpc-root] .pr-item__main { padding-right: 0; }
    /* Status grows; the 3 action buttons take their own full-width row. */
    [data-mpc-root] .pr-statuswrap { flex: 1 1 auto; }
    [data-mpc-root] .pr-item__act { display: flex; gap: 8px; flex: 1 1 100%; }
    [data-mpc-root] .pr-item__act .ly-iconbtn { flex: 1 1 0; width: auto; }
    /* Drag handle sits at the top-left with the sort number. */
    .mpc-drag { align-self: flex-start; }
    /* Save-order bar spans the width above the bottom nav. */
    .mpc-reorderbar { left: 10px; right: 10px; transform: none; bottom: 74px; justify-content: space-between; }
}

/* ───────────────────────── Collections + Featured ─────────────────────────
   Curated home-feed rows (collections) + paid placements (featured). Reuses
   the .pr-* list + .ly-* form chrome; these are the bespoke bits (restaurant
   picker autocomplete, ordered chips, status pills). */
.ly-field--full { grid-column: 1 / -1; }

/* Restaurant autocomplete (form picker + featured single-pick). */
.col-ac { position: relative; display: flex; align-items: center; width: 100%; border: 1px solid var(--color-border); border-radius: 10px; background: #fff; padding: 0 10px; }
.col-ac__ic { font-size: 0.9rem; opacity: .7; flex: 0 0 auto; }
.col-ac__input { flex: 1 1 auto; min-width: 0; font: inherit; font-size: 0.88rem; border: none; outline: none; background: transparent; padding: 11px 6px; }
.col-ac__clear { border: none; background: transparent; color: var(--color-text-muted); cursor: pointer; font-size: 0.85rem; padding: 2px 4px; }
.col-ac__clear:hover { color: var(--color-danger, #e11d48); }
.col-ac__panel { position: absolute; top: calc(100% + 4px); left: 0; right: 0; z-index: 40; background: #fff; border: 1px solid var(--color-border); border-radius: 12px; box-shadow: 0 10px 30px rgba(15, 23, 42, .12); max-height: 280px; overflow-y: auto; padding: 4px; }
.col-ac__item { display: flex; flex-direction: column; gap: 1px; width: 100%; text-align: left; border: none; background: transparent; font: inherit; padding: 9px 10px; border-radius: 8px; cursor: pointer; color: var(--color-text); }
.col-ac__item:hover { background: var(--color-primary-soft); }
.col-ac__name { font-size: 0.9rem; font-weight: 600; }
.col-ac__detail { font-size: 0.74rem; color: var(--color-text-muted); }

/* Ordered, draggable picked restaurants. */
.col-picklist { display: flex; flex-direction: column; gap: 6px; margin-top: 10px; }
.col-pick { display: flex; align-items: center; gap: 10px; background: var(--color-bg-alt, #f8fafc); border: 1px solid var(--color-border); border-radius: 10px; padding: 8px 10px; }
.col-pick.is-dragging { opacity: .5; }
.col-pick__drag { cursor: grab; color: var(--color-text-muted); font-size: 1.15rem; line-height: 1; user-select: none; touch-action: none; }
.col-pick__drag:active { cursor: grabbing; }
.col-pick__body { display: flex; flex-direction: column; gap: 1px; flex: 1 1 auto; min-width: 0; }
.col-pick__name { font-size: 0.9rem; font-weight: 600; }
.col-pick__detail { font-size: 0.74rem; color: var(--color-text-muted); }
.col-pick__x { border: none; background: transparent; color: var(--color-text-muted); cursor: pointer; font-size: 0.9rem; padding: 4px 6px; border-radius: 6px; }
.col-pick__x:hover { color: var(--color-danger, #e11d48); background: var(--color-primary-soft); }
.col-pick-empty { margin-top: 8px; }

/* List sub-text (subtitle + meta) + cover thumbnail. */
.col-sub { display: block; margin-top: 2px; }
.col-sub__line { display: block; font-size: 0.78rem; color: var(--color-text-muted); }
.col-sub__meta { display: block; font-size: 0.74rem; color: var(--color-text-muted); }
.col-cover img { object-fit: cover; }

/* Arrange page drag hint + save bar (reuses the reorderbar look). */
.col-draghint { margin: 0 0 8px; font-size: 0.8rem; color: var(--color-text-muted); }
.col-list--drag .pr-item { cursor: default; }
.col-list--drag .pr-item.is-dragging { opacity: .5; }
.col-reorderbar { position: fixed; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 60; display: flex; align-items: center; gap: 14px; background: var(--color-text, #0f172a); color: #fff; padding: 10px 14px; border-radius: 999px; box-shadow: 0 10px 28px rgba(15, 23, 42, .28); }
.col-reorderbar__msg { font-size: 0.85rem; font-weight: 600; }
.col-reorderbar__act { display: flex; gap: 8px; }

/* Featured status pill. */
.feat-badge { display: inline-block; font-size: 0.72rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; }
.feat-badge--live { background: #dcfce7; color: #15803d; }
.feat-badge--off { background: #f1f5f9; color: #64748b; }

/* Community group type badge (Users vs Restaurants). */
.cm-tag { display: inline-block; font-size: 0.66rem; font-weight: 700; padding: 1px 7px; border-radius: 999px; margin-left: 6px; vertical-align: middle; text-transform: uppercase; letter-spacing: .02em; }
.cm-tag--user { background: #dbeafe; color: #1d4ed8; }
.cm-tag--restaurant { background: #fef3c7; color: #b45309; }

/* ── Community feed (admin posts + moderation) ─────────────────────── */
.cavatar { flex: 0 0 auto; width: 38px; height: 38px; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; font-size: .95rem; }
.cavatar--sm { width: 28px; height: 28px; font-size: .78rem; }
.cavatar--t0 { background: #E5252A; } .cavatar--t1 { background: #F4A100; } .cavatar--t2 { background: #14A35E; }
.cavatar--t3 { background: #2E7CF6; } .cavatar--t4 { background: #8B5CF6; } .cavatar--t5 { background: #EC4899; } .cavatar--t6 { background: #0EA5A5; }

.cf-compose { background: #fff; border: 1px solid var(--color-border, #e5e7eb); border-radius: 12px; padding: 12px; margin-bottom: 16px; }
.cf-compose__text { width: 100%; border: none; resize: vertical; font: inherit; min-height: 46px; outline: none; }
.cf-compose__bar { display: flex; align-items: center; justify-content: space-between; border-top: 1px solid #f1f1f1; padding-top: 8px; margin-top: 6px; }
.cf-compose__photo { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; color: #6b6b6b; font-weight: 600; font-size: .85rem; padding: 6px 8px; border-radius: 6px; }
.cf-compose__photo:hover { background: #f7f7f8; color: #e5252a; }
.cf-compose__preview { position: relative; margin: 8px 0; border-radius: 10px; overflow: hidden; max-width: 320px; }
.cf-compose__preview img { width: 100%; max-height: 240px; object-fit: cover; display: block; }
.cf-compose__preview-x { position: absolute; top: 6px; right: 6px; width: 26px; height: 26px; border: none; border-radius: 50%; background: rgba(0,0,0,.6); color: #fff; cursor: pointer; }
.cf-comment-block { display: flex; flex-direction: column; gap: 8px; }
.cf-comment-replies { margin-left: 36px; display: flex; flex-direction: column; gap: 8px; }
.cf-comment-replies:empty { display: none; }
.cf-comment__reply { align-self: flex-start; margin-left: 36px; border: none; background: transparent; color: #6b6b6b; font-size: .76rem; font-weight: 700; cursor: pointer; padding: 0; }
.cf-comment__reply:hover { color: #e5252a; }
.cf-compose--reply { margin-left: 36px; }
.cf-compose--cmt { display: flex; gap: 8px; align-items: center; padding: 8px 0 0; margin: 0; border: none; }
.cf-compose--cmt input { flex: 1; border: 1px solid #e5e7eb; border-radius: 999px; padding: 7px 13px; font: inherit; outline: none; }

.cf-list { display: flex; flex-direction: column; gap: 14px; }
.cf-post { background: #fff; border: 1px solid var(--color-border, #e5e7eb); border-radius: 12px; padding: 12px 14px; }
.cf-post__head { display: flex; align-items: center; gap: 10px; }
.cf-post__meta { display: flex; flex-direction: column; line-height: 1.2; flex: 1; }
.cf-post__author { font-weight: 700; font-size: .9rem; display: inline-flex; align-items: center; gap: 6px; }
.cf-post__time { font-size: .72rem; color: #9a9a9a; }
.cf-post__body { margin: 10px 0 0; white-space: pre-wrap; word-break: break-word; font-size: .92rem; }
.cf-post__media { margin: 10px -14px 0; }
.cf-post__media img { width: 100%; max-height: 420px; object-fit: cover; display: block; }
.cf-post__stats { font-size: .74rem; color: #9a9a9a; padding: 10px 0 6px; }
.cf-post__actions { border-top: 1px solid #f1f1f1; padding-top: 6px; }
.cf-act { border: none; background: transparent; cursor: pointer; font: inherit; font-weight: 600; color: #6b6b6b; padding: 6px 8px; border-radius: 6px; }
.cf-act:hover { background: #f7f7f8; }
.cf-del { border: none; background: transparent; cursor: pointer; font-size: .95rem; opacity: .6; padding: 4px 6px; border-radius: 6px; }
.cf-del:hover { opacity: 1; background: #fee2e2; }
.cf-del--sm { font-size: .8rem; }
.cf-comments { border-top: 1px solid #f1f1f1; margin-top: 6px; padding-top: 10px; }
.cf-commentlist { display: flex; flex-direction: column; gap: 10px; }
.cf-comment { display: flex; gap: 8px; align-items: flex-start; }
.cf-comment__bubble { background: #f7f7f8; border-radius: 12px; padding: 7px 11px; flex: 1; }
.cf-comment__author { font-weight: 700; font-size: .78rem; margin-right: 6px; }
.cf-comment__text { font-size: .84rem; white-space: pre-wrap; word-break: break-word; }
.cf-comment__time { display: block; font-size: .66rem; color: #9a9a9a; margin-top: 2px; }
.cf-loading { font-size: .8rem; color: #9a9a9a; padding: 4px 0; }
.cf-more { text-align: center; margin-top: 16px; }

/* Feed Order page — section icon + show/hide toggle. */
.fo-ic { font-size: 1.3rem; }
.fo-toggle { display: inline-flex; align-items: center; gap: 6px; font-size: 0.85rem; cursor: pointer; color: var(--color-text-muted); }
.fo-toggle input { cursor: pointer; }
/* Fixed (non-reorderable) rows — My Favourites (top) + Top restaurants (bottom). */
.fo-fixed { opacity: 0.7; background: var(--color-bg-alt, #f8fafc); }
.fo-lock { font-size: 0.95rem; padding: 0 4px; cursor: not-allowed; color: var(--color-text-muted); }

@media (max-width: 899px) {
    .col-reorderbar { left: 10px; right: 10px; transform: none; bottom: 74px; justify-content: space-between; }
}
