/* ==========================================================================
   booking-widget.css — автономные стили механизма онлайн-бронирования
   сайта probka.org (кнопка → диалог «Бронирование» → виджет Hostme).

   Источник: app/local/templates/probka/assets/css/app.css (probka.org).
   Вынесены дословно блоки: :root-переменные, @font-face (Geometria,
   feathericon), .btn, .select, .dialog, .backdrop, .booking, helpers.

   Пути к шрифтам — относительно этого файла: ../fonts/...
   ========================================================================== */

/* --------------------------------------------------------------------------
   0. Минимальный reboot.
   В probka.org это часть Bootstrap-reboot в начале app.css; здесь оставлено
   только то, от чего зависят блоки ниже (box-sizing, базовая типографика,
   сброс кнопок).
   -------------------------------------------------------------------------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--default-font);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
  color: var(--main-text-color);
  background-color: var(--layout);
  -webkit-font-smoothing: antialiased;
}

button,
select {
  font-family: inherit;
  font-size: 100%;
  line-height: 1.15;
  margin: 0;
  text-transform: none;
}

button,
[type="button"] {
  -webkit-appearance: button;
}

button {
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   1. Дизайн-переменные (app.css, блок :root)
   -------------------------------------------------------------------------- */
:root {
  font-size: 14px;
  --gap: 15px;
  --gap-half: calc(var(--gap) / 2);
  --gap-big: 40px;
  --font-size-base: 14px;
  --font-size-tiny: 11px;
  --font-size-small: 13px;
  --font-size-big: 16px;
  --font-size-bigger: 19px;
  --font-size-legend: 24px;
  --font-size-large: 28px;
  --font-size-title: 28px;
  --font-size-headline: 36px;
  --line-height: 1.5;
  --line-height-tiny: 1.45;
  --line-height-small: 1.53;
  --line-height-title: 1.2;
  --font-family: "Geometria", sans-serif;
  --heading-font: var(--font-family);
  --default-font: var(--font-family);
  --radius: 5px;
  --speed: 0.3s;
  --button-size: 40px;
  --layout: hsla(0, 0%, 100%, 1);
  --primary-color: hsl(31deg 31% 53%);
  --primary-color-hover: hsl(31deg 31% 46%);
  --primary-color-transparent: hsl(31deg 31% 53% / 35%);
  --button-color: hsla(0, 0%, 90%, 1);
  --focus-highlight: hsla(0, 0%, 50%, 0.25);
  --main-text-color: hsla(0, 0%, 8%, 1);
  --muted-text-color: hsla(0, 0%, 40%, 1);
  --light-text-color: hsla(0, 0%, 100%, 1);
  --footer-text-color: hsla(0, 0%, 77%, 1);
  --border-color: hsla(0, 0%, 77%, 1);
  --backdrop: hsla(0, 0%, 0%, 0.45);
  --footer: hsla(213, 13%, 17%, 1);
  --danger: hsla(354, 70%, 54%, 1);
  --success: hsla(162, 48%, 49%, 1);
  --switcher: hsla(0, 0%, 100%, 1);
  --safe-top: env(safe-area-inset-top);
  --safe-bottom: env(safe-area-inset-bottom);
  --safe-left: env(safe-area-inset-left);
  --safe-right: env(safe-area-inset-right);
}

/* --------------------------------------------------------------------------
   2. Шрифты (app.css, @font-face)
   Geometria — текст диалога и кнопок; feathericon — иконка стрелки
   в шапке кастомного селекта (content: "\e92e").
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Geometria";
  font-style: normal;
  font-weight: 300;
  src: url("../fonts/Geometria/Geometria-Light.woff2") format("woff2");
}

@font-face {
  font-family: "Geometria";
  font-style: normal;
  font-weight: 400;
  src: url("../fonts/Geometria/Geometria-Regular.woff2") format("woff2");
}

@font-face {
  font-family: "Geometria";
  font-style: normal;
  font-weight: 700;
  src: url("../fonts/Geometria/Geometria-Bold.woff2") format("woff2");
}

@font-face {
  font-family: "feathericon";
  font-style: normal;
  font-weight: normal;
  src: url("../fonts/feathericon/feathericon.woff2") format("woff2");
}

/* --------------------------------------------------------------------------
   3. Кнопки (app.css, блок .btn)
   -------------------------------------------------------------------------- */
