/* =========================================================
   BUTTON (der auf der Seite angezeigt wird)
========================================================= */
.button-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  gap: 2rem;                 /* Abstand zwischen Buttons */
  margin-bottom: 1.2rem;
}

/* Buttons sollen sich auf Desktop nicht dehnen */
.button-row > div {
  flex: 0 0 auto;
}

.calendar-widget {
  border-radius: 0.3rem;
  background: #ffffff;
}

.calendar-btn {
  display: flex;
  align-items: center;
  gap: 1rem;
  background: #ffffff;
  border: none;
  border-radius: 0.3rem;
  padding: 0.9rem 1.8rem;
  color: #727272;
  font-family: "Montserrat", sans-serif;
  font-weight: 400;
  font-size: 1.0rem;
  line-height: 1.4rem !important;
  cursor: pointer;
}

.booking {
  border-radius: 0.3rem;
  background: #ffffff;
}

.booking-btn {
  background: #C0AE74 !important;
  color: #ffffff !important;
}

.calendar-btn:hover {
  background: rgba(192,174,116,0.2);
  color: #464646;
}

.booking-btn:hover {
  background: #717029 !important;
}

.calendar-btn .icon {
  width: 20px;
  height: 20px;
}

.calendar-btn .arrow {
  margin-left: auto;
  width: 16px;
  height: 16px;
}

.booking-btn .arrow {
  margin-left: auto !important;
  width: 12px !important;
  height: 18px !important;
}

/* ================================================
   MOBILE: Buttons untereinander
================================================ */

@media (max-width: 640px) {
  .button-row {
    flex-direction: column;   /* untereinander */
    align-items: stretch;
    gap: 0.8rem;
  }

  .button-row > div {
    width: 100%;
  }

  .calendar-btn {
    width: 100%;
    justify-content: flex-start;
    gap: 0.8rem;
    padding: 0.9rem 1.2rem;
    font-size: 0.95rem;
  }
}


/* =========================================================
   MODAL + ANIMATION
========================================================= */

.calendar-modal {
  position: fixed;
  inset: 0;
  display: none;
  justify-content: center;
  align-items: center;
  background: rgba(0,0,0,0.35);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
  z-index: 9999;
}

.calendar-modal.show {
  opacity: 1;
  pointer-events: all;
}

.calendar-modal-content {
  background: #ffffff;
  padding: 22px;
  border-radius: 0.3rem;
  width: 95%;
  max-width: 750px;
  font-family: "Montserrat", sans-serif;
  animation: fadeIn 0.25s ease;
}

@keyframes fadeIn {
  from { transform: scale(0.98); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}


/* =========================================================
   HEADER (zentriert, Summary rechts, Pfeile klickbar)
========================================================= */

.cal-header {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  position: relative;
  z-index: 10;
  margin-bottom: 1.4rem;
  margin-top: 0.4rem;
  height: 3rem;
}

/* Monatsbereich */
.cal-month-area {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  pointer-events: none; /* verhindert Blockieren der Pfeile */
}

.cal-month-label {
  font-weight: 500;
  font-size: 1.1rem;
  color: #727272;
  text-align: center;
  pointer-events: none; /* verhindert Blockieren der Pfeile */
}

/* Summary */
.cal-summary {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  padding: 0.2rem 0.8rem;
  background: #C0AE74;
  border-radius: 0.25rem;
  font-size: 0.74rem;
  font-weight: 500;
  color: #fff;
  white-space: nowrap;
  pointer-events: none;
}

.cal-summary-empty {
  display: none !important;
}

/* Mobile: Summary ausblenden */
@media (max-width: 480px) {
  .cal-summary { display: none !important; }
}

/* Navigation Buttons — NEUE FIXED HITBOX */
.cal-nav {
  width: 3rem;
  height: 3rem;
  background: none;
  border: none;
  cursor: pointer;

  display: flex;
  align-items: center;
  justify-content: center;

  position: relative;
  z-index: 50; /* ← schützt Buttons vor Overlap */
  pointer-events: auto;
  touch-action: manipulation;
}

.cal-nav img {
  width: 1.8rem;
  height: 1.8rem;
  display: block;
  pointer-events: none; /* ← wichtig! */
  transition: transform 0.18s ease;
}

.cal-nav:hover img {
  transform: scale(1.12);
}


/* =========================================================
   WEEKDAYS
========================================================= */

.cal-weekdays {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  margin-bottom: 0.8rem;
}

.cal-weekdays span {
  text-align: center;
  font-size: 0.9rem;
  font-weight: 500;
  color: #727272;
}


/* =========================================================
   GRID + DAY CELLS
========================================================= */

.cal-grid {
  display: grid;
  grid-template-columns: repeat(7,1fr);
  gap: 0.2rem;
}

.cal-day {
  min-height: 65px;
  border-radius: 0.3rem;
  padding: 0.4rem;
  display: flex;
  flex-direction: column;
  position: relative; /* notwendig für Tooltip */
}

.cal-day-number {
  font-weight: 500;
  font-size: 0.9rem;
  margin-bottom: 2px;
}

.cal-day-label {
  font-weight: 300;
  font-size: 0.9rem;
}


/* =========================================================
   HEUTE MARKIERUNG
========================================================= */

.cal-day-today {
  outline: 0.24rem solid #717029;
  outline-offset: -0.24rem;
}

.cal-day-today-closed {
  outline: 0.24rem solid #C0AE74;
  outline-offset: -0.24rem;
}


/* =========================================================
   STATUS-FARBEN
========================================================= */

.cal-day-free {
  background: #C0AE74;
  color: #ffffff;
}

.cal-day-booked {
  background: #c5c5c5;
  color: #333333;
}

.cal-day-closed {
  background: #464646;
  color: #ffffff;
}

.cal-day-empty {
  background: transparent;
}


/* =========================================================
   MOBILE: Label ausblenden & kompaktere Zellen
========================================================= */

@media (max-width: 480px) {
  .cal-day-label { display: none !important; }

  .cal-day {
    min-height: 48px;
    padding: 0.3rem;
    display: flex;
    justify-content: center;
    align-items: center;
  }

  .cal-day-number {
    margin: 0;
    font-size: 0.85rem;
  }
}


/* =========================================================
   TOOLTIP (nur Mobil)
========================================================= */

@media (max-width: 480px) {
  .cal-tooltip {
    position: absolute;
    top: -1.8rem;
    left: 50%;
    transform: translateX(-50%);
    background: #000000cc;
    color: #fff;
    padding: 0.25rem 0.6rem;
    font-size: 0.75rem;
    border-radius: 0.25rem;
    white-space: nowrap;
    opacity: 0;
    transition: opacity 0.15s ease;
    z-index: 30;
    pointer-events: none;
  }

  .cal-day.show-tooltip .cal-tooltip {
    opacity: 1;
  }
}


/* =========================================================
   MOBILE LEGENDE
========================================================= */

.cal-legend {
  display: none;
  margin-top: 1.2rem;
  font-size: 0.9rem;
  color: #727272;
  font-family: "Montserrat", sans-serif;
  gap: 1rem;
}

.cal-legend-item {
  display: flex;
  align-items: center;
  gap: 0.4rem;
}

.cal-legend-color {
  width: 1rem;
  height: 1rem;
  border-radius: 0.25rem;
}

@media (max-width: 480px) {
  .cal-legend {
    display: flex;
    justify-content: space-around;
  }
}