/* ─────────────────────────────────────────────────────────────────────────
   Owner-side catalog: /my/catalog (manage list) and /my/catalog/* (editor).
   Buyer-facing catalog styles stay in commerce.css — nothing here is used by
   a signed-out visitor.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Manage list ──────────────────────────────────────────────────────── */
.mc-head-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.mc-head-actions .btn.disabled { opacity: .5; pointer-events: none; }

.mc-plan-row { display: flex; align-items: center; gap: 13px; }
.mc-plan-ic {
  width: 38px; height: 38px; border-radius: 11px; flex-shrink: 0;
  background: var(--accent-soft); color: var(--accent-2); display: grid; place-items: center;
}
.mc-plan-ic svg { width: 18px; height: 18px; }
.mc-plan-tx { flex: 1; min-width: 0; }
.mc-plan-name { font-weight: 800; color: var(--ink); font-size: 14px; }
.mc-plan-sub { font-size: 12.5px; color: var(--muted); margin-top: 2px; }

.mc-usage { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.mc-usage-top { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--muted); margin-bottom: 6px; }
.mc-usage-top b { color: var(--ink); font-variant-numeric: tabular-nums; }
.mc-bar { height: 6px; border-radius: 999px; background: var(--divider); overflow: hidden; }
.mc-bar span { display: block; height: 100%; background: var(--accent); border-radius: 999px; }
.mc-bar span.full { background: var(--red); }

.mc-group { margin-bottom: 18px; }
.mc-row { display: flex; align-items: center; gap: 14px; padding: 14px 18px; border-top: 1px solid var(--divider); }
.mc-row:first-child { border-top: none; }
.mc-thumb {
  width: 62px; height: 62px; border-radius: var(--r-sm); overflow: hidden; flex-shrink: 0;
  background: var(--bg-2); display: grid; place-items: center; color: var(--subtle);
}
.mc-thumb img { width: 100%; height: 100%; object-fit: cover; }
.mc-thumb .ph svg { width: 22px; height: 22px; }
.mc-tx { flex: 1; min-width: 0; }
.mc-name { font-weight: 700; color: var(--ink); font-size: 14.5px; }
.mc-sub { font-size: 12.5px; color: var(--muted); margin-top: 3px; }
.mc-price { font-weight: 800; color: var(--accent-2); }
.mc-price.enquire { color: var(--muted); font-weight: 600; }
.mc-badges { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.mc-actions { display: flex; gap: 8px; flex-shrink: 0; flex-wrap: wrap; justify-content: flex-end; }

@media (max-width: 720px) {
  .mc-usage { grid-template-columns: 1fr; }
  .mc-row { flex-wrap: wrap; }
  .mc-actions { width: 100%; justify-content: flex-start; }
}

/* ── Editor ───────────────────────────────────────────────────────────── */
.wrap-form { max-width: 860px; }

.ed-section { margin-bottom: 18px; }
.ed-head { margin-bottom: 16px; }
.ed-title { font-size: 16px; font-weight: 800; color: var(--ink); letter-spacing: -.015em; }
.ed-sub { font-size: 13px; color: var(--muted); margin-top: 4px; line-height: 1.5; }

.field-count { float: right; font-weight: 600; letter-spacing: 0; text-transform: none; color: var(--subtle); }

/* Chip-style single-select. Mirrors the app's choice chips: the whole row is
   the control, and the pressed state is the value. */
.chip-choices { display: flex; flex-wrap: wrap; gap: 8px; }
.choice {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 700;
  background: var(--paper); color: var(--body); border: 1.5px solid var(--hairline);
  cursor: pointer; transition: border-color .12s, background .12s, color .12s;
}
.choice:hover:not(:disabled) { background: var(--bg-2); }
.choice.on {
  border-color: var(--accent); color: var(--accent-2);
  background: color-mix(in srgb, var(--accent) 7%, var(--paper));
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.choice svg { width: 13px; height: 13px; }
.chip-x {
  display: inline-grid; place-items: center; width: 16px; height: 16px; margin-left: 2px;
  border-radius: 50%; background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent-2);
}
.chip-x svg { width: 10px; height: 10px; }

/* ── Media ────────────────────────────────────────────────────────────── */
.media-actions { display: flex; gap: 9px; flex-wrap: wrap; }
.media-left { margin-top: 10px; }
.media-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr));
  gap: 12px; margin-top: 14px;
}
.media-tile {
  position: relative; aspect-ratio: 1; border-radius: var(--r-md); overflow: hidden;
  background: var(--bg-2); border: 1px solid var(--hairline);
  display: grid; place-items: center; color: var(--subtle);
}
.media-tile.pending { border-style: dashed; border-color: var(--accent); }
.media-tile img { width: 100%; height: 100%; object-fit: cover; }
.media-tile .ph svg { width: 28px; height: 28px; }
.media-x {
  position: absolute; top: 6px; right: 6px; width: 24px; height: 24px; border-radius: 50%;
  background: rgba(21,17,13,.72); color: #fff; display: grid; place-items: center; cursor: pointer;
}
.media-x svg { width: 12px; height: 12px; }
.media-tag {
  position: absolute; left: 6px; bottom: 6px; max-width: calc(100% - 12px);
  padding: 3px 8px; border-radius: 999px; background: rgba(21,17,13,.72); color: #fff;
  font-size: 10.5px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.doc-tile {
  display: flex; align-items: center; gap: 12px; margin-top: 14px; padding: 13px 15px;
  border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-2);
}
.doc-ic {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--paper); color: var(--accent-2); display: grid; place-items: center;
}
.doc-ic svg { width: 17px; height: 17px; }
.doc-tx { flex: 1; min-width: 0; }
.doc-name { font-weight: 700; color: var(--ink); font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ── Variations ───────────────────────────────────────────────────────── */
.var-rows { display: flex; flex-direction: column; gap: 10px; }
.var-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-2);
}
.var-row.off { opacity: .6; }
.var-move { display: flex; flex-direction: column; gap: 2px; flex-shrink: 0; }
.var-mv { width: 22px; height: 18px; display: grid; place-items: center; color: var(--muted); cursor: pointer; }
.var-mv:disabled { color: var(--subtle); opacity: .4; cursor: not-allowed; }
.var-mv svg { width: 13px; height: 13px; }
.var-tx { flex: 1; min-width: 0; }
.var-label { font-weight: 700; color: var(--ink); font-size: 13.5px; }
.var-meta { font-size: 12px; color: var(--muted); margin-top: 2px; }

