/* =============================================================
   СТИЛИ ДЛЯ СТРАНИЦ С КАРУСЕЛЬЮ (page1, page2, page11)
   ============================================================= */

.carousel-item {
  background: #f0f2ef;
  border-radius: 2rem;
  overflow: hidden;
}

.carousel-item img.photo-img {
  width: 100%;
  height: 500px;
  object-fit: cover;
  background: #f0f2ef;
  display: block;
  cursor: pointer;
}

.floor-plan-slide {
  position: relative;
  width: 100%;
  background: #f0f2ef;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 400px;
}

.floor-plan-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #f0f2ef;
}

.floor-plan-container img {
  max-width: 100%;
  height: auto;
  display: block;
}

.rooms-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.room-area {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: auto;
  cursor: pointer;
  border: 2px solid transparent;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  box-sizing: border-box;
  background-color: rgba(76, 175, 80, 0.15);
  
  /* ===== ГЛАВНОЕ ИСПРАВЛЕНИЕ: АППАРАТНОЕ УСКОРЕНИЕ ===== */
  will-change: transform;
  transform: translateZ(0);
  backface-visibility: hidden;
  /* ==================================================== */
}

.room-area.occupied {
  background-color: rgba(0, 0, 0, 0.05);
  pointer-events: none !important;
  cursor: default !important;
}

.room-area.occupied:hover {
  border-color: transparent !important;
  background-color: rgba(0, 0, 0, 0.05) !important;
}

.room-area:not(.occupied):hover {
  border-color: #2b6fd1;
  background-color: rgba(43, 111, 209, 0.25);
}

.room-area:not(.occupied):active {
  border-color: #2b6fd1;
  background-color: rgba(43, 111, 209, 0.35);
}

.room-number {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-weight: bold;
  color: #333;
  pointer-events: none;
  background: rgba(255, 255, 255, 0.85);
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.9rem;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.15);
  z-index: 2;
}

.carousel-control-prev,
.carousel-control-next {
  width: 50px;
  height: 50px;
  background: rgba(0, 0, 0, 0.3);
  border-radius: 50%;
  top: 50%;
  transform: translateY(-50%);
  opacity: 1;
  z-index: 1020;
}

.carousel-control-prev {
  left: 20px;
}

.carousel-control-next {
  right: 20px;
}

.carousel-control-prev-icon,
.carousel-control-next-icon {
  filter: brightness(0) invert(1);
}

.thumbnails-container {
  margin-top: 20px;
}

.img-thumbnail {
  height: 100px;
  width: 100px;
  object-fit: cover;
  cursor: pointer;
  border: 2px solid transparent;
  transition: 0.3s;
  border-radius: 1rem;
}

.img-thumbnail:hover {
  border-color: #2b6fd1;
  transform: scale(1.02);
}

.thumbnail-active {
  border: 3px solid #2b6fd1 !important;
}

.thumbnail-plan {
  background: #a6a99c;
  display: flex;
  align-items: center;
  justify-content: center;
  color: white;
  font-weight: bold;
  font-size: 1.2rem;
  text-align: center;
  line-height: 1.2;
}

/* ГЛОБАЛЬНЫЙ ТУЛТИП */
.global-tooltip {
  position: fixed;
  background: white;
  padding: 12px 18px;
  border-radius: 12px;
  box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
  min-width: 200px;
  z-index: 10000;
  border: 1px solid #eee;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.15s ease;
  font-size: 14px;
  
  /* Тоже добавляем ускорение для плавности */
  will-change: opacity, transform;
  transform: translateZ(0);
}

.global-tooltip h5 {
  margin: 0 0 8px 0;
  color: #2b6fd1;
  font-size: 1.2rem;
}

.global-tooltip p {
  margin: 5px 0;
}

.global-tooltip .price {
  font-weight: bold;
  color: #d12b2b;
}

.global-tooltip.show {
  opacity: 1;
  visibility: visible;
}

/* МОДАЛЬНОЕ ОКНО */
.modal-overlay {
  display: none;
  position: fixed;
  z-index: 2000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  align-items: center;
  justify-content: center;
}

.modal-content {
  background-color: #fefefe;
  margin: auto;
  padding: 30px;
  border: 1px solid #888;
  width: 90%;
  max-width: 500px;
  border-radius: 2rem;
  position: relative;
  text-align: center;
}

.close-modal {
  color: #aaa;
  position: absolute;
  top: 10px;
  right: 20px;
  font-size: 32px;
  cursor: pointer;
}

.contact-info p {
  margin: 15px 0;
  font-size: 1.3rem;
}

.contact-info a {
  color: black;
  text-decoration: none;
  border-bottom: 2px dashed #232323;
}

/* ЛАЙТБОКС */
.lightbox-overlay {
  display: none;
  position: fixed;
  z-index: 3000;
  left: 0;
  top: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.92);
  justify-content: center;
  align-items: center;
  cursor: default;
}

.lightbox-overlay.active {
  display: flex;
}

.lightbox-content {
  max-width: 90%;
  max-height: 85%;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 0 40px rgba(0, 0, 0, 0.8);
  cursor: default;
  user-select: none;
}

.lightbox-close {
  position: absolute;
  top: 25px;
  right: 40px;
  color: #fff;
  font-size: 48px;
  font-weight: bold;
  cursor: pointer;
  transition: 0.3s;
  z-index: 3001;
  line-height: 1;
}

