
/* ---------- форма записи ---------- */
.bform { display: grid; gap: 16px; margin-top: 26px; }
.bform__row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.bform__field { display: grid; gap: 7px; font-size: 13px; min-width: 0; }
.bform__field > span { color: rgba(255, 255, 255, 0.72); letter-spacing: 0.01em; }
.bform__field > span em { font-style: normal; opacity: 0.6; }
.bform input[type="text"],
.bform input[type="tel"],
.bform select,
.bform textarea {
  width: 100%;
  font: inherit;
  font-size: 15px;
  color: var(--plum-dark);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 12px 14px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.bform input:focus,
.bform select:focus,
.bform textarea:focus {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(243, 221, 231, 0.35);
}
.bform textarea { resize: vertical; min-height: 78px; }

/* ---------- календарь ---------- */
.bcal {
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 16px;
  padding: 14px;
  max-width: 360px;
}
.bcal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}
.bcal__title { font-size: 14.5px; font-weight: 500; text-transform: capitalize; }
.bcal__nav {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: transparent;
  color: #fff;
  font-size: 17px;
  line-height: 1;
  cursor: pointer;
  transition: background-color 0.2s ease;
}
.bcal__nav:hover { background: rgba(255, 255, 255, 0.16); }
.bcal__weekdays,
.bcal__grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.bcal__weekdays span {
  text-align: center;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.5);
  padding-bottom: 4px;
}
.bcal__cell {
  aspect-ratio: 1 / 1;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid transparent;
  border-radius: 10px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 13.5px;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.bcal__cell:hover { background: rgba(255, 255, 255, 0.14); }
.bcal__cell--empty { cursor: default; }
.bcal__cell.is-past { color: rgba(255, 255, 255, 0.28); cursor: default; }
.bcal__cell.is-past:hover { background: transparent; }
.bcal__cell.is-today { border-color: var(--rose-deep); }
.bcal__cell.is-selected {
  background: #fff;
  color: var(--plum-dark);
  border-color: #fff;
  font-weight: 600;
}

/* ---------- кастомные выпадающие списки ---------- */
.bselect { position: relative; min-width: 0; max-width: 100%; }
.bselect__button {
  width: 100%;
  min-width: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  font: inherit;
  font-size: 15px;
  text-align: left;
  color: var(--plum-dark);
  background: #fff;
  border: 1px solid rgba(255, 255, 255, 0.4);
  border-radius: 12px;
  padding: 12px 14px;
  cursor: pointer;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}
.bselect__button:focus-visible,
.bselect.is-open .bselect__button {
  outline: none;
  border-color: var(--rose);
  box-shadow: 0 0 0 3px rgba(243, 221, 231, 0.35);
}
.bselect__label {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.bselect__label.is-placeholder { color: #9a8b90; }
.bselect__arrow {
  width: 0;
  height: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  border-top: 5px solid var(--muted);
  transition: transform 0.2s ease;
}
.bselect.is-open .bselect__arrow { transform: rotate(180deg); }
.bselect__list {
  position: absolute;
  z-index: 30;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  max-height: 260px;
  overflow-y: auto;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 18px 40px -18px rgba(43, 32, 39, 0.45);
  border: 1px solid var(--rose-deep);
  display: none;
}
.bselect.is-open .bselect__list { display: block; }
.bselect__option {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--ink);
  cursor: pointer;
  line-height: 1.3;
}
.bselect__option-main { flex: 1 1 auto; min-width: 0; }
.bselect__option-note {
  flex: 0 0 auto;
  font-size: 11.5px;
  color: #a2949b;
  white-space: nowrap;
}
.bselect__option.is-selected .bselect__option-note { color: rgba(255, 255, 255, 0.7); }
.bselect__option:hover,
.bselect__option:focus { background: var(--rose); outline: none; }
.bselect__option.is-selected { background: var(--plum); color: #fff; }
.bselect__option.is-disabled { color: #d3c6cb; cursor: default; opacity: 0.75; }
.bselect__option.is-disabled:hover { background: transparent; }


/* ---------- защита от выезда за экран ---------- */
body { overflow-x: hidden; }
.booking__form-side,
.booking__contacts { min-width: 0; }
.booking__contacts a,
.contact-row a,
.contact-row b { overflow-wrap: anywhere; }
.bform input,
.bform textarea,
.bform .bselect,
.bform .bselect__button,

@media (max-width: 480px) {
  .booking { padding: 28px 16px; border-radius: 24px; }
  .bcal { padding: 10px; }
  .bcal__cell { font-size: 13px; border-radius: 8px; }
          }

/* ---------- сетка получасовых ячеек ---------- */
.bslots { display: grid; gap: 6px; }
.bslots.is-idle { display: none; }
.bslots__row { display: grid; grid-template-columns: repeat(6, 1fr); gap: 6px; }
.bslots__cell {
  font: inherit;
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
  height: 40px;
  border-radius: 9px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.07);
  color: rgba(255, 255, 255, 0.85);
  cursor: pointer;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  transition: background-color 0.12s ease, border-color 0.12s ease, color 0.12s ease;
}
.bslots__cell:hover { background: rgba(255, 255, 255, 0.16); }
.bslots__cell.is-end-ok {
  color: rgba(255, 255, 255, 0.9);
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.55);
  border-style: dashed;
  text-decoration: none;
}

.bslots__cell.is-busy {
  color: rgba(255, 196, 196, 0.6);
  background: rgba(255, 120, 120, 0.12);
  border-color: rgba(255, 156, 156, 0.34);
  text-decoration: line-through;
  text-decoration-color: rgba(255, 150, 150, 0.75);
  cursor: not-allowed;
}

.bslots__cell.is-past { color: rgba(255, 255, 255, 0.25); background: transparent; cursor: default; }
.bslots__cell.is-preview { background: rgba(243, 221, 231, 0.45); border-color: var(--rose); }
.bslots__cell.is-anchor {
  border-color: #fff;
  box-shadow: inset 0 0 0 2px #fff;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
}
.bslots__cell.is-on {
  background: #fff;
  border-color: #fff;
  color: var(--plum-dark);
  font-weight: 600;
}

/* ---------- сводка на календаре ---------- */
.bcal__cell { position: relative; }
.bcal__cell.has-windows::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 4px;
  width: 12px;
  height: 2px;
  border-radius: 2px;
  background: var(--rose);
  transform: translateX(-50%);
}
.bcal__cell.is-selected.has-windows::after { background: var(--plum-soft); }

@media (max-width: 380px) {
  .bslots__cell { height: 36px; font-size: 10.5px; }
  .bslots__row { gap: 4px; }
}
/* ---------- шапка сетки ---------- */
.bslots-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px 12px;
}
.bslots-head .bform__hint { margin: 0; }
.bslots-head .bform__clear { margin-left: auto; }

