/* ==========================================================================
   Шаблон №2 («ЖК застройщика» — detail_developer_v2)
   Все правила строго изолированы под body[data-pdp-template="developer"].
   Базовая дизайн-система ap-r.ru (pdp-base.css + pdp.css + apr-wide.css) не меняется.
   ========================================================================== */

/* 0. ШАПКА: защита логотипа от сжатия */
@media (min-width: 1024px) {
  body[data-pdp-template="developer"] .header .logo {
    flex: 0 0 auto;
  }
  body[data-pdp-template="developer"] .header .logo img {
    display: block;
    height: 30px !important;
    width: auto !important;
    flex-shrink: 0;
  }
}
@media (max-width: 1023px) {
  body[data-pdp-template="developer"] .header .m-fav,
  body[data-pdp-template="developer"] .header .m-fav svg {
    color: #ffffff;
  }
}

/* 1. ПЕРВЫЙ ЭКРАН: строго равный верхний и нижний край фото и правой карточки (delta = 0 px) */
@media (min-width: 1024px) {
  body[data-pdp-template="developer"] .pdp-hero-grid {
    grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
    gap: 24px;
    align-items: stretch;
  }

  body[data-pdp-template="developer"] .pdp-hero-photo,
  body[data-pdp-template="developer"] .pdp-hero-card {
    box-sizing: border-box;
    min-width: 0;
    height: auto;
    max-height: none;
    margin-block: 0;
    align-self: stretch;
  }

  body[data-pdp-template="developer"] .pdp-hero-photo {
    aspect-ratio: auto;
    position: relative;
  }

  body[data-pdp-template="developer"] .pdp-hero-photo::before {
    content: "";
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    pointer-events: none;
  }

  body[data-pdp-template="developer"] #pdp-hero-main-img {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: var(--hero-focus, 50% 46%);
  }

  body[data-pdp-template="developer"] .pdp-hero-card {
    gap: 15px;
    padding: 26px 28px;
  }

  body[data-pdp-template="developer"] .pdp-hero-cta {
    margin-top: auto;
  }
}

/* Компактная адаптация на ноутбуках 1024–1199 px */
@media (min-width: 1024px) and (max-width: 1199px) {
  body[data-pdp-template="developer"] .pdp-hero-card {
    padding: 22px;
    gap: 12px;
  }
  body[data-pdp-template="developer"] .pdp-hero-ptypes {
    display: none;
  }
}

