/* Public rental detail page: photo + info header, then the availability
   calendar and booking summary. Order-independent — owns its own selectors and
   its media queries live at the end of this file (project CSS convention). */

.rental-show {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
  padding: 64px var(--pad-x) 40px;
  background: var(--cream);
}

/* Shown instead of the calendar when a rental has no units on hand. */
.booking-paused {
  max-width: 640px;
  margin: 0 auto;
  padding: 24px 28px;
  background: var(--no-bg);
  border-radius: var(--radius-md);
  color: var(--ink);
  font-weight: 700;
  text-align: center;
}

/* No-JS date form (inside <noscript>, so invisible with JS on). */
.booking-noscript {
  display: grid;
  gap: 12px;
  margin: 0 0 20px;
  padding: 18px 20px;
  background: var(--sky-wash);
  border-radius: var(--radius-md);
}

.booking-noscript p {
  margin: 0;
  font-weight: 600;
}

.booking-noscript label {
  display: grid;
  gap: 4px;
  font-weight: 700;
}

.booking-noscript input[type="date"] {
  min-height: 44px;
  padding: 8px 12px;
  border: 2px solid #e5e2da;
  border-radius: var(--radius-sm);
  font: inherit;
}

.rental-hero-image {
  vertical-align: top;
  width: 100%;
  aspect-ratio: 3 / 2;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-xl);
}

.rental-show-info h1 {
  margin: 0;
  color: var(--ink);
  font-family: var(--display-font);
  font-size: clamp(2.4rem, 4vw, 3.6rem);
  font-weight: 800;
  line-height: 1.02;
}

.rental-show-specs {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 1.1rem;
  font-weight: 700;
}

.rental-show-desc {
  margin: 22px 0 0;
  max-width: 46ch;
  color: var(--body);
  font-size: 1.12rem;
  font-weight: 600;
  line-height: 1.55;
}

/* Availability section ---------------------------------------------------- */
.availability-section {
  padding: 56px var(--pad-x) 88px;
  background: var(--sky-wash);
}

.booking-intro {
  max-width: 60ch;
  margin: 14px auto 0;
  color: var(--body);
  font-size: 1.1rem;
  font-weight: 600;
  text-align: center;
}

.booking-key {
  padding: 1px 8px;
  border-radius: 999px;
  font-weight: 800;
}

.booking-key--open {
  background: var(--ok-bg);
  color: var(--ok-ink);
}

.booking-key--booked {
  background: var(--no-bg);
  color: var(--no-ink);
}

.booking-key--premium {
  background: #fff3cf;
  color: #a86a00;
}

/* Weekday / weekend / premium rate table under the price. */
.rate-tiers {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 0;
}

.rate-tier {
  min-width: 120px;
  padding: 10px 14px;
  background: #fff;
  border: 2px solid #eef3f7;
  border-radius: 14px;
}

.rate-tier dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.02em;
}

.rate-tier dd {
  margin: 2px 0 0;
  font-family: var(--display-font);
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--ink);
}

.rate-tier--premium {
  border-color: #ffe8a8;
  background: #fffbee;
}