/* ---------- недоступные ячейки ---------- */
.bslots__cell.is-off,
.bslots__cell:disabled:not(.is-on) {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.08);
  color: rgba(255, 255, 255, 0.22);
  cursor: default;
}
.bslots__cell.is-on:disabled { cursor: default; }
/* ---------- ловушка для ботов: поле видят только роботы ---------- */
.bform__trap {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  opacity: 0;
  pointer-events: none;
}
/* ---------- выбранные промежутки ---------- */
.bform__windows-title {
  margin: 18px 0 8px;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: rgba(255, 255, 255, 0.72);
}

.bform__windows {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.bform__window {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 8px 8px 8px 14px;
  font-size: 13px;
}
.bform__remove {
  border: none;
  background: rgba(255, 255, 255, 0.24);
  color: #fff;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  cursor: pointer;
  line-height: 1;
  font-size: 15px;
  transition: background-color 0.2s ease;
}
.bform__remove:hover { background: rgba(255, 255, 255, 0.4); }

/* ---------- согласие, кнопка, статус ---------- */
.bform__consent {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.82);
}
.bform__consent input {
  margin-top: 3px;
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
  accent-color: var(--plum-soft);
}
.bform__submit { justify-self: start; margin-top: 4px; }
.bform__submit:disabled { opacity: 0.7; cursor: default; }
.bform__status { margin: 0; font-size: 13.5px; line-height: 1.4; min-height: 20px; }
.bform__status.is-ok {
  font-size: 15.5px;
  font-weight: 600;
  line-height: 1.5;
  color: #eaffea;
  background: rgba(150, 255, 170, 0.14);
  border: 1px solid rgba(190, 255, 205, 0.4);
  border-radius: 12px;
  padding: 12px 14px;
}
.bform__status.is-error {
  font-size: 15px;
  font-weight: 600;
  line-height: 1.5;
  color: #ffe1e1;
  background: rgba(255, 110, 110, 0.18);
  border: 1px solid rgba(255, 140, 140, 0.55);
  border-radius: 12px;
  padding: 12px 14px;
}
.bform__status.is-error::before {
  content: "! ";
  font-weight: 700;
}
.bform__status.is-shake { animation: statusShake 0.32s ease-in-out 2; }

@keyframes statusShake {
  0%, 100% { transform: translateX(0); }
  25% { transform: translateX(-4px); }
  75% { transform: translateX(4px); }
}

.bform__submit.is-back {
  background: transparent;
  border: 1px dashed rgba(255, 255, 255, 0.55);
  color: #fff;
}
.bform__submit.is-back:hover {
  background: rgba(255, 255, 255, 0.12);
}
.booking__tg { margin-top: 6px; text-align: center; }

/* ---------- кнопка «Очистить всё» ---------- */
.bform__clear {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  white-space: nowrap;
  padding: 11px 22px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: transparent;
  color: #fff;
  cursor: pointer;
  transition: box-shadow 0.2s ease, transform 0.15s ease, opacity 0.2s ease;
}
.bform__clear:disabled { opacity: 0.35; cursor: default; }
.bform__clear.is-ready {
  background-color: #f3dde7;
  border-color: #f3dde7;
  color: #3e1d35;
  box-shadow: 0 10px 24px -12px rgba(243, 221, 231, 0.9);
}
.bform__clear.is-ready:hover {
  background-color: #ffffff;
  border-color: #ffffff;
  transform: translateY(-1px);
}
.bform__clear.is-hot { animation: clearPulse 1.1s ease-out 3; }