.var-pool { display: grid; grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)); gap: 9px; margin-top: 10px; }
.var-pick {
  position: relative; aspect-ratio: 1; border-radius: var(--r-sm); overflow: hidden; cursor: pointer;
  background: var(--bg-2); border: 2px solid transparent; display: grid; place-items: center; color: var(--subtle);
}
.var-pick img { width: 100%; height: 100%; object-fit: cover; }
.var-pick.on { border-color: var(--accent); box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 14%, transparent); }
.var-pick-tag {
  position: absolute; left: 4px; bottom: 4px; padding: 2px 6px; border-radius: 999px;
  background: rgba(21,17,13,.72); color: #fff; font-size: 9.5px; font-weight: 700;
}

/* ── Location ─────────────────────────────────────────────────────────── */
.loc-row {
  display: flex; align-items: center; gap: 13px; padding: 14px 15px; flex-wrap: wrap;
  border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-2);
}
.loc-ic {
  width: 36px; height: 36px; border-radius: 10px; flex-shrink: 0;
  background: var(--paper); color: var(--accent-2); display: grid; place-items: center;
}
.loc-ic svg { width: 17px; height: 17px; }
.loc-tx { flex: 1; min-width: 160px; }
.loc-title { font-weight: 700; color: var(--ink); font-size: 13.5px; }
.loc-sub { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.45; }

