/* Klohr Weddings – Buchungskalender */

/* OVERLAY */
#kw-cal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 9999;
  background: rgba(26,26,26,0.7);
  backdrop-filter: blur(4px);
  align-items: center;
  justify-content: center;
  padding: 20px;
}
#kw-cal-overlay.open {
  display: flex;
}

/* POPUP */
#kw-cal-popup {
  background: #fff;
  width: 100%;
  max-width: 860px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  display: grid;
  grid-template-columns: 1fr 1fr;
}

/* CLOSE */
#kw-cal-close {
  position: absolute;
  top: 16px;
  right: 20px;
  background: none;
  border: none;
  font-size: 24px;
  cursor: pointer;
  color: #9a9590;
  line-height: 1;
  z-index: 2;
  transition: color 0.2s;
}
#kw-cal-close:hover { color: #1a1a1a; }

/* LEFT – KALENDER */
.kw-cal-left {
  padding: 36px 32px;
  border-right: 1px solid #e8e0d4;
}
.kw-cal-header-top {
  margin-bottom: 6px;
}
.kw-cal-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 26px;
  font-weight: 300;
  color: #1a1a1a;
  margin-bottom: 4px;
}
.kw-cal-sub {
  font-size: 11px;
  color: #9a9590;
  margin-bottom: 20px;
  letter-spacing: 0.04em;
}

/* MONATS-NAVIGATION */
.kw-cal-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}
.kw-cal-nav button {
  background: none;
  border: 1px solid #e8e0d4;
  width: 32px;
  height: 32px;
  cursor: pointer;
  font-size: 16px;
  color: #6b6560;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.kw-cal-nav button:hover {
  background: #1a1a1a;
  color: #fff;
  border-color: #1a1a1a;
}
.kw-cal-month-label {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 18px;
  font-weight: 400;
  color: #1a1a1a;
}

/* GRID */
.kw-cal-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.kw-cal-dow {
  font-size: 9px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #9a9590;
  text-align: center;
  padding: 6px 0;
}
.kw-cal-day {
  aspect-ratio: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 13px;
  border-radius: 2px;
  cursor: default;
  transition: all 0.15s;
  color: #1a1a1a;
  position: relative;
}
.kw-cal-day.empty { background: transparent; }
.kw-cal-day.past  { color: #d8cfc2; cursor: not-allowed; }
.kw-cal-day.heute { font-weight: 500; outline: 1px solid #1a1a1a; }

/* Status-Farben */
.kw-cal-day.frei {
  background: #f0fdf4;
  color: #166534;
  cursor: pointer;
}
.kw-cal-day.frei:hover {
  background: #166534;
  color: #fff;
}
.kw-cal-day.option {
  background: #fefce8;
  color: #854d0e;
  cursor: not-allowed;
}
.kw-cal-day.gebucht {
  background: #fef2f2;
  color: #dc2626;
  cursor: not-allowed;
  text-decoration: line-through;
}
.kw-cal-day.selected {
  background: #1a1a1a !important;
  color: #fff !important;
  font-weight: 500;
}

/* LEGENDE */
.kw-cal-legend {
  display: flex;
  gap: 16px;
  margin-top: 16px;
  flex-wrap: wrap;
}
.kw-legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 11px;
  color: #6b6560;
}
.kw-legend-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  flex-shrink: 0;
}
.kw-legend-dot.frei    { background: #dcfce7; border: 1px solid #86efac; }
.kw-legend-dot.option  { background: #fef9c3; border: 1px solid #fde047; }
.kw-legend-dot.gebucht { background: #fee2e2; border: 1px solid #fca5a5; }

/* RIGHT – FORMULAR */
.kw-cal-right {
  padding: 36px 32px;
  display: flex;
  flex-direction: column;
}
.kw-form-title {
  font-family: 'Cormorant Garamond', Georgia, serif;
  font-size: 22px;
  font-weight: 300;
  color: #1a1a1a;
  margin-bottom: 4px;
}
.kw-selected-date {
  font-size: 13px;
  color: #6b6560;
  margin-bottom: 20px;
  min-height: 20px;
}
.kw-selected-date strong {
  color: #1a1a1a;
  font-weight: 500;
}
.kw-hint {
  background: #f9f6f1;
  border: 1px solid #e8e0d4;
  padding: 16px 18px;
  font-size: 13px;
  color: #6b6560;
  line-height: 1.6;
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

/* FORM FELDER */
.kw-form { display: flex; flex-direction: column; gap: 0; }
.kw-fg {
  position: relative;
  background: #f9f6f1;
  margin-bottom: 2px;
}
.kw-fg label {
  position: absolute;
  top: 7px;
  left: 14px;
  font-size: 9px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: #9a9590;
  pointer-events: none;
}
.kw-fg input,
.kw-fg select,
.kw-fg textarea {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid #e8e0d4;
  color: #1a1a1a;
  font-family: inherit;
  font-size: 14px;
  font-weight: 300;
  padding: 22px 14px 8px;
  outline: none;
  transition: border-color 0.2s;
  -webkit-appearance: none;
  border-radius: 0;
}
.kw-fg input:focus,
.kw-fg select:focus,
.kw-fg textarea:focus {
  border-color: #1a1a1a;
  background: #fff;
}
.kw-fg textarea { resize: none; min-height: 80px; }
.kw-fg select option { background: #fff; }
.kw-form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 2px; margin-bottom: 0; }
.kw-submit {
  margin-top: 2px;
  background: #1a1a1a;
  color: #fff;
  border: none;
  padding: 16px;
  font-family: inherit;
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  cursor: pointer;
  transition: background 0.2s;
  font-weight: 400;
  width: 100%;
}
.kw-submit:hover { background: #2e2e2e; }
.kw-submit:disabled { opacity: 0.6; cursor: not-allowed; }
.kw-form-ok {
  padding: 14px 16px;
  background: #f0fdf4;
  border: 1px solid #bbf7d0;
  color: #166534;
  font-size: 13px;
  margin-top: 8px;
  line-height: 1.5;
}
.kw-form-err {
  padding: 14px 16px;
  background: #fef2f2;
  border: 1px solid #fecaca;
  color: #dc2626;
  font-size: 13px;
  margin-top: 8px;
}

/* LOADING */
.kw-cal-loading {
  text-align: center;
  padding: 40px;
  color: #9a9590;
  font-size: 13px;
  grid-column: span 7;
}

/* RESPONSIVE */
@media (max-width: 680px) {
  #kw-cal-popup {
    grid-template-columns: 1fr;
    max-height: 95vh;
  }
  .kw-cal-left { border-right: none; border-bottom: 1px solid #e8e0d4; padding: 24px 20px; }
  .kw-cal-right { padding: 24px 20px; }
}

/* MOBILE */
@media(max-width:680px){
  #kw-cal-overlay{padding:0;align-items:flex-end}
  #kw-cal-popup{
    grid-template-columns:1fr;
    max-height:92vh;
    border-radius:16px 16px 0 0;
    overflow-y:auto;
  }
  .kw-cal-left{padding:28px 20px 20px;border-right:none;border-bottom:1px solid #e8e0d4}
  .kw-cal-right{padding:24px 20px 32px}
  .kw-form-title{font-size:18px}
  #kw-cal-close{top:16px;right:16px;font-size:24px}
  .kw-cal-grid{gap:2px}
  .kw-cal-day{font-size:12px}
  #kw-form-wrap .kw-fg input,
  #kw-form-wrap .kw-fg select,
  #kw-form-wrap .kw-fg textarea{font-size:16px}
}