@keyframes clearPulse {
  0% { box-shadow: 0 0 0 0 rgba(243, 221, 231, 0.75); }
  100% { box-shadow: 0 0 0 16px rgba(243, 221, 231, 0); }
}

/* ---------- надпись, когда ничего не выбрано ---------- */
#bf-empty {
  font-size: 13.5px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.85);
  background: rgba(255, 255, 255, 0.08);
  border: 1px dashed rgba(255, 255, 255, 0.3);
  border-radius: 12px;
  padding: 10px 14px;
  margin: 0;
}
#bf-empty[hidden] { display: none; }

@media (max-width: 420px) {
  .bform__clear { padding: 10px 16px; font-size: 13px; }
  #bf-empty { font-size: 13px; padding: 9px 12px; }
}
/* ---------- подсказка объединения интервалов ---------- */
.bmodal {
  position: fixed;
  inset: 0;
  z-index: 200;
  pointer-events: none;
}
.bmodal[hidden] { display: none; }
.bmodal__card {
  position: absolute;
  width: min(320px, calc(100vw - 24px));
  pointer-events: auto;
  background: var(--plum);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 16px;
  padding: 16px;
  box-shadow: 0 24px 50px -24px rgba(0, 0, 0, 0.75);
}
.bmodal__card::before {
  content: "";
  position: absolute;
  top: -7px;
  left: var(--arrow-x, 50%);
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: var(--plum);
  border-left: 1px solid rgba(255, 255, 255, 0.22);
  border-top: 1px solid rgba(255, 255, 255, 0.22);
  transform: rotate(45deg);
}
.bmodal__card.is-above::before {
  top: auto;
  bottom: -7px;
  border-left: 0;
  border-top: 0;
  border-right: 1px solid rgba(255, 255, 255, 0.22);
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
}
.bmodal__text {
  margin: 0 0 14px;
  font-size: 13.5px;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.94);
}
.bmodal__actions { display: grid; gap: 8px; }
.bmodal__merge,
.bmodal__cancel {
  font: inherit;
  font-size: 13.5px;
  font-weight: 600;
  padding: 10px 16px;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  transition: transform 0.15s ease, background-color 0.15s ease;
}
.bmodal__merge {
  background: #f3dde7;
  border-color: #f3dde7;
  color: #3e1d35;
}
.bmodal__merge:hover { background: #ffffff; border-color: #ffffff; }
.bmodal__cancel {
  background: transparent;
  border-color: rgba(255, 255, 255, 0.36);
  color: #ffffff;
}
.bmodal__cancel:hover { background: rgba(255, 255, 255, 0.12); }

/* уже выбранные ячейки во время выбора нового окна: видны, но неактивны */
.bslots__cell.is-on.is-locked {
  cursor: default;
  opacity: 0.4;
}
/* ---------- подсказка об ошибке у поля ---------- */
.btip {
  position: fixed;
  z-index: 300;
  max-width: 260px;
  padding: 10px 13px;
  background: #ffffff;
  color: #3e1d35;
  font-family: var(--sans);
  font-size: 13px;
  font-weight: 600;
  line-height: 1.4;
  border-radius: 12px;
  border: 1.5px solid rgba(91, 44, 78, 0.35);
  box-shadow: 0 18px 40px -18px rgba(0, 0, 0, 0.6), 0 0 0 4px rgba(255, 255, 255, 0.35);
  pointer-events: none;
}
.btip[hidden] { display: none; }
.btip::after {
  content: "";
  position: absolute;
  bottom: -6px;
  left: var(--tip-arrow, 50%);
  width: 12px;
  height: 12px;
  margin-left: -6px;
  background: #ffffff;
  transform: rotate(45deg);
  border-radius: 2px;
  border-right: 1.5px solid rgba(91, 44, 78, 0.35);
  border-bottom: 1.5px solid rgba(91, 44, 78, 0.35);
}
.btip.btip--below::after {
  bottom: auto;
  top: -6px;
  border-right: 0;
  border-bottom: 0;
  border-left: 1.5px solid rgba(91, 44, 78, 0.35);
  border-top: 1.5px solid rgba(91, 44, 78, 0.35);
}

/* подсветка проблемного поля */
input.is-invalid,
textarea.is-invalid,
.is-invalid .bselect__button,
.bslots.is-invalid {
  border-color: #ff9b9b !important;
  box-shadow: 0 0 0 3px rgba(255, 120, 120, 0.28) !important;
}
.bform__consent.is-invalid,
input[type="checkbox"].is-invalid {
  outline: 2px solid #ff9b9b;
  outline-offset: 3px;
  border-radius: 6px;
}
