/* Marketplace product detail. Kept independent so it can be enabled without touching the T-FEED shell. */
body.tfeed-market-detail-open { overflow: hidden; }

.tfeed-market-detail {
  position: fixed;
  z-index: 2147482500;
  inset: 0;
  display: grid;
  place-items: center;
  padding: max(14px, env(safe-area-inset-top)) max(14px, env(safe-area-inset-right)) max(14px, env(safe-area-inset-bottom)) max(14px, env(safe-area-inset-left));
  color: #f7f7ff;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.tfeed-market-detail__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(1, 4, 15, .8);
  backdrop-filter: blur(18px);
}

.tfeed-market-detail__panel {
  position: relative;
  width: min(920px, 100%);
  max-height: min(780px, calc(100dvh - 28px));
  overflow: auto;
  outline: none;
  border: 1px solid rgba(165, 127, 255, .42);
  border-radius: 28px;
  background: linear-gradient(145deg, rgba(13, 19, 42, .98), rgba(5, 8, 20, .99));
  box-shadow: 0 32px 100px rgba(0, 0, 0, .64), inset 0 1px rgba(255, 255, 255, .11);
}

.tfeed-market-detail__header {
  position: sticky;
  z-index: 2;
  top: 0;
  min-height: 58px;
  display: grid;
  grid-template-columns: 42px 1fr 42px;
  align-items: center;
  padding: 0 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
  background: rgba(10, 15, 34, .88);
  backdrop-filter: blur(18px);
}

.tfeed-market-detail__header strong { text-align: center; font-size: .95rem; }
.tfeed-market-detail__icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50%;
  color: #f5f7ff;
  background: rgba(255, 255, 255, .08);
  cursor: pointer;
  font-size: 1.55rem;
  line-height: 1;
}
.tfeed-market-detail__icon:hover { background: rgba(132, 91, 255, .38); }

