/* =========================================================
   ЗЕЛЕМІНЬ — блок бронювання + календар (світлий і темний варіант)
   Layout: заголовок ліворуч, нижче дві панелі — календар (2 місяці) | гості й підсумок,
   під ними — смуга з месенджерами.
   ========================================================= */

/* ---------- Секція ---------- */
.booking {
  position: relative;
  background:
    radial-gradient(80% 60% at 100% 0%, rgba(111, 125, 71, .12), transparent 60%),
    var(--linen);
  color: var(--ink);
  padding-block: clamp(72px, 9vw, 140px);
  padding-inline: var(--gutter);
  color-scheme: light;
}
.booking__inner { max-width: var(--container); margin: 0 auto; }

.booking__head {
  display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr); gap: 24px 64px; align-items: end;
  margin-bottom: clamp(36px, 4vw, 56px);
}
.section-eyebrow {
  grid-column: 1 / -1; margin: 0;
  display: flex; align-items: center; gap: 14px;
  font-size: var(--step--1); font-weight: 600; letter-spacing: .26em; text-transform: uppercase;
  color: var(--olive-600);
}
.section-eyebrow::before { content: ""; width: 56px; height: 1px; background: currentColor; }
.booking__title {
  margin: 0; font-family: var(--font-display); font-weight: 600;
  font-size: var(--step-h2); line-height: 1; letter-spacing: -.01em; text-wrap: balance;
}
.booking__title em { font-style: italic; font-weight: 500; color: var(--olive-600); }
.booking__lead { margin: 0; max-width: 34em; color: var(--ink-soft); font-size: 1.05rem; justify-self: end; }

.booking__grid {
  display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(360px, 1fr); gap: 24px; align-items: stretch;
}
.booking-cal { display: flex; flex-direction: column; }
.booking-cal__foot { margin-top: auto !important; }
.booking-cal .cal { margin-bottom: 26px; }
.panel {
  background: var(--paper); border: 1px solid var(--line); border-radius: 28px;
  padding: clamp(20px, 2.4vw, 36px);
  box-shadow: 0 40px 80px -50px rgba(28, 36, 20, .35);
  min-width: 0;
}
.panel__title { margin: 0 0 6px; font-family: var(--font-display); font-weight: 600; font-size: 1.7rem; line-height: 1.1; }

/* ---------- Календар (спільні стилі) ---------- */
.cal { position: relative; --c-fg: var(--ink); --c-soft: var(--ink-soft); --c-line: var(--line);
       --c-cell: #fff; --c-cell-hover: #f3f0e6; --c-busy: #ebe6da; --c-busy-fg: rgba(28, 36, 20, .38);
       --c-range: rgba(92, 104, 59, .14); --c-sel: var(--olive-600); --c-sel-fg: var(--cream);
       --c-price: var(--olive-600); --c-pill: #efebe0;
       color: var(--c-fg); }
.cal--dark { --c-fg: var(--cream); --c-soft: var(--cream-soft); --c-line: var(--glass-line);
       --c-cell: rgba(240, 224, 184, .06); --c-cell-hover: rgba(240, 224, 184, .14);
       --c-busy: transparent; --c-busy-fg: rgba(240, 224, 184, .3);
       --c-range: rgba(185, 195, 140, .16); --c-sel: var(--cream); --c-sel-fg: var(--forest-900);
       --c-price: var(--moss-300); --c-pill: rgba(240, 224, 184, .08); }

.cal__bar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 22px; }
.cal__selects { display: flex; gap: 8px; }
.cal__select { position: relative; }
.cal__select select {
  appearance: none; -webkit-appearance: none;
  border: 1px solid var(--c-line); background: var(--c-pill); color: var(--c-fg);
  border-radius: 999px; padding: 10px 40px 10px 20px; font-weight: 600; font-size: .95rem; cursor: pointer;
}
.cal__select::after {
  content: ""; position: absolute; right: 18px; top: 50%; width: 7px; height: 7px; margin-top: -5px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor; transform: rotate(45deg); pointer-events: none;
}
.cal--dark .cal__select select option { background: var(--forest-900); }
.cal__nav {
  width: 44px; height: 44px; border-radius: 50%; flex: none;
  border: 1px solid var(--c-line); background: var(--c-pill); cursor: pointer; display: grid; place-items: center;
  transition: background .3s, border-color .3s, opacity .3s;
}
.cal__nav:hover:not(:disabled) { border-color: var(--c-fg); }
.cal__nav:disabled { opacity: .3; cursor: default; }

