/* ===== Section «Номера» ===== */

.rooms {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #687f63 0%, #87a580 50%, #687f63 100%);
  padding: 10rem 0 24.2rem;
  color: #fff;
}

.rooms__title {
  position: relative;
  z-index: 1;
  margin: 0;
  font-family: 'Montserrat Alternates', sans-serif;
  font-weight: 900;
  font-size: 10rem;
  line-height: 1.16;
  text-align: center;
  color: #fff;
}

.rooms__grid {
  position: relative;
  z-index: 1;
  width: 140.8rem;
  margin: 3.5rem auto 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 45rem);
  column-gap: 2.9rem;
  row-gap: 6.1rem;
  justify-content: center;
}

/* ----- Card ----- */

.rooms .room-card {
  width: 45rem;
}

.rooms .room-card__media {
  position: relative;
  height: 66.9rem;
  overflow: hidden;
  background: #584949;
}

.rooms .room-card__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rooms .room-card__name {
  position: absolute;
  left: 0;
  right: 0;
  top: 20.7rem;
  margin: 0;
  font-family: 'Jost', 'Helvetica Neue', sans-serif;
  font-weight: 300;
  font-size: 8.6rem;
  line-height: 1;
  text-align: center;
  color: #fff;
  mix-blend-mode: plus-lighter;
}

.rooms .room-card__name--lg {
  top: 22.4rem;
  font-size: 12.8rem;
}

.rooms .room-card__emblem {
  position: absolute;
  left: 6rem;
  top: 38.8rem;
  width: 34rem;
  height: 20rem;
}

.rooms .room-card__count {
  position: absolute;
  left: 0;
  right: 0;
  top: 44.6rem;
  font-family: 'Jost', 'Helvetica Neue', sans-serif;
  font-weight: 300;
  font-size: 12.8rem;
  line-height: 1.15;
  text-align: center;
  color: #fff;
}

.rooms .room-card__persons {
  position: absolute;
  left: 0;
  right: 0;
  top: 61.1rem;
  font-family: 'Jost', 'Helvetica Neue', sans-serif;
  font-weight: 300;
  font-size: 4.8rem;
  line-height: 1.2;
  text-align: center;
  color: #fff;
  mix-blend-mode: plus-lighter;
}

/* ----- Card buttons ----- */

.rooms .room-card__actions {
  display: flex;
  justify-content: space-between;
  margin-top: 1rem;
}

.rooms .room-card__btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 21.2rem;
  height: 4.7rem;
  border: 0;
  border-radius: 1.4rem;
  background: #50700e;
  font-family: 'Jost', 'Helvetica Neue', sans-serif;
  font-weight: 300;
  font-size: 2.4rem;
  line-height: 1;
  color: #fff;
  text-align: center;
  cursor: pointer;
  transition: filter 0.2s;
}

.rooms .room-card__btn:hover {
  filter: brightness(1.15);
}

.rooms .room-card__btn--book {
  background: #385102;
}

/* ----- Decorative fir branches ----- */

.rooms__branch {
  position: absolute;
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

/* Wrapper centres from Figma, placed via translate(-50%, -50%) around the centre point */
.rooms__branch--top-left {
  left: 8.9rem;
  top: 24.3rem;
  width: 27.8rem;
  height: 59.1rem;
  transform: translate(-50%, -50%) rotate(-55.88deg) scaleY(-1);
}

.rooms__branch--top-right {
  left: calc(80% + 30.4rem);
  top: 2rem;
  width: 41.3rem;
  height: 27.5rem;
  transform: translate(-50%, -50%) rotate(159.59deg) scaleY(-1);
}

.rooms__branch--mid-right {
  left: calc(80% + 38rem);
  top: 102.9rem;
  width: 27.8rem;
  height: 59.1rem;
  transform: translate(-50%, -50%) rotate(124.12deg) scaleY(-1);
}

.rooms__branch--mid-left {
  left: 8rem;
  top: 94.5rem;
  width: 41.3rem;
  height: 27.5rem;
  transform: translate(-50%, -50%) rotate(-20.41deg) scaleY(-1);
}

.rooms__branch--bottom-left {
  left: 7.6rem;
  top: 142.9rem;
  width: 27.8rem;
  height: 59.1rem;
  transform: translate(-50%, -50%) rotate(-55.88deg) scaleY(-1);
}

.rooms__branch--low-right {
  left: calc(80% + 31.5rem);
  top: 105.9rem;
  width: 41.3rem;
  height: 27.5rem;
  transform: translate(-50%, -50%) rotate(159.59deg) scaleY(-1);
}

.rooms__branch--bottom-right {
  left: calc(80% + 38.6rem);
  top: 182.3rem;
  width: 27.8rem;
  height: 59.1rem;
  transform: translate(-50%, -50%) rotate(124.12deg) scaleY(-1);
}

/* ===== Room detail modal ===== */

.room-modal {
  width: min(122rem, calc(100vw - 4rem));
  max-height: calc(100vh - 6rem);
  margin: auto;
  padding: 5rem 6rem 5.5rem;
  border: 0;
  border-radius: 2.4rem;
  background: #687f63;
  color: #fff;
  overflow-y: auto;
}

.room-modal::backdrop {
  background: rgba(20, 28, 16, 0.6);
}

.room-modal__close {
  position: absolute;
  top: 1.8rem;
  right: 2.2rem;
  width: 4.4rem;
  height: 4.4rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: transparent;
  font-size: 3rem;
  line-height: 1;
  color: #fff;
  cursor: pointer;
  transition: background 0.2s;
}

.room-modal__close:hover {
  background: rgba(255, 255, 255, 0.15);
}

.room-modal__title {
  margin: 0 0 2.6rem auto;
  width: 50%;
  font-family: 'Montserrat', 'Arial Black', sans-serif;
  font-weight: 400;
  font-size: 7rem;
  line-height: 1.1;
  text-align: center;
  color: #fff;
}

.room-modal__grid {
  display: grid;
  grid-template-columns: 54.5rem 1fr;
  grid-template-areas:
    'photo info'
    'note  cta';
  column-gap: 4rem;
  row-gap: 2.6rem;
  align-items: start;
}

.room-modal__photo {
  grid-area: photo;
  width: 100%;
  height: 38.9rem;
  object-fit: cover;
  background: #584949;
}

.room-modal__info {
  grid-area: info;
  display: flex;
  flex-direction: column;
  height: 100%;
}

.room-modal__desc {
  margin: 0;
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-weight: 400;
  font-size: 3.4rem;
  line-height: normal;
  text-align: right;
}

.room-modal__chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-start;
  gap: 1.4rem;
  margin: auto 0 0;
  padding: 1.9rem 0 0;
  list-style: none;
}

