/* ==========================================================================
Apartment Popup — isolated styles for #popup-apartment
Fully independent, no reliance on other popup styles
Uses `apa-` prefix and `--apa-` variables
=========================================================================== */

#popup-apartment {
  display: none;
}

#popup-apartment.active {
  display: flex;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  justify-content: center;
  align-items: center;
  z-index: 1000;
  overflow: hidden;
}

/* Фон затемнения */
#popup-apartment .apa__overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  z-index: 1;
}

/* Основной контейнер */
#popup-apartment .apa__frame {
  position: relative;
  max-width: 1080px;
  width: 96%;
  margin: 40px auto;
  border: 2px solid var(--apa-border);
  background: var(--apa-bg);
  color: var(--apa-text);
  border-radius: 12px;
  padding: 24px;
  overflow: hidden;
  box-sizing: border-box;
  z-index: 2;
  display: flex;
  flex-direction: column;
}

/* === Переменные цветов === */
#popup-apartment {
  --apa-bg: #2a2a2a;
  --apa-panel: #242424;
  --apa-text: #fff;
  --apa-muted: #ccc;
  --apa-border: rgba(255, 255, 255, 0.35);
  --apa-accent: #ff0000;
  --apa-accent-hover: #cc0000;
}

/* === Кнопка "Позвоните нам" === */
.apa__callwrap {
  display: flex;
  justify-content: center;
  margin-bottom: 10px;
}

.apa-callbtn {
  display: inline-flex;
  align-items: center;
  gap: 40px;
  background: var(--apa-accent);
  color: var(--apa-text);
  border: 2px solid #fff;
  border-radius: 10px;
  padding: 12px 80px;
  font-size: 28px;
  font-weight: 600;
  cursor: pointer;
}

.apa-callbtn:hover {
  background: var(--apa-accent-hover);
}

.apa-callbtn__icon img {
  width: 64px;
  height: 64px;
  object-fit: contain;
}

/* === Заголовок === */
.apa__section-title {
  text-align: center;
  font-size: 36px;
  font-weight: 600;
  margin: 6px 0 14px 0;
}

/* Описание (опционально) */
.apa__description {
  text-align: center;
  color: var(--apa-muted);
  font-size: 18px;
  margin-bottom: 16px;
}

/* === Сетка карточек === */
.apa__grid {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 16px;
}

/* === Карточка === */
.apa-card {
  position: relative;
  display: flex;
  flex-direction: row;
  align-items: stretch;
  border: 2px solid var(--apa-border);
  border-radius: 8px;
  background: var(--apa-panel);
  overflow: hidden;
  min-height: 180px;
  box-sizing: border-box;
  background-size: cover; /* Растягиваем изображение, сохраняя пропорции */
  background-position: center; /* Центрируем изображение */
}

.apa-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  z-index: 1;
}

.apa-card__thumb {
  flex: 0 0 240px;
  position: relative;
  z-index: 2;
}

.apa-card__thumb img {
  width: 240px;
  height: 100%;
  object-fit: cover;
  border-radius: 8px 0 0 8px;
  border: 3px solid #fff;
  display: block;
}

.apa-card__body {
  display: grid;
  grid-template-columns: 1fr 220px;
  gap: 12px;
  padding: 16px;
  position: relative;
  z-index: 2;
  flex: 1 1 auto;
}

.apa-card__title {
  font-size: 25px;
  font-weight: 700;
  text-align: center;
  margin: 4px 0 0 0;
  line-height: 38px;
  color: var(--apa-text);
}

.apa-card__list {
  list-style: none;
  margin: 0;
  padding: 30px 0 0 0;
  font-size: 21px;
  color: var(--apa-text);
  display: flex;
  flex-direction: column;
  gap: 6px;
  line-height: 38px;
  font-weight: 300;
  text-align: left;
}

/* Маркеры: плюс для первого, галочка для остальных */


.apa-card__list li:before {
  content: "";
  display: inline-block;
  width: 14px;
  height: 14px;
  margin-right: 7px;
  background-image: url('../apartment/galka.webp');
  background-size: contain;
  background-position: center;
  background-repeat: no-repeat;
  vertical-align: middle;
}