.cal__months { display: grid; grid-template-columns: repeat(var(--months, 1), minmax(0, 1fr)); gap: clamp(24px, 3vw, 48px); }
.cal__month-title { margin: 0 0 12px; font-family: var(--font-display); font-size: 1.45rem; font-weight: 600; text-transform: capitalize; }
.cal__wd, .cal__grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 6px; }
.cal__wd { margin-bottom: 8px; }
.cal__wd span { text-align: center; font-size: .72rem; font-weight: 600; letter-spacing: .12em; text-transform: uppercase; color: var(--c-soft); }
.cal__wd span:nth-child(5), .cal__wd span:nth-child(6) { color: var(--c-price); } /* ночі пт і сб — вихідний тариф */

.cal-day {
  position: relative; aspect-ratio: 1 / 1; min-width: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border: 1px solid var(--c-line); border-radius: 14px; background: var(--c-cell);
  color: var(--c-fg); cursor: pointer; padding: 0;
  transition: background .25s, border-color .25s, color .25s, transform .25s var(--ease);
}
.cal-day__n { font-weight: 600; font-size: 1.02rem; line-height: 1; font-variant-numeric: tabular-nums; }
.cal-day__p { font-size: .62rem; line-height: 1; color: var(--c-price); font-variant-numeric: tabular-nums; letter-spacing: .01em; }
.cal-day:hover:not(:disabled) { background: var(--c-cell-hover); border-color: var(--c-fg); }
.cal-day.is-empty { visibility: hidden; }
.cal-day.is-past { background: transparent; border-color: transparent; color: var(--c-busy-fg); cursor: default; }
.cal-day.is-past .cal-day__p { display: none; }
.cal-day.is-busy {
  background: var(--c-busy)
    repeating-linear-gradient(-45deg, transparent 0 6px, rgba(128, 128, 110, .12) 6px 7px);
  border-color: transparent; color: var(--c-busy-fg); cursor: not-allowed;
}
.cal-day.is-busy .cal-day__n { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.cal-day.is-busy .cal-day__p { visibility: hidden; }
/* день, на який можна виїхати, хоча з цього дня ніч зайнята */
.cal-day.is-checkout-ok { cursor: pointer; color: var(--c-fg); border-color: var(--c-line);
  background: linear-gradient(135deg, var(--c-cell) 50%, var(--c-busy) 50%); }
.cal-day.is-checkout-ok .cal-day__n { text-decoration: none; }
.cal-day.is-today::after { content: ""; position: absolute; top: 7px; right: 7px; width: 5px; height: 5px; border-radius: 50%; background: var(--ember); }
.cal-day.is-range { background: var(--c-range); border-color: transparent; }
.cal-day.is-hover-range { background: var(--c-range); border-style: dashed; border-color: var(--c-price); }
.cal .cal-day.is-start, .cal .cal-day.is-end { background: var(--c-sel); border-color: var(--c-sel); color: var(--c-sel-fg); }
.cal-day.is-start .cal-day__p, .cal-day.is-end .cal-day__p { color: inherit; opacity: .8; }
.cal-day.is-start::before, .cal-day.is-end::before {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%);
  font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 999px; background: var(--ember); color: var(--forest-900); white-space: nowrap;
}
.cal-day.is-start::before { content: "заїзд"; }
.cal-day.is-end::before { content: "виїзд"; }

/* підказка при наведенні: що станеться після кліку */
.cal-day.is-preview-in, .cal-day.is-preview-out { border-color: var(--c-price); border-style: dashed; }
.cal-day.is-preview-in::before, .cal-day.is-preview-out::before {
  position: absolute; top: -9px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-size: .58rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 999px; white-space: nowrap;
  background: var(--c-cell); color: var(--c-price); border: 1px solid var(--c-price);
}
.cal-day.is-preview-in::before { content: "заїзд"; }
.cal-day.is-preview-out::before { content: "виїзд"; }

/* хрестик для скасування дати */
.cal-day__x {
  position: absolute; top: -8px; right: -8px; z-index: 3;
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: var(--ink); color: var(--cream); border: 2px solid var(--paper);
  font-size: .85rem; line-height: 1; font-weight: 600;
  opacity: 0; transform: scale(.6); transition: opacity .2s, transform .25s var(--ease);
}
.cal--dark .cal-day__x { background: var(--ember); color: var(--forest-900); border-color: var(--forest-900); }
.cal-day.is-start:hover .cal-day__x, .cal-day.is-end:hover .cal-day__x,
.cal-day.is-start:focus-visible .cal-day__x, .cal-day.is-end:focus-visible .cal-day__x { opacity: 1; transform: none; }
.cal .cal-day.is-start:hover, .cal .cal-day.is-end:hover { filter: brightness(.92); }
@media (hover: none) { .cal-day__x { opacity: 1; transform: none; } }
.cal-day.is-shake { animation: shake .4s; }
@keyframes shake { 25% { transform: translateX(-3px); } 75% { transform: translateX(3px); } }