body[data-pdp-template="developer"] .pdp-hero-price-wrap {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
body[data-pdp-template="developer"] .pdp-hero-checks {
  flex-wrap: nowrap;
  overflow: hidden;
}
@media (max-width: 767px) {
  body[data-pdp-template="developer"] .pdp-hero-grid > * {
    min-width: 0;
  }
  body[data-pdp-template="developer"] .pdp-hero-checks {
    flex-wrap: wrap;
  }
  body[data-pdp-template="developer"] .pdp-hero-price {
    flex-wrap: wrap;
    gap: 10px 16px;
  }
  body[data-pdp-template="developer"] .pdp-hero-thumbs {
    max-width: calc(100% - 118px);
    overflow-x: auto;
    scrollbar-width: none;
  }
  body[data-pdp-template="developer"] .pdp-hero-thumbs::-webkit-scrollbar {
    display: none;
  }
  body[data-pdp-template="developer"] .pdp-hero-thumb {
    flex-shrink: 0;
  }
}
@media (max-width: 440px) {
  body[data-pdp-template="developer"] .pdp-hero-thumbs .pdp-hero-thumb:nth-child(n+4) {
    display: none;
  }
}

/* Предпродажное состояние цены в Hero */
body[data-pdp-template="developer"] .pdp-hero-presale-status {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 26px;
  line-height: 1.15;
  color: var(--canon-navy, #13374f);
  letter-spacing: -0.02em;
}
body[data-pdp-template="developer"] .pdp-hero-presale-sub {
  font-size: 13.5px;
  color: var(--canon-muted, #6a7c8c);
  margin-top: 4px;
}

/* 2. ЗАЩИТА ПОДМЕНЮ .pdp-subnav ОТ ОБРЕЗКИ СЛОВ */
body[data-pdp-template="developer"] .pdp-subnav-link,
body[data-pdp-template="developer"] .pdp-subnav-more-btn,
body[data-pdp-template="developer"] .pdp-subnav-cta .pdp-btn {
  white-space: nowrap;
  flex-shrink: 0;
}
body[data-pdp-template="developer"] .pdp-subnav-anchors {
  overflow: visible;
  flex-wrap: nowrap;
}

/* 3. КОНТАКТНЫЕ СЛОТЫ «ОТДЕЛ ПРОДАЖ ЗАСТРОЙЩИКА» (.pr-mgr, .s2a-mgr, #mgr) */
body[data-pdp-template="developer"] .dev-emblem-avatar {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #13374f 0%, #17545f 100%);
  color: #ffffff;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 13px;
  letter-spacing: 0.04em;
  user-select: none;
}
body[data-pdp-template="developer"] .s2a-mgr-photo .dev-emblem-project-img {
  display: none;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
body[data-pdp-template="developer"] #s2-root.view-catalog .s2a-mgr-photo .dev-emblem-avatar,
body[data-pdp-template="developer"] #s2-root.view-plans .s2a-mgr-photo .dev-emblem-avatar {
  display: none;
}
body[data-pdp-template="developer"] #s2-root.view-catalog .s2a-mgr-photo .dev-emblem-project-img,
body[data-pdp-template="developer"] #s2-root.view-plans .s2a-mgr-photo .dev-emblem-project-img {
  display: block;
}
body[data-pdp-template="developer"] .pr-mgr .pr-zoom,
body[data-pdp-template="developer"] .s2a-mgr .pr-zoom {
  display: none !important;
}

/* Большой левый слот в тёмно-зелёной секции #mgr */
body[data-pdp-template="developer"] .pdp-mgr-photo {
  position: relative;
}
body[data-pdp-template="developer"] .pdp-mgr-photo-cap {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 7px 11px;
  border-radius: 10px;
  background: rgba(12, 32, 48, 0.78);
  backdrop-filter: blur(6px);
  color: #ffffff;
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.25;
}
body[data-pdp-template="developer"] .pdp-mgr-photo-cap b {
  font-weight: 800;
  color: #a3d977;
}
body[data-pdp-template="developer"] .pdp-mgr-quote--plain {
  font-style: normal;
}
body[data-pdp-template="developer"] .pdp-mgr-office-line {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.45;
  color: rgba(255, 255, 255, 0.86);
}
body[data-pdp-template="developer"] .pdp-mgr-channel--phone {
  white-space: nowrap;
}
body[data-pdp-template="developer"] #s2fc-mgr .on,
body[data-pdp-template="developer"] #s2fc-mgr .dot {
  display: none !important;
}
body[data-pdp-template="developer"] #s2fc-ov .s2fc-mgr-av {
  background: linear-gradient(145deg, #13374f 0%, #17545f 100%) !important;
  color: #ffffff !important;
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 12px;
  letter-spacing: 0.04em;
  display: flex;
  align-items: center;
  justify-content: center;
}
/* Скрываем агентские exit-intent, ленту скидок Краснодара и общие плавающие виджеты на карточке застройщика */
body[data-pdp-template="developer"] #apr-eov,
body[data-pdp-template="developer"] .apr-eov,
body[data-pdp-template="developer"] #aprl-dock,
body[data-pdp-template="developer"] #aprl-ov,
body[data-pdp-template="developer"] #aprl-look,
body[data-pdp-template="developer"] #aprl-reels {
  display: none !important;
}