/* === Цена и кнопки === */
.apa-card__meta {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.apa-card__price {
  display: inline-block;
  position: relative;
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin-bottom: 2px;
  padding-bottom: 6px;
  line-height: 1.1;
}

.apa-card__price::after {
  content: "";
  position: absolute;
  left: -5px;
  right: -5px;
  bottom: 0;
  height: 3px;
  background: var(--apa-accent);
  border-radius: 2px;
}

.apa-card__price span {
  font-size: 14px;
  color: #ffffffcc;
}

.apa-card__note {
  font-size: 14px;
  color: #ffffff;
  opacity: 0.9;
  margin: 0;
  margin-bottom: 30px;
  text-align: center;
}

.apa-card__buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  width: 100%;
}

.apa-btn {
  height: 40px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--apa-border);
  background: #fff;
  color: var(--apa-accent);
  cursor: pointer;
  font-size: 18px;
  width: 100%;
  font-weight: 500;
}

.apa-btn:hover {
  background: rgba(255, 255, 255, 0.1);
}

.apa-btn--accent {
  background: var(--apa-accent);
  border: none;
  color: var(--apa-text);
}

.apa-btn--accent:hover {
  background: var(--apa-accent-hover);
  color: var(--apa-text);
}

/* === Преимущества внизу === */
.apa__benefits {
  display: flex;
  justify-content: space-between;
  align-items: stretch;
  background: #ffffff;
  border: 2px solid var(--apa-accent);
  border-radius: 12px;
  padding: 16px 20px;
  gap: 10px;
  color: #000;
}

.apa-benefit {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 8px;
  text-align: center;
}

.apa-benefit__img {
  width: 110px;
  height: 110px;
  object-fit: contain;
}

.apa-benefit__text {
  font-size: 22px !important;
  color: #000 !important;
  font-weight: 600 !important;
  line-height: 1.3;
}

/* === Кнопка закрытия === */
.apa__close {
  position: absolute;
  top: 10px;
  right: 10px;
  background: none;
  border: none;
  font-size: 36px;
  color: #fff;
  cursor: pointer;
  z-index: 3;
}

/* === Сетка из 3 блоков в строку === */
.apa__grid--row {
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin-bottom: 16px;
  width: 100%;
}

/* Карточки в строку — равномерно распределены */
.apa-card--row {
  flex: 1;
  min-width: 0;
  background: var(--apa-panel);
  border: 2px solid var(--apa-border);
  border-radius: 8px;
  overflow: hidden;
  box-sizing: border-box;
  position: relative;
}

/* Убираем левый блок с изображением */
.apa-card--row .apa-card__thumb {
  display: none;
}

/* === Центрирование всего содержимого по вертикали === */
.apa-card--row .apa-card__body {
  display: flex;
  flex-direction: column;
  justify-content: center;        /* ← Основное выравнивание */
  align-items: stretch;
  height: 100%;
  padding: 16px;
  gap: 12px;
  color: var(--apa-text);
}

/* Заголовок — по центру */
.apa-card--row .apa-card__title {
  text-align: center;
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  line-height: 1.2;
}

/* Список — с отступом снизу */
.apa-card--row .apa-card__list {
  padding: 16px 0;
  margin: 0;
  text-align: left;
  display: flex;
  flex-direction: column;
  gap: 6px;
}



/* Цена — по центру */
.apa-card--row .apa-card__price {
  text-align: center;
  font-size: 20px;
  font-weight: 700;
  color: #ffffff;
  margin: 8px 0;
}

.apa-card--row .apa-card__note {
  text-align: center;
  font-size: 13px;
  color: #ffffffcc;
  margin: 0;
}

/* Кнопки — по центру, в столбик */
.apa-card--row .apa-card__buttons {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 8px;
  align-items: center;
}

.apa-card--row .apa-btn {
  width: 180px;  /* фиксированная ширина для аккуратности */
  text-align: center;
}

/* === Специфичная стилизация для карточки "Беспроводной умный дом" === */
.apa-card .apa-card__body {
  /* Основной контейнер — центрирование */
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  padding: 16px;
  text-align: center;
}

/* Заголовок — по центру */
.apa-card .apa-card__title {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  color: var(--apa-text);
  text-align: center;
}

