/* ── Availability calendar + enquiry widget ───────────────────────────── */

:root {
  --plc-fg: #1c1c1e;
  --plc-muted: #8a8a8e;
  --plc-line: #e5e5ea;
  --plc-accent: #1e7a34;       /* endpoints — solid */
  --plc-accent-soft: #eaf6ee;  /* available — pale */
  --plc-accent-hover: #d6ecdd; /* available, hovered */
  --plc-accent-mid: #b5ddc4;   /* nights in range — mid */
  --plc-danger: #c0392b;
  --plc-radius: 10px;
}

* { box-sizing: border-box; }

/* Transparent so the host page's background shows through the iframe
   rather than a white box. Both html and body must be set — either one
   left opaque paints over the other. */
html,
body {
  background: transparent;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  margin: 0;
  padding: 1rem;
  color: var(--plc-fg);
  -webkit-font-smoothing: antialiased;
}

#pricelabs-calendar { max-width: 900px; margin: 0 auto; }

.plc-loading,
.plc-error {
  text-align: center;
  padding: 3rem 1rem;
  color: var(--plc-muted);
  font-size: 0.9rem;
}
.plc-error { color: var(--plc-danger); }

/* ── Two-column layout, collapsing to one on narrow screens ─────────────*/

.plc-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 2rem;
  align-items: start;
}

@media (max-width: 760px) {
  .plc-layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 1.5rem;
  }
}

/* ── Calendar ───────────────────────────────────────────────────────────*/

.plc-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1rem;
}

