/* ── Slando — listing detail page ────────────────────────────────────── */

.detail-page {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 16px 24px 0;
}

.detail-page .breadcrumbs { margin-bottom: 16px; }

.detail-page__layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: 24px;
  align-items: start;
}
@media (max-width: 900px) {
  .detail-page__layout { grid-template-columns: 1fr; }
}

/* ── Gallery ─────────────────────────────────────────────────────────── */

.gallery {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px;
  box-shadow: var(--shadow-sm);
}
.gallery__main {
  width: 100%;
  aspect-ratio: 4 / 3;
  background: #eceef2;
  border-radius: var(--radius-sm);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 10px;
  cursor: zoom-in;
}
.gallery__main:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.gallery__main img {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #fafafc;
}
.gallery__main .no-photo {
  color: var(--muted);
  font-size: 14px;
}
.gallery__thumbs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
}
.gallery__thumb {
  flex-shrink: 0;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s;
  background: #eceef2;
}
.gallery__thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.gallery__thumb.is-active { border-color: var(--accent); }

/* ── Info panel (right column) ───────────────────────────────────────── */

.listing-info {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: 16px;
  position: relative;
}

/* 40px round favorite button, top-right, matches the list-card style */
.listing-info__fav {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  color: var(--muted);
  box-shadow: 0 1px 3px rgba(20, 20, 40, 0.1);
  transition: transform 0.18s, color 0.15s, background 0.15s;
  z-index: 1;
}
.listing-info__fav:hover { transform: scale(1.08); color: var(--accent); }
.listing-info__fav.is-active { color: var(--accent); }

.listing-info h1 {
  font-size: 22px;
  font-weight: 800;
  line-height: 1.3;
  letter-spacing: -0.3px;
  /* Padding-right makes room for the absolute fav button. On very narrow
     screens 52px cuts off too much title — reduce to 44px. */
  padding-right: 52px;
  overflow-wrap: break-word;
  word-break: break-word;
}
.listing-info__price {
  font-size: 32px;
  font-weight: 800;
  color: var(--accent);
  letter-spacing: -0.5px;
  line-height: 1;
}
.listing-info__price .no-price {
  font-size: 18px;
  color: var(--muted);
  font-weight: 500;
}

.listing-info__badges {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.listing-info__actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}
.listing-info__actions .btn {
  flex: 1;
  /* Allow buttons to shrink on narrow screens; 120px prevents them from
     becoming too small to read, but won't force overflow like 160px did. */
  min-width: 120px;
}

.meta-list {
  list-style: none;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px 24px;
}
.meta-list li {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.meta-list .meta-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
}
.meta-list .meta-value {
  font-size: 14px;
  color: var(--ink);
  font-weight: 600;
}

/* ── Report link + modal fields (T1.4) ──────────────────────────────── */
.listing-info__footer {
  margin-top: 14px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
  display: flex;
  justify-content: flex-end;
}
.listing-report-btn {
  background: none;
  border: 0;
  padding: 6px 4px;
  color: var(--muted);
  font-size: 12px;
  cursor: pointer;
  border-radius: 6px;
  transition: color 0.15s, background 0.15s;
}
.listing-report-btn:hover {
  color: var(--danger, #dc2626);
  background: var(--surface-muted, #f7f5ee);
}
.report-field {
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.report-field__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.3px;
}
.report-field .input {
  width: 100%;
  font-size: 14px;
}

/* ── Description ─────────────────────────────────────────────────────── */

.description-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
}
.description-card h2 {
  font-size: 18px;
  font-weight: 800;
  margin-bottom: 12px;
}
.description-text {
  color: var(--ink-soft);
  line-height: 1.65;
  white-space: pre-wrap;
  word-wrap: break-word;
  font-size: 15px;
}

/* ── Stats card (owner-only, T2.11 FE) ───────────────────────────────── */

.stats-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 24px;
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
}
.stats-card[hidden] { display: none; }
.stats-card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.stats-card__title {
  font-size: 18px;
  font-weight: 800;
  margin: 0;
}
.stats-card__ranges {
  display: flex;
  gap: 4px;
}
.stats-card__range {
  background: transparent;
  border: 1px solid var(--line);
  padding: 4px 10px;
  font: inherit;
  font-size: 12px;
  color: var(--muted);
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.15s, background 0.15s, border-color 0.15s;
}
.stats-card__range:hover { color: var(--ink); }
.stats-card__range.is-active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}
.stats-card__summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 14px;
}
.stats-card__metric {
  padding: 10px 0;
}
.stats-card__metric-value {
  font-size: 28px;
  font-weight: 800;
  color: var(--ink);
  line-height: 1.1;
}
.stats-card__metric-label {
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.5px;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 4px;
}
.stats-card__chart {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 80px;
  padding-top: 10px;
  border-top: 1px solid var(--line-soft);
}
.stats-card__bar {
  flex: 1;
  min-width: 2px;
  height: 100%;
  display: flex;
  align-items: flex-end;
}
.stats-card__bar-fill {
  width: 100%;
  background: var(--accent);
  border-radius: 2px 2px 0 0;
  opacity: 0.85;
  transition: opacity 0.15s;
}
.stats-card__bar:hover .stats-card__bar-fill { opacity: 1; }
.stats-card__empty {
  color: var(--muted);
  font-size: 13px;
  text-align: center;
  padding: 20px;
  width: 100%;
}
.stats-card__status {
  margin-top: 8px;
  color: var(--muted);
  font-size: 12px;
  min-height: 1em;
}

