/* ===== HotelDatepicker — Crotiria Brand Overrides ===== */

/* Enlarge the calendar and apply brand colors */
.datepicker {
  font-family: var(--crotiria-font-body, inherit);
  border-radius: var(--crotiria-radius-sm, 12px);
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15), 0 2px 8px rgba(0, 0, 0, 0.08);
  border: none;
  background: #fff;
  padding: 16px;
  z-index: 9999;
}

/* Month headers */
.datepicker .datepicker__month-caption {
  font-weight: 600;
  color: var(--crotiria-color-primary, #28516f);
  font-size: 1.05rem;
  text-transform: capitalize;
}

/* Day names row */
.datepicker .datepicker__week-name {
  font-weight: 600;
  font-size: 0.8rem;
  color: var(--crotiria-color-primary, #28516f);
  opacity: 0.6;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* Day cells */
.datepicker .datepicker__month-day {
  font-size: 0.95rem;
  padding: 6px;
  border-radius: 8px;
  transition: background-color 0.15s ease, color 0.15s ease;
  min-width: 42px;
  min-height: 34px;
  line-height: 34px;
}

/* Weekend days (Saturday=7, Sunday=1) — subtle accent */
.datepicker .datepicker__month-day:nth-child(7n+6),
.datepicker .datepicker__month-day:nth-child(7n) {
  color: #c0392b;
}

/* Today's date */
.datepicker .datepicker__month-day--today:not(.datepicker__month-day--selected) {
  background: var(--crotiria-color-bg, #f4f0ec);
  border-radius: 8px;
}

/* Hover */
.datepicker .datepicker__month-day:not(.datepicker__month-day--disabled):not(.datepicker__month-day--selected):hover {
  background: color-mix(in srgb, var(--crotiria-color-primary, #28516f) 10%, transparent);
  color: var(--crotiria-color-primary, #28516f);
}

/* Selected check-in / check-out */
.datepicker .datepicker__month-day--selected,
.datepicker .datepicker__month-day--checkin-date,
.datepicker .datepicker__month-day--checkout-date {
  background: var(--crotiria-color-primary, #28516f) !important;
  color: #fff !important;
  border-radius: 8px;
  font-weight: 700;
}

/* Range between selected dates — no border-radius on inner days */
.datepicker .datepicker__month-day--hovering,
.datepicker .datepicker__month-day--selected:not(.datepicker__month-day--checkin-date):not(.datepicker__month-day--checkout-date):not(.datepicker__month-day--first-day-selected):not(.datepicker__month-day--last-day-selected) {
  background: color-mix(in srgb, var(--crotiria-color-primary, #28516f) 12%, transparent);
  color: var(--crotiria-color-primary, #28516f);
  border-radius: 0;
}

/* First/last in range — keep rounded corners */
.datepicker .datepicker__month-day--first-day-selected {
  border-radius: 8px 0 0 8px;
}

.datepicker .datepicker__month-day--last-day-selected {
  border-radius: 0 8px 8px 0;
}

/* Disabled / past dates */
.datepicker .datepicker__month-day--disabled {
  opacity: 0.3;
  cursor: not-allowed;
}

/* Navigation arrows — perfect circle */
.datepicker .datepicker__month-button {
  border: none;
  background: transparent;
  color: var(--crotiria-color-primary, #28516f);
  cursor: pointer;
  width: 36px;
  height: 36px;
  padding: 0;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: background-color 0.15s;
}

.datepicker .datepicker__month-button:hover {
  background: color-mix(in srgb, var(--crotiria-color-primary, #28516f) 10%, transparent);
}

/* Hide "selected" info bar — dates are shown in the split check-in/check-out fields */
.datepicker .datepicker__info.datepicker__info--selected {
  display: none !important;
}

/* Info/tooltip bar */
.datepicker .datepicker__info--feedback {
  background: var(--crotiria-color-primary, #28516f);
  color: #fff;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 0.85rem;
  margin-top: 8px;
}

/* Close/clear buttons */
.datepicker .datepicker__close-button,
.datepicker .datepicker__clear-button {
  color: var(--crotiria-color-primary, #28516f);
  font-weight: 600;
  border: none;
  background: transparent;
  cursor: pointer;
  padding: 6px 12px;
  border-radius: 8px;
  transition: background-color 0.15s;
}

.datepicker .datepicker__close-button:hover,
.datepicker .datepicker__clear-button:hover {
  background: color-mix(in srgb, var(--crotiria-color-primary, #28516f) 8%, transparent);
}

/* Desktop: ensure calendar is wide enough for two months side-by-side */
@media (min-width: 768px) {
  .datepicker {
    min-width: 730px;
  }
}

/* Mobile / tablet portrait: stack months vertically */
@media (max-width: 767.98px) {
  .datepicker {
    width: 100% !important;
    max-width: 100vw;
    left: 0 !important;
    right: 0 !important;
    border-radius: 16px 16px 0 0;
    overflow-y: auto;
    max-height: 90vh;
  }

  .datepicker .datepicker__months {
    display: flex;
    flex-direction: column;
  }

  .datepicker .datepicker__months::before {
    display: none;
  }

  .datepicker .datepicker__month {
    float: none !important;
    width: 100% !important;
  }

  .datepicker .datepicker__month--month2 {
    display: table !important;
    margin-top: 8px;
  }

  .datepicker .datepicker__month-day {
    min-width: 38px;
    min-height: 32px;
    line-height: 32px;
    font-size: 0.9rem;
    padding: 4px;
  }
}

/* Tooltip badge for nights count */
.datepicker .datepicker__tooltip {
  background: var(--crotiria-color-accent, #cd9a5a);
  color: #fff;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 0.8rem;
  font-weight: 600;
}
