/*
 * Бани Мира — свои окна выбора даты и времени в форме бронирования (assets/js/bm-pickers.js).
 * Цвета и шрифт сайта: синий #0FA3F7, тёмный #0F3A4A, светлый фон #F3F6FA, зелёный #A3BF07, Gilroy.
 * Селекторы с button[type="button"] — чтобы перебить общие стили кнопок темы и Elementor.
 */

/* Системные поля остаются в форме (их читают тема и плагин), но не видны */
.bmp-native {
  display: none !important;
}

/* ---------- поле на странице ---------- */

/* шрифт, цвет и отступы JS копирует с системного поля — выглядит как раньше */
button.bmp-trigger[type="button"],
button.bmp-trigger[type="button"]:hover,
button.bmp-trigger[type="button"]:focus,
button.bmp-trigger[type="button"]:active {
  display: block;
  flex: 1 1 auto;
  box-sizing: border-box;
  width: 100%;
  min-width: 0;
  height: auto;
  min-height: 0;
  margin: 0;
  padding-right: 34px;
  border: 0;
  border-radius: 0;
  background-color: transparent;
  background-repeat: no-repeat;
  background-position: right center;
  background-size: 22px 22px;
  box-shadow: none;
  outline: none;
  text-align: left;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  cursor: pointer;
  user-select: none;
  transition: color 0.15s;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

button.bmp-trigger--date[type="button"],
button.bmp-trigger--date[type="button"]:hover,
button.bmp-trigger--date[type="button"]:focus,
button.bmp-trigger--date[type="button"]:active {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230FA3F7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='4.5' width='18' height='16.5' rx='2.5'/%3E%3Cpath d='M3 9.5h18M8 2.5v4M16 2.5v4'/%3E%3C/svg%3E");
}

button.bmp-trigger--time[type="button"],
button.bmp-trigger--time[type="button"]:hover,
button.bmp-trigger--time[type="button"]:focus,
button.bmp-trigger--time[type="button"]:active {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%230FA3F7' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Ccircle cx='12' cy='12' r='9'/%3E%3Cpath d='M12 7v5l3.5 2'/%3E%3C/svg%3E");
}

/* цвет текста задан у кнопки инлайном (скопирован), поэтому состояния — через !important */
button.bmp-trigger.bmp-trigger--empty[type="button"] {
  color: rgba(15, 58, 74, 0.45) !important;
}

button.bmp-trigger[type="button"]:hover,
button.bmp-trigger.bmp-trigger--open[type="button"] {
  color: #0FA3F7 !important;
}

button.bmp-trigger[type="button"]:focus-visible {
  outline: 2px solid #0FA3F7;
  outline-offset: 3px;
  border-radius: 4px;
}

button.bmp-trigger[type="button"]:disabled {
  cursor: default;
  opacity: 0.5;
}

/* ---------- окно ---------- */

.bmp-panel {
  position: fixed;
  z-index: 100001;
  box-sizing: border-box;
  width: 336px;
  max-width: calc(100vw - 16px);
  padding: 16px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 48px rgba(15, 58, 74, 0.22), 0 2px 8px rgba(15, 58, 74, 0.08);
  color: #0F3A4A;
  font-size: 16px;
  line-height: 1.2;
  text-align: left;
  animation: bmp-in 0.16s ease-out;
}

.bmp-panel--time {
  width: auto;
}

.bmp-panel *,
.bmp-panel *::before,
.bmp-panel *::after {
  box-sizing: border-box;
}

/* сброс общих стилей кнопок темы (розовые рамки, отступы) */
.bmp-panel button[type="button"],
.bmp-panel button[type="button"]:hover,
.bmp-panel button[type="button"]:focus,
.bmp-panel button[type="button"]:active {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: auto;
  height: auto;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  outline: none;
  color: inherit;
  font: inherit;
  line-height: 1;
  letter-spacing: normal;
  text-transform: none;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  transition: background-color 0.15s, color 0.15s, box-shadow 0.15s;
  -webkit-appearance: none;
  appearance: none;
  -webkit-tap-highlight-color: transparent;
}

.bmp-panel button[type="button"]:focus-visible {
  outline: 2px solid #0FA3F7;
  outline-offset: 2px;
}

.bmp-panel button[type="button"]:disabled {
  cursor: default;
}

.bmp-panel svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ---------- календарь ---------- */

.bmp-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.bmp-title {
  font-size: 18px;
  font-weight: 600;
}

.bmp-panel button.bmp-nav[type="button"] {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: #F3F6FA;
  color: #0FA3F7;
}

.bmp-panel button.bmp-nav[type="button"]:hover {
  background: #0FA3F7;
  color: #fff;
}

.bmp-panel button.bmp-nav[type="button"]:disabled,
.bmp-panel button.bmp-nav[type="button"]:disabled:hover {
  background: #F3F6FA;
  color: #0FA3F7;
  opacity: 0.35;
}

.bmp-week,
.bmp-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}

.bmp-week {
  margin-bottom: 4px;
}

.bmp-wd {
  font-size: 13px;
  line-height: 24px;
  text-align: center;
  color: rgba(15, 58, 74, 0.5);
}

.bmp-panel button.bmp-day[type="button"] {
  justify-self: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
  color: #0F3A4A;
}

