/* Price modal: layout, responsive styles and motion. */

body[data-price-modal-open="true"] {
  overflow: hidden;
}

.price-modal[hidden] {
  display: none;
}

.price-modal {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: grid;
  place-items: center;
  padding: clamp(12px, 3vw, 36px);
  background: rgba(48, 40, 33, 0.48);
  backdrop-filter: blur(5px);
  opacity: 0;
  transition: opacity 220ms ease;
}

.price-modal[data-state="open"] {
  opacity: 1;
}

.price-modal[data-state="closing"] {
  pointer-events: none;
}

.price-modal__dialog {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr);
  width: min(1120px, 100%);
  max-height: min(820px, calc(100svh - 24px));
  overflow: hidden;
  border: 1px solid rgba(66, 50, 39, 0.16);
  border-radius: 24px;
  background: #fbf8f3;
  box-shadow: 0 28px 80px rgba(32, 23, 17, 0.28);
  outline: none;
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  transition: opacity 220ms ease, transform 260ms cubic-bezier(0.22, 1, 0.36, 1);
}

.price-modal[data-state="open"] .price-modal__dialog {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.price-modal__header {
  display: flex;
  align-items: start;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(22px, 3.2vw, 38px) clamp(22px, 4vw, 52px) 20px;
  border-bottom: 1px solid var(--line);
  background: rgba(251, 248, 243, 0.96);
}

.price-modal__eyebrow {
  margin: 0 0 8px;
  color: var(--accent-dark);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.price-modal__title {
  margin: 0;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
}

.price-modal__close {
  display: grid;
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  place-items: center;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 28px;
  font-weight: 300;
  line-height: 1;
  transition: border-color 180ms ease, color 180ms ease, background-color 180ms ease;
}

.price-modal__close:hover,
.price-modal__close:focus-visible {
  border-color: var(--accent);
  background: rgba(167, 116, 82, 0.08);
  color: var(--accent-dark);
}

.price-modal__content {
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 0 clamp(22px, 4vw, 52px) clamp(24px, 4vw, 48px);
}

.price-group {
  margin-top: 30px;
}

.price-group__title {
  margin: 0 0 14px;
  font-family: var(--font-sans);
  font-size: 15px;
  font-weight: 600;
  color: var(--accent-dark);
}

.price-list {
  display: grid;
  gap: 12px;
}

.price-service {
  display: grid;
  grid-template-columns: minmax(190px, 1.1fr) repeat(4, minmax(104px, 0.7fr)) auto;
  align-items: start;
  gap: 14px;
  padding: 18px 16px 18px 20px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.56);
}

.price-service__name {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  line-height: 1.35;
}

.price-service__duration {
  display: block;
  margin-top: 5px;
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.4;
}

.price-service__prices {
  display: contents;
}

.price-entry {
  position: relative;
  min-width: 0;
  padding-top: 20px;
}

.price-entry__label {
  position: absolute;
  top: 0;
  left: 0;
  color: var(--text-soft);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.02em;
  line-height: 1.2;
}

.price-entry__value {
  color: var(--text);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.3;
  white-space: nowrap;
}

.price-entry__note-toggle {
  display: inline-grid;
  width: 17px;
  height: 17px;
  margin-left: 4px;
  place-items: center;
  padding: 0;
  border: 1px solid rgba(143, 96, 66, 0.54);
  border-radius: 50%;
  background: transparent;
  color: var(--accent-dark);
  cursor: pointer;
  font-size: 11px;
  font-style: italic;
  font-weight: 600;
  line-height: 1;
  vertical-align: 1px;
}

.price-entry__note {
  position: absolute;
  z-index: 3;
  top: calc(100% + 10px);
  left: 0;
  display: none;
  width: min(290px, calc(100vw - 64px));
  padding: 11px 12px;
  border-radius: 10px;
  background: #423227;
  color: #fff;
  font-size: 11px;
  line-height: 1.45;
  box-shadow: 0 10px 22px rgba(48, 40, 33, 0.2);
}

@media (hover: hover) and (pointer: fine) {
  .price-entry:has(.price-entry__note-toggle:hover) .price-entry__note,
  .price-entry:has(.price-entry__note-toggle:focus-visible) .price-entry__note {
    display: block;
  }
}

.price-entry[data-note-open="true"] .price-entry__note {
  display: block;
}

.price-service__booking {
  align-self: center;
  min-height: 38px;
  padding: 9px 13px;
  font-size: 12px;
}

.price-modal__status {
  margin: 30px 0 0;
  color: var(--text-soft);
  font-size: 15px;
  line-height: 1.5;
}

.price-modal__bonus-note {
  margin: 32px 0 0;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--text-soft);
  font-size: 12px;
  line-height: 1.5;
}

@media (max-width: 900px) {
  .price-service {
    grid-template-columns: minmax(180px, 0.85fr) minmax(280px, 1.35fr);
    grid-template-rows: auto 1fr;
    column-gap: 22px;
  }

  .price-service__prices {
    display: grid;
    grid-column: 2;
    grid-row: 1 / span 2;
    grid-template-columns: repeat(2, minmax(120px, 1fr));
    gap: 16px 18px;
  }

  .price-service__booking {
    grid-column: 1;
    grid-row: 2;
    align-self: end;
    justify-self: start;
  }
}

@media (max-width: 640px) {
  .price-modal {
    align-items: start;
    padding: 12px;
  }

  .price-modal__dialog {
    width: 100%;
    max-height: calc(100svh - 24px);
    border-radius: 22px;
  }

  .price-modal__header {
    padding: 22px 20px 18px;
  }

  .price-modal__close {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .price-modal__content {
    padding: 0 16px 28px;
  }

  .price-group {
    margin-top: 24px;
  }

  .price-modal__bonus-note {
    margin-top: 24px;
  }

  .price-service {
    display: block;
    padding: 18px;
  }

  .price-service__name {
    font-size: 16px;
  }

  .price-service__heading {
    text-align: center;
  }

  .price-service__prices {
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 10px;
    margin-top: 18px;
  }

  .price-entry {
    display: grid;
    width: min(100%, 247px);
    grid-template-columns: minmax(0, 130px) 80px 21px;
    align-items: center;
    gap: 8px;
    margin-inline: auto;
    padding: 0;
  }

  .price-entry__label {
    position: static;
    font-size: 12px;
  }

  .price-entry__value {
    font-size: 14px;
    justify-self: end;
  }

  .price-entry__note-toggle {
    justify-self: end;
    margin-left: 0;
  }

  .price-entry__note {
    top: calc(100% + 8px);
    right: 0;
    left: auto;
    width: min(300px, calc(100vw - 64px));
  }

  .price-service__booking {
    display: flex;
    width: 100%;
    justify-content: center;
    margin-top: 20px;
  }
}