/* ── Seller card ─────────────────────────────────────────────────────── */

.seller-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow-sm);
  margin-top: 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.seller-avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 22px;
  flex-shrink: 0;
}
/* When the avatar links to the seller profile give it a pointer affordance
   and a subtle lift on hover so it doesn't look like static chrome. */
.seller-avatar--link {
  text-decoration: none;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.seller-avatar--link:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(233, 69, 96, 0.25);
}
.seller-avatar--link:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.seller-info {
  flex: 1;
  min-width: 0;
}
.seller-info .seller-name {
  font-weight: 700;
  font-size: 16px;
  color: var(--ink);
  margin-bottom: 4px;
  /* Long usernames / display names must wrap, not overflow */
  overflow-wrap: anywhere;
  word-break: break-word;
}
.seller-info .seller-sub {
  color: var(--muted);
  font-size: 13px;
}

/* ── Seller card: action buttons column ──────────────────────────────── */
/* This element was missing CSS entirely; it holds the Message + TG buttons. */
.seller-card__actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

/* ── Related listings / seller other listings ────────────────────────── */

.related-section {
  margin-top: 40px;
}
.related-section > .section-header {
  padding: 0 4px;
}

/* ── Gallery lightbox (click main image) ─────────────────────────────── */

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(8, 10, 16, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px 60px;
}
.gallery-lightbox[hidden] { display: none; }
body.is-lightbox-open { overflow: hidden; }

.gallery-lightbox__stage {
  max-width: 100%;
  max-height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-lightbox__img {
  max-width: 100%;
  max-height: calc(100vh - 80px);
  width: auto;
  height: auto;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
  border-radius: 4px;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.5);
}
.gallery-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 28px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.gallery-lightbox__close:hover { background: rgba(255, 255, 255, 0.24); transform: scale(1.05); }
.gallery-lightbox__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 0;
  background: rgba(255, 255, 255, 0.12);
  color: #fff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.15s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
  padding-bottom: 4px; /* optical centering of › / ‹ glyphs */
}
.gallery-lightbox__nav:hover { background: rgba(255, 255, 255, 0.24); }
.gallery-lightbox__nav:hover:not([hidden]) { transform: translateY(-50%) scale(1.05); }
.gallery-lightbox__nav--prev { left: 16px; }
.gallery-lightbox__nav--next { right: 16px; }
.gallery-lightbox__nav[hidden] { display: none; }
.gallery-lightbox__counter {
  position: absolute;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.75);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.5px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.4);
  border-radius: 999px;
}

@media (max-width: 600px) {
  .gallery-lightbox { padding: 24px 16px; }
  .gallery-lightbox__nav {
    width: 44px;
    height: 44px;
    font-size: 30px;
  }
  .gallery-lightbox__nav--prev { left: 8px; }
  .gallery-lightbox__nav--next { right: 8px; }
  .gallery-lightbox__close { top: 10px; right: 10px; width: 40px; height: 40px; font-size: 24px; }
}

/* ── Listing page: mobile overrides ─────────────────────────────────── */

@media (max-width: 600px) {
  /* Seller card: stack info + actions vertically */
  .seller-card {
    flex-wrap: wrap;
    gap: 12px;
  }
  .seller-card__actions {
    flex-direction: row;
    flex-wrap: wrap;
    width: 100%;
  }
  .seller-card__actions .btn {
    flex: 1;
    min-width: 0;
  }
  /* Meta list: single column at narrow widths */
  .meta-list {
    grid-template-columns: 1fr;
    gap: 10px;
  }
  /* Listing title: smaller padding-right on narrow screens */
  .listing-info h1 {
    padding-right: 44px;
    font-size: 20px;
  }
  /* Price: scale down a touch */
  .listing-info__price {
    font-size: 26px;
  }
  /* Actions: each button full-width when stacked */
  .listing-info__actions .btn {
    min-width: 0;
  }
  /* Detail page padding */
  .detail-page {
    padding-left: 14px;
    padding-right: 14px;
  }
  /* Description word-wrap */
  .description-text {
    word-break: break-word;
    overflow-wrap: anywhere;
  }
}