.lightbox-close:hover {
  color: #aaa;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 54px;
  font-weight: 300;
  cursor: pointer;
  padding: 20px 15px;
  transition: 0.3s;
  z-index: 3001;
  user-select: none;
  background: rgba(0, 0, 0, 0.2);
  border-radius: 8px;
  line-height: 1;
}

.lightbox-nav:hover {
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
}

.lightbox-nav.prev {
  left: 20px;
}

.lightbox-nav.next {
  right: 20px;
}

.lightbox-counter {
  position: absolute;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%);
  color: rgba(255, 255, 255, 0.6);
  font-size: 16px;
  z-index: 3001;
  background: rgba(0, 0, 0, 0.4);
  padding: 6px 16px;
  border-radius: 20px;
}

/* =============================================================
   АДАПТАЦИЯ ПОД МОБИЛЬНЫЕ ТЕЛЕФОНЫ (ПЛАНШЕТЫ И ТЕЛЕФОНЫ)
   ============================================================= */

/* Планшеты и небольшие ноутбуки */
@media (max-width: 992px) {
  .floor-plan-slide {
    min-height: 350px;
  }
  
  .carousel-item img.photo-img {
    height: 400px;
  }
}

/* Телефоны (портретный режим) */
@media (max-width: 768px) {
  /* Убираем фиксированную высоту для фото, делаем адаптивной */
  .carousel-item img.photo-img {
    height: auto;
    max-height: 400px;
    min-height: 250px;
    width: 100%;
    aspect-ratio: 4/3;
    object-fit: cover;
  }

  .floor-plan-slide {
    min-height: 280px;
  }

  .floor-plan-container img {
    max-width: 100%;
    height: auto;
  }

  .section-title {
    font-size: 2rem;
  }

  .img-thumbnail {
    height: 60px;
    width: 60px;
  }

  .thumbnail-plan {
    font-size: 0.8rem;
  }

  .carousel-control-prev,
  .carousel-control-next {
    width: 40px;
    height: 40px;
  }

  .carousel-control-prev {
    left: 10px;
  }

  .carousel-control-next {
    right: 10px;
  }

  .lightbox-close {
    top: 15px;
    right: 25px;
    font-size: 36px;
  }

  .lightbox-nav {
    font-size: 36px;
    padding: 12px 10px;
  }

  .lightbox-nav.prev {
    left: 8px;
  }

  .lightbox-nav.next {
    right: 8px;
  }

  .lightbox-counter {
    font-size: 13px;
    bottom: 18px;
    padding: 4px 12px;
  }

  .room-number {
    width: 22px;
    height: 22px;
    font-size: 0.7rem;
  }

  .global-tooltip {
    bottom: 20px;
    top: auto !important;
    left: 50% !important;
    transform: translateX(-50%);
    width: 90%;
    max-width: 280px;
    text-align: center;
  }
}

/* Маленькие телефоны (ширина до 480px) */
@media (max-width: 480px) {
  .carousel-item img.photo-img {
    max-height: 300px;
    min-height: 200px;
    aspect-ratio: 4/3;
  }

  .floor-plan-slide {
    min-height: 220px;
  }

  .section-block {
    padding: 3rem 1rem;
  }

  .img-thumbnail {
    height: 50px;
    width: 50px;
  }

  .thumbnail-plan {
    font-size: 0.65rem;
  }

  .carousel-control-prev,
  .carousel-control-next {
    width: 32px;
    height: 32px;
  }

  .carousel-control-prev {
    left: 6px;
  }

  .carousel-control-next {
    right: 6px;
  }

  .carousel-control-prev-icon,
  .carousel-control-next-icon {
    width: 16px;
    height: 16px;
  }

  .lightbox-close {
    top: 12px;
    right: 18px;
    font-size: 28px;
  }

  .lightbox-nav {
    font-size: 28px;
    padding: 8px 6px;
  }

  .lightbox-nav.prev {
    left: 4px;
  }

  .lightbox-nav.next {
    right: 4px;
  }

  .lightbox-counter {
    font-size: 11px;
    bottom: 12px;
    padding: 3px 10px;
  }

  .room-number {
    width: 18px;
    height: 18px;
    font-size: 0.6rem;
  }
}

/* Очень маленькие телефоны (до 360px) */
@media (max-width: 360px) {
  .carousel-item img.photo-img {
    max-height: 220px;
    min-height: 150px;
  }

  .floor-plan-slide {
    min-height: 180px;
  }

  .img-thumbnail {
    height: 40px;
    width: 40px;
  }

  .thumbnail-plan {
    font-size: 0.55rem;
  }

  .section-title {
    font-size: 1.6rem;
  }

  .section-subtitle {
    font-size: 1rem;
  }
}

/* =============================================================
   УВЕЛИЧЕННЫЙ ОТСТУП ДЛЯ СТРАНИЦ С КАРУСЕЛЬЮ
   ============================================================= */

/* Основной отступ для страниц с каруселью */
.section-block.page-content {
  padding-top: 12rem !important;
}

/* При сжатом навбаре */
.section-block.page-content.shrink-padding {
  padding-top: 8rem !important;
}

/* Планшеты */
@media (max-width: 768px) {
  .section-block.page-content {
    padding-top: 9rem !important;
  }
  .section-block.page-content.shrink-padding {
    padding-top: 6.5rem !important;
  }
}

/* Телефоны */
@media (max-width: 480px) {
  .section-block.page-content {
    padding-top: 8rem !important;
  }
  .section-block.page-content.shrink-padding {
    padding-top: 6rem !important;
  }
}