/* Public listing page (/listings/:slug) */

.public-page {
  padding: 32px 0 90px;
  min-height: calc(100vh - var(--header-h));
}

/* This page doesn't load dashboard.css/sites.css (where these are normally
   defined) — restyled here to match exactly. */
.dashboard-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 60px 0;
}

.dashboard-empty {
  margin: 16px 0 0;
  padding: 32px;
  text-align: center;
  color: var(--text-muted);
  font-size: 14px;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
}

.breadcrumbs {
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--text-muted);
}

.breadcrumbs a {
  color: var(--text-muted);
  text-decoration: none;
}

.breadcrumbs a:hover {
  color: var(--purple);
  text-decoration: underline;
}

.listing-page {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 32px;
  align-items: start;
}

.listing-page__preview {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.creative-workspace {
  position: sticky;
  top: 88px;
  padding: 16px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(120% 80% at 0% 0%, rgba(124, 58, 237, 0.08), transparent 55%),
    linear-gradient(180deg, #f8f7fc 0%, #ffffff 100%);
  border: 1px solid rgba(124, 58, 237, 0.12);
}

.creative-workspace__header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  margin-bottom: 12px;
}

.creative-workspace__title {
  margin: 0;
  font-size: 16px;
  font-weight: 700;
  color: var(--text);
}

.creative-workspace__hint {
  margin: 0;
  flex: 1 1 auto;
  font-size: 12px;
  color: var(--text-muted);
}

.creative-workspace__viewports {
  display: inline-flex;
  gap: 4px;
  padding: 2px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.04);
}

.creative-workspace__slotInfo {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.03);
  border: 1px solid rgba(15, 23, 42, 0.06);
}

.creative-workspace__slotSize,
.creative-workspace__slotRatio {
  margin: 0;
  font-size: 12.5px;
  color: var(--text);
  font-weight: 600;
}

.creative-workspace__slotRatio {
  margin-top: 2px;
  font-weight: 500;
  color: var(--text-muted);
}

.creative-workspace__viewportSizes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 8px;
}

.creative-workspace__viewportSize {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 8px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  background: transparent;
  border: 1px solid transparent;
}

.creative-workspace__viewportSize.is-active {
  color: var(--text);
  background: #fff;
  border-color: rgba(124, 58, 237, 0.28);
  box-shadow: 0 0 0 2px rgba(124, 58, 237, 0.1);
}

.creative-workspace__viewportSize.is-unavailable {
  opacity: 0.55;
}

.creative-workspace__slotInfo.is-unavailable .creative-workspace__slotSize,
.creative-workspace__slotInfo.is-unavailable .creative-workspace__slotRatio {
  color: #b45309;
  font-weight: 600;
}

.creative-workspace__viewportBtn,
.creative-workspace__fitBtn {
  border: 0;
  background: transparent;
  padding: 6px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
}

.creative-workspace__viewportBtn.is-active,
.creative-workspace__fitBtn.is-active {
  background: #fff;
  color: var(--text);
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.08);
}

.creative-workspace__stage {
  position: relative;
  min-height: 180px;
}

.creative-workspace__slotMount {
  display: flex;
  justify-content: center;
  padding: 12px 0 4px;
}

.creative-workspace__hiddenNotice {
  margin: 24px 0;
  padding: 16px;
  text-align: center;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  background: rgba(15, 23, 42, 0.03);
  border-radius: var(--radius-md);
}

.creative-workspace__fit {
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid rgba(15, 23, 42, 0.06);
}

.creative-workspace__fitLabel {
  margin: 0 0 8px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.creative-workspace__fitModes {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.creative-workspace__coverTools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}

.creative-workspace__zoom {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.creative-workspace__dragHint {
  margin: 0;
  width: 100%;
  font-size: 12px;
  color: var(--text-muted);
}

.vb-creative-preview__badge {
  position: absolute;
  top: 6px;
  left: 6px;
  z-index: 2;
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  pointer-events: none;
}

.vb-creative-preview__empty {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 12px;
  text-align: center;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.vb-creative-preview__img {
  z-index: 1;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
}

.vb-creative-preview__img.is-dragging {
  cursor: grabbing;
}

.listing-cover {
  position: relative;
  width: 100%;
  aspect-ratio: 21 / 9;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--brand-gradient-soft);
}

.listing-cover__fallback {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 16px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  text-align: center;
}

/* When a ready preview exists, the placeholder box above is overridden by
   the real (often much taller than 21:9) screenshot at its natural aspect
   ratio — the fixed-height box is only ever the no-preview fallback. */
.listing-cover:has(.listing-cover__img) {
  aspect-ratio: auto;
  background: none;
}

.listing-cover__img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-lg);
}

