/* ============================================================
   WALCHSEER HOF — Zeitraum-Kalender (js/datepicker.js)
   Style Guide: Creme-Grund, Kaiser-Schwarz für Anreise/Abreise,
   Gold-Ton für den Zeitraum dazwischen, Cormorant für Monatsnamen.
   ============================================================ */

/* ── Auslöser in der Buchungsleiste (grün) ────────────────── */
.dp-trigger {
  display: flex;
  align-items: center;
  width: 100%;
  min-width: 150px;
  height: 34px;
  padding: 0 26px 0 2px;
  border: 0;
  border-bottom: 1px solid rgba(243,237,226,.35);
  background: transparent url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='14' height='14' viewBox='0 0 24 24' fill='none' stroke='%23E6CC86' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E") no-repeat right 2px center;
  color: var(--wh-off-white);
  font-family: var(--font-sans);
  font-size: var(--text-body-sm);
  text-align: left;
  cursor: pointer;
  transition: border-color var(--transition);
}
.dp-trigger:hover,
.dp-trigger.is-active { border-bottom-color: var(--wh-bronze-300); }
.dp-trigger:focus-visible { outline: 2px solid var(--wh-bronze-300); outline-offset: 3px; }
.dp-trigger > span { pointer-events: none; }
.dp-trigger__ph { color: rgba(243,237,226,.6); }
.bb-field.is-invalid .dp-trigger { border-bottom-color: #E6A08A; }

/* ── Auslöser im Anfrage-Panel (heller Kasten wie die Felder) ── */
.dp-trigger--field {
  height: 48px;
  padding: 0 40px 0 14px;
  border: 1.5px solid var(--border-strong);
  border-radius: var(--radius-md);
  background-color: var(--surface-raised);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%237A5F22' stroke-width='1.8' stroke-linecap='round'%3E%3Crect x='3' y='5' width='18' height='16' rx='2'/%3E%3Cpath d='M16 3v4M8 3v4M3 10h18'/%3E%3C/svg%3E");
  background-position: right 14px center;
  color: var(--text-body);
}
.dp-trigger--field:hover,
.dp-trigger--field.is-active { border-color: var(--border-focus); }
.dp-trigger--field .dp-trigger__ph { color: var(--text-faint); }

/* ── Popover ──────────────────────────────────────────────── */
.dp {
  position: fixed;
  z-index: 70;
  width: max-content;
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 24px);   /* passt immer auf den Bildschirm, notfalls scrollbar */
  max-height: calc(100svh - 24px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 24px 18px;
  border-radius: 16px;
  background: var(--wh-sand-50);
  color: var(--text-body);
  box-shadow: 0 24px 60px rgba(20,18,16,.32), 0 0 0 1px rgba(20,18,16,.06);
  opacity: 0;
  transform: translateY(10px) scale(.98);
  transition: opacity 220ms var(--ease-out), transform 260ms var(--ease-out);
}
.dp--bottom { transform: translateY(-10px) scale(.98); }
.dp.is-open { opacity: 1; transform: none; }
.dp[hidden] { display: none; }

.dp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-5);
  margin-bottom: var(--space-3);
}
.dp-hint {
  font-family: var(--font-sans);
  font-size: 11px;
  font-weight: var(--weight-bold);
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--text-gold);
}
.dp-nav { display: flex; gap: 6px; }
.dp-nav__btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1px solid var(--border-hairline);
  background: var(--surface-raised);
  color: var(--text-body);
  transition: border-color var(--transition), background var(--transition);
}
.dp-nav__btn:hover:not(:disabled) { border-color: var(--wh-ink); }
.dp-nav__btn:disabled { opacity: .35; cursor: default; }
.dp-nav__btn svg { width: 16px; height: 16px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

.dp-months { display: grid; gap: 32px; }
.dp-months--2 { grid-template-columns: repeat(2, auto); }
.dp-month__title {
  margin-bottom: 10px;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  font-size: 1.375rem;
  color: var(--text-display);
  text-align: center;
}
.dp-grid {
  display: grid;
  grid-template-columns: repeat(7, 42px);
  row-gap: 4px;
}
.dp-wd {
  padding-bottom: 6px;
  font-size: 11px;
  font-weight: var(--weight-medium);
  letter-spacing: .06em;
  text-transform: uppercase;
  text-align: center;
  color: var(--text-muted);
}

/* Tage */
.dp-day {
  position: relative;
  height: 42px;
  border: 0;
  background: transparent;
  font-family: var(--font-sans);
  font-size: var(--text-body-sm);
  color: var(--text-body);
  cursor: pointer;
  z-index: 0;
}
.dp-day::after {                       /* runder Punkt für Hover/Start/Ende */
  content: '';
  position: absolute;
  inset: 2px;
  border-radius: 50%;
  z-index: -1;
  transition: background 150ms ease;
}
.dp-day:hover:not(:disabled)::after { background: var(--wh-sand); }
.dp-day.is-today { font-weight: var(--weight-bold); color: var(--text-gold); }
.dp-day.is-before { color: var(--text-muted); }
.dp-day.is-tooshort { color: var(--wh-ink-300); }                  /* zu kurz für das Angebot */
.dp-day.is-tooshort:not(.is-end)::before {
  content: ''; position: absolute; left: 50%; bottom: 7px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--wh-sand-300);
}
.dp-min {
  margin: -4px 0 var(--space-3);
  font-size: var(--text-meta);
  color: var(--text-muted);
}
.dp-min strong { color: var(--text-gold); font-weight: var(--weight-bold); }
.dp-warn {
  margin: 0 0 var(--space-3);
  padding: 10px 14px;
  border-radius: var(--radius-md);
  background: var(--status-error-bg);
  color: var(--status-error);
  font-size: var(--text-meta);
  line-height: 1.45;
  max-width: 560px;
}   /* vor der Anreise: klickbar = neue Anreise */
.dp-day.is-disabled { color: var(--wh-ink-300); text-decoration: line-through; text-decoration-color: rgba(143,136,122,.5); cursor: default; }

