/**
 * @file
 * Shared room detail modal (used by "Наши номера" and "Сравнение номеров").
 */

.hr-room-modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(17, 24, 39, 0.6);
  /* Above the booking modal (100002): the detail modal is also opened
     from step 2 inside the booking modal and must stay on top. */
  z-index: 100003;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  animation: hr-room-modal-fade-in 0.2s ease both;
}

@keyframes hr-room-modal-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

.hr-room-modal {
  position: relative;
  background: #fff;
  border-radius: 16px;
  width: var(--hr-room-modal-width, 65%);
  max-width: var(--hr-room-modal-width, 65%);
  min-height: 70vh;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
}

/* Perfectly round icon buttons — reset theme button styles. */
.hr-room-modal__close,
.hr-room-modal__nav {
  padding: 0;
  margin: 0;
  min-width: 0;
  min-height: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  border: none;
  cursor: pointer;
}

.hr-room-modal__close {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 3;
  width: 36px;
  height: 36px;
  background: rgba(17, 24, 39, 0.7);
  color: #fff;
}

.hr-room-modal__close svg {
  width: 14px;
  height: 14px;
}

.hr-room-modal__close:hover {
  background: rgba(17, 24, 39, 0.9);
}

/* ── Carousel (slick-like free scroll) ─────────────────────────── */

.hr-room-modal__slider {
  position: relative;
  background: #14171c;
  padding: 20px 0;
}

.hr-room-modal__track-viewport {
  overflow-x: auto;
  overflow-y: hidden;
  cursor: grab;
  scrollbar-width: none;
  scroll-snap-type: x proximity;
  touch-action: pan-y;
}

.hr-room-modal__track-viewport::-webkit-scrollbar {
  display: none;
}

.hr-room-modal__track-viewport.is-dragging {
  cursor: grabbing;
  scroll-snap-type: none;
}

.hr-room-modal__track {
  display: flex;
  gap: 12px;
  padding: 0 24px;
  width: max-content;
}

.hr-room-modal__slide {
  position: relative;
  flex: 0 0 auto;
  height: 504px;
  max-height: 43vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #1e232b;
  border-radius: 12px;
  overflow: hidden;
  scroll-snap-align: center;
  user-select: none;
  -webkit-user-select: none;
}

.hr-room-modal__slide img {
  height: 100%;
  width: auto;
  max-width: 82vw;
  object-fit: contain;
  display: block;
  pointer-events: none;
  -webkit-user-drag: none;
}

.hr-room-modal__zoom {
  position: absolute;
  bottom: 10px;
  right: 10px;
  width: 34px;
  height: 34px;
  padding: 0;
  margin: 0;
  min-width: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  cursor: pointer;
}

.hr-room-modal__zoom svg {
  width: 16px;
  height: 16px;
}

.hr-room-modal__zoom:hover {
  background: rgba(0, 0, 0, 0.8);
}

.hr-room-modal__counter {
  position: absolute;
  bottom: 12px;
  left: 12px;
  padding: 4px 12px;
  border-radius: 20px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 13px;
  font-family: system-ui, sans-serif;
  pointer-events: none;
}

.hr-room-modal__nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  background: rgba(255, 255, 255, 0.92);
  color: #111827;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.18);
}

.hr-room-modal__nav svg {
  width: 16px;
  height: 16px;
}

.hr-room-modal__nav:hover {
  background: #fff;
}

.hr-room-modal__nav--prev { left: 12px; }
.hr-room-modal__nav--next { right: 12px; }

/* ── Body ──────────────────────────────────────────────────── */

.hr-room-modal__body {
  padding: 20px 24px 24px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  align-items: flex-start;
}

.hr-room-modal__body .hr-room-card__type-badge {
  padding: 5px 10px;
}

.hr-room-modal__name {
  margin: 0;
  font-size: 22px;
  color: #111827;
}

.hr-room-modal__meta {
  display: flex;
  gap: 16px;
  align-items: center;
  flex-wrap: wrap;
  font-size: 14px;
  color: #6b7280;
}

.hr-room-modal__price {
  font-weight: 700;
  color: #92400e;
  font-size: 18px;
}

.hr-room-modal__desc {
  margin: 0;
  font-size: 14px;
  line-height: 1.6;
  color: #374151;
  white-space: pre-wrap;
}

.hr-room-modal__book {
  margin-top: 6px;
  padding: 12px 28px;
  border: none;
  border-radius: 10px;
  background: #d97706;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}

.hr-room-modal__book:hover {
  background: #b45309;
}

@media (max-width: 640px) {
  .hr-room-modal {
    width: 95%;
    max-width: 95%;
  }
  .hr-room-modal__slide { height: 346px; max-height: 38vh; }
  .hr-room-modal__slide img { max-width: 86vw; }
}

/* ── Lightbox viewer ───────────────────────────────────────── */

.hr-room-lightbox-overlay {
  position: fixed;
  inset: 0;
  z-index: 100004;
  background: rgba(0, 0, 0, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: hr-room-modal-fade-in 0.2s ease both;
}

.hr-room-lightbox-overlay img {
  max-width: 92vw;
  max-height: 88vh;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 12px 48px rgba(0, 0, 0, 0.6);
}

.hr-room-lightbox__close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  padding: 0;
  margin: 0;
  min-width: 0;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  border: none;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.hr-room-lightbox__close svg {
  width: 16px;
  height: 16px;
}

.hr-room-lightbox__close:hover {
  background: rgba(255, 255, 255, 0.28);
}

.hr-room-lightbox__counter {
  position: absolute;
  bottom: 16px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.85);
  font-size: 14px;
  font-family: system-ui, sans-serif;
}
