/* ============================================================
   Undegarth · shop-tab.css
   Downtime shops. Scoped to .ug-shop-* so nothing in app.html
   changes shape. Inherits app.html's palette and Cinzel display
   face — no new colors introduced.
   DROP IN: api/public/shop-tab.css
   ============================================================ */

/* ---------- tab bar: the compact chat button that replaces the chat tab ---------- */
#chat-icon-btn {
  flex: none; display: flex; align-items: center; justify-content: center;
  position: relative; width: 46px; padding: 0; margin: 0;
  border: none; background: transparent; border-radius: 0;
  color: #6f6557; cursor: pointer;
}
#chat-icon-btn::before {
  content: ''; position: absolute; left: 0; top: 22%; height: 56%;
  width: 1px; background: rgba(224, 190, 125, .12);
}
#chat-icon-btn svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#chat-icon-btn .ico { display: flex; align-items: center; justify-content: center; width: 34px; height: 26px; border-radius: 999px; transition: background .2s; }
#chat-icon-btn.on { color: #eed9a4; }
#chat-icon-btn.on .ico { background: rgba(224, 190, 125, .14); }
#chat-icon-btn .dot { position: absolute; top: 9px; right: 9px; width: 7px; height: 7px; }

/* ---------- shop list ---------- */
.ug-shop-listhead {
  display: none;
  gap: 0 14px; padding: 4px 16px 8px;
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 8.5px;
  letter-spacing: .16em; text-transform: uppercase; color: #7d7161;
}
.ug-shop-row {
  display: grid; grid-template-columns: minmax(0, 1fr) 22px; gap: 6px 12px;
  align-items: center; width: 100%; text-align: left;
  background: rgba(255, 255, 255, .035); border: 1px solid rgba(224, 190, 125, .1);
  border-radius: 16px; padding: 14px 16px; cursor: pointer;
  font-family: inherit; letter-spacing: 0; text-transform: none; white-space: normal;
  transition: border-color .18s, background .18s;
}
.ug-shop-row:hover { border-color: rgba(224, 190, 125, .32); background: rgba(255, 255, 255, .055); }
.ug-shop-row .nm {
  grid-column: 1; grid-row: 1; min-width: 0;
  font-family: 'Cinzel', serif; font-weight: 700; font-size: 16px;
  line-height: 1.3; color: #f2ece0; overflow-wrap: anywhere;
}
.ug-shop-row .loc {
  grid-column: 1; grid-row: 2; min-width: 0;
  font-size: 12.5px; line-height: 1.35; color: #9a8d7c; overflow-wrap: anywhere;
}
.ug-shop-row .tags {
  grid-column: 1; grid-row: 3;
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
}
.ug-shop-row .chev {
  grid-column: 2; grid-row: 1 / 4; align-self: center; justify-self: end;
  color: #6f6557; font-size: 20px; line-height: 1;
}
.ug-shop-type {
  display: inline-flex; align-items: center; white-space: nowrap; font-family: 'Cinzel', serif;
  font-weight: 700; font-size: 8px; text-transform: uppercase; letter-spacing: .12em;
  padding: 4px 9px; border-radius: 999px; color: #e0be7d; background: rgba(224, 190, 125, .13);
}
.ug-shop-draft { color: #f0a992; background: rgba(240, 169, 146, .14); }

/* ---------- shop detail ---------- */
.ug-shop-banner {
  position: relative; width: 100%; max-width: 100%; min-width: 0;
  height: clamp(150px, 42vw, 180px); border-radius: 18px; overflow: hidden;
  border: 1px solid rgba(224, 190, 125, .18); background: #151109;
  box-shadow: 0 14px 34px rgba(0, 0, 0, .3);
}
.ug-shop-banner img { width: 100%; height: 100%; object-fit: cover; object-position: center center; display: block; }
.ug-shop-banner .empty {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-family: 'Cinzel', serif; font-size: 11px; letter-spacing: .16em; text-transform: uppercase; color: #5d5245;
}
.ug-shop-banner .cap {
  position: absolute; inset: auto 0 0 0; padding: 20px 20px 16px; pointer-events: none;
  background: linear-gradient(to top, rgba(8, 6, 4, .94) 12%, rgba(8, 6, 4, .55) 58%, rgba(8, 6, 4, 0));
}
.ug-shop-banner .cap h2 {
  font-family: 'Cinzel', serif; font-weight: 700; font-size: clamp(21px, 5.4vw, 32px);
  color: #f4e6c8; margin: 0; line-height: 1.14; text-shadow: 0 2px 14px rgba(0, 0, 0, .7);
}
.ug-shop-banner .cap .sub { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; margin-top: 7px; font-size: 12.5px; color: #d5cab7; }
.ug-shop-blurb { margin: 14px 2px 0; font-size: 13.5px; line-height: 1.65; color: #9a8d7c; text-wrap: pretty; }

/* ---------- catalog ---------- */
.ug-shop-cat { margin-top: 18px; }
.ug-shop-cat > .hd { font-family: 'Cinzel', serif; font-weight: 700; font-size: 10px; letter-spacing: .24em; text-transform: uppercase; color: #e0be7d; display: flex; align-items: center; gap: 12px; margin: 0 0 4px; }
.ug-shop-cat > .hd::after { content: ''; flex: 1; height: 1px; background: rgba(224, 190, 125, .14); }
.ug-shop-item { border-bottom: 1px solid rgba(224, 190, 125, .07); }
.ug-shop-line { display: flex; align-items: baseline; gap: 10px; padding: 10px 2px; cursor: pointer; }
.ug-shop-line .tw { flex: none; width: 11px; color: #6f6557; font-size: 10px; }
.ug-shop-line .nm { flex: 0 1 auto; min-width: 0; overflow-wrap: anywhere; font-size: 14.5px; color: #f2ece0; }
.ug-shop-line .stk { flex: none; font-size: 11px; color: #8d8070; font-style: italic; }
.ug-shop-line .led { flex: 1; min-width: 20px; border-bottom: 1px dotted rgba(224, 190, 125, .25); transform: translateY(-4px); }
.ug-shop-line .pr { flex: none; font-size: 13.5px; color: #e0be7d; }
.ug-shop-share {
  flex: none; padding: 6px 9px; border: 1px solid rgba(224, 190, 125, .18);
  border-radius: 999px; background: rgba(224, 190, 125, .07); color: #c9bda8;
  font-size: 8px; letter-spacing: .08em; line-height: 1; text-transform: uppercase;
}
.ug-shop-share:hover { color: #eed9a4; border-color: rgba(224, 190, 125, .38); }
.ug-shop-itemdetail { margin: 0 0 13px 23px; }
.ug-shop-desc { margin: 0 0 10px; font-size: 13px; line-height: 1.65; color: #c2b6a1; text-wrap: pretty; }
.ug-shop-tier-list {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 6px; padding: 9px; border: 1px solid rgba(224, 190, 125, .12);
  border-radius: 12px; background: rgba(0, 0, 0, .18);
}
.ug-shop-tier {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 6px 8px; border-radius: 8px; background: rgba(255, 255, 255, .03);
  color: #8d8070; font-family: 'Cinzel', serif; font-size: 8.5px;
  font-weight: 700; letter-spacing: .1em; text-transform: uppercase;
}
.ug-shop-tier strong { color: #e0be7d; font-family: inherit; font-size: 10px; white-space: nowrap; }

/* ---------- edit in place ---------- */
.ug-shop-editrow { padding: 11px 2px 13px; }
.ug-shop-editrow .top { display: flex; align-items: center; gap: 8px; }
.ug-shop-editrow input, .ug-shop-editrow textarea { margin: 0; }
.ug-shop-editrow .i-name { flex: 1; min-width: 0; }
.ug-shop-editrow .i-price { flex: none; width: 96px; color: #e0be7d; }
.ug-shop-editrow .i-stack { flex: none; width: 56px; text-align: center; }
.ug-shop-editrow .i-desc { display: block; width: calc(100% - 23px); margin: 8px 0 0 23px; }
.ug-shop-editrow .rm { flex: none; width: 38px; padding: 0; height: 40px; background: transparent; border: 1px solid rgba(166, 58, 40, .4); color: #c67a68; border-radius: 10px; font-size: 15px; }
.ug-shop-stacklabel { font-family: 'Cinzel', serif; font-weight: 700; font-size: 8px; letter-spacing: .12em; text-transform: uppercase; color: #8d8070; }
.ug-shop-editcat > .hd .i-cat {
  flex: 0 1 240px; width: 240px; max-width: calc(100% - 48px);
  background: transparent; border: none; padding: 0; margin: 0;
  color: #e0be7d; font-family: 'Cinzel', serif; font-weight: 700;
  font-size: 10px; letter-spacing: .24em; text-transform: uppercase;
}
.ug-shop-tier-edit { width: calc(100% - 36px); margin: 9px 0 0 36px; }
.ug-shop-tier-label {
  display: block; margin-bottom: 5px; color: #c9bda8; font-family: 'Cinzel', serif;
  font-size: 8.5px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase;
}
.ug-shop-tier-edit .i-tier-prices { min-height: 62px; padding: 10px 12px; font-size: 14px; line-height: 1.45; resize: vertical; }
.ug-shop-tier-hint { display: block; margin-top: 4px; color: #74695b; font-size: 10.5px; line-height: 1.4; }
#shop-draft-items .ug-shop-tier-edit { width: 100%; margin-left: 0; }
.ug-shop-drag {
  flex: none; display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 32px; border-radius: 8px; color: #8d8070;
  font-family: system-ui, sans-serif; font-size: 18px; letter-spacing: -4px;
  cursor: grab; touch-action: none; user-select: none;
}
.ug-shop-drag:hover, .ug-shop-drag:focus-visible { color: #eed9a4; background: rgba(224, 190, 125, .1); outline: none; }
.ug-shop-drag:active { cursor: grabbing; }
.ug-shop-dragging { opacity: .58; }
body.ug-shop-reordering { user-select: none; }
.ug-shop-add {
  display: block; width: 100%; margin-top: 10px; padding: 11px 12px;
  border: 1px dashed rgba(224, 190, 125, .28); border-radius: 12px; background: transparent;
  color: #9a8d7c; font-size: 12.5px; cursor: pointer;
}
.ug-shop-add:hover { color: #eed9a4; border-color: rgba(224, 190, 125, .45); }
.ug-shop-editbar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin-top: 16px; padding: 14px 16px;
  border: 1px solid rgba(224, 190, 125, .2); border-radius: 16px; background: rgba(38, 30, 22, .7);
}
.ug-shop-editbar .say { flex: 1; min-width: 180px; font-size: 12.5px; color: #9a8d7c; }

/* ---------- create form ---------- */
.ug-shop-drop {
  position: relative; width: 100%; max-width: 100%; min-width: 0;
  height: clamp(140px, 40vw, 170px); border-radius: 14px;
  border: 1px dashed rgba(224, 190, 125, .3); background: #120f0a; overflow: hidden;
  display: flex; align-items: center; justify-content: center; cursor: pointer;
}
.ug-shop-drop img { width: 100%; height: 100%; object-fit: cover; object-position: center center; }
.ug-shop-drop .hint { position: absolute; text-align: center; font-size: 12px; color: #7d7161; padding: 0 20px; line-height: 1.5; }
.ug-shop-drop.has img + .hint { display: none; }
.ug-shop-visrow { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 14px; }

@media (max-width: 639px) {
  .ug-shop-line {
    display: grid; grid-template-columns: 11px minmax(0, 1fr) auto auto;
    gap: 4px 8px; align-items: center;
  }
  .ug-shop-line .tw { grid-column: 1; grid-row: 1 / 3; }
  .ug-shop-line .nm { grid-column: 2; grid-row: 1; line-height: 1.3; }
  .ug-shop-line .stk { grid-column: 2; grid-row: 2; }
  .ug-shop-line .led { display: none; }
  .ug-shop-line .pr { grid-column: 3; grid-row: 1 / 3; }
  .ug-shop-line .ug-shop-share { grid-column: 4; grid-row: 1 / 3; }
  .ug-shop-editcat .ug-shop-editrow .top {
    display: grid; grid-template-columns: 28px minmax(0, 1fr) 84px 38px;
    gap: 8px;
  }
  .ug-shop-editcat .ug-shop-editrow .ug-shop-drag { grid-column: 1; grid-row: 1 / 3; }
  .ug-shop-editcat .ug-shop-editrow .i-name { grid-column: 2; grid-row: 1; }
  .ug-shop-editcat .ug-shop-editrow .i-price { grid-column: 3; grid-row: 1; width: 100%; }
  .ug-shop-editcat .ug-shop-editrow .rm { grid-column: 4; grid-row: 1 / 3; }
  .ug-shop-editcat .ug-shop-editrow .ug-shop-stacklabel { grid-column: 2; grid-row: 2; justify-self: end; }
  .ug-shop-editcat .ug-shop-editrow .i-stack { grid-column: 3; grid-row: 2; width: 100%; }
  .ug-shop-editcat .ug-shop-editrow .i-desc { width: calc(100% - 36px); margin-left: 36px; }
}

@media (min-width: 640px) {
  #scr-shop { width: 100%; max-width: 900px; margin: 0 auto; }
  .ug-shop-banner { height: auto; aspect-ratio: 3 / 1; min-height: 150px; }
  .ug-shop-drop { height: auto; aspect-ratio: 3 / 1; min-height: 130px; }
  .ug-shop-listhead {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(130px, 200px) minmax(150px, 190px) 22px;
  }
  .ug-shop-row {
    grid-template-columns: minmax(0, 1fr) minmax(130px, 200px) minmax(150px, 190px) 22px;
    gap: 0 14px;
  }
  .ug-shop-row .nm { grid-column: 1; grid-row: 1; align-self: center; }
  .ug-shop-row .loc {
    grid-column: 2; grid-row: 1;
    font-size: 13px; color: #b1a28d;
  }
  .ug-shop-row .tags { grid-column: 3; grid-row: 1; }
  .ug-shop-row .chev { grid-column: 4; grid-row: 1; font-size: 17px; }
}