.rate-tiers-note {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.booking-widget {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: clamp(24px, 4vw, 48px);
  align-items: start;
  max-width: 900px;
  margin: 44px auto 0;
}

/* Calendar ---------------------------------------------------------------- */
.cal {
  display: block;
  padding: 24px;
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.cal-month {
  font-family: var(--display-font);
  font-size: 1.3rem;
  font-weight: 800;
  color: var(--ink);
}

.cal-nav {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 999px;
  background: var(--sky-wash);
  color: var(--ink);
  font-size: 1.4rem;
  font-weight: 800;
  line-height: 1;
}

.cal-nav:hover {
  background: var(--pink-soft);
}

.cal-nav--off {
  opacity: 0.3;
  cursor: default;
}

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 6px;
}

.cal-dow {
  padding-bottom: 6px;
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 800;
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.cal-day {
  aspect-ratio: 1;
  display: grid;
  place-items: center;
  padding: 0;
  border: 2px solid transparent;
  border-radius: var(--radius-sm);
  background: transparent;
  font-family: var(--body-font);
  font-size: 1rem;
  font-weight: 700;
  color: var(--ink);
}

.cal-day.is-past {
  color: #c7ccd3;
}

/* Availability colours */
.cal-day.is-available {
  background: var(--ok-bg);
  color: var(--ok-ink);
  cursor: pointer;
}

.cal-day.is-available:hover {
  background: var(--ok-bg-strong);
}

.cal-day.is-unavailable {
  background: var(--no-bg);
  color: var(--no-ink);
  cursor: not-allowed;
}

/* Premium-rate days get a small star so the higher price isn't a surprise.
   Only selectable (in-month, future, open) days carry the tier class. */
.cal-day.tier-premium {
  position: relative;
}

.cal-day.tier-premium::after {
  content: "★";
  position: absolute;
  top: 2px;
  right: 5px;
  font-size: 0.6rem;
  line-height: 1;
  color: #a86a00;
}

/* Selection state */
.cal-day.is-in-range {
  background: #bfefd5;
  color: #14804a;
}

.cal-day.is-start,
.cal-day.is-end {
  background: var(--green);
  border-color: var(--green-shadow);
  color: #063d22;
}

/* Booking summary --------------------------------------------------------- */
.booking-summary {
  padding: 26px;
  background: #fff;
  border-radius: var(--card-radius);
  box-shadow: var(--card-shadow);
}

.booking-summary-empty {
  margin: 0;
  color: var(--muted);
  font-weight: 700;
  text-align: center;
}

.booking-range {
  margin: 0 0 16px;
  font-family: var(--display-font);
  font-size: 1.2rem;
  font-weight: 800;
  color: var(--ink);
}

/* Per-tier breakdown lines above the totals ("2 × weekend @ $175  $350"). */
.booking-lines {
  margin: 0 0 6px;
  padding: 0;
  list-style: none;
}

.booking-lines li {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 4px 0;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.booking-lines li span:last-child {
  color: var(--body);
  font-weight: 700;
}

.booking-figures {
  margin: 0 0 22px;
}

.booking-figures div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding: 8px 0;
  border-bottom: 1px dashed #e6edf2;
}

.booking-figures dt {
  color: var(--body);
  font-weight: 600;
}

.booking-figures dd {
  margin: 0;
  font-family: var(--display-font);
  font-weight: 800;
  color: var(--ink);
}

.booking-summary .button {
  width: 100%;
  text-align: center;
}

.booking-error {
  margin: 16px 0 0;
  padding: 10px 14px;
  background: var(--no-bg);
  border-radius: var(--radius-sm);
  color: #b3243f;
  font-size: 0.95rem;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 960px) {
  .rental-show {
    grid-template-columns: 1fr;
    gap: 32px;
    padding-top: 44px;
  }

  .booking-widget {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  /* Calendar tightens up on phones (was a separate 480px query). */
  .cal {
    padding: 16px;
  }

  .cal-grid {
    gap: 4px;
  }

  .cal-day {
    border-radius: 9px;
    font-size: 0.92rem;
  }

  /* All three rate boxes stay on one row on phones: equal flex shares, no
     minimum width, tighter padding and type. "Premium dates" may wrap to two
     lines inside its box on the narrowest screens; the amount never does. */
  .rate-tiers {
    flex-wrap: nowrap;
    gap: 8px;
  }

  .rate-tier {
    flex: 1 1 0;
    min-width: 0;
    padding: 8px 6px;
    text-align: center;
  }

  .rate-tier dt {
    font-size: 0.7rem;
    line-height: 1.2;
  }

  .rate-tier dd {
    font-size: 1.15rem;
    white-space: nowrap;
  }
}