.room-modal__chip {
  padding: 0.7rem 2.6rem;
  border-radius: 2rem;
  background: rgba(217, 217, 217, 0.68);
  font-family: 'Montserrat', 'Arial Black', sans-serif;
  font-size: 3.4rem;
  line-height: 1.15;
  color: #fff;
  white-space: nowrap;
}

.room-modal__note {
  grid-area: note;
  margin: 0;
  font-family: 'Montserrat', 'Inter', sans-serif;
  font-weight: 400;
  font-size: 3.4rem;
  line-height: normal;
}

.room-modal__cta {
  grid-area: cta;
  align-self: center;
}

/* ===== Mobile ===== */

@media (max-width: 768px) {
  .rooms {
    padding: 4rem 0 6rem;
  }

  .rooms__title {
    font-size: 3.6rem;
  }

  .rooms__grid {
    width: 100%;
    margin-top: 2.4rem;
    padding: 0 2rem;
    grid-template-columns: minmax(0, 36rem);
    row-gap: 3.2rem;
  }

  .rooms .room-card {
    width: 36rem;
    max-width: 100%;
    margin: 0 auto;
  }

  /* card internals scaled ×0.8 (45rem → 36rem) */
  .rooms .room-card__media {
    height: 53.5rem;
  }

  .rooms .room-card__name {
    top: 16.6rem;
    font-size: 6.9rem;
  }

  .rooms .room-card__name--lg {
    top: 17.9rem;
    font-size: 10.2rem;
  }

  .rooms .room-card__emblem {
    left: 4.8rem;
    top: 31rem;
    width: 27.2rem;
    height: 16rem;
  }

  .rooms .room-card__count {
    top: 35.7rem;
    font-size: 10.2rem;
  }

  .rooms .room-card__persons {
    top: 48.9rem;
    font-size: 3.8rem;
  }

  .rooms .room-card__actions {
    margin-top: 0.8rem;
  }

  .rooms .room-card__btn {
    width: 16.9rem;
    height: 4rem;
    border-radius: 1.2rem;
    font-size: 1.8rem;
  }

  .rooms__branch--mid-left,
  .rooms__branch--mid-right,
  .rooms__branch--bottom-left,
  .rooms__branch--low-right {
    display: none;
  }

  .rooms__branch--top-left {
    left: -2rem;
    top: 4rem;
    width: 12rem;
    height: 25.5rem;
  }

  .rooms__branch--top-right {
    left: auto;
    right: -13rem;
    top: 2rem;
    width: 20rem;
    height: 13.4rem;
    transform: rotate(159.59deg) scaleY(-1);
  }

  .rooms__branch--bottom-right {
    left: auto;
    right: -9rem;
    top: auto;
    bottom: -5rem;
    width: 13rem;
    height: 27.6rem;
    transform: rotate(124.12deg) scaleY(-1);
  }

  /* modal stacks vertically */
  .room-modal {
    width: calc(100vw - 3.2rem);
    padding: 4.8rem 2rem 3.2rem;
    border-radius: 1.6rem;
  }

  .room-modal__title {
    width: 100%;
    margin: 0 0 1.6rem;
    font-size: 3.2rem;
  }

  .room-modal__grid {
    grid-template-columns: 1fr;
    grid-template-areas:
      'photo'
      'info'
      'note'
      'cta';
    row-gap: 1.6rem;
  }

  .room-modal__photo {
    height: auto;
    aspect-ratio: 4 / 3;
  }

  .room-modal__desc {
    font-size: 1.8rem;
    text-align: left;
  }

  .room-modal__chips {
    justify-content: flex-start;
    gap: 1rem;
    padding-top: 0.6rem;
  }

  .room-modal__chip {
    padding: 0.5rem 1.6rem;
    border-radius: 1.4rem;
    font-size: 1.7rem;
  }

  .room-modal__note {
    font-size: 1.8rem;
  }

  .room-modal__close {
    top: 1rem;
    right: 1rem;
    width: 3.6rem;
    height: 3.6rem;
    font-size: 2.2rem;
  }
}