.btn {
  position: relative;
  display: inline-flex;
  appearance: none;
  -webkit-appearance: none;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: var(--button-size);
  padding: 0 1.5rem;
  outline: none;
  text-align: center;
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--main-text-color);
  border: 0;
  border-radius: var(--radius);
  background: var(--button-color);
  font-family: var(--heading-font);
  font-size: var(--font-size-base);
  font-weight: 700;
  line-height: var(--button-size);
  cursor: pointer;
  transition: background-color var(--speed), color var(--speed);
  -webkit-tap-highlight-color: transparent;
}

.btn:focus {
  outline: 5px auto var(--focus-highlight);
}

.btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.btn__icon {
  flex: none;
  line-height: 1;
  display: inline-block;
  width: 1rem;
  height: 1rem;
  fill: none;
}

.btn__icon:first-child {
  margin-right: var(--gap-half);
}

.btn__icon:last-child {
  margin-left: var(--gap-half);
}

.btn__icon:first-child:last-child {
  margin: 0;
}

.btn__label {
  flex: auto;
}

/* square button */
.btn--square {
  padding: 0;
  width: var(--button-size);
}

/* full width */
.btn--wide {
  display: flex;
  width: 100%;
}

/* primary */
.btn--primary {
  color: var(--light-text-color);
  background-color: var(--primary-color);
}

.btn--primary:hover {
  background-color: var(--primary-color-hover);
}

.btn--primary .btn__icon {
  fill: var(--light-text-color);
}

.btn--primary:focus {
  outline: 5px auto var(--primary-color-transparent);
}

/* transparent */
.btn--transparent {
  color: var(--muted-text-color);
  background: transparent;
}

.btn--transparent:hover {
  color: var(--main-text-color);
}

.btn--transparent .btn__icon {
  stroke: currentColor;
}

.btn--transparent:focus {
  outline: 5px auto var(--focus-highlight);
}

/* inverse */
.btn--inverse {
  color: var(--inverse-text-color);
  background-color: var(--main-text-color);
}

.btn--inverse:hover {
  color: var(--light-text-color);
  background-color: var(--primary-color);
}

.btn--inverse:focus {
  outline: 5px auto var(--focus-highlight);
}

/* svg icons */
.btn .btn__icon {
  pointer-events: none;
}

/* --------------------------------------------------------------------------
   4. Кастомный селект (app.css, блок .select)
   JS (booking-widget.js) строит из нативного <select> элементы
   .select__control (шапка) и .select__options > .select__list (выпадашка).
   -------------------------------------------------------------------------- */
.select {
  position: relative;
}

.select__input {
  position: absolute;
  appearance: none;
  -webkit-appearance: none;
  width: 1px;
  height: 1px;
  opacity: 0;
  padding: 0;
  border: 0;
}

.select__control {
  position: relative;
  display: flex;
  align-items: center;
  box-sizing: border-box;
  width: 100%;
  height: var(--button-size);
  padding: 0 1rem;
  color: var(--main-text-color);
  border: 0;
  border-radius: var(--radius);
  background-color: var(--button-color);
  font-family: var(--default-font);
  font-size: var(--font-size-base);
  cursor: pointer;
  transition: background-color var(--speed);
  -webkit-tap-highlight-color: transparent;
}

.select__control::after {
  position: absolute;
  top: 50%;
  right: 1rem;
  display: block;
  margin-top: -0.5em;
  font-family: "feathericon";
  font-size: 1rem;
  line-height: 1;
  color: var(--muted-text-color);
  content: "\e92e";
}

.select__control:hover,
.select__control[selected] {
  background-color: var(--primary-color);
}

.select__options {
  position: absolute;
  z-index: 10;
  top: calc(var(--button-size) + 2px);
  right: 0;
  display: none;
  max-height: 250px;
  box-sizing: border-box;
  margin: 0;
  padding: 0.3rem 0;
  overflow-y: auto;
  list-style-type: none;
  color: var(--main-text-color);
  border-radius: var(--radius);
  background: var(--layout);
  box-shadow: 0 5px 10px rgba(0, 0, 0, 0.15);
  font-family: var(--default-font);
  font-size: var(--font-size-base);
}

.select__options--expanded {
  display: block;
}

