.bido-listing-context-wrap {
  padding: 16px 32px 0;
  display: grid;
  gap: 12px;
}

.bido-listing-gallery-block {
  display: grid;
  gap: 12px;
  margin-bottom: 24px;
}

.bido-listing-photo-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(84px, 112px);
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: thin;
}

/* Wide table variants. min() caps the floor at the card width so the table
   keeps its comfortable single-line width on a roomy card but collapses to fit
   a narrow one — a wide table in the dashboard's slim aside column wraps to fit
   instead of clipping (see .bido-table-card in components/shell.css). Once the
   card drops below ~50rem these variants reflow into stacked cards via a
   container query, also in shell.css. */
.bido-table-wide .tbl {
  min-width: min(900px, 100%);
}

.bido-table-xwide .tbl {
  min-width: min(1080px, 100%);
}

.bx-dark .bido-listing-facts > div,
.bx-dark .bido-highlight-item {
  background: rgba(var(--bx-white-rgb),0.04);
  border-color: rgba(var(--bx-white-rgb),0.10);
  color: var(--bx-ink);
}

.bx-dark .bido-listing-details-panel {
  background: rgba(var(--bx-white-rgb),0.04);
  border-color: rgba(var(--bx-white-rgb),0.10);
  color: var(--bx-ink);
}

.bx-dark .bido-listing-details-panel dt { color: var(--bx-ink-3); }
.bx-dark .bido-listing-details-panel dd { color: var(--bx-ink); }

.bx-dark .bido-rate-grid {
  background: rgba(var(--bx-white-rgb),0.10);
  border-color: rgba(var(--bx-white-rgb),0.10);
}

.bx-dark .bido-rate-grid > div {
  background: var(--bido-dark);
  color: var(--bx-ink);
}

.bx-dark .bido-listing-warning {
  background: rgba(var(--bx-amber-rgb),0.18);
  color: var(--bx-vibes-ink);
  border: 1px solid rgba(var(--bx-amber-rgb),0.30);
}

.bx-dark .bido-listing-payment-note { color: var(--bx-ink-3); }

.bx-dark .bido-gallery-jump {
  background: rgba(var(--bx-navy-rgb),0.85);
  backdrop-filter: blur(8px);
  color: var(--bx-ink);
  border-color: rgba(var(--bx-white-rgb),0.18);
}

.bx-dark .bido-listing-rule,
.bx-dark .bido-listing-rule-sm,
.bx-dark .bx-hr { border-color: rgba(var(--bx-white-rgb),0.10); }

.bx-dark .bido-listing-price-rows .total {
  border-top-color: rgba(var(--bx-white-rgb),0.10);
}

.bx-dark .bido-listing-breadcrumb { color: rgba(var(--bx-white-rgb),0.62); }

.bido-listing-main {
  padding: 20px 32px;
}

.bido-listing-layout {
  display: grid;
  /* Summary rail flexes with the viewport instead of a fixed 360px (Rule 7). */
  grid-template-columns: minmax(0, 1fr) clamp(18rem, 26vw, 22.5rem);
  gap: 36px;
}

.bido-listing-layout > aside {
  min-width: 0;
}

.bido-listing-breadcrumb {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: var(--bx-text-md);
}

.bido-listing-gallery {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr) minmax(0, 1fr);
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 10px;
  height: clamp(300px, 38vw, 500px);
  margin-bottom: 24px;
}

.bido-listing-gallery > .photo {
  width: 100%;
  height: 100%;
}

.bido-listing-gallery > .photo:first-child {
  grid-row: 1 / 3;
}

.bido-gallery-jump {
  position: absolute;
  right: 14px;
  bottom: 14px;
  background: rgba(var(--bx-white-rgb), 0.92);
  backdrop-filter: blur(8px);
}

.bido-listing-gallery {
  position: relative;
}

.bido-listing-gallery.bido-listing-gallery--sparse {
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  grid-template-rows: auto;
  height: auto;
}

.bido-listing-gallery.bido-listing-gallery--sparse > .photo {
  height: auto;
  aspect-ratio: 16 / 10;
}

.bido-listing-gallery.bido-listing-gallery--sparse > .photo:first-child {
  grid-row: auto;
}

/* Real-photo tiles are links into the lightbox; the > .photo rules above
   already size them, so add only the interactive affordance. */
.bido-gallery-tile { cursor: zoom-in; }

.bido-gallery-tile:focus-visible {
  outline: 2px solid var(--bx-accent);
  outline-offset: 2px;
}

@media (any-hover: hover) {
  .bido-gallery-tile { transition: filter .15s; }
  .bido-gallery-tile:hover { filter: brightness(1.06); }
}

/* Polished empty-gallery tiles — listings with no uploaded photos (vibes/pros)
   render labelled placeholders. Drop the global dashed-hatch wireframe in
   favour of a calm tinted tile so the page reads as finished, not a stub.
   Scoped to the gallery so the shared .photo placeholder (cards, home, drawer)
   is untouched. */
.bido-listing-gallery > .photo:not(.photo-real) {
  background:
    linear-gradient(135deg,
      rgba(var(--bx-accent-rgb), 0.16),
      rgba(var(--bx-teal-rgb), 0.12));
  align-items: center;
  justify-content: center;
  text-align: center;
}

.bido-listing-gallery > .photo:not(.photo-real)::before { content: none; }

