/* Календарь Nika Travel — только на страницах с формой даты */

:root {
  --nika-cal-shadow: 0 5px 20px rgba(69, 84, 102, 0.5);
}

.nika-cal {
  position: absolute;
  z-index: 1000;
  box-sizing: border-box;
  width: min(300px, calc(100vw - 24px));
  padding: 10px;
  border-radius: 8px;
  background: var(--white);
  box-shadow: var(--nika-cal-shadow);
  font-family: Montserrat, sans-serif;
  font-size: 14px;
  line-height: 1.2;
  color: var(--navy);
  -webkit-user-select: none;
  user-select: none;
}

.nika-cal[hidden] {
  display: none !important;
}

.nika-cal__head {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 2px;
  margin-bottom: 4px;
  min-height: 40px;
}

.nika-cal__title,
.nika-cal__nav,
.nika-cal__cell {
  margin: 0;
  border: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  cursor: pointer;
}

.nika-cal__title {
  padding: 8px 10px;
  border-radius: 8px;
  font-weight: 500;
  text-align: left;
}

.nika-cal__nav {
  width: 40px;
  height: 40px;
  border-radius: 8px;
  font-size: 26px;
  line-height: 1;
}

.nika-cal__title:hover,
.nika-cal__nav:hover,
.nika-cal__cell:hover:not(:disabled) {
  background: var(--muted);
}

.nika-cal__week,
.nika-cal__grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}

.nika-cal__week {
  margin-bottom: 2px;
}

.nika-cal__week-day {
  padding: 6px 0;
  background: var(--muted);
  color: var(--navy);
  font-weight: 700;
  font-size: 11px;
  text-align: center;
  text-transform: uppercase;
}

.nika-cal__week-day:first-child {
  border-radius: 5px 0 0 5px;
}

.nika-cal__week-day:last-child {
  border-radius: 0 5px 5px 0;
}

.nika-cal__cell {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 38px;
  border-radius: 6px;
  font-size: 14px;
}

.nika-cal__cell.is-muted {
  color: #999;
}

.nika-cal__cell.is-today {
  font-weight: 500;
}

.nika-cal__cell.is-selected,
.nika-cal__cell.is-selected:hover {
  background: var(--muted);
  color: var(--text);
  font-weight: 500;
}

.nika-cal__cell:disabled {
  color: #ccc;
  cursor: default;
  background: transparent;
}

.nika-cal__months,
.nika-cal__years {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nika-cal__months .nika-cal__cell,
.nika-cal__years .nika-cal__cell {
  min-height: 42px;
}

@media (max-width: 767px) {
  .nika-cal {
    width: min(320px, calc(100vw - 24px));
  }

  .nika-cal__cell {
    min-height: 40px;
  }

  .nika-cal__months .nika-cal__cell,
  .nika-cal__years .nika-cal__cell {
    min-height: 44px;
  }
}
