/* ═══════════════════════════════════════════════════════════
   Listing Detail Page — page-specific styles
   Requires: css/main.css loaded first
   ═══════════════════════════════════════════════════════════ */

/* ─── Section headings (Amenities / House Rules) ─────────────
   Overrides the shared .label-sm size (css/main.css) for just these
   3 headings, without affecting .label-sm elsewhere (index.html, host.html). */
#lp-amenities .label-sm,
#lp-house-rules .label-sm {
  font-size: 14px;
}

/* ─── Map modal ──────────────────────────────────────────── */
.map-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.map-modal-backdrop.open { display: flex; }
.map-modal {
  position: relative;
  width: min(92vw, 900px);
  height: min(85vh, 700px);
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
}
.map-modal-close {
  position: absolute;
  top: 14px;
  left: 14px;
  z-index: 10;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: none;
  background: #fff;
  color: var(--charcoal, #1a1a1a);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 2px 10px rgba(0,0,0,.3), 0 0 0 1px rgba(0,0,0,.04);
  transition: transform .15s ease, box-shadow .15s ease;
}
.map-modal-close:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(0,0,0,.35), 0 0 0 1px rgba(0,0,0,.04);
}
.map-modal-close:active { transform: scale(.94); }
.map-modal iframe { width: 100%; height: 100%; border: 0; display: block; }

/* ─── Auth modal (sign in / sign up without leaving listing.html) ──
   Opened by submitBookingRequest() when a guest isn't logged in — see
   openAuthModal() in listing.js. Deliberately minimal (no forgot-password,
   Google, passkey, or role picker — a guest booking here is always
   role='user') compared to the full login.html forms. */
.auth-modal-backdrop {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.6);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.auth-modal-backdrop.open { display: flex; }
.auth-modal {
  position: relative;
  width: min(92vw, 420px);
  max-height: 90vh;
  overflow-y: auto;
  /* White, not cream — the inputs themselves are cream (matching
     login.css's .field input exactly), and login.html's real page
     background is white (.panel-form), which is what gives them contrast
     against their surroundings. A cream modal background made them blend
     in since both were the same color. */
  background: var(--white);
  border-radius: 16px;
  padding: 32px 28px;
  box-shadow: 0 24px 64px rgba(0,0,0,.35);
}
.auth-modal-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: none;
  background: none;
  color: var(--stone);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .15s ease;
}
.auth-modal-close:hover { background: rgba(0,0,0,.06); }

/* Everything below deliberately mirrors css/pages/login.css's .auth-tabs /
   .form-heading / .field / .btn-submit / .alert values exactly, so this
   modal is visually indistinguishable from the real login.html forms —
   just scoped under .auth-modal instead of imported wholesale, since
   login.css also carries page-level rules (a 2-column body grid) that
   would break listing.html's own layout if linked directly. */
.auth-modal-tabs {
  display: flex;
  background: var(--cream);
  border-radius: 50px;
  padding: 4px;
  margin-bottom: 24px;
}
.auth-modal-tab {
  flex: 1;
  padding: 10px;
  text-align: center;
  font-size: .85rem;
  font-weight: 500;
  color: var(--stone);
  border-radius: 50px;
  cursor: pointer;
  transition: all .2s ease;
  border: none;
  background: none;
  font-family: inherit;
}
.auth-modal-tab.active { background: var(--white); color: var(--charcoal); box-shadow: 0 2px 8px rgba(42,37,32,.1); }
.auth-modal h2 { font-family: var(--font-display); font-size: 2rem; font-weight: 500; margin-bottom: 6px; line-height: 1.1; }
.auth-modal p.auth-modal-sub { font-size: .875rem; color: var(--stone); margin-bottom: 20px; line-height: 1.5; }
.auth-modal .field { margin-bottom: 14px; }
.auth-modal label {
  display: block;
  font-size: .72rem;
  font-weight: 500;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--stone);
  margin-bottom: 7px;
}
.auth-modal input[type="text"],
.auth-modal input[type="email"],
.auth-modal input[type="password"] {
  width: 100%;
  padding: 12px 16px;
  border: 1.5px solid var(--parchment);
  border-radius: 12px;
  font-size: 1rem;
  font-family: inherit;
  color: var(--charcoal);
  background: var(--cream);
  transition: border-color .2s, background .2s;
  appearance: none;
}
.auth-modal input[type="text"]:focus,
.auth-modal input[type="email"]:focus,
.auth-modal input[type="password"]:focus {
  outline: none;
  border-color: var(--clay);
  background: var(--white);
}
.auth-modal-submit {
  width: 100%;
  padding: 14px;
  background: var(--forest);
  color: var(--white);
  border: none;
  border-radius: 12px;
  font-size: .95rem;
  font-weight: 500;
  font-family: inherit;
  cursor: pointer;
  margin-top: 8px;
  transition: all .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}