.tfeed-market-detail__body { display: grid; grid-template-columns: minmax(0, 1.08fr) minmax(290px, .92fr); }
.tfeed-market-detail__gallery { padding: 18px; min-width: 0; }
.tfeed-market-detail__photo-stage {
  position: relative;
  display: grid;
  place-items: center;
  overflow: hidden;
  min-height: 380px;
  aspect-ratio: 1 / 1;
  border: 1px solid rgba(51, 222, 255, .22);
  border-radius: 21px;
  background: radial-gradient(circle at 50% 20%, rgba(105, 62, 242, .32), transparent 54%), #070b1d;
}
.tfeed-market-detail__photo-stage img { width: 100%; height: 100%; object-fit: cover; }
.tfeed-market-detail__photo-empty { color: #a887ff; font-size: 5rem; opacity: .65; }
.tfeed-market-detail__photo-count {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 6px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  font-size: .74rem;
  font-weight: 800;
}
.tfeed-market-detail__gallery-nav {
  position: absolute;
  top: calc(50% - 20px);
  z-index: 1;
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(5, 9, 23, .65);
  cursor: pointer;
  font-size: 2rem;
  line-height: .8;
}
.tfeed-market-detail__gallery-nav--previous { left: 12px; }
.tfeed-market-detail__gallery-nav--next { right: 12px; }
.tfeed-market-detail__gallery-nav:hover { background: rgba(125, 67, 255, .9); }
.tfeed-market-detail__thumbnails { display: flex; gap: 8px; overflow-x: auto; padding-top: 10px; }
.tfeed-market-detail__thumbnails button { flex: 0 0 57px; width: 57px; height: 57px; overflow: hidden; padding: 0; border: 2px solid transparent; border-radius: 11px; background: #0d1328; cursor: pointer; }
.tfeed-market-detail__thumbnails button.is-active { border-color: #8c63ff; box-shadow: 0 0 13px rgba(126, 92, 255, .54); }
.tfeed-market-detail__thumbnails img { width: 100%; height: 100%; object-fit: cover; }

.tfeed-market-detail__info { display: flex; flex-direction: column; padding: 25px 25px 24px 8px; min-width: 0; }
.tfeed-market-detail__price-row { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; }
.tfeed-market-detail__eyebrow { color: #a99cff; font-size: .66rem; font-weight: 900; letter-spacing: .12em; }
.tfeed-market-detail__price-row strong { color: #47f1ca; font-size: 1.12rem; white-space: nowrap; }
.tfeed-market-detail__info h1 { margin: 9px 0 7px; font-size: clamp(1.3rem, 3.4vw, 2rem); line-height: 1.12; overflow-wrap: anywhere; }
.tfeed-market-detail__meta { display: flex; flex-wrap: wrap; gap: 9px 15px; margin: 0; color: #aab2ca; font-size: .82rem; }
.tfeed-market-detail__description { margin: 24px 0 13px; padding-top: 19px; border-top: 1px solid rgba(255, 255, 255, .08); }
.tfeed-market-detail__description h2 { margin: 0 0 9px; font-size: .93rem; }
.tfeed-market-detail__description p { margin: 0; color: #d0d5e8; font-size: .9rem; line-height: 1.55; overflow-wrap: anywhere; }
.tfeed-market-detail__muted { margin: 23px 0 14px; color: #8f98b8; font-size: .86rem; }
.tfeed-market-detail__seller {
  display: flex;
  align-items: center;
  gap: 11px;
  width: 100%;
  margin: auto 0 14px;
  padding: 12px;
  border: 1px solid rgba(255, 255, 255, .09);
  border-radius: 16px;
  color: #f8f9ff;
  background: rgba(255, 255, 255, .04);
  text-align: left;
  cursor: pointer;
}
.tfeed-market-detail__seller:hover { border-color: rgba(80, 222, 255, .52); background: rgba(73, 177, 255, .09); }
.tfeed-market-detail__seller img { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; }
.tfeed-market-detail__seller span { display: grid; min-width: 0; gap: 1px; }
.tfeed-market-detail__seller small, .tfeed-market-detail__seller em { color: #9da7c6; font-size: .72rem; font-style: normal; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tfeed-market-detail__seller strong { font-size: .88rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tfeed-market-detail__seller b { margin-left: auto; color: #a98aff; font-size: 1.35rem; }
.tfeed-market-detail__primary { width: 100%; padding: 14px 17px; border: 0; border-radius: 15px; color: #fff; background: linear-gradient(100deg, #7245f8, #9c40ee 50%, #26cffa); box-shadow: 0 10px 22px rgba(102, 60, 240, .3); font-weight: 850; cursor: pointer; }
.tfeed-market-detail__primary:hover { filter: brightness(1.1); }
.tfeed-market-detail__primary:disabled { opacity: .7; cursor: wait; }
.tfeed-market-detail__message { margin: 0 0 9px; color: #b7c1db; font-size: .8rem; }
.tfeed-market-detail__message[data-kind="error"] { color: #ffb1c0; }
.tfeed-market-detail__loading, .tfeed-market-detail__error { position: relative; width: min(390px, calc(100vw - 30px)); padding: 30px; border: 1px solid rgba(158, 113, 255, .38); border-radius: 22px; background: #0a1024; box-shadow: 0 28px 70px rgba(0, 0, 0, .6); text-align: center; }
.tfeed-market-detail__error strong { display: block; font-size: 1.05rem; }
.tfeed-market-detail__error p { color: #b9c2dd; line-height: 1.45; }
.tfeed-market-detail__error button { padding: 10px 17px; border: 0; border-radius: 11px; color: #fff; background: #7350e9; cursor: pointer; }

@media (max-width: 700px) {
  .tfeed-market-detail { padding: 0; place-items: end center; }
  .tfeed-market-detail__panel { width: 100%; max-height: min(93dvh, 800px); border-width: 1px 0 0; border-radius: 24px 24px 0 0; }
  .tfeed-market-detail__body { display: block; }
  .tfeed-market-detail__gallery { padding: 12px 12px 0; }
  .tfeed-market-detail__photo-stage { min-height: min(51dvh, 440px); border-radius: 17px; }
  .tfeed-market-detail__info { padding: 20px 17px calc(20px + env(safe-area-inset-bottom)); }
  .tfeed-market-detail__seller { margin-top: 25px; }
}

@media (max-width: 360px) {
  .tfeed-market-detail__photo-stage { min-height: 300px; }
  .tfeed-market-detail__info h1 { font-size: 1.28rem; }
}