.listing-cover__highlight {
  position: absolute;
  box-sizing: border-box;
  border: 2px solid var(--purple);
  background: rgba(124, 58, 237, 0.15);
  border-radius: 4px;
  pointer-events: none;
}

.listing-cover__highlight[hidden] {
  display: none;
}

.listing-title {
  margin: 20px 0 4px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.listing-type {
  margin: 0 0 16px;
  font-size: 14px;
  color: var(--text-muted);
}

.listing-description {
  margin: 0 0 20px;
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-muted);
}

.listing-specs {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px 24px;
  margin: 0 0 20px;
  padding: 16px 20px;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
}

.listing-specs dt {
  font-size: 11.5px;
  font-weight: 700;
  color: var(--text-muted);
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.listing-specs dd {
  margin: 2px 0 0;
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}

.site-link {
  display: inline-block;
  font-size: 14px;
  font-weight: 600;
  color: var(--purple-dark);
  text-decoration: none;
}

.site-link:hover {
  text-decoration: underline;
}

.listing-page__side {
  position: sticky;
  top: 24px;
  padding: 24px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.listing-price-block {
  margin-bottom: 16px;
}

.listing-price {
  margin: 0;
  font-size: 2rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--purple-dark);
  line-height: 1.1;
}

.listing-price .vb-price__approx {
  font-size: 0.95rem;
  font-weight: 600;
}

.listing-price__unit {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-muted);
}

.listing-rates {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: var(--text-muted);
}

.listing-rates li + li {
  margin-top: 2px;
}

.listing-rates[hidden] {
  display: none;
}

.listing-discount-preview {
  margin: 10px 0 0;
  padding: 0;
  list-style: none;
  font-size: 13px;
  color: #166534;
}

.listing-discount-preview li + li {
  margin-top: 2px;
}

.listing-discount-preview[hidden] {
  display: none;
}

.listing-booking-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 12px;
}

.listing-booking-meta__min {
  font-size: 12.5px;
  color: var(--text-muted);
}

.booking-mode-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 8px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
}

.booking-mode-badge--instant {
  background: #ede9fe;
  color: var(--purple-dark);
}

.booking-mode-badge--request {
  background: var(--bg-muted);
  color: var(--text-muted);
}

#viewPlacementBtn {
  display: block;
  width: 100%;
  margin-top: 10px;
  text-align: center;
}

#viewPlacementBtn[hidden] {
  display: none;
}

@media (max-width: 720px) {
  .listing-page {
    grid-template-columns: 1fr;
  }

  .listing-page__side {
    position: static;
  }

  .creative-workspace {
    position: static;
  }

  .public-page {
    padding-bottom: 110px;
  }
}

/* Booking calendar */

.booking-calendar {
  margin-top: 20px;
  padding-top: 20px;
  border-top: 1px solid var(--border);
}

.booking-calendar[hidden] {
  display: none;
}

.booking-calendar--disabled .booking-calendar__day,
.booking-calendar--loading .booking-calendar__day {
  pointer-events: none;
}

.booking-calendar--loading {
  opacity: 0.7;
}

.booking-status {
  margin: 12px 0 0;
  font-size: 13.5px;
  line-height: 1.45;
}

.booking-status--loading {
  color: var(--text-muted);
}

.booking-status--unavailable {
  color: var(--text);
  font-weight: 600;
}

.booking-status--error {
  color: #b42318;
}

.booking-status[hidden],
.booking-retry[hidden] {
  display: none;
}

.booking-retry {
  margin-top: 10px;
}

#listingApiError .btn {
  margin-left: 8px;
}

