/* items3d module: Catalog tab, catalog cards, drag ghost, product details and the open / deploy controls.
   Every rule is prefixed with .items3d- and uses the core colour tokens, so light and dark both work. */

.items3d-panel { display: block; }
.items3d-intro { font-size: 12.5px; margin: 2px 0 8px; }
.items3d-count { font-size: 12px; white-space: nowrap; }
.items3d-small { font-size: 12px; line-height: 1.4; margin: 6px 0 0; }
.items3d-label { font-size: 11.5px; color: var(--vb-muted); }

/* filters */
.items3d-filters { display: grid; gap: 6px; margin: 0 0 8px; }
.items3d-filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.items3d-toggle { padding: 6px 11px; border-radius: 999px; border: 1px solid var(--vb-border); background: var(--vb-surface); color: var(--vb-text); font: inherit; font-size: 12.5px; font-weight: 600; cursor: pointer; white-space: nowrap; }
.items3d-toggle:hover { background: var(--vb-surface-2); }
.items3d-toggle[aria-pressed="true"] { background: var(--vb-accent); border-color: var(--vb-accent); color: var(--vb-on-accent, #fff); }
.items3d-mount { flex: 1 1 110px; min-width: 0; }

/* groups */
.items3d-group { border: 1px solid var(--vb-border); border-radius: var(--vb-radius); background: var(--vb-surface); margin-top: 8px; }
.items3d-group.is-ultra { border-color: var(--vb-accent); }
.items3d-group-head { display: flex; align-items: center; gap: 8px; width: 100%; padding: 11px 12px; border: 0; background: none; color: var(--vb-text); font: inherit; font-size: 14px; font-weight: 700; text-align: left; cursor: pointer; border-radius: var(--vb-radius); }
.items3d-group-head:hover { background: var(--vb-surface-2); }
.items3d-group-name { flex: 1 1 auto; min-width: 0; }
.items3d-group.is-ultra .items3d-group-name { color: var(--vb-accent); }
.items3d-group-count { flex: none; min-width: 24px; padding: 1px 7px; border-radius: 999px; background: var(--vb-surface-2); color: var(--vb-muted); font-size: 11.5px; font-weight: 600; text-align: center; }
.items3d-group-body { padding: 0 8px 10px; }
.items3d-group-body[hidden] { display: none; }
.items3d-sub { margin: 12px 2px 6px; font-size: 11px; font-weight: 700; letter-spacing: 0.06em; text-transform: uppercase; color: var(--vb-muted); }
.items3d-sub:first-child { margin-top: 4px; }
.items3d-more { margin-top: 10px; }

/* cards */
.items3d-card { position: relative; padding: 9px; cursor: grab; }
.items3d-card + .items3d-card { margin-top: 7px; }
.items3d-card.is-nofit { border-style: dashed; }
.items3d-card.is-attached { border-color: var(--vb-accent); box-shadow: inset 0 0 0 1px var(--vb-accent); }
.items3d-card-top { display: flex; align-items: flex-start; gap: 9px; }
.items3d-card-main { flex: 1 1 auto; min-width: 0; }
.items3d-thumb { flex: none; width: 66px; height: 66px; padding: 0; border: 1px solid var(--vb-border); border-radius: 9px; overflow: hidden; cursor: pointer; background: var(--vb-surface-2); background: linear-gradient(145deg, var(--vb-surface-2), color-mix(in srgb, var(--items3d-c, #b9a58a) 26%, var(--vb-surface-2))); }
.items3d-thumb:hover { border-color: var(--vb-accent); }
.items3d-thumb-img { display: block; width: 100%; height: 100%; object-fit: contain; pointer-events: none; -webkit-user-drag: none; }
.items3d-thumb-img[hidden] { display: none; }
.items3d-name { display: block; width: 100%; padding: 0; border: 0; background: none; color: var(--vb-text); font: inherit; font-size: 13px; font-weight: 700; line-height: 1.25; text-align: left; cursor: pointer; overflow-wrap: anywhere; }
.items3d-name:hover { color: var(--vb-accent); }
.items3d-brand { font-size: 11.5px; line-height: 1.3; margin-top: 2px; display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.items3d-chips { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 6px; }
.items3d-chips .vb-chip { font-size: 11px; padding: 2px 7px; white-space: nowrap; }
.items3d-chip-power { color: var(--vb-text); }
.items3d-chip-water { color: var(--vb-select); }
.items3d-chip-warn { background: var(--vb-warn-bg); color: var(--vb-warn-text); }
.items3d-grip { flex: none; display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 36px; margin: -3px -4px 0 0; padding: 0; border: 0; border-radius: 8px; background: none; color: var(--vb-muted); cursor: grab; touch-action: none; transform: rotate(90deg); }
.items3d-grip:hover { background: var(--vb-surface-2); color: var(--vb-text); }
.items3d-pop { display: flex; align-items: flex-start; gap: 7px; margin-top: 8px; font-size: 11.5px; line-height: 1.35; color: var(--vb-muted); }
.items3d-badge { flex: none; display: inline-flex; align-items: center; gap: 4px; padding: 2px 7px; border-radius: 999px; background: var(--vb-surface-2); background: color-mix(in srgb, var(--vb-accent) 16%, transparent); color: var(--vb-accent); font-size: 11px; font-weight: 700; }
.items3d-pop-note { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.items3d-card-foot { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 8px; margin-top: 9px; }
.items3d-price { font-size: 13px; }
.items3d-price small { font-size: 11px; }
.items3d-actions { display: flex; align-items: center; gap: 6px; margin-left: auto; }

/* dragging a card into the van */
.items3d-ghost { position: fixed; left: 0; top: 0; z-index: 2000; max-width: 230px; display: grid; gap: 1px; padding: 7px 10px; border-radius: 9px; border: 1px solid var(--vb-border); background: var(--vb-surface); color: var(--vb-text); box-shadow: var(--vb-shadow, 0 6px 24px rgba(0, 0, 0, 0.2)); font-size: 12px; pointer-events: none; opacity: 0.94; }
.items3d-ghost strong { font-size: 12.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.items3d-ghost span { color: var(--vb-muted); }
.items3d-ghost.is-over { border-color: var(--vb-accent); box-shadow: 0 0 0 2px var(--vb-accent), var(--vb-shadow, 0 6px 24px rgba(0, 0, 0, 0.2)); }
body.items3d-dragging, body.items3d-dragging * { cursor: grabbing !important; user-select: none !important; -webkit-user-select: none !important; }

/* details dialog */
.items3d-detail { display: grid; gap: 12px; }
.items3d-detail-pic { display: flex; align-items: center; justify-content: center; height: 200px; border-radius: var(--vb-radius); border: 1px solid var(--vb-border); }
.items3d-detail-img { max-width: 100%; height: 192px; object-fit: contain; }
.items3d-detail-img[hidden] { display: none; }
.items3d-detail-buy { display: flex; justify-content: flex-start; }
.items3d-detail-buy:empty { display: none; }

/* product facts (dialog and inspector) */
.items3d-kv { margin-top: 10px; font-size: 12.5px; }
.items3d-kv dd { overflow-wrap: anywhere; }
.items3d-notes { margin: 10px 0 0; font-size: 12.5px; line-height: 1.45; overflow-wrap: anywhere; }
.items3d-popnote { font-size: 12.5px; line-height: 1.4; }
.items3d-srcwrap { margin-top: 10px; }
.items3d-sources { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 4px 12px; font-size: 12.5px; }
.items3d-sources a { display: inline-flex; align-items: center; gap: 3px; overflow-wrap: anywhere; }

/* inspector controls */
.items3d-open.is-on { border-color: var(--vb-accent); color: var(--vb-accent); }
.items3d-clear { font-size: 12.5px; line-height: 1.4; }
.items3d-clear-ok { color: var(--vb-ok, #1f8a4c); }
.items3d-look .vb-row { gap: 6px; }
.items3d-matrow .vb-select { width: 160px; max-width: 62%; }
.items3d-matrow[hidden] { display: none; }
.items3d-resize { margin-top: 10px; padding: 8px 10px; border-radius: 8px; background: var(--vb-surface-2); display: grid; gap: 4px; }
.items3d-range { width: 100%; accent-color: var(--vb-accent); height: 28px; }
.items3d-scale-out { font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums; }

@media (max-width: 860px), (max-width: 960px) and (max-height: 500px) {
  .items3d-thumb { width: 72px; height: 72px; }
  .items3d-name { font-size: 14px; }
  .items3d-toggle { padding: 9px 13px; font-size: 13.5px; }
  .items3d-group-head { padding: 13px 12px; font-size: 15px; }
  .items3d-grip { width: 40px; height: 44px; }
  .items3d-actions .vb-btn, .items3d-actions .vb-buy { min-height: 38px; padding-left: 13px; padding-right: 13px; }
  .items3d-range { height: 36px; }
  .items3d-detail-pic { height: 170px; }
  .items3d-detail-img { height: 160px; }
}
