/* The shop and the provisioner.
 *
 * One of the stylesheets split out of the old style.css. index.html links them
 * in the order they had in that file, so the cascade is unchanged - keep
 * that order when adding a rule, or a later sheet may win where it used to lose. */

/* ---------- Shop & Equipment Items ---------- */

.shop-modal {
  width: min(1180px, calc(var(--safe-vw) * .96));
}

.shop-modal-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  border-bottom: 1px solid rgba(200, 153, 72, 0.3);
  padding-bottom: 8px;
  margin-bottom: 12px;
}

.shop-header-title-block {
  display: flex;
  align-items: baseline;
  gap: 16px;
  flex-wrap: wrap;
}

.shop-header-title-block h2 {
  margin: 0;
  border-bottom: none;
  padding-bottom: 0;
  font-size: 20px;
}

.shop-gold-display {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.shop-close-btn {
  min-width: 0 !important;
  min-height: 32px !important;
  padding: 4px 12px !important;
  font-size: 11px !important;
}

.shop-modal-body {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  align-items: start;
}

.shop-col-wares,
.shop-col-arms {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

@media (max-width: 1000px) {
  .shop-modal-body {
    grid-template-columns: 1fr;
  }
}

@media (max-height: 500px) {
  .shop-modal-body { grid-template-columns: 1fr; }
}

.shop-section-title,
.modal-section-title {
  margin: 10px 0 8px;
  color: #cdb07a;
  font-size: 13px;
}

.shop-section-title:first-of-type { margin-top: 12px; }
.shop-empty { margin: 8px 0 12px; }

.shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 10px;
  margin-bottom: 4px;
  background: var(--row);
}

.shop-item-sell {
  margin-top: 14px;
  border-top: 1px solid var(--rule);
  padding-top: 12px;
}

.item-thumb {
  width: 44px;
  height: 44px;
  background: rgba(0, 0, 0, 0.25);
  border-radius: 2px;
  padding: 2px;
  flex-shrink: 0;
}

.shop-item-info {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 2px;
  text-align: left;
}

.shop-item-info strong {
  color: #fff0c9;
  font-size: 14px;
}

.shop-item-info small {
  color: var(--muted);
  font-size: 11px;
}

.shop-item button {
  min-width: 64px !important;
  min-height: 36px !important;
  padding: 6px 12px !important;
  font-size: 12px !important;
}

/* Why a Buy button is off, under the item - see renderDraughtShop and
   renderBagShop. A rank is a lock instead (.town-lock). */
.shop-blocked-reason {
  align-self: flex-start;
  margin-top: 2px;
  padding: 1px 6px;
  font-size: 10px;
  color: #f2aaaa;
  background: rgba(185, 67, 67, 0.12);
  border-radius: 2px;
}

/* Each named bag keeps its painted silhouette inside the shared item slot. */
.shop-bag-thumb { object-fit:contain; image-rendering:auto; box-sizing:border-box; }
.shop-bag-carrying { margin:0 0 6px; color:var(--muted); font-size:12px; line-height:1.4; }

/* Armour, rings and gems (renderMerchantStock): the piece's stats, then what
   it would change against what is worn in its slot. */
.shop-ware-thumb { object-fit:contain; image-rendering:auto; box-sizing:border-box; }
.shop-ware-compare { color:var(--muted); }
.shop-ware-compare .gear-stat-diffs { display:inline-flex; flex-wrap:wrap; gap:2px 8px; margin:0; font-size:11px; }
.shop-ware-compare .diff-label { color:var(--muted); }
.shop-ware-compare .stat-diff.positive { color:#a9c88e; font-weight:500; }
.shop-ware-compare .stat-diff.negative { color:#dea79c; font-weight:500; }