.booking-calendar__nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.booking-calendar__label {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.booking-calendar__navBtn {
  width: 28px;
  height: 28px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  color: var(--text);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
}

.booking-calendar__navBtn:hover {
  background: var(--bg-muted);
}

.booking-calendar__navBtn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.booking-calendar__weekdays,
.booking-calendar__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.booking-calendar__weekdays {
  margin-bottom: 4px;
  font-size: 11px;
  font-weight: 700;
  color: var(--text-muted);
  text-align: center;
  text-transform: uppercase;
}

.booking-calendar__day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12.5px;
  border-radius: var(--radius-md);
  border: none;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.booking-calendar__day:hover:not(:disabled) {
  background: var(--bg-muted);
}

.booking-calendar__day:disabled {
  color: var(--text-muted);
  opacity: 0.4;
  cursor: not-allowed;
}

.booking-calendar__day--empty {
  visibility: hidden;
  cursor: default;
}

.booking-calendar__day--blocked {
  color: var(--text-muted);
  text-decoration: line-through;
  background: var(--bg-muted);
}

.booking-calendar__day--selected {
  background: var(--purple);
  color: #fff;
  font-weight: 700;
}

.booking-calendar__day--in-range {
  background: rgba(124, 58, 237, 0.15);
  color: var(--purple-dark);
  font-weight: 600;
}

.booking-calendar__legend {
  display: flex;
  gap: 16px;
  margin: 10px 0;
  font-size: 12px;
  color: var(--text-muted);
}

.booking-calendar__legend span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.booking-calendar__swatch {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 3px;
}

.booking-calendar__swatch--selected {
  background: var(--purple);
}

.booking-calendar__swatch--blocked {
  background: var(--bg-muted);
  border: 1px solid var(--border);
}

.booking-calendar__hint {
  margin: 4px 0 12px;
  font-size: 13px;
  color: var(--text-muted);
}

.booking-summary {
  margin: 0 0 14px;
  padding: 12px 14px;
  background: var(--bg-muted);
  border-radius: var(--radius-md);
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  font-size: 13px;
}

.booking-summary[hidden] {
  display: none;
}

.booking-summary dt {
  color: var(--text-muted);
}

.booking-summary dd {
  margin: 0;
  font-weight: 700;
  color: var(--text);
  text-align: right;
}

#bookingSummaryLocalLabel,
#bookingSummaryLocalTotal {
  font-weight: 600;
  color: var(--text-muted);
}

.booking-error,
.booking-success {
  margin: 0 0 12px;
  font-size: 13px;
  padding: 8px 10px;
  border-radius: var(--radius-md);
}

.booking-error {
  color: #b91c1c;
  background: #fef2f2;
}

.booking-success {
  color: #15803d;
  background: #f0fdf4;
}

.booking-error[hidden],
.booking-success[hidden] {
  display: none;
}

#bookingSubmitBtn {
  display: block;
  width: 100%;
  text-align: center;
}

#bookingSubmitBtn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.booking-auth-note {
  margin: 10px 0 0;
  font-size: 12.5px;
  text-align: center;
  color: var(--text-muted);
}

.booking-auth-note[hidden] {
  display: none;
}

.booking-auth-note a {
  color: var(--purple-dark);
  font-weight: 600;
}

.booking-auth-hint {
  margin: 8px 0 0;
  font-size: 12px;
  text-align: center;
  color: var(--text-muted);
}

.booking-auth-hint[hidden] {
  display: none;
}

.booking-resume-note {
  margin: 0 0 12px;
  padding: 10px 12px;
  border-radius: 8px;
  background: #f5f3ff;
  color: #4c1d95;
  font-size: 13px;
  line-height: 1.4;
}

.booking-resume-note[hidden] {
  display: none;
}

.booking-auth-gate {
  margin: 0 0 14px;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  background: var(--bg);
  display: grid;
  gap: 10px;
  text-align: center;
}

.booking-auth-gate[hidden] {
  display: none;
}

.booking-auth-gate__title {
  margin: 0;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}

.booking-auth-gate__copy {
  margin: 0;
  font-size: 13.5px;
  line-height: 1.45;
  color: var(--text-muted);
}

.booking-auth-gate__login {
  margin: 0;
  font-size: 13px;
  color: var(--text-muted);
}

.booking-auth-gate__login a {
  color: var(--purple-dark);
  font-weight: 600;
}

.booking-form {
  margin: 0 0 14px;
  display: grid;
  gap: 10px;
}

.booking-form[hidden] {
  display: none;
}

.booking-form__row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.booking-form__field {
  display: grid;
  gap: 4px;
}

.booking-form__label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.booking-form__input {
  width: 100%;
  padding: 8px 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  font: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: #fff;
}

.booking-form__input:focus {
  outline: none;
  border-color: var(--purple);
  box-shadow: 0 0 0 3px rgba(124, 58, 237, 0.12);
}