.plc-header button {
  background: #f4f4f6;
  border: none;
  border-radius: 8px;
  width: 36px;
  height: 36px;
  font-size: 1rem;
  cursor: pointer;
  color: var(--plc-fg);
  transition: background 0.12s ease;
}
.plc-header button:hover:not(:disabled) { background: #e8e8ec; }
.plc-header button:disabled { opacity: 0.25; cursor: default; }

.plc-month-title { font-size: 1.1rem; font-weight: 600; }

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

.plc-day-label {
  text-align: center;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.04em;
  color: var(--plc-muted);
  padding-bottom: 6px;
  text-transform: uppercase;
}

.plc-day {
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: var(--plc-radius);
  font-size: 0.85rem;
  padding: 2px;
  border: none;
  background: none;
  font-family: inherit;
  color: var(--plc-fg);
  transition: background 0.1s ease, color 0.1s ease;
}

.plc-day.empty { visibility: hidden; }

.plc-day.available {
  background: var(--plc-accent-soft);
  color: var(--plc-accent);
  cursor: pointer;
}
.plc-day.available:hover { background: var(--plc-accent-hover); }

.plc-day.unavailable {
  background: #f5f5f7;
  /* De-emphasised but still legible — #c2c2c6 measured 1.63:1, well under
     the 3:1 floor, which made booked dates unreadable. */
  color: #8a8a8e;
  text-decoration: line-through;
  cursor: not-allowed;
}

/* Selection states. Three deliberately distinct steps:
   available (pale) → in-range (mid) → endpoint (solid).           */
.plc-day.in-range,
.plc-day.in-range:hover {
  background: var(--plc-accent-mid);
  color: #14612a;
}

.plc-day.endpoint,
.plc-day.endpoint:hover {
  background: var(--plc-accent);
  color: #fff;
}

.plc-day:focus-visible {
  outline: 2px solid var(--plc-accent);
  outline-offset: 2px;
}

.plc-date-num { line-height: 1.1; }

.plc-price {
  font-size: 0.62rem;
  font-weight: 600;
  margin-top: 2px;
  color: var(--plc-muted);
}
/* Order matters: these share specificity with the rule above, so the
   selected states must come last or the price is painted green-on-green
   and disappears. */
.plc-day.available .plc-price { color: var(--plc-accent); }
.plc-day.in-range .plc-price { color: #14612a; }
.plc-day.endpoint .plc-price { color: #fff; }

.plc-legend {
  display: flex;
  gap: 1.25rem;
  justify-content: center;
  margin-top: 1rem;
  font-size: 0.75rem;
  color: var(--plc-muted);
  flex-wrap: wrap;
}
.plc-legend span { display: inline-flex; align-items: center; gap: 6px; }

.plc-dot {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  display: inline-block;
}

.plc-hint {
  text-align: center;
  font-size: 0.78rem;
  color: var(--plc-muted);
  margin-top: 0.75rem;
  min-height: 1.2em;
}
.plc-hint.warn { color: var(--plc-danger); }

/* ── Invoice sidebar ────────────────────────────────────────────────────*/

.plc-invoice {
  border: 1px solid var(--plc-line);
  border-radius: 14px;
  padding: 1.25rem;
  position: sticky;
  top: 1rem;
}

@media (max-width: 760px) {
  .plc-invoice { position: static; }
}

.plc-invoice h2 {
  font-size: 1rem;
  margin: 0 0 0.25rem;
  font-weight: 600;
}

.plc-stay {
  font-size: 0.8rem;
  color: var(--plc-muted);
  margin-bottom: 1rem;
}

.plc-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
  font-size: 0.85rem;
  padding: 0.4rem 0;
}
.plc-line .plc-line-label { color: #55555a; }
.plc-line .plc-line-value { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Per-night breakdown. Rates vary night to night, so each is listed. */
.plc-nights-head {
  font-weight: 600;
  padding-bottom: 0.25rem;
}
.plc-nights-head .plc-link { font-size: 0.78rem; }

.plc-nights {
  max-height: 13rem;
  overflow-y: auto;
  padding-left: 0.5rem;
  border-left: 2px solid var(--plc-accent-soft);
}

.plc-night {
  padding: 0.2rem 0;
  font-size: 0.8rem;
}
.plc-night .plc-line-label { color: var(--plc-muted); }

.plc-subtotal {
  border-top: 1px solid var(--plc-line);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
}

/* ── Rate selection ─────────────────────────────────────────────────────*/

.plc-rates {
  border: none;
  margin: 0.85rem 0 0.25rem;
  padding: 0;
  display: grid;
  gap: 0.4rem;
}

.plc-rates-legend {
  padding: 0;
  font-size: 0.72rem;
  font-weight: 600;
  color: #55555a;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  margin-bottom: 0.15rem;
}

.plc-rate {
  display: flex;
  align-items: flex-start;
  gap: 0.55rem;
  border: 1px solid var(--plc-line);
  border-radius: 10px;
  padding: 0.6rem 0.7rem;
  cursor: pointer;
  transition: border-color 0.12s ease, background 0.12s ease;
}
.plc-rate:hover { border-color: var(--plc-accent-mid); }

.plc-rate.selected {
  border-color: var(--plc-accent);
  background: var(--plc-accent-soft);
}

/* Keep the native radio: it carries keyboard and screen-reader behaviour
   for free, and styling a replacement usually loses one or the other. */
.plc-rate input {
  margin: 0.15rem 0 0;
  accent-color: var(--plc-accent);
  flex: none;
}

.plc-rate-body { display: block; flex: 1; min-width: 0; }

.plc-rate-top {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  flex-wrap: wrap;
}

.plc-rate-name { font-size: 0.85rem; font-weight: 600; }

.plc-rate-price {
  display: block;
  font-size: 0.95rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-top: 0.1rem;
}

.plc-rate-note {
  display: block;
  font-size: 0.72rem;
  color: var(--plc-accent);
  font-weight: 600;
  margin-top: 0.05rem;
}

.plc-badge {
  background: var(--plc-accent);
  color: #fff;
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  text-transform: uppercase;
  padding: 0.12rem 0.4rem;
  border-radius: 999px;
  white-space: nowrap;
}

.plc-discount .plc-line-label,
.plc-discount .plc-line-value {
  color: var(--plc-accent);
  font-weight: 600;
}

.plc-total {
  border-top: 1px solid var(--plc-line);
  margin-top: 0.5rem;
  padding-top: 0.75rem;
  font-weight: 700;
  font-size: 0.95rem;
}

.plc-empty-invoice {
  font-size: 0.82rem;
  color: var(--plc-muted);
  line-height: 1.5;
}

/* ── Form ───────────────────────────────────────────────────────────────*/

.plc-form { margin-top: 1.25rem; }

.plc-field { margin-bottom: 0.75rem; }

.plc-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem;
}

.plc-field label {
  display: block;
  font-size: 0.72rem;
  font-weight: 600;
  color: #55555a;
  margin-bottom: 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.plc-field input,
.plc-field textarea {
  width: 100%;
  border: 1px solid var(--plc-line);
  border-radius: 8px;
  padding: 0.55rem 0.65rem;
  font-size: 0.88rem;
  font-family: inherit;
  color: var(--plc-fg);
  background: #fff;
}

.plc-field input:focus,
.plc-field textarea:focus {
  outline: none;
  border-color: var(--plc-accent);
  box-shadow: 0 0 0 3px var(--plc-accent-soft);
}

.plc-field textarea { resize: vertical; min-height: 80px; }

.plc-link {
  background: none;
  border: none;
  padding: 0;
  font-family: inherit;
  font-size: 0.8rem;
  color: var(--plc-accent);
  cursor: pointer;
  text-decoration: underline;
  margin-bottom: 0.75rem;
}

.plc-submit {
  width: 100%;
  background: var(--plc-accent);
  color: #fff;
  border: none;
  border-radius: 10px;
  padding: 0.8rem;
  font-size: 0.92rem;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: opacity 0.12s ease;
}
.plc-submit:hover:not(:disabled) { opacity: 0.9; }
.plc-submit:disabled { opacity: 0.4; cursor: not-allowed; }

.plc-form-msg {
  font-size: 0.8rem;
  margin-top: 0.75rem;
  line-height: 1.4;
}
.plc-form-msg.ok { color: var(--plc-accent); }
.plc-form-msg.err { color: var(--plc-danger); }
