/* Listing detail: large swipeable gallery, sticky summary card, data and description. */
.listing-page { padding-block: 20px 56px; }
.listing-back { display: inline-grid; place-items: center; width: 44px; height: 44px; margin-bottom: 12px; border: 1px solid var(--border); border-radius: 50%; background: var(--surface); color: var(--ink); }
.listing-back:hover { border-color: var(--ink); text-decoration: none; }
.listing-back svg { width: 20px; height: 20px; stroke-width: 2; }
.listing-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; grid-template-areas: "gallery summary" "body summary"; gap: 28px 32px; align-items: start; }
.listing-gallery { grid-area: gallery; min-width: 0; }
.listing-summary { grid-area: summary; position: sticky; top: 20px; display: grid; gap: 14px; padding: 24px; border: 1px solid var(--border); border-radius: 10px; background: var(--surface); }
.listing-body { grid-area: body; min-width: 0; display: grid; gap: 28px; }

.gallery-stage { position: relative; overflow: hidden; border-radius: 10px; background: #1f1f1f; }
.gallery-track { display: flex; margin: 0; padding: 0; overflow-x: auto; list-style: none; scroll-snap-type: x mandatory; scroll-behavior: smooth; scrollbar-width: none; }
.gallery-track::-webkit-scrollbar { display: none; }
.gallery-slide { flex: 0 0 100%; aspect-ratio: 4 / 3; scroll-snap-align: start; }
.gallery-slide img { width: 100%; height: 100%; object-fit: contain; cursor: zoom-in; }
.gallery-arrow { position: absolute; top: 50%; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #ffffffe6; color: var(--ink); box-shadow: 0 2px 8px #00000033; transform: translateY(-50%); cursor: pointer; }
.gallery-arrow:hover { background: var(--surface); }
.gallery-arrow:disabled { opacity: 0; pointer-events: none; }
.gallery-prev { left: 12px; }
.gallery-next { right: 12px; }
.gallery-arrow svg, .gallery-close svg { width: 22px; height: 22px; stroke-width: 2; }
.gallery-counter { position: absolute; right: 12px; bottom: 12px; padding: 3px 10px; border-radius: 12px; background: #000000a6; color: #ffffff; font-size: 13px; font-variant-numeric: tabular-nums; }
.gallery-close { position: absolute; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 50%; background: #ffffffe6; color: var(--ink); cursor: pointer; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; scrollbar-width: thin; }
.gallery-thumbs a { flex: 0 0 96px; aspect-ratio: 4 / 3; overflow: hidden; border: 2px solid transparent; border-radius: 6px; opacity: .7; }
.gallery-thumbs a:hover { opacity: 1; }
.gallery-thumbs a[aria-current="true"] { border-color: var(--accent); opacity: 1; }
.gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; }
.gallery-empty { display: grid; place-items: center; gap: 8px; aspect-ratio: 4 / 3; border-radius: 10px; background: #e9ebe8; color: var(--muted); }
.gallery-empty svg { width: 48px; height: 48px; }

/* Full-screen view: the same gallery fills the window. */
.gallery-open { overflow: hidden; }
.listing-gallery.is-fullscreen { position: fixed; z-index: 100; inset: 0; display: flex; flex-direction: column; padding: 12px; background: #000000; }
.is-fullscreen .gallery-stage { flex: 1; border-radius: 0; background: transparent; }
.is-fullscreen .gallery-track { height: 100%; }
.is-fullscreen .gallery-slide { aspect-ratio: auto; height: 100%; }
.is-fullscreen .gallery-slide img { cursor: default; }
.is-fullscreen .gallery-thumbs { justify-content: center; }

.listing-summary h1 { margin: 0; font-size: clamp(22px, 2.4vw, 28px); line-height: 1.2; overflow-wrap: anywhere; }
.listing-summary-price { margin: 0; font-size: 30px; font-weight: 800; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.listing-summary-meta { display: grid; gap: 8px; margin: 0; padding: 14px 0 0; border-top: 1px solid var(--border); list-style: none; color: var(--muted); font-size: 14px; }
.listing-summary-meta li { display: flex; align-items: center; gap: 10px; }
.listing-summary-meta svg { flex: none; width: 18px; height: 18px; }
.listing-cta { width: 100%; }

.listing-section h2 { margin: 0 0 14px; font-size: 20px; }
.listing-facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); margin: 0; border-top: 1px solid var(--border); }
.listing-facts > div { display: flex; justify-content: space-between; gap: 16px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.listing-facts > div:nth-child(odd) { margin-right: 24px; }
.listing-facts dt { color: var(--muted); font-size: 14px; }
.listing-facts dd { margin: 0; font-size: 15px; font-weight: 600; text-align: right; overflow-wrap: anywhere; }
.listing-description { font-size: 16px; line-height: 1.7; overflow-wrap: anywhere; }
.listing-description p, .listing-description ul { margin: 0 0 12px; }
.listing-description ul { padding-left: 22px; }
.listing-description li + li { margin-top: 2px; }
.listing-muted { color: var(--muted); }

@media (max-width: 900px) {
  .listing-layout { grid-template-columns: minmax(0, 1fr); grid-template-areas: "gallery" "summary" "body"; gap: 20px; }
  .listing-summary { position: static; padding: 0; border: 0; background: transparent; }
}
@media (max-width: 600px) {
  .listing-page { padding-top: 12px; }
  .listing-gallery:not(.is-fullscreen) .gallery-stage { margin-inline: -16px; border-radius: 0; }
  .listing-gallery:not(.is-fullscreen) .gallery-thumbs { display: none; }
  .gallery-arrow { display: none; }
  .listing-facts { grid-template-columns: minmax(0, 1fr); }
  .listing-facts > div:nth-child(odd) { margin-right: 0; }
}
.listing-report { justify-self: center; color: var(--muted); font-size: 13px; }

/* Seller box and listing tiles (more from this seller, similar listings). */
.listing-seller { display: flex; gap: 12px; align-items: flex-start; margin-top: 16px; padding-top: 16px; border-top: 1px solid var(--border); font-size: 14px; }
.listing-seller-icon { display: grid; flex: none; place-items: center; width: 40px; height: 40px; border-radius: 50%; background: var(--page); color: var(--muted); }
.listing-seller-icon svg { width: 22px; height: 22px; }
.listing-seller > span:last-child { display: grid; gap: 2px; }
.listing-seller > span:last-child > span { color: var(--muted); font-size: 13px; }
.listing-seller a { font-size: 13px; font-weight: 600; }
.listing-more { margin-top: 40px; }
.listing-tiles { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; margin: 0; padding: 0; list-style: none; }
.listing-tile a { display: grid; gap: 4px; height: 100%; padding-bottom: 10px; border: 1px solid var(--border); border-radius: 8px; overflow: hidden; background: var(--surface); color: var(--ink); text-decoration: none; }
.listing-tile a:hover { border-color: #aaaaaa; text-decoration: none; }
.listing-tile-image { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: #f3f4f1; }
.listing-tile-image img { width: 100%; height: 100%; object-fit: cover; }
.listing-tile-title, .listing-tile-price, .listing-tile-place { padding-inline: 12px; }
.listing-tile-title { display: -webkit-box; overflow: hidden; margin-top: 6px; font-size: 14px; font-weight: 600; line-height: 1.35; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.listing-tile-price { font-size: 16px; }
.listing-tile-place { color: var(--muted); font-size: 12px; }
@media (max-width: 760px) {
  .listing-tiles { grid-auto-flow: column; grid-auto-columns: 62%; grid-template-columns: none; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding-bottom: 6px; }
  .listing-tile { scroll-snap-align: start; }
}
