/* Sales features (js/ui/sales/): share panel, presentation mode, sun badge + panel.
   Everything is scoped to .sales-* classes or body[data-presenting]; nothing else changes. */

/* ------------------------------------------------------------ sun badge */
.sales-sun-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  max-width: 100%;
  margin-top: 4px;
  padding: 2px 8px 2px 6px;
  border-radius: var(--r-pill, 999px);
  background: var(--timber-soft);
  color: var(--timber-ink);
  font-size: var(--fs-12, 12px);
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
}
.sales-sun-badge[hidden] { display: none; }
.sales-sun-badge__text { overflow: hidden; text-overflow: ellipsis; }
.sales-sun-badge .sales-sun__icon,
.sales-sun .sales-sun__icon { flex: none; width: 14px; height: 14px; color: var(--timber); }

/* ------------------------------------------------------------ sun panel (drawer) */
.sales-sun { margin: var(--sp-4, 16px) 0; }
.sales-sun[hidden] { display: none; }
.sales-sun__head { display: flex; align-items: center; gap: 8px; }
.sales-sun__head .sales-sun__icon { width: 18px; height: 18px; }
.sales-sun__title { margin: 0; }
.sales-sun__subtitle { margin: 4px 0 8px; color: var(--ink-muted); font-size: var(--fs-12, 12px); }
.sales-sun__seasons { margin-bottom: 8px; }
.sales-sun__headline { margin: 0 0 8px; font-size: var(--fs-13, 13px); line-height: 1.45; }
.sales-sun__table { width: 100%; border-collapse: collapse; font-size: var(--fs-13, 13px); }
.sales-sun__table th,
.sales-sun__table td { padding: 5px 4px; border-top: 1px solid var(--border); text-align: left; vertical-align: top; }
.sales-sun__table thead th { border-top: 0; color: var(--ink-muted); font-weight: var(--fw-medium, 500); font-size: var(--fs-12, 12px); }
.sales-sun__room { font-weight: var(--fw-medium, 500); }
.sales-sun__facing { width: 3.5em; color: var(--ink-muted); }
.sales-sun__cell { display: flex; flex-wrap: wrap; gap: 2px 8px; }
.sales-sun__hours { font-variant-numeric: tabular-nums; }
.sales-sun__range { color: var(--ink-muted); font-variant-numeric: tabular-nums; }
.sales-sun__table tr[data-period="none"] .sales-sun__period { color: var(--ink-muted); }
.sales-sun__method { margin-top: 8px; font-size: var(--fs-12, 12px); color: var(--ink-muted); }
.sales-sun__method summary { cursor: pointer; }
.sales-sun__method p { margin: 6px 0 0; line-height: 1.45; }