.auth-modal-submit:hover { background: var(--forest-light); transform: translateY(-1px); }
.auth-modal-submit:disabled { opacity: .6; cursor: not-allowed; transform: none; }
.auth-modal-error {
  background: #fdf0ef;
  border: 1px solid #f5c6c2;
  color: #c0392b;
  border-radius: 12px;
  padding: 12px 16px;
  font-size: .85rem;
  margin-bottom: 20px;
  display: none;
}
.auth-modal-success { text-align: center; padding: 12px 0; }
.auth-modal-success .icon { font-size: 2.5rem; margin-bottom: 12px; }

/* On phones the map deserves as much of the screen as possible; desktop
   keeps the original capped size so it doesn't balloon on large monitors. */
@media (max-width: 640px) {
  .map-modal-backdrop { padding: 8px; }
  .map-modal {
    width: 95vw;
    height: 90vh;
  }
}

/* ─── Page shell ─────────────────────────────────────────── */
.lp-back-bar {
  position: sticky;
  top: var(--header-h);
  z-index: 100;
  background: rgba(247, 243, 238, .95);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--parchment);
  padding: 10px 0;
}

.lp-back-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.lp-back-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: .875rem;
  color: var(--stone);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px 0;
  transition: color var(--dur);
}

.lp-back-btn:hover {
  color: var(--charcoal);
}

.lp-header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.lp-gallery-wrap {
  padding: 20px 0 0;
}

#lp-gallery {
  max-width: 1100px;
  margin: 0 auto;
}

.lp-layout {
  display: block;
  max-width: 1100px;
  margin: 0 auto;
  padding: 32px 0 80px;
}

.lp-main-col {
  min-width: 0;
}

.lp-title {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3vw, 2.4rem);
  font-weight: 500;
  color: var(--charcoal);
  line-height: 1.15;
  margin-top: 8px;
}

@media (max-width: 768px) {
  .lp-back-bar {
    display: none;
  }

  .lp-gallery-wrap {
    padding: 12px 0 0;
  }

  .lp-layout {
    padding: 20px 0 80px;
  }

  .lp-title {
    font-size: 1.5rem;
  }
}

/* ─── Photo Lightbox ──────────────────────────────────────── */
.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, .95);
  z-index: 3000;
  display: none;
  flex-direction: column;
}

.photo-lightbox.open {
  display: flex;
}

.lightbox-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  flex-shrink: 0;
}

.lightbox-counter {
  color: rgba(255, 255, 255, .65);
  font-size: .875rem;
}

.lightbox-close {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .1);
  border: none;
  color: white;
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s;
}

.lightbox-close:hover {
  background: rgba(255, 255, 255, .2);
}

.lightbox-body {
  flex: 1;
  display: flex;
  align-items: center;
  min-height: 0;
  position: relative;
}

.lightbox-img-wrap {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  padding: 20px 64px;
  min-width: 0;
}

.lightbox-img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  border-radius: var(--radius);
  display: block;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .12);
  border: none;
  color: white;
  font-size: 1.5rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background .18s;
  z-index: 1;
}

.lightbox-nav:hover {
  background: rgba(255, 255, 255, .25);
}

.lightbox-nav.prev {
  left: 12px;
}

.lightbox-nav.next {
  right: 12px;
}

@media (max-width: 768px) {
  .lightbox-img-wrap {
    padding: 12px 50px;
  }

  .lightbox-nav {
    width: 36px;
    height: 36px;
    font-size: 1.2rem;
  }

  .lightbox-nav.prev {
    left: 6px;
  }

  .lightbox-nav.next {
    right: 6px;
  }
}

/* ─── Availability calendar ───────────────────────────────── */
.cal-wrap {
  padding: 4px 0;
}

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