/* Zeitraum-Band */
.dp-day.is-in-range { background: var(--wh-bronze-100); }
.dp-day.is-start.has-range { background: linear-gradient(90deg, transparent 50%, var(--wh-bronze-100) 50%); }
.dp-day.is-end.has-range   { background: linear-gradient(90deg, var(--wh-bronze-100) 50%, transparent 50%); }
.dp-day.is-start, .dp-day.is-end { color: var(--wh-off-white); font-weight: var(--weight-bold); }
.dp-day.is-start::after, .dp-day.is-end::after,
.dp-day.is-start:hover::after, .dp-day.is-end:hover::after { background: var(--wh-black); }

/* Fuß: Zusammenfassung + Buttons */
.dp-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  margin-top: var(--space-4);
  padding-top: var(--space-4);
  border-top: 1px solid var(--border-hairline);
}
.dp-summary { font-size: var(--text-body-sm); color: var(--text-muted); }
.dp-summary strong { color: var(--text-body); font-weight: var(--weight-medium); }
.dp-actions { display: flex; align-items: center; gap: var(--space-3); }
.dp-reset {
  border: 0;
  background: none;
  font-family: var(--font-sans);
  font-size: var(--text-meta);
  color: var(--text-muted);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.dp-reset:hover { color: var(--text-body); }
.dp-done:disabled { opacity: .45; cursor: default; }

/* Schmale Fenster: ein Monat, kompakter */
@media (max-width: 720px) {
  .dp { padding: 18px 16px 14px; }
  .dp-grid { grid-template-columns: repeat(7, minmax(36px, 1fr)); }
  .dp-foot { flex-direction: column; align-items: stretch; }
  .dp-actions { justify-content: space-between; }
}