/* 4. ЖИВЫЕ ПОЛЗУНКИ И ЧИПЫ В РОДНОМ КАЛЬКУЛЯТОРЕ #mort (.pdp-mort-card) */
body[data-pdp-template="developer"] .pdp-mort-progs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
body[data-pdp-template="developer"] button.pdp-chip {
  font-family: inherit;
  cursor: pointer;
  border: 1px solid var(--canon-border, #dfe6ec);
  background: #ffffff;
}
body[data-pdp-template="developer"] button.pdp-chip.pdp-chip--active {
  background: var(--canon-navy, #13374f);
  border-color: var(--canon-navy, #13374f);
  color: #ffffff;
}
body[data-pdp-template="developer"] .pdp-mort-row .range {
  position: relative;
}
body[data-pdp-template="developer"] .dev-mort-slider {
  position: absolute;
  inset: -8px 0;
  width: 100%;
  height: 24px;
  margin: 0;
  opacity: 0;
  cursor: pointer;
  z-index: 3;
}
body[data-pdp-template="developer"] .pdp-mort-row.is-disabled {
  opacity: 0.45;
  pointer-events: none;
}
body[data-pdp-template="developer"] .dev-mort-secondary {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(19, 55, 79, 0.12);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px 12px;
}
body[data-pdp-template="developer"] .dev-mort-secondary--stack {
  grid-template-columns: 1fr;
  gap: 10px;
}
body[data-pdp-template="developer"] .dev-mort-big2 {
  font-family: 'Manrope', sans-serif;
  font-weight: 800;
  font-size: 26px;
  line-height: 1.1;
  color: var(--canon-navy, #13374f);
  letter-spacing: -0.02em;
  margin-top: 2px;
}
body[data-pdp-template="developer"] .dev-mort-fullrow {
  grid-column: 1 / -1;
  padding-top: 6px;
  border-top: 1px dashed rgba(19, 55, 79, 0.14);
}
body[data-pdp-template="developer"] .dev-mort-secondary .k {
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: #4f6b58;
}
body[data-pdp-template="developer"] .dev-mort-secondary .v {
  font-weight: 800;
  font-size: 15px;
  color: #13374f;
  margin-top: 1px;
}
body[data-pdp-template="developer"] .dev-mort-SubCards {
  margin-top: 18px;
}

/* Подраздел отделки White Box внутри родного #about */
body[data-pdp-template="developer"] .dev-finish-box {
  margin: 24px 0 22px;
}
body[data-pdp-template="developer"] .dev-finish-title {
  font-size: 20px;
  font-weight: 800;
  color: var(--canon-navy, #13374f);
  margin: 0 0 6px;
  letter-spacing: -0.01em;
}
body[data-pdp-template="developer"] .dev-finish-sub {
  font-size: 14px;
  color: var(--canon-muted, #5d6b73);
  margin: 0 0 14px;
}

/* 5. ЧЕКБОКС СОГЛАСИЯ 152-ФЗ (БЕЗ checked, С ПОДСВЕТКОЙ ОШИБКИ) */
body[data-pdp-template="developer"] .dev-consent-label {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  text-align: left;
  cursor: pointer;
  font-size: 12px;
  line-height: 1.42;
}
body[data-pdp-template="developer"] .dev-consent-label input[type="checkbox"] {
  margin-top: 2px;
  width: 15px;
  height: 15px;
  flex: 0 0 15px;
  accent-color: #17b7bf;
  cursor: pointer;
}
body[data-pdp-template="developer"] .dev-consent-label.is-invalid {
  outline: 2px solid #e74c3c;
  outline-offset: 4px;
  border-radius: 6px;
}

/* 6. МОДАЛКА ПОДТВЕРЖДЕНИЯ ПЕРЕДАЧИ ЗАЯВКИ В ОТДЕЛ ПРОДАЖ ЗАСТРОЙЩИКА */
#apr-dev-webhook-toast {
  position: fixed;
  inset: 0;
  z-index: 2200;
  background: rgba(12, 32, 48, 0.58);
  display: none;
  align-items: center;
  justify-content: center;
  padding: 16px;
}
#apr-dev-webhook-toast.is-open {
  display: flex;
}
#apr-dev-webhook-toast .dw-box {
  background: #ffffff;
  border-radius: 18px;
  max-width: 480px;
  width: 100%;
  padding: 26px 28px;
  box-shadow: 0 24px 60px rgba(12, 32, 48, 0.28);
  color: #13374f;
  position: relative;
}
#apr-dev-webhook-toast .dw-x {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid #dfe6ec;
  background: #fff;
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  color: #5a6b78;
}
#apr-dev-webhook-toast .dw-badge {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: #e7f6ee;
  color: #1b6e3e;
  font-size: 11.5px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-bottom: 10px;
}
#apr-dev-webhook-toast h3 {
  margin: 0 0 8px;
  font-size: 21px;
  font-weight: 800;
}
#apr-dev-webhook-toast p {
  margin: 0 0 12px;
  font-size: 14px;
  color: #5a6b78;
  line-height: 1.5;
}
#apr-dev-webhook-toast .dw-meta {
  padding: 12px 14px;
  border-radius: 12px;
  background: #f4f8fa;
  border: 1px solid #dfe6ec;
  font-size: 13px;
  line-height: 1.5;
  color: #13374f;
}