/* Два списка — в одну строку */
.apa-card .apa-card__body > div {
  display: flex;
  flex-direction: row;
  gap: 10px;
  justify-content: center;
  flex-wrap: wrap; /* если мало места — перенос */
  width: 100%;
  margin: 0;
}

/* Один список */
.apa-card .apa-card__list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 20px;
  color: var(--apa-text);
  text-align: left;
  min-width: 280px;
  max-width: 320px;
}



/* Блок с ценой — под списками */
.apa-card .apa-card__meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
  margin-top: 10px;
}

.apa-card .apa-card__price {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.apa-card .apa-card__note {
  font-size: 14px;
  color: #ffffffcc;
  margin: 0;
}

/* Кнопки — в одну строку */
.apa-card .apa-card__buttons {
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin-top: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.apa-card .apa-btn {
  width: auto;
  min-width: 140px;
  padding: 0 18px;
  font-size: 18px;
  height: 40px;
  text-align: center;
}

/* === Специальная стилизация для карточки "Беспроводной умный дом" === */
.apa-card .apa-card__body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  padding: 16px;
  text-align: center;
  color: var(--apa-text);
}

/* Заголовок — по центру */
.apa-card .apa-card__title {
  margin: 0;
  font-size: 25px;
  font-weight: 700;
  text-align: center;
  color: var(--apa-text);
}

/* Обёртка для двух списков — в строку */
.apa-card__lists-wrapper {
  display: flex;
  flex-direction: row;
  gap: 40px;
  justify-content: space-between;
  flex-wrap: wrap;
  width: 100%;
  margin: 10px 0;
}

/* Один список */
.apa-card .apa-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 20px;
  color: var(--apa-text);
  text-align: left;
  min-width: 260px;
  max-width: 300px;
}



/* Блок цены */
.apa-card .apa-card__meta {
  display: flex;
  flex-direction: column !important;
  align-items: center;
  gap: 6px;
  text-align: center;
  margin-top: 10px;
}

.apa-card .apa-card__price {
  font-size: 22px;
  font-weight: 700;
  color: #ffffff;
  margin: 0;
}

.apa-card .apa-card__note {
  font-size: 14px;
  color: #ffffffcc;
  margin: 0;
}

/* Кнопки — в одну строку */
.apa-card .apa-card__buttons {
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin-top: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.apa-card .apa-btn {
  width: auto;
  min-width: 140px;
  padding: 0 18px;
  font-size: 18px;
  height: 40px;
  text-align: center;
}

/* === Более широкие списки и меньше отступы === */

.apa-card .apa-card__body {
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 16px;
  padding: 16px; /* можно уменьшить, если нужно сжать по бокам */
  text-align: center;
  color: var(--apa-text);
  width: 100%;
}

/* Уменьшаем внутренние отступы карточки, если нужно больше места */
.apa-card .apa-card__body {
  padding-left: 24px;
  padding-right: 24px;
}

/* Обёртка для списков — растягиваем на большую ширину */
.apa-card__lists-wrapper {
  display: flex;
  flex-direction: row;
  gap: 32px; /* можно уменьшить на 800px */
  justify-content: center;
  width: 100%;
  margin: 10px 0;
  flex-wrap: nowrap; /* сохраняем в строку, если хватает места */
}

/* Адаптив: на узких экранах — перенос */
@media (max-width: 800px) {
  .apa-card__lists-wrapper {
    flex-direction: column;
    align-items: center;
    gap: 12px;
    padding: 0 20px;
  }
}

/* Списки — более широкие, больше ширины */
.apa-card .apa-card__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 20px;
  color: var(--apa-text);
  text-align: left;
  min-width: 300px;     /* ← увеличено */
  max-width: 400px;     /* ← стало шире */
  flex: 1;              /* ← растягивается равномерно */
}

/* Убираем лишние отступы у контейнера с кнопками */
.apa-card .apa-card__buttons {
  display: flex;
  flex-direction: row;
  gap: 12px;
  margin-top: 12px;
  justify-content: center;
  flex-wrap: wrap;
  padding: 0 10px; /* не даём «прилипать» к краям */
  
}

.apa-card .apa-btn {
  min-width: 150px;
  padding: 0 20px; /* комфортно для текста */
  font-size: 18px;
  height: 40px;
}