.booking-form__check {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.booking-form__check input {
  margin-top: 2px;
}

.booking-form__creative {
  margin: 0 0 12px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
}

.booking-form__recommended {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 6px;
  background: var(--bg-muted);
}

.booking-form__recommendedTitle {
  margin: 0 0 2px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.booking-form__recommendedDims {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
}

.booking-form__recommendedRatio {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--text-muted);
}

.booking-form__recommended.is-unavailable .booking-form__recommendedDims,
.booking-form__recommended.is-unavailable .booking-form__recommendedRatio {
  color: #b45309;
}

.booking-form__creativeHint {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.booking-form__creativeName {
  margin: 0 0 2px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  word-break: break-all;
}

.booking-form__creativeDims {
  margin: 0 0 8px;
  font-size: 12px;
  color: var(--text-muted);
}

.booking-form__creativeWarn {
  margin: 0 0 8px;
  font-size: 12px;
  color: #b45309;
}

.booking-form__creativeActions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.booking-geo {
  margin: 0 0 14px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  display: grid;
  gap: 8px;
}

.booking-geo__legend {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}

.booking-geo__hint {
  margin: 0;
  font-size: 12.5px;
  color: var(--text-muted);
  line-height: 1.4;
}

.booking-geo__modes {
  display: grid;
  gap: 6px;
}

.booking-geo__mode {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  font-size: 13px;
  color: var(--text);
  cursor: pointer;
}

.booking-geo__worldwide {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.4;
  color: #92400e;
  background: #fffbeb;
  border-radius: var(--radius-md);
  padding: 8px 10px;
}

.booking-geo__worldwide[hidden],
.booking-geo__picker[hidden],
.booking-geo__conflict[hidden],
.booking-geo__results[hidden] {
  display: none;
}

.booking-geo__picker {
  display: grid;
  gap: 6px;
  position: relative;
}

.booking-geo__results {
  list-style: none;
  margin: 0;
  padding: 4px 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: #fff;
  max-height: 220px;
  overflow: auto;
  z-index: 3;
}

.booking-geo__result {
  padding: 8px 10px;
  font-size: 13px;
  cursor: pointer;
}

.booking-geo__result:hover,
.booking-geo__result.is-active {
  background: var(--bg-muted);
}

.booking-geo__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.booking-geo__chip {
  border: 1px solid var(--border);
  background: var(--bg-muted);
  border-radius: 999px;
  padding: 4px 10px;
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}

.booking-geo__chip:hover,
.booking-geo__chip:focus {
  border-color: var(--purple);
}

.booking-geo__limit {
  margin: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.booking-geo__conflict {
  margin: 0;
  font-size: 12.5px;
  line-height: 1.45;
  color: #b91c1c;
  background: #fef2f2;
  border-radius: var(--radius-md);
  padding: 8px 10px;
}

.booking-confirm {
  margin: 0 0 12px;
  padding: 12px;
  border-radius: var(--radius-md);
  background: var(--bg-muted);
}

.booking-confirm__title {
  margin: 0 0 8px;
  font-size: 14px;
  font-weight: 700;
}

.booking-confirm__list {
  margin: 0 0 12px;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px 10px;
  font-size: 12.5px;
}

.booking-confirm__list dt {
  color: var(--text-muted);
}

.booking-confirm__list dd {
  margin: 0;
  font-weight: 600;
}

.booking-confirm__thumb {
  width: 72px;
  height: 48px;
  object-fit: contain;
  border-radius: 4px;
  background: #fff;
  border: 1px solid var(--border);
}

.booking-confirm__actions {
  display: flex;
  gap: 8px;
  justify-content: flex-end;
}

.booking-mobile-bar {
  display: none;
}

@media (max-width: 720px) {
  .booking-form__row {
    grid-template-columns: 1fr;
  }

  .booking-mobile-bar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 50;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 12px 16px calc(12px + env(safe-area-inset-bottom, 0px));
    background: #fff;
    border-top: 1px solid var(--border);
    box-shadow: 0 -8px 24px rgba(15, 23, 42, 0.08);
  }

  .booking-mobile-bar[hidden] {
    display: none;
  }

  .booking-mobile-bar__info {
    display: flex;
    flex-direction: column;
    min-width: 0;
  }

  .booking-mobile-bar__price {
    font-size: 14px;
    font-weight: 700;
    color: var(--text);
  }

  .booking-mobile-bar__price .vb-price__approx {
    font-size: 11px;
    font-weight: 600;
  }

  .booking-mobile-bar__meta {
    font-size: 12px;
    color: var(--text-muted);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  #bookingSubmitBtn {
    display: none;
  }
}