/* Touch targets. Same convention as app.css: a transparent ::after gives a
   small icon button a 44px hit area, and paired buttons only grow along the
   axis they aren't paired on — .var-mv is a vertical pair, so it grows sideways. */
@media (pointer: coarse) {
  .media-x, .var-mv { position: relative; }
  .media-x::after {
    content: ""; position: absolute; top: 50%; left: 50%;
    width: 44px; height: 44px; transform: translate(-50%, -50%);
  }
  .var-mv::after {
    content: ""; position: absolute; top: 0; bottom: 0; left: 50%;
    width: 44px; transform: translateX(-50%);
  }
}

@media (max-width: 620px) {
  /* Three items on one row need ~360px of their own; below that the action
     buttons drop under the text rather than crushing the label. */
  .var-row, .doc-tile { flex-wrap: wrap; }
  .var-tx, .doc-tx { min-width: 140px; }
  .media-grid { grid-template-columns: repeat(auto-fill, minmax(92px, 1fr)); }
}

/* ── Save bar ─────────────────────────────────────────────────────────── */
.ed-bar {
  position: sticky; bottom: 0; z-index: 5;
  display: flex; justify-content: flex-end; gap: 10px; flex-wrap: wrap;
  padding: 14px 0 26px;
  background: linear-gradient(to top, var(--bg) 62%, transparent);
}

/* ─────────────────────────────────────────────────────────────────────────
   Post composer (/posts/new) and the professions editor (/my/professions).
   Both reuse the .ed-section / .chip-choices / .loc-row vocabulary above.
   ───────────────────────────────────────────────────────────────────────── */

/* ── Poll options ─────────────────────────────────────────────────────── */
.poll-opt { display: flex; align-items: center; gap: 10px; }
.poll-opt .input { flex: 1; min-width: 0; }
.poll-num {
  width: 24px; height: 24px; border-radius: 50%; flex-shrink: 0;
  background: var(--bg-2); color: var(--muted); display: grid; place-items: center;
  font-size: 12px; font-weight: 800; font-variant-numeric: tabular-nums;
}

/* A disabled plan-gated choice still reads as a real option, just locked —
   hiding it would hide the fact that a higher plan has more. */
.choice:disabled { opacity: .5; cursor: not-allowed; }
.choice:disabled svg { width: 11px; height: 11px; opacity: .8; }

/* ── Professions ──────────────────────────────────────────────────────── */
.prof-rows { display: flex; flex-direction: column; gap: 10px; }
.prof-row {
  display: flex; align-items: center; gap: 12px; padding: 12px 14px;
  border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--bg-2);
}
.prof-row.off { opacity: .62; }
.prof-row-ic {
  width: 34px; height: 34px; border-radius: 10px; flex-shrink: 0;
  background: var(--paper); color: var(--accent-2); display: grid; place-items: center;
}
.prof-row-ic svg { width: 16px; height: 16px; }
.prof-row-tx { flex: 1; min-width: 0; }
.prof-row-name { font-weight: 700; color: var(--ink); font-size: 14px; }
.prof-row-meta { font-size: 12px; color: var(--muted); margin-top: 2px; line-height: 1.45; }

.prof-pick { display: flex; flex-direction: column; gap: 6px; max-height: 54vh; overflow-y: auto; margin-top: 12px; }
.prof-pick-row {
  display: flex; align-items: center; gap: 12px; padding: 10px 12px; width: 100%; text-align: left;
  border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--paper); cursor: pointer;
  transition: border-color .12s, background .12s;
}
.prof-pick-row:hover { border-color: var(--accent); background: var(--bg-2); }
.prof-pick-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.prof-pick-name { font-weight: 700; color: var(--ink); font-size: 13.5px; }
.prof-pick-cat { font-size: 11.5px; color: var(--muted); }
.prof-pick-row .lr-go { color: var(--subtle); flex-shrink: 0; }
.prof-pick-row .lr-go svg { width: 15px; height: 15px; }

@media (max-width: 620px) {
  .prof-row { flex-wrap: wrap; }
  .prof-row-tx { min-width: 140px; }
}
