/* =========================================================
   Календарь «Даты» в фильтре туров (assets/js/season-date-picker.js)
   — вместо Lightpick (04.11). Вид — как календарь поиска на главной
   (макет 2027, assets/css/home-2027.css): дни с выездами в круге 40px,
   выбранный — оранжевый, период — светло-оранжевая полоса.
   Mobile-first: шторка снизу; с 900px — панель под полем, два месяца.
   ========================================================= */

.sdp[hidden] {
  display: none;
}

.sdp {
  color: #16140f;
  font-family: var(--font-main, 'Onest'), system-ui, sans-serif;
  line-height: normal;
  text-align: left;
}

/* Кнопки темы и плагинов — сбрасываем, дальше задаём свои */
.sdp button {
  min-width: 0;
  min-height: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font: inherit;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

/* ---- Шторка снизу (до 900px) ---- */
.sdp__bd {
  position: fixed;
  inset: 0;
  z-index: 1300; /* выше панели «Фильтр» и шапки */
  background: rgba(22, 20, 15, .4);
}

.sdp__panel {
  position: fixed;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 1301;
  box-sizing: border-box;
  max-height: 86vh;
  overflow: auto;
  overscroll-behavior: contain;
  padding: 18px 12px calc(18px + env(safe-area-inset-bottom));
  border-radius: 20px 20px 0 0;
  background: #fff;
  box-shadow: 0 -8px 32px rgba(20, 18, 12, .12);
  animation: sdpUp .22s ease;
}

.sdp__h {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 8px 12px;
  font-size: 18px;
  font-weight: 600;
}

.sdp .sdp__x {
  width: 36px;
  height: 36px;
  border-radius: 999px;
  background: #f0f0f0; /* как крестик шторки на главной */
  color: #16140f;
  font-size: 20px;
}

/* ---- Месяцы и стрелки ---- */
.sdp__nav {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  margin-bottom: 6px;
}

.sdp__titles,
.sdp__months {
  display: grid;
  flex: 1;
  grid-template-columns: minmax(0, 1fr);
}

.sdp__t {
  font-size: 16px;
  font-weight: 600;
  text-align: center;
}

/* Стрелки — крупные, без круга, как на главной и в календаре тура */
.sdp .sdp__a {
  position: absolute;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 999px;
  color: #16140f;
  transform: translateY(-50%);
  transition: background-color .15s;
}

.sdp .sdp__a--prev {
  left: 0;
}

.sdp .sdp__a--next {
  right: 0;
}

.sdp .sdp__a:disabled {
  color: #d6d6cf;
  cursor: default;
}

/* Строки прижаты к верху: у месяца в 5 недель они не растягиваются до высоты
   соседнего месяца в 6 недель — ряды двух месяцев стоят ровно (Иван, 04.11) */
.sdp__months {
  align-items: start;
}

.sdp__g {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  align-content: start;
  row-gap: 4px;
}

.sdp__w {
  padding: 4px 0 6px;
  color: #9aa096;
  font-size: 12px;
  text-align: center;
}

.sdp__c {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 44px;
}

/* Период — сплошная светло-оранжевая полоса высотой с кружок: каждая неделя —
   своя скруглённая «капсула», края периода — от середины оранжевого кружка
   (Иван, 04.11: прямоугольники с рамками внутри рябили). */
.sdp__c.is-in::before {
  content: '';
  position: absolute;
  top: 2px;
  right: 0;
  bottom: 2px;
  left: 0;
  background: #fde9da;
}

.sdp__c.is-row-first::before {
  left: 2px;
  border-radius: 20px 0 0 20px;
}

.sdp__c.is-row-last::before {
  right: 2px;
  border-radius: 0 20px 20px 0;
}

.sdp__c.is-row-first.is-row-last::before {
  border-radius: 20px;
}

.sdp__c.is-start::before {
  left: 50%;
  border-radius: 0;
}

.sdp__c.is-end::before {
  right: 50%;
  border-radius: 0;
}

/* Начало в воскресенье / конец в понедельник — от кружка полосы не нужно */
.sdp__c.is-start.is-row-last::before,
.sdp__c.is-end.is-row-first::before {
  display: none;
}

/* Дни внутри периода — без рамок и белого фона, полоса сплошная */
.sdp__c.is-in .sdp__d.is-on {
  border-color: transparent;
  background: transparent;
}

.sdp .sdp__d {
  position: relative;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  width: 40px;
  height: 40px;
  border: 1px solid transparent;
  border-radius: 999px;
  color: #c4c6bf;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
}

.sdp .sdp__d.is-on {
  border-color: #c9c9c2;
  background: #fff;
  color: #16140f;
  font-weight: 600;
  transition: border-color .15s;
}

.sdp .sdp__d.is-sel {
  border-color: #E86B18;
  background: #E86B18;
  color: #fff;
  font-weight: 600;
}

/* ---- Низ: подсказка, «Дата / Период», «Сбросить» ---- */
.sdp__hint {
  padding: 10px 6px 0;
  color: #9aa096;
  font-size: 13px;
}

/* Выбрано — подпись крупнее и тёмная: «С 5 ноября по 23 декабря» */
.sdp__hint.is-picked {
  color: #16140f;
  font-size: 15px;
  font-weight: 600;
}

.sdp__f {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 6px 2px;
}

.sdp__mode {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: #f0f0f0;
}

.sdp .sdp__mode-o {
  padding: 9px 16px;
  border-radius: 999px;
  color: #2a2a2a;
  font-size: 14px;
  font-weight: 600;
}

.sdp .sdp__mode-o.is-active {
  background: #E86B18;
  color: #fff;
}

.sdp .sdp__any {
  padding: 6px 0;
  color: #E86B18;
  font-size: 14px;
  font-weight: 600;
}

/* Наведение — только мышью: на телефоне серый фон «залипал» бы после касания */
@media (hover: hover) {
  .sdp .sdp__a:not(:disabled):hover {
    background: #f3f3f3;
  }

  .sdp .sdp__x:hover {
    background: #e6e6e6;
  }

  .sdp .sdp__d.is-on:hover {
    border-color: #16140f;
  }
}

.sdp button:focus-visible {
  outline: 2px solid #E86B18;
  outline-offset: 1px;
}

@keyframes sdpUp {
  from { opacity: 0; transform: translateY(24px); }
  to { opacity: 1; transform: none; }
}

@keyframes sdpDn {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .sdp__panel {
    animation: none;
  }
}

/* =========================================================
   С 900px — панель под полем (место считает JS), два месяца
   ========================================================= */
@media (min-width: 900px) {
  .sdp__bd,
  .sdp__h {
    display: none;
  }

  .sdp__panel {
    position: absolute;
    right: auto;
    bottom: auto;
    z-index: 900;
    max-height: none;
    overflow: visible;
    padding: 14px 18px 14px;
    border-radius: 16px;
    box-shadow: 0 1px 2px rgba(20, 18, 12, .06), 0 14px 36px rgba(20, 18, 12, .14);
    animation: sdpDn .18s ease;
  }

  /* Месяц — 7 дней по 44px; заголовки — той же ширины, чтобы стоять над своим месяцем */
  .sdp__g {
    grid-template-columns: repeat(7, 44px);
  }

  .sdp__titles,
  .sdp__months {
    grid-template-columns: 308px;
  }

  /* Месяцы ближе друг к другу — период читается одной полосой (Иван, 04.11; было 32px) */
  .sdp--two .sdp__titles,
  .sdp--two .sdp__months {
    grid-template-columns: repeat(2, 308px);
    column-gap: 16px;
  }
}