.cal--dark .cal-day { border-radius: 12px; }
.cal--dark .cal-day__n { font-size: .95rem; }
.cal--dark .cal__month-title { font-size: 1.3rem; }

.cal-legend { display: flex; flex-wrap: wrap; gap: 8px 18px; font-size: .82rem; color: inherit; opacity: .85; }
.cal-legend span { display: inline-flex; align-items: center; gap: 8px; }
.lg { width: 16px; height: 16px; border-radius: 5px; border: 1px solid var(--line); display: inline-block; }
.lg--free { background: #fff; }
.lg--busy { background: #ebe6da repeating-linear-gradient(-45deg, transparent 0 3px, rgba(128, 128, 110, .25) 3px 4px); }
.lg--sel { background: var(--olive-600); border-color: var(--olive-600); }
.qb-pop .lg { border-color: var(--glass-line); }
.qb-pop .lg--free { background: rgba(240, 224, 184, .12); }
.qb-pop .lg--busy { background: transparent repeating-linear-gradient(-45deg, transparent 0 3px, rgba(240, 224, 184, .3) 3px 4px); }

.booking-cal__foot {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px 24px;
  margin-top: 26px; padding-top: 22px; border-top: 1px solid var(--line);
}
.booking-cal__hint { margin: 0; font-weight: 600; font-size: 1rem; }
.booking-cal__hint.is-warn { color: #a3541f; }

/* ---------- Форма ---------- */
.booking-form { position: relative; display: grid; grid-template-columns: minmax(0, 1fr); gap: 22px; }
.guest-row {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--line);
}
.guest-row:last-child { border-bottom: 0; padding-bottom: 0; }
.guest-row__name { margin: 0; font-weight: 600; }
.guest-row__note { margin: 2px 0 0; font-size: .84rem; color: var(--ink-soft); }
.stepper--light .stepper__btn { border-color: var(--line); background: #fff; width: 40px; height: 40px; font-size: 1.15rem; }
.stepper--light .stepper__btn:hover:not(:disabled) { background: var(--olive-600); border-color: var(--olive-600); color: var(--cream); }
.stepper--light output { font-size: 1.15rem; min-width: 2ch; }

/* Підсумок */
.summary {
  border-radius: 22px; padding: 22px;
  background: var(--forest-900); color: var(--cream);
  background-image: radial-gradient(90% 80% at 100% 0%, rgba(111, 125, 71, .45), transparent 60%);
}
.summary__dates { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: 10px; padding-bottom: 18px; border-bottom: 1px solid var(--glass-line); }
.summary__right { text-align: right; }
.summary__label { display: block; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase; font-weight: 600; color: var(--moss-300); }
.summary__date { display: block; font-family: var(--font-display); font-weight: 600; font-size: 1.55rem; line-height: 1.15; }
.summary__time { display: block; font-size: .78rem; color: var(--cream-soft); }
.summary__nights {
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--glass-line);
  font-size: .8rem; font-weight: 600; white-space: nowrap;
}
.summary__lines { list-style: none; margin: 0; padding: 14px 0; display: grid; gap: 8px; font-size: .9rem; color: var(--cream-soft); }
.summary__lines li { display: flex; justify-content: space-between; gap: 12px; }
.summary__lines li span:last-child { color: var(--cream); font-variant-numeric: tabular-nums; white-space: nowrap; }
.summary__lines .is-muted { font-style: italic; }
.summary__total { display: flex; justify-content: space-between; align-items: baseline; padding-top: 14px; border-top: 1px solid var(--glass-line); }
.summary__total span { font-size: .9rem; color: var(--cream-soft); }
.summary__total strong { font-family: var(--font-display); font-size: 2.3rem; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }

.booking-form__contacts { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.field { display: grid; gap: 6px; min-width: 0; border: 0; padding: 0; margin: 0; }
.field > label, .field > legend { font-size: .72rem; letter-spacing: .16em; text-transform: uppercase; font-weight: 600; color: var(--ink-soft); padding: 0; }
.field input {
  width: 100%; min-width: 0; padding: 14px 16px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 1rem;
  transition: border-color .3s, box-shadow .3s;
}
.field input::placeholder { color: rgba(28, 36, 20, .35); }
.field input:focus { outline: none; border-color: var(--olive-600); box-shadow: 0 0 0 4px rgba(92, 104, 59, .15); }
.field input.is-invalid { border-color: #b4532a; }
.field--chips { grid-column: 1 / -1; }
.field--chips legend { margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { position: relative; }
.chip input { position: absolute; inset: 0; opacity: 0; pointer-events: none; }
.chip span {
  display: inline-block; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; font-size: .88rem; font-weight: 600; cursor: pointer; transition: background .3s, color .3s, border-color .3s;
}
.chip span:hover { border-color: var(--olive-600); }
.chip input:checked + span { background: var(--olive-600); border-color: var(--olive-600); color: var(--cream); }
.chip input:focus-visible + span { outline: 2px solid var(--ember); outline-offset: 2px; }

.booking-form__error { margin: -6px 0 0; color: #a3541f; font-weight: 600; font-size: .9rem; }
.booking-form__fine { margin: -8px 0 0; font-size: .82rem; color: var(--ink-soft); text-align: center; }
.booking-form .btn--primary { box-shadow: 0 20px 40px -20px rgba(75, 86, 49, .8); }
.booking-form .btn--primary:disabled { opacity: .6; cursor: progress; }

.booking-done {
  position: absolute; inset: 0; z-index: 2; border-radius: 28px;
  background: var(--paper);
  display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; gap: 12px;
  padding: 32px; animation: popIn .5s var(--ease);
}
.booking-done__icon { color: var(--olive-600); }
.booking-done h3 { margin: 0; font-family: var(--font-display); font-size: 2.2rem; font-weight: 600; }
.booking-done p { margin: 0; max-width: 26em; color: var(--ink-soft); }
.btn--ghost-dark { border-color: var(--line); background: #fff; color: var(--ink); margin-top: 8px; }
.btn--ghost-dark:hover { border-color: var(--ink); }

/* ---------- Смуга контактів ---------- */
.contact-bar {
  margin-top: 24px; padding: 22px clamp(20px, 2.4vw, 36px);
  border-radius: 28px; background: var(--forest-900); color: var(--cream);
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px 32px;
  scroll-margin-top: 110px;
}
.contact-bar__title { margin: 0; font-family: var(--font-display); font-size: 1.6rem; font-weight: 600; line-height: 1.15; }
.contact-bar__sub { margin: 2px 0 0; font-size: .9rem; color: var(--cream-soft); }
.contact-bar__links { display: flex; flex-wrap: wrap; gap: 10px; }
.contact-btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 12px 18px; border-radius: 999px; border: 1px solid var(--glass-line);
  font-weight: 600; font-size: .92rem; white-space: nowrap;
  transition: background .3s, color .3s, border-color .3s, transform .3s var(--ease);
}
.contact-btn svg { width: 20px; height: 20px; flex: none; }
.contact-btn:hover { background: var(--cream); color: var(--forest-900); border-color: var(--cream); transform: translateY(-2px); }
.contact-btn--phone { background: var(--olive-600); border-color: var(--olive-600); font-variant-numeric: tabular-nums; }

/* ---------- Адаптив ---------- */
@media (max-width: 1180px) {
  .booking__grid { grid-template-columns: minmax(0, 1fr); }
  .booking__head { grid-template-columns: minmax(0, 1fr); }
  .booking__lead { justify-self: start; }
}
@media (max-width: 760px) {
  .booking { padding-block: 64px; }
  .panel { border-radius: 22px; padding: 18px 14px; }
  .cal__bar { margin-bottom: 16px; }
  .cal__select select { padding: 9px 32px 9px 14px; font-size: .88rem; }
  .cal__select::after { right: 13px; }
  .cal__nav { width: 40px; height: 40px; }
  .cal__wd, .cal__grid { gap: 4px; }
  .cal-day { border-radius: 10px; }
  .cal-day__n { font-size: .92rem; }
  .cal-day__p { font-size: .55rem; }
  .cal-day.is-start::before, .cal-day.is-end::before { font-size: .5rem; padding: 1px 4px; top: -7px; }
  .booking-form__contacts { grid-template-columns: minmax(0, 1fr); }
  .summary { padding: 18px; }
  .summary__date { font-size: 1.3rem; }
  .summary__total strong { font-size: 1.9rem; }
  .contact-bar { border-radius: 22px; }
  .contact-bar__links { width: 100%; display: grid; grid-template-columns: 1fr 1fr; }
  .contact-btn { justify-content: center; }
  .contact-btn--phone { grid-column: 1 / -1; }
}
@media (max-width: 380px) {
  .cal-day__p { display: none; }
}

/* дати, недосяжні для виїзду з поточного заїзду */
.cal-day.is-unreachable:not(.is-busy) { opacity: .38; cursor: not-allowed; }
.cal-day.is-unreachable:not(.is-busy):hover { background: var(--c-cell); border-color: var(--c-line); }
.cal-day.is-unreachable .cal-day__p { visibility: hidden; }
.cal-day.is-preview-no::before {
  content: "недоступно"; position: absolute; top: -9px; left: 50%; transform: translateX(-50%); z-index: 2;
  font-size: .55rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase;
  padding: 2px 6px; border-radius: 999px; white-space: nowrap;
  background: var(--c-cell); color: var(--c-soft); border: 1px solid var(--c-line);
}

/* спливаюча підказка */
.cal-tip {
  position: absolute; z-index: 10; width: max-content; max-width: min(320px, 100%);
  padding: 12px 16px; border-radius: 14px;
  background: var(--ink); color: var(--cream);
  font-size: .86rem; line-height: 1.45; font-weight: 500;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .5);
  pointer-events: none;
}
.cal-tip::after {
  content: ""; position: absolute; top: 100%; left: var(--arrow, 50%); margin-left: -7px;
  border: 7px solid transparent; border-top-color: var(--ink);
}
.cal--dark .cal-tip { background: var(--cream); color: var(--forest-900); }
.cal--dark .cal-tip::after { border-top-color: var(--cream); }
.cal-tip.is-in { animation: tipIn .35s var(--ease); }
@keyframes tipIn { from { opacity: 0; transform: translateY(6px); } }

/* ---------- Бронювання у вікні ---------- */
.book-modal { position: fixed; inset: 0; z-index: 120; display: grid; place-items: center; padding: 24px; }
.book-modal__backdrop { position: absolute; inset: 0; background: rgba(8, 10, 6, .82); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); animation: bmFade .35s var(--ease); }
.book-modal__box {
  position: relative; width: min(1320px, 100%); max-height: calc(100svh - 48px); overflow-y: auto; overscroll-behavior: contain;
  border-radius: 30px; padding: clamp(22px, 3vw, 44px) !important;
  box-shadow: 0 50px 100px -30px rgba(0, 0, 0, .8);
  animation: bmIn .5s var(--ease);
}
.book-modal__head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; margin-bottom: 24px; }
.book-modal__head .section-eyebrow { margin-bottom: 10px; }
.book-modal__title { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.9rem, 1.2rem + 1.6vw, 3rem); line-height: 1.02; color: var(--ink); }
.book-modal__title em { font-style: italic; font-weight: 500; color: var(--olive-600); }
.book-modal__close {
  flex: none; width: 46px; height: 46px; border-radius: 50%; cursor: pointer;
  border: 1px solid var(--line); background: #fff; color: var(--ink); font-size: 1.6rem; line-height: 1;
  transition: background .3s, color .3s;
}
.book-modal__close:hover { background: var(--ink); color: var(--cream); }
.book-modal .booking__grid { grid-template-columns: minmax(0, 1.6fr) minmax(340px, 1fr); }
.book-modal .panel { box-shadow: none; }
body.book-open { overflow: hidden; }
@keyframes bmFade { from { opacity: 0; } }
@keyframes bmIn { from { opacity: 0; transform: translateY(24px) scale(.98); } }
@media (max-width: 1180px) { .book-modal .booking__grid { grid-template-columns: minmax(0, 1fr); } }
@media (max-width: 760px) {
  .book-modal { padding: 0; place-items: end stretch; }
  .book-modal__box { width: 100%; max-height: 94svh; border-radius: 24px 24px 0 0; padding: 18px 12px calc(20px + env(safe-area-inset-bottom, 0px)) !important; animation: bmUp .5s var(--ease); }
  @keyframes bmUp { from { transform: translateY(100%); } }
  .book-modal__head { padding: 0 6px; }
}
/* на вузьких клітинках хрестик не перекриває мітку: під час наведення мітку ховаємо */
.cal-day.is-start:hover::before, .cal-day.is-end:hover::before { opacity: 0; }

/* особлива ціна на дату */
.cal-day__p.is-special { color: #c0702a; font-weight: 700; }
.cal--dark .cal-day__p.is-special { color: var(--ember); }
