/* =====================================================================
   Стили модалки бронирования + кнопок .btn
   Перенесено из старого style.css и подогнано под новую палитру.
   Подключается только на новой главной (index.php).
   ===================================================================== */

:root {
  --radius: 2px;
  --accent-dark: #BC8D00;
  --ink-mute: #6b6b6b;
  --bg-alt: #F6F5F3;
  --line-strong: rgba(20, 20, 20, 0.18);
}

/* ---------- Кнопки ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-body);
  font-size: 11.5px; font-weight: 600;
  text-transform: uppercase; letter-spacing: 0.14em;
  padding: 15px 28px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  cursor: pointer; text-align: center;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease), transform 0.3s var(--ease);
}
.btn svg { flex: 0 0 auto; }
.btn-lg { padding: 17px 34px; font-size: 12px; }
.btn-sm { padding: 11px 18px; font-size: 10.5px; }
.btn-primary,
.btn-accent { background: var(--accent); color: #fff; }
.btn-primary:hover,
.btn-accent:hover { background: var(--accent-bright); }
.btn-primary:active,
.btn-accent:active { background: var(--accent-dark); }
.btn-outline { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-outline:hover { background: var(--navy); border-color: var(--navy); color: #fff; }
.btn-phone { background: transparent; border-color: var(--navy); color: var(--navy); }
.btn-phone:hover { background: var(--navy); border-color: var(--navy); color: #fff; }

/* ---------- Форма бронирования ---------- */
dialog.booking {
  position: fixed; inset: 0; margin: auto;
  width: min(560px, calc(100% - 32px));
  max-height: calc(100vh - 48px);
  padding: 0; border: 0;
  background: #fff;
  border-radius: var(--radius);
  overflow: auto;
  color: var(--ink);
}
dialog.booking::backdrop { background: rgba(10, 10, 10, 0.9); }

.booking__inner { position: relative; padding: 34px 34px 30px; }
.booking__close {
  position: absolute; top: 18px; right: 18px;
  width: 42px; height: 42px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  color: var(--ink); cursor: pointer;
  transition: background 0.3s var(--ease), color 0.3s var(--ease), border-color 0.3s var(--ease);
}
.booking__close:hover { background: var(--ink); border-color: var(--ink); color: #fff; }

.booking__title {
  margin: 6px 0 0;
  font-family: var(--font-head);
  font-size: 2.05rem; font-weight: 600; line-height: 1.15;
}
.booking__note { margin: 10px 0 0; font-size: 14.5px; line-height: 1.55; color: var(--ink-mute); }

.booking__tour {
  display: flex; flex-direction: column; gap: 3px;
  margin-top: 18px; padding: 13px 16px;
  background: var(--bg-alt);
  border-left: 3px solid var(--accent);
}
.booking__tour-label { font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); }
.booking__tour-name { font-family: var(--font-head); font-size: 1.2rem; font-weight: 600; line-height: 1.25; }

.booking__form { margin-top: 22px; }
.booking__row { display: grid; grid-template-columns: 1fr 1fr; gap: 4px 16px; }
.booking__field { margin-bottom: 12px; }
.booking__field--wide { grid-column: 1 / -1; }
.booking__field label {
  display: block; margin-bottom: 7px;
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.1em; text-transform: uppercase;
  color: var(--ink-mute);
}
.booking__field input {
  width: 100%; box-sizing: border-box;
  font-family: var(--font-body); font-size: 15px; color: var(--ink);
  padding: 13px 14px;
  background: var(--bg-alt);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  transition: border-color 0.25s var(--ease), background 0.25s var(--ease);
}
.booking__field input::placeholder { color: #9B9B9B; }
.booking__field input:focus { outline: none; background: #fff; border-color: var(--accent); }
.booking__field input.is-invalid { border-color: #B3261E; background: #FDF4F3; }

.booking__err { display: block; min-height: 15px; margin-top: 5px; font-size: 12.5px; line-height: 1.3; color: #B3261E; }

.booking__hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.booking__consent {
  display: flex; align-items: flex-start; gap: 10px;
  margin-top: 4px; font-size: 13.5px; line-height: 1.5; color: var(--ink-soft); cursor: pointer;
}
.booking__consent input { flex: 0 0 auto; width: 17px; height: 17px; margin-top: 2px; accent-color: var(--accent); }
.booking__consent a { color: var(--accent); text-decoration: underline; }

.booking__status:not(:empty) {
  margin-top: 14px; padding: 11px 14px;
  font-size: 13.5px; line-height: 1.45;
  background: #FDF4F3; border-left: 3px solid #B3261E; color: #8C2318;
}

.booking__submit { width: 100%; margin-top: 20px; }
.booking__submit.is-loading { opacity: 0.65; pointer-events: none; }

.booking__privacy { margin: 14px 0 0; font-size: 12.5px; line-height: 1.5; color: var(--ink-mute); text-align: center; }

.booking__done { padding: 22px 0 6px; text-align: center; }
.booking__tick { color: var(--accent); }
.booking__done h3 { margin: 16px 0 0; font-family: var(--font-head); font-size: 1.9rem; font-weight: 600; }
.booking__done-text { margin: 12px auto 0; max-width: 400px; font-size: 15px; line-height: 1.6; color: var(--ink-soft); }
.booking__again { margin-top: 22px; }

@media (max-width: 640px) {
  /* Мобильная модалка — во весь экран.
     Раньше здесь стояло inset: auto: диалог «прилипал» к своей статической
     позиции и выходил уже вьюпорта (при 390px ширина 339px, прижат к левому
     краю, справа дыра 36px). Теперь inset: 0 + margin: 0 — ровно по экрану.
     100dvh вместо 100vh: нижние поля не уезжают под адресную строку. */
  dialog.booking {
    inset: 0;
    width: 100%;
    max-width: none;
    height: 100vh;
    height: 100dvh;
    max-height: 100vh;
    max-height: 100dvh;
    margin: 0;
    border-radius: 0;
    overflow-y: auto;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
  }
  /* крестик не уезжает при прокрутке длинной формы */
  .booking__close {
    position: fixed;
    top: calc(12px + env(safe-area-inset-top, 0px));
    right: calc(12px + env(safe-area-inset-right, 0px));
    z-index: 2;
    background: #fff;
    box-shadow: 0 4px 16px rgba(10, 10, 10, .16);
  }
  .booking__inner { padding: 26px 20px calc(30px + env(safe-area-inset-bottom, 0px)); }
  .booking__title { font-size: 1.6rem; padding-right: 52px; }
  .booking__row { grid-template-columns: 1fr; gap: 0; }
}

/* Readable mobile fields without automatic focus zoom. */
@media screen and (max-width: 767px) {
  .booking input, .booking select, .booking textarea { font-size: 16px; }
}

/* A dedicated inner scroller lets Safari handle momentum and input scrolling. */
html.has--modal{overflow:hidden}
dialog.booking{overflow:hidden;max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px)}
.booking__inner{overflow-y:auto;overflow-x:hidden;max-height:calc(100vh - 48px);max-height:calc(100dvh - 48px);min-height:0;-webkit-overflow-scrolling:touch;overscroll-behavior-y:contain;touch-action:pan-y pinch-zoom;scroll-behavior:auto;scroll-padding-block:24px}
@media(max-width:640px){dialog.booking{height:100vh;height:100dvh;max-height:100vh;max-height:100dvh;overflow:hidden}.booking__inner{height:100%;max-height:100%;padding-top:calc(26px + env(safe-area-inset-top,0px));padding-bottom:calc(30px + env(safe-area-inset-bottom,0px))}}