.select__item {
  display: block;
  padding: 0.5rem 1rem;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.select__item:hover {
  background-color: var(--button-color);
}

.select__label {
  display: block;
  padding: 0.5rem 1rem 0.25rem;
  color: var(--muted-text-color);
  font-size: var(--font-size-tiny);
  letter-spacing: 0.5px;
  text-transform: uppercase;
  cursor: default;
}

/* --------------------------------------------------------------------------
   5. Диалоги и затемнение (app.css, блоки .dialog и .backdrop, строки
   12265–12398 — перенесено дословно, без -webkit-/-ms-префиксов автопрефиксера)
   -------------------------------------------------------------------------- */
.dialog {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.1);
  transition: var(--speed);
  z-index: -1;
}

.dialog--open {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  z-index: 9999;
}

@media screen and (max-width: 768px) {
  .dialog--open {
    transform: translateY(0);
  }
}

.dialog__window {
  position: relative;
  background-color: var(--layout);
  width: 500px;
  max-width: calc(100% - 2rem);
  max-height: calc(100vh - var(--gap-big) * 2);
  overflow-y: auto;
  overflow-x: hidden;
  border-radius: var(--radius);
  box-shadow: 0px 3px 5px -1px rgba(0, 0, 0, 0.2), 0px 5px 8px 0px rgba(0, 0, 0, 0.14), 0px 1px 14px 0px rgba(0, 0, 0, 0.12);
}

.dialog__window--small {
  overflow: initial;
}

.dialog__closer {
  position: relative;
}

.dialog__closer--inner {
  position: absolute;
  right: 1rem;
  top: 1rem;
  border-radius: var(--radius);
  z-index: 20;
  box-shadow: 0px 3px 3px -2px rgba(0, 0, 0, 0.2), 0px 3px 4px 0px rgba(0, 0, 0, 0.14), 0px 1px 8px 0px rgba(0, 0, 0, 0.12);
}

.dialog__picture {
  position: relative;
  display: block;
}

.dialog__image {
  max-width: 100%;
}

.dialog__header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 4.5rem;
  padding: 0 1.5rem;
  border-bottom: 1px solid var(--border-color);
  font-family: var(--heading-font);
}

.dialog__title {
  color: var(--main-text-color);
  font-size: 1.2rem;
  font-weight: 600;
  margin-right: var(--gap);
}

@media screen and (max-width: 768px) {
  .dialog__title {
    font-size: 1rem;
  }
}

.dialog__body {
  padding: 1.5rem;
}

.backdrop {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  overflow: auto;
  background-color: #000000;
  background-color: rgba(0, 0, 0, 0.9);
  z-index: 999;
}

.backdrop__show {
  animation: backdrop-show var(--speed) both;
}

.backdrop__hide {
  animation: backdrop-hide var(--speed) both;
}

@keyframes backdrop-show {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
    visibility: visible;
  }
}

@keyframes backdrop-hide {
  from {
    opacity: 1;
  }
  to {
    opacity: 0;
    visibility: hidden;
  }
}

/* --------------------------------------------------------------------------
   5.1 Кнопка закрытия попапа Hostme (добавляется из booking-widget.js).

   Сам виджет кнопку закрытия НЕ рисует: его попап .j-hostme-popup-iframe
   закрывается только по postMessage CLOSE_WIDGET, который присылает страница
   бронирования внутри iframe — и только на доверенном parent-origin
   (probka.org). На другом сайте (и на file://) крестика не будет, поэтому
   скрипт добавляет свою кнопку в .hostme-popup__cnt. Стили крестика — по
   аналогии с .dialog__closer кнопкой диалога, крест белый на тёмном фоне.
   -------------------------------------------------------------------------- */
.js-hostme-popup-close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--button-size);
  height: var(--button-size);
  padding: 0;
  border: 0;
  border-radius: var(--radius);
  background-color: transparent;
  color: var(--light-text-color);
  transition: var(--speed);
}

.js-hostme-popup-close:hover {
  opacity: 0.7;
}

/* --------------------------------------------------------------------------
   6. Блок бронирования (app.css, блок .booking)
   -------------------------------------------------------------------------- */
.booking {
  position: relative;
}

.booking__action {
  margin-top: var(--gap);
}

/* --------------------------------------------------------------------------
   7. Хелперы отображения (app.css, helpers)
   -------------------------------------------------------------------------- */
@media screen and (min-width: 768px) {
  .display-mobile {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  .display-desktop {
    display: none;
  }
}

.booking__action {
    display: none;
}