/* ------------------------------------------------------------ share panel */
.sales-share {
  width: min(440px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: var(--sp-5, 20px);
  border-radius: var(--r-panel, 16px);
  color: var(--ink);
  overflow: auto;
}
.sales-share::backdrop { background: var(--scrim); }
.sales-share__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.sales-share__title { margin: 0; font-family: var(--font-display); font-size: var(--fs-20, 20px); }
.sales-share__detail { margin: 6px 0 12px; color: var(--ink-muted); font-size: var(--fs-14, 14px); }
.sales-share__label { display: grid; gap: 4px; font-size: var(--fs-12, 12px); color: var(--ink-muted); }
.sales-share__url {
  width: 100%;
  min-height: 40px;
  padding: 8px 10px;
  border: 1px solid var(--control-border, var(--border-strong));
  border-radius: var(--r-xs, 8px);
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: var(--fs-13, 13px);
}
.sales-share__actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.sales-share__actions .btn { flex: 1 1 120px; justify-content: center; min-height: var(--touch, 44px); }
.sales-share__actions .btn[hidden] { display: none; }
.sales-share__whatsapp .icon { color: var(--pine); }
.sales-share__status { min-height: 1.2em; margin: 8px 0 0; font-size: var(--fs-13, 13px); color: var(--pine); }
.sales-share__local {
  margin: 8px 0 0;
  padding: 8px 10px;
  border-radius: var(--r-xs, 8px);
  background: var(--st-reserved-tint);
  color: var(--st-reserved-ink);
  font-size: var(--fs-12, 12px);
}
.sales-share__local[hidden] { display: none; }
.sales-share__privacy { margin: 8px 0 0; font-size: var(--fs-12, 12px); color: var(--ink-muted); }

/* Interim top-bar share button: tablet/desktop only (phones get it in the ☰ menu). */
@media (max-width: 759px) {
  .topbar__share { display: none; }
}

/* ------------------------------------------------------------ presentation mode */
body[data-presenting] #topbar,
body[data-presenting] #context,
body[data-presenting] #rail,
body[data-presenting] #drawer,
body[data-presenting] #list,
body[data-presenting] #sheet,
body[data-presenting] .st-dock-zone,
body[data-presenting] .st-dock,
body[data-presenting] .st-chips,
body[data-presenting] .st-card,
body[data-presenting] .st-compass,
body[data-presenting] .st-legend,
body[data-presenting] .st-model,
body[data-presenting] .st-sun,
body[data-presenting] .vw-tour__modes,
body[data-presenting] .vw-tour__rail,
body[data-presenting] .vw-tour__rooms,
body[data-presenting] .vw-tour__nav,
body[data-presenting] .vw-tour__counter,
body[data-presenting] .vw-tour__actions,
body[data-presenting] .vw-tour__hint,
body[data-presenting] .vw-tour__review,
body[data-presenting] .vw-tour__eyebrow,
body[data-presenting] .vw-tour__title,
body[data-presenting] .vw-tour__caption,
body[data-presenting] .vw-map,
body[data-presenting] [class*="minimap"] {
  display: none !important;
}
/* Kept on purpose: data attribution (.st-credits/.st-attrib) and the PB-3BR notice (.vw-tour__issue). */

.sales-present {
  position: fixed;
  inset: 0;
  z-index: var(--z-toast, 90);
  pointer-events: none;
  display: grid;
  place-items: end center;
  padding: 0 16px calc(16px + var(--safe-bottom, 0px));
}
.sales-present > * { pointer-events: auto; }
.sales-present__bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 16px;
  width: min(720px, 100%);
  padding: 14px 16px 18px 20px;
  border-radius: var(--r-panel, 16px);
  color: var(--ink);
  transition: opacity var(--dur, 240ms) var(--ease, ease);
}
.sales-present__caption { flex: 1; min-width: 0; }
.sales-present__eyebrow { margin: 0; font-size: var(--fs-12, 12px); letter-spacing: var(--tracking-caps, 0.08em); text-transform: uppercase; color: var(--ink-muted); }
.sales-present__title { margin: 2px 0 0; font-family: var(--font-display); font-size: var(--fs-24, 24px); line-height: 1.2; }
.sales-present__text { margin: 4px 0 0; font-size: var(--fs-14, 14px); color: var(--ink-muted); }
.sales-present__text[hidden] { display: none; }
.sales-present__controls { display: flex; gap: 4px; flex: none; }
.sales-present__progress {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 7px;
  height: 3px;
  border-radius: 2px;
  background: var(--basalt-a08);
  overflow: hidden;
}
.sales-present__progress span { display: block; height: 100%; width: 0; background: var(--pine); }
.sales-present[data-idle="true"] .sales-present__controls { opacity: 0; }
.sales-present[data-idle="true"] { cursor: none; }
.sales-present__contact {
  position: fixed;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -60%);
  width: min(460px, calc(100vw - 32px));
  padding: 24px;
  border-radius: var(--r-panel, 16px);
  color: var(--ink);
  text-align: center;
}
.sales-present__contact[hidden] { display: none; }
.sales-present__contact-eyebrow { margin: 0; font-size: var(--fs-12, 12px); letter-spacing: var(--tracking-caps, 0.08em); text-transform: uppercase; color: var(--ink-muted); }
.sales-present__contact-title { margin: 6px 0; font-family: var(--font-display); font-size: var(--fs-32, 32px); }
.sales-present__contact-unit { margin: 0; font-weight: var(--fw-semibold, 600); }
.sales-present__contact-facts { margin: 4px 0 12px; color: var(--ink-muted); }
.sales-present__contact-name { margin: 0 0 12px; }
.sales-present__contact-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; }
.sales-present__contact-actions .btn { min-height: var(--touch, 44px); }
.sales-present__contact-note { margin: 12px 0 0; font-size: var(--fs-12, 12px); color: var(--ink-muted); }

/* Phone landscape / short screens: a slimmer caption bar, the contact card centred. */
@media (max-height: 500px) {
  .sales-present { padding-bottom: calc(8px + var(--safe-bottom, 0px)); }
  .sales-present__bar { padding: 8px 12px 12px 14px; gap: 10px; width: min(640px, 100%); }
  .sales-present__title { font-size: var(--fs-16, 16px); }
  .sales-present__text { font-size: var(--fs-12, 12px); }
  .sales-present__eyebrow { display: none; }
  .sales-present__contact { transform: translate(-50%, -62%); padding: 12px 16px; }
  .sales-present__contact-title { font-size: var(--fs-20, 20px); margin: 2px 0; }
  .sales-present__contact-facts { margin-bottom: 6px; }
  .sales-present__contact-name { margin-bottom: 6px; }
  .sales-present__contact-note { display: none; }
}
@media (max-width: 480px) {
  .sales-present__title { font-size: var(--fs-20, 20px); }
}
@media (prefers-reduced-motion: reduce) {
  .sales-present__bar { transition: none; }
  .sales-present__progress span { transition: none !important; }
}

/* ------------------------------------------------------------ layout fixes (UI declutter, 4 Oct) */
/* The badge's nowrap text must ellipsize, not widen the residence card past its panel (it hid the price). */
.res-card:has(.sales-sun-badge),
.res-card__body:has(> .sales-sun-badge) {
  min-width: 0;
}

/* Phones: the drawer is reordered for the sheet (residences.css); the sun panel follows the details
   so the peek keeps showing status and price (without an order it rose to the top). */
@media (max-width: 759px) {
  .res-drawer__scroll > .sales-sun,
  .res-drawer__content > .sales-sun {
    order: 5;
    margin: var(--sp-4) var(--sp-4) 0;
  }
}