.cal-nav {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--mist);
  border: none;
  font-size: 1.3rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--charcoal);
  transition: background .12s;
}

.cal-nav:disabled {
  opacity: .3;
  cursor: default;
}

.cal-nav:not(:disabled):hover {
  background: var(--parchment);
}

.cal-month-label {
  font-weight: 600;
  font-size: 1rem;
  color: var(--charcoal);
}

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

.cal-day-name {
  text-align: center;
  font-size: .65rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--stone);
  padding: 6px 0;
}

.cal-day {
  text-align: center;
  padding: 10px 2px;
  font-size: .875rem;
  cursor: default;
  color: var(--charcoal);
  border-radius: 50%;
  transition: background .12s;
  position: relative;
  user-select: none;
}

.cal-day.empty  { background: none; }
.cal-day.past        { color: #c0b8b0; pointer-events: none; }
.cal-day.unavailable { color: #b8b0a8; background: rgba(0,0,0,.04); border-radius: 6px; pointer-events: none; }
.cal-day.booked      { color: #b8b0a8; background: rgba(0,0,0,.04); border-radius: 6px; text-decoration: line-through; pointer-events: none; }
.cal-day.minstay     { color: #b8b0a8; opacity: .8; }

.cal-day.available {
  cursor: pointer;
  color: var(--charcoal);
}

.cal-day.available:hover {
  background: var(--parchment);
}

.cal-day.checkout-only {
  cursor: pointer;
  color: var(--stone);
  font-style: italic;
}

.cal-day.checkin {
  background: var(--forest) !important;
  color: white;
  border-radius: 50%;
  cursor: pointer;
}

.cal-day.checkout {
  background: var(--forest) !important;
  color: white;
  border-radius: 50%;
}

.cal-day.inrange {
  background: rgba(45, 74, 56, .12);
  border-radius: 0;
}

.cal-selection {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  margin-top: 18px;
  padding: 14px;
  background: var(--mist);
  border-radius: 12px;
}

.cal-sel-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.cal-sel-item span {
  font-size: .7rem;
  text-transform: uppercase;
  letter-spacing: .06em;
  color: var(--stone);
}

.cal-sel-item strong {
  font-size: .9rem;
  color: var(--charcoal);
}

/* ─── Fee breakdown ───────────────────────────────────────── */
.cal-fee-breakdown {
  margin-top: 14px;
  padding: 14px;
  background: var(--mist);
  border-radius: 12px;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.cal-fee-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: .85rem;
  color: var(--charcoal);
  padding: 8px 0;
  border-bottom: 1px solid var(--parchment);
}

.cal-fee-row:last-child {
  border-bottom: none;
}

.cal-fee-duration {
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .03em;
  color: var(--stone);
  padding-bottom: 10px;
}

.cal-fee-total {
  padding-top: 10px;
  font-weight: 700;
}

.cal-fee-total span,
.cal-fee-total strong {
  font-size: .95rem;
  color: var(--charcoal);
}

/* ─── Floating "Check Availability" pill (mobile only) ───────
   Sits just above .float-nav (css/components/float-nav.css) — that bar
   is ~90px tall (60px items + 15px top/bottom padding) plus
   safe-area-inset-bottom, so this pill's `bottom` clears it with a
   12px gap. Shown/hidden via its own scroll-threshold JS (listing.js),
   deliberately a different trigger (200px) than the nav bar's (100px). */
.lp-float-book {
  display: none;
}

@media (max-width: 768px) {
  .lp-float-book {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    position: fixed;
    left: 50%;
    bottom: calc(90px + env(safe-area-inset-bottom) + 12px);
    transform: translateX(-50%) translateY(10px);
    z-index: 840;
    background: var(--clay);
    color: #fff;
    border: none;
    border-radius: 999px;
    padding: 14px 24px;
    font-family: inherit;
    font-size: .875rem;
    font-weight: 600;
    white-space: nowrap;
    box-shadow: 0 8px 24px rgba(0, 0, 0, .25);
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .3s ease, transform .3s ease;
  }

  .lp-float-book svg {
    width: 16px;
    height: 16px;
    stroke: currentColor;
    fill: none;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
    flex-shrink: 0;
  }

  .lp-float-book.visible {
    opacity: 1;
    pointer-events: all;
    transform: translateX(-50%) translateY(0);
  }
}