.bido-listing-gallery > .photo:not(.photo-real) > .photo-label {
  background: rgba(var(--bx-navy-rgb), 0.55);
  color: rgba(var(--bx-white-rgb), 0.92);
}

.bido-listing-copy {
  min-width: 0;
}

.bido-listing-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
}

.bido-listing-meta {
  margin-top: 6px;
}

/* Fact tiles reflow 4→2→1 on container width (Rule 7). */
.bido-listing-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 10rem), 1fr));
  gap: 8px;
  margin-top: 18px;
}

.bido-listing-facts > div,
.bido-highlight-item {
  min-width: 0;
  padding: 10px 12px;
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-r);
  background: white;
  font-size: var(--bx-text-sm);
}

.bido-listing-facts > div {
  display: flex;
  align-items: center;
  gap: 8px;
}

/* Highlight tiles reflow 3→2→1 on container width (Rule 7). The grid lives
   in products/listing.css because the listing page is its only consumer —
   it previously lived in products/affiliate.css and was picked up via
   cascade, which made the listing page's layout silently dependent on
   another product's stylesheet. */
.bido-highlights-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem), 1fr));
  gap: 8px;
}

/* Centre the label within each highlight tile so single-line items don't
   sit top-left of cells stretched to match a wrapping neighbour. */
.bido-highlight-item {
  display: flex;
  align-items: center;
}

.bido-listing-details-panel {
  margin-top: 18px;
  padding: 14px;
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-r);
  background: white;
}

.bido-listing-details-panel dl {
  display: grid;
  gap: 8px;
  margin: 10px 0 0;
}

.bido-listing-details-panel dl > div {
  display: grid;
  grid-template-columns: minmax(92px, auto) minmax(0, 1fr);
  gap: 12px;
  align-items: baseline;
}

.bido-listing-details-panel dt {
  color: var(--bx-ink-3);
  font-size: var(--bx-text-sm);
}

.bido-listing-details-panel dd {
  min-width: 0;
  margin: 0;
  font-size: var(--bx-text-sm);
  font-weight: 600;
}

.bido-listing-rule {
  margin: 22px 0 !important;
}

.bido-listing-description {
  max-width: 760px;
  line-height: 1.7;
}

.bido-listing-highlights-title {
  margin-top: 24px;
  margin-bottom: 10px;
}

.bido-listing-summary-card {
  position: sticky;
  top: 20px;
  padding: 20px;
  overflow: visible;
}

.bido-listing-price-head {
  display: flex;
  align-items: baseline;
  gap: 6px;
}

.bido-listing-trip-total {
  margin-top: 2px;
  font-size: var(--bx-text-sm);
}

.bido-rate-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1px;
  margin-top: 18px;
  overflow: hidden;
  border: 1px solid var(--bx-line);
  border-radius: var(--bx-r);
  background: var(--bx-line);
}

.bido-listing-summary-edit-note {
  margin-top: 8px;
  font-size: var(--bx-text-xs);
}

.bido-inline-link {
  color: var(--bx-accent);
  text-decoration: underline;
}

.bido-rate-grid > div {
  min-width: 0;
  padding: 10px 12px;
  background: white;
  display: grid;
  gap: 2px;
}

.bido-rate-grid strong {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bido-rate-grid .full {
  grid-column: 1 / 3;
}

.bido-rate-grid .eyebrow {
  font-size: var(--bx-text-3xs);
}

.bido-listing-warning {
  margin-top: 14px;
  padding: 10px 12px;
  border-radius: var(--bx-r);
  background: rgba(var(--bx-amber-rgb), 0.12);
  color: var(--bido-navy);
  font-size: var(--bx-text-sm);
}

.bido-listing-cta {
  width: 100%;
  justify-content: center;
  margin-top: 14px;
}

.bx .button_to:has(.bido-listing-cta) {
  display: flex;
  width: 100%;
}

.bido-listing-payment-note {
  margin-top: 8px;
  text-align: center;
  font-size: var(--bx-text-xs);
}

.bido-listing-rule-sm {
  margin: 16px 0 !important;
}

.bido-listing-price-rows {
  display: grid;
  gap: 8px;
  font-size: var(--bx-text-sm);
}

.bido-listing-price-rows > div {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: baseline;
}

.bido-listing-price-rows .total {
  padding-top: 8px;
  border-top: 1px solid var(--bx-line);
  font-weight: 700;
}

/* === Responsive — listing detail ===
   The summary rail drops below the content once the two can no longer sit
   side by side. */
@media (max-width: 64rem) {
  .bido-listing-layout {
    grid-template-columns: 1fr;
  }
  .bido-listing-summary-card {
    position: static;
  }
}

/* Narrow viewports — the photo gallery unstacks into a single column and the
   detail rows lose their two-column dt/dd split. */
@media (max-width: 48rem) {
  .bido-listing-context-wrap,
  .bido-listing-main {
    padding-left: 16px;
    padding-right: 16px;
  }
  .bido-listing-gallery {
    grid-template-columns: 1fr;
    grid-template-rows: auto;
    height: auto;
  }
  .bido-listing-gallery > .photo {
    grid-row: auto;
    aspect-ratio: 16 / 10;
    height: auto;
  }
  .bido-listing-details-panel dl > div {
    grid-template-columns: 1fr;
    gap: 2px;
  }
  .bido-gallery-jump {
    position: static;
    margin-top: 8px;
    justify-content: center;
  }
}