.bmp-panel button.bmp-day[type="button"]:hover {
  background: #E3F5FE;
}

.bmp-panel button.bmp-day.is-today[type="button"] {
  box-shadow: inset 0 0 0 1.5px #0FA3F7;
}

.bmp-panel button.bmp-day.is-selected[type="button"],
.bmp-panel button.bmp-day.is-selected[type="button"]:hover {
  background: #0FA3F7;
  color: #fff;
  font-weight: 600;
  box-shadow: none;
}

.bmp-panel button.bmp-day[type="button"]:disabled,
.bmp-panel button.bmp-day[type="button"]:disabled:hover {
  background: transparent;
  color: rgba(15, 58, 74, 0.25);
  font-weight: normal;
  box-shadow: none;
}

.bmp-foot {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid #EEF2F6;
}

.bmp-foot--end {
  justify-content: flex-end;
}

.bmp-panel button.bmp-quick[type="button"] {
  padding: 9px 18px;
  border: 1px solid #0FA3F7;
  border-radius: 25px;
  color: #0FA3F7;
  font-size: 15px;
}

.bmp-panel button.bmp-quick[type="button"]:hover,
.bmp-panel button.bmp-quick.is-selected[type="button"] {
  background: #0FA3F7;
  color: #fff;
}

.bmp-panel button.bmp-quick[type="button"]:disabled,
.bmp-panel button.bmp-quick[type="button"]:disabled:hover {
  background: transparent;
  color: #0FA3F7;
  opacity: 0.4;
}

/* ---------- время ---------- */

.bmp-cols {
  display: flex;
  align-items: flex-start;
}

.bmp-group + .bmp-group {
  margin-left: 20px;
  padding-left: 20px;
  border-left: 1px solid #EEF2F6;
}

.bmp-group-title {
  margin-bottom: 10px;
  font-size: 14px;
  color: rgba(15, 58, 74, 0.5);
}

.bmp-chips {
  display: grid;
  gap: 6px;
}

.bmp-chips--hour {
  grid-template-columns: repeat(4, 48px);
}

.bmp-chips--minute {
  grid-template-columns: repeat(3, 48px);
}

.bmp-panel button.bmp-chip[type="button"] {
  height: 40px;
  border-radius: 10px;
  background: #F3F6FA;
  color: #0F3A4A;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

.bmp-panel button.bmp-chip[type="button"]:hover {
  background: #E3F5FE;
}

.bmp-panel button.bmp-chip.is-selected[type="button"],
.bmp-panel button.bmp-chip.is-selected[type="button"]:hover {
  background: #0FA3F7;
  color: #fff;
  font-weight: 600;
}

.bmp-panel button.bmp-chip[type="button"]:disabled,
.bmp-panel button.bmp-chip[type="button"]:disabled:hover {
  background: transparent;
  color: rgba(15, 58, 74, 0.25);
  font-weight: normal;
}

.bmp-panel button.bmp-done[type="button"] {
  padding: 10px 26px;
  border-radius: 25px;
  background: #0FA3F7;
  color: #fff;
  font-size: 16px;
}

.bmp-panel button.bmp-done[type="button"]:hover {
  background: #A3BF07;
}

/* ---------- телефон: панель снизу экрана ---------- */

.bmp-backdrop,
.bmp-sheet-head {
  display: none;
}

.bmp-backdrop.bmp-backdrop--on {
  display: block;
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 100000;
  background: rgba(15, 58, 74, 0.45);
  touch-action: none;
  animation: bmp-fade 0.16s ease-out;
}

.bmp-panel.bmp-panel--sheet {
  top: auto;
  right: 0;
  bottom: 0;
  left: 0;
  width: auto;
  max-width: none;
  max-height: 85vh;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 8px 16px calc(16px + env(safe-area-inset-bottom));
  border-radius: 18px 18px 0 0;
  animation: bmp-up 0.2s ease-out;
}

.bmp-panel--sheet .bmp-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 0 12px;
}

.bmp-sheet-title {
  font-size: 18px;
  font-weight: 600;
}

.bmp-panel button.bmp-close[type="button"] {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #F3F6FA;
  color: #0F3A4A;
}

.bmp-panel--sheet button.bmp-day[type="button"] {
  width: 100%;
  max-width: 44px;
  height: auto;
  aspect-ratio: 1;
}

.bmp-panel--sheet .bmp-cols {
  flex-direction: column;
}

.bmp-panel--sheet .bmp-group {
  width: 100%;
}

.bmp-panel--sheet .bmp-group + .bmp-group {
  margin: 18px 0 0;
  padding: 0;
  border: 0;
}

.bmp-panel--sheet .bmp-chips--hour,
.bmp-panel--sheet .bmp-chips--minute {
  grid-template-columns: repeat(6, 1fr);
}

.bmp-panel--sheet button.bmp-chip[type="button"] {
  height: 44px;
}

.bmp-panel--sheet .bmp-foot .bmp-quick,
.bmp-panel--sheet .bmp-foot .bmp-done {
  flex: 1 1 0;
}

@keyframes bmp-in {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

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

@keyframes bmp-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .bmp-panel,
  .bmp-panel.bmp-panel--sheet,
  .bmp-backdrop.bmp-backdrop--on {
    animation: none;
  }
}
