/* css/products.css — area D (Products and credits). Owned by area D during the build; every class
   carries the prefix .prod-. Shared components come only from css/sas.css; the
   lead folds this file into its AREA D section in phase (c).

   The products panel (js/views/products-panel.js), its dialog, credits.html and purchases.html. */

/* ----- The products panel ------------------------------------------------- */

.prod-body > * + * { margin-top: 15px; }

.prod-item {
  padding: 15px;
  background: var(--orc-white);
  border: var(--orc-rule-soft);
}

.prod-panel-bare .prod-item { border: var(--orc-rule); }

.prod-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
}

.prod-head .prod-icon { flex: none; }

.prod-name {
  margin: 0;
  font-size: 20px;
  line-height: 24px;
}

.prod-price {
  margin-left: auto;
  font-family: var(--orc-font-display);
  font-weight: 500;
  font-size: 16px;
  line-height: 21px;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

.prod-desc,
.prod-sample,
.prod-route { margin: 8px 0 0; }

.prod-sample { font-size: 14px; line-height: 17.5px; }

.prod-state > p { margin: 10px 0 0; }

.prod-status .chip { margin-right: 5px; }

.prod-reason,
.prod-norun,
.prod-stopped,
.prod-packs-off {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 10px 0 0;
}

.prod-reason .icon,
.prod-norun .icon,
.prod-stopped .icon,
.prod-packs-off .icon { margin-top: 1px; }

.prod-norun,
.prod-stopped,
.prod-none { margin: 0; }

.prod-none { font-style: italic; }

.prod-actions:not(:empty) { margin-top: 12px; }

.prod-msgs:not(:empty) { margin-top: 10px; }

.prod-msgs .msg { margin: 0; }

/* the inline spend panel (spend.js) sits on white here: ruled, as on the page */
.prod-spend .spend { background: var(--orc-page); }

.prod-dialog-lead { margin: 0 0 15px; }

/* ----- credits.html ------------------------------------------------------- */

.prod-paid { margin: 0 0 20px; }

.prod-paid .msg { margin: 0; }

.prod-paid .btn-row { margin-top: 10px; }

.prod-packs {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 20px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.prod-pack {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 20px;
  background: var(--orc-white);
  border: var(--orc-rule);
}

.prod-pack-credits {
  margin: 0;
  font-family: var(--orc-font-display);
  font-weight: 500;
  font-size: 24px;
  line-height: 28px;
}

.prod-pack-price {
  margin: 0;
  font-size: 20px;
  line-height: 24px;
  font-variant-numeric: tabular-nums;
}

.prod-pack-per {
  margin: 0;
  color: var(--sas-muted);
  font-variant-numeric: tabular-nums;
}

.prod-pack .btn-row { margin-top: auto; padding-top: 10px; }

.prod-pack .btn { min-width: 120px; justify-content: center; }

.prod-vat {
  max-width: 760px;
  margin-top: 30px;
}

.prod-vat p { margin: 0; }

.prod-vat p + p { margin-top: 10px; }

/* ----- purchases.html ----------------------------------------------------- */

.prod-tabpanel:focus { outline: 0; }

.prod-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 10px;
  margin: 0 0 15px;
}

.prod-filter label { font-weight: 700; }

.prod-filter .input { width: auto; }

.prod-what-sub {
  display: block;
  color: var(--sas-muted);
  font-size: 12px;
  line-height: 16px;
}

.prod-in { color: var(--sas-ok); }

.prod-cell-note {
  font-size: 12px;
  line-height: 16px;
  color: var(--sas-muted);
}

.prod-open { white-space: nowrap; }

.prod-pager { margin-top: 15px; }

.prod-updated {
  margin: 10px 0 0;
  color: var(--sas-muted);
  font-size: 12px;
  line-height: 16px;
}

@media (max-width: 479.98px) {
  .prod-price { margin-left: 0; width: 100%; }
  .prod-packs { grid-template-columns: 1fr; }
}

.prod-packs-off { margin: 15px 0 0; }

.prod-add-note { color: var(--sas-muted); }

.prod-add .prod-msgs:not(:empty) { margin-top: 10px; }

/* a message at the top of the panel, about a product without a row of its own */
.prod-body > .prod-panel-msgs:first-child { margin-top: 0; }

/* purchases.html: Open and, when the file can't be opened, why */
.prod-file {
  display: inline-flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 5px;
}

.prod-cell-msgs:empty { display: none; }

.prod-cell-msgs .msg { margin: 0; font-size: 12px; line-height: 16px; }
