/* Внутренние страницы нового дизайна (layouts/main.php): текст слева, справа меню раздела и баннеры. */
.page {
  display: flex;
  gap: 40px;
  padding: 30px 40px 50px;
  background: #fff;
}

.page__content {
  flex: 1;
  min-width: 0;
}

.page__sidebar {
  flex: 0 0 240px;
}

/* Содержимое страниц писалось под ширину ~700px: картинки, видео и таблицы не шире колонки. */
.page__content img,
.page__content video {
  max-width: 100%;
  height: auto;
}

.page__content iframe,
.page__content embed,
.page__content object {
  max-width: 100%;
}

.page__content table {
  max-width: 100%;
}

/* Страницы объектов свёрстаны в .container из newstyle.css, его ширина (750–1170px)
   рассчитана на окно, а не на колонку текста. */
.page__content .container {
  width: auto;
  max-width: 100%;
}

.page__content .breadcrumbs {
  margin-bottom: 10px;
  font-size: 12px;
}

/* «Клиенты» (site/clients.php): логотипы разных пропорций в сетке одинаковых ячеек.
   В main.css это float-блоки 160×90 с картинкой высотой 66px, которая вылезала из ячейки. */
.page__content .client-type {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 16px;
  margin: 30px 0 40px;
}

.page__content .client-type h2 {
  grid-column: 1 / -1;
  margin: 0 0 4px !important;
}

.page__content .client-type .clear {
  display: none;
}

.page__content .cont-logo {
  float: none;
  width: auto;
  height: 100px;
  margin: 0;
  padding: 12px;
  box-sizing: border-box;
  border: 1px solid #eee;
  border-radius: 4px;
}

.page__content .cont-logo a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  height: 100%;
}

.page__content .logo-client {
  width: auto;
  height: auto;
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
}

/* Услуги (protected/views/service). Список — карточками. */
.service-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 16px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.service-list__item {
  margin: 0;
}

.service-list__link {
  display: flex;
  align-items: center;
  height: 100%;
  min-height: 72px;
  padding: 16px 20px;
  box-sizing: border-box;
  font-family: var(--rrg-font);
  font-size: 16px;
  font-weight: 500;
  line-height: 1.35;
  color: var(--rrg-text);
  text-decoration: none;
  border: 1px solid var(--rrg-border);
  border-left: 3px solid var(--rrg-accent);
  border-radius: 4px;
  transition: color .2s, box-shadow .2s;
}

.service-list__link:hover {
  color: var(--rrg-accent);
  box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}

/* Лендинг подключает /css/new.css, написанный для отдельной страницы: там
   body { max-width: none } — страница растягивалась на всё окно.
   Вернуть body значения из main.css; html body сильнее, чем body. */
html body {
  width: auto;
  min-width: 0;
}

@media screen and (max-width: 2000px) {
  html body { max-width: 1400px; }
}

.service-page #navbar {
  display: flex;
  flex-wrap: wrap;
  gap: .5rem 1rem;
  width: auto;
  height: auto;
  margin-block: 0 var(--rrg-text-gap);
}

.service-page #navbar li {
  top: auto;
  height: auto;
  padding: 0;
}

.service-page #navbar a { white-space: normal; }

/* Лендинги услуг (include/infrastructure.php, include/smart.php) строят свою сетку .row,
   а main.css даёт всем .row отступы -15px от Bootstrap — колонка вылезала за край. */
.service-page .row {
  margin-left: 0;
  margin-right: 0;
}

/* main.css даёт .container белый фон — на обложке SMART брокериджа он закрывал белый заголовок. */
.service-page .smart-brokerage .cover .container {
  background: none;
}

.service-page .smart-brokerage .cover .title {
  line-height: 1.2;
}

/* Подписи к иконкам SMART брокериджа (.icon-name) main.css принимает за значки Bootstrap
   ([class^="icon-"]: 14×14px со спрайтом), а на узких экранах растягивает картинки на всю ширину. */
.service-page .smart-brokerage .icon-name {
  display: block;
  width: auto;
  height: auto;
  margin: 0;
  line-height: 1.4;
  vertical-align: baseline;
  background: none;
}

.service-page .smart-brokerage .inner-col img {
  width: 80px !important;
}

.service-page .form__input {
  box-sizing: border-box;
  max-width: 100%;
}

/* Колонки 1fr не уже самих полей ввода (~230px), а в колонке текста места меньше. */
.service-page .form__line--1 {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* Предложения: объекты плиткой (themes/new/views/object/default/list.php, _viewList.php). */
.object-tiles {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 24px;
  margin: 24px 0 30px;
}

.object-tile {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  font-family: var(--rrg-font);
  color: var(--rrg-text);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--rrg-border);
  border-radius: 6px;
  transition: box-shadow .2s, border-color .2s;
}

.object-tile:hover {
  border-color: transparent;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.object-tile__image {
  display: block;
  aspect-ratio: 4 / 3;
  background: #f2f2f2;
  overflow: hidden;
}

.page__content .object-tile__image img {
  display: block;
  width: 100%;
  height: 100%;
  max-width: none;
  object-fit: cover;
  transition: transform .3s;
}

.object-tile:hover .object-tile__image img {
  transform: scale(1.04);
}

.object-tile__body {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px 18px;
}

.object-tile__title {
  font-size: var(--rrg-h3-size);
  font-weight: 700;
  line-height: 1.3;
  transition: color .2s;
}

.object-tile:hover .object-tile__title {
  color: var(--rrg-accent);
}

.object-tile__place {
  font-size: var(--rrg-small-size);
  color: var(--rrg-text-muted);
}

/* Анонс — список характеристик по строке, как в старом списке выводится целиком. */
.object-tile__notice {
  font-size: var(--rrg-content-font-size);
  line-height: var(--rrg-content-line-height);
}

/* Форма обратной связи (protected/views/contact/_feedback.php). */
.feedback-form {
  max-width: 520px;
  margin: 20px 0 30px;
  font-family: var(--rrg-font);
}

.feedback-form__trap {
  position: absolute;
  left: -10000px;
}

.feedback-form__row {
  margin-bottom: 14px;
}

.feedback-form__row label {
  display: block;
  margin-bottom: 4px;
  font-size: 14px;
  font-weight: 700;
  color: var(--rrg-text);
}

.feedback-form__row input,
.feedback-form__row textarea {
  width: 100%;
  padding: 10px 12px;
  box-sizing: border-box;
  font-family: var(--rrg-font);
  font-size: 15px;
  border: 1px solid #ccc;
  border-radius: 4px;
}

.feedback-form__row input:focus,
.feedback-form__row textarea:focus {
  border-color: var(--rrg-accent);
  outline: none;
}

.feedback-form__row .error {
  border-color: #c00;
}

.feedback-form__errors {
  margin-bottom: 14px;
  font-size: 14px;
  color: #c00;
}

.feedback-form__errors ul {
  margin: 0;
  padding-left: 18px;
}

.feedback-form__submit {
  padding: 12px 32px;
  font-family: var(--rrg-font);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--rrg-accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

.feedback-form__submit:hover {
  background: #c94a10;
}

.feedback-form__sent {
  margin: 20px 0 30px;
  padding: 16px 20px;
  font-size: 15px;
  color: #1e6b2e;
  background: #eaf6ec;
  border-radius: 4px;
}

/* Меню раздела: подпункты текущего пункта главного меню. */
.section-nav-wrap {
  margin-bottom: 30px;
}

.section-nav {
  font-family: var(--rrg-font);
}

/* Когда баннеры прокрутились и под ними пусто, меню закрепляется (site.js); left и width задаёт скрипт. */
.section-nav--pinned {
  position: fixed;
  z-index: 100;
  box-sizing: border-box;
  background: #fff;
  animation: section-nav-drop .35s ease-out;
}

/* Меню «опускается» сверху при закреплении. */
@keyframes section-nav-drop {
  from { transform: translateY(-100%); opacity: 0; }
  to { transform: translateY(0); opacity: 1; }
}

@media (prefers-reduced-motion: reduce) {
  .section-nav--pinned { animation: none; }
}

.section-nav__title {
  margin: 0 0 10px;
  font-family: var(--rrg-font);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .04em;
  color: var(--rrg-text-muted);
}

.section-nav ul {
  margin: 0;
  padding: 0;
  list-style: none;
  border-left: 1px solid var(--rrg-border);
}

.section-nav li {
  margin: 0;
}

.section-nav a {
  display: block;
  margin-left: -1px;
  padding: 6px 0 6px 14px;
  font-size: 14px;
  line-height: 1.35;
  color: var(--rrg-text);
  text-decoration: none;
  border-left: 2px solid transparent;
}

.section-nav a:hover {
  color: var(--rrg-accent);
}

.section-nav .active > a {
  color: var(--rrg-accent);
  border-left-color: var(--rrg-accent);
}

.page__banners {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.banner {
  text-align: center;
}

.banner img {
  display: block;
  width: 150px;
  height: auto;
  aspect-ratio: 1;
  object-fit: cover;
  margin: 0 auto;
}

.banner__title {
  margin: 0 0 10px;
  font-size: 11px;
}

/* Планшеты и телефоны: колонка справа уходит под текст, баннеры выстраиваются в ряд. */
@media (max-width: 1023px) {
  .page { flex-direction: column; gap: 30px; padding: 24px 24px 40px; }
  .page__sidebar { flex: none; padding-top: 24px; border-top: 1px solid #ccc; }
  .page__banners { flex-direction: row; flex-wrap: wrap; justify-content: center; align-items: flex-start; gap: 24px 40px; }
}

@media (max-width: 767px) {
  .page { padding: 20px 16px 32px; }

  /* Широкие таблицы прокручиваются вбок, а не растягивают страницу. */
  .page__content table { display: block; overflow-x: auto; }

  .banner img { width: 130px; }

  /* Лендинг SMART брокериджа (css/smart_brokerage.css) свёрстан под широкий экран:
     у списков отступы 70px + 86px, на телефоне текст сжимался в узкую полоску.
     smart_brokerage.css подключается позже, поэтому селекторы с .service-page. */
  .service-page .smart-brokerage .rrg-present { padding: 24px 16px; }
  .service-page .smart-brokerage .icons-ok,
  .service-page .smart-brokerage .icons-ok-2 { margin: 24px 0; padding: 0; }
  .service-page .smart-brokerage .icons-ok li,
  .service-page .smart-brokerage .icons-ok-2 li { padding: 2px 0 2px 52px; margin-bottom: 24px; }
  .service-page .smart-brokerage ul.icons-ok li::after,
  .service-page .smart-brokerage ul.icons-ok-2 li::after { left: 0; }
  .service-page .smart-brokerage .cover .title { padding: 0 16px; font-size: 28px; line-height: 1.2; }
  .service-page .smart-brokerage .cover .title span { font-size: 20px; }
  .service-page .smart-brokerage .col-4 { flex-basis: 50%; max-width: 50%; padding: 0 8px; }
  .service-page .smart-brokerage .col-6 { max-width: 100%; }

  .page__content .client-type { grid-template-columns: repeat(2, 1fr); gap: 12px; }
  .page__content .cont-logo { height: 84px; padding: 10px; }
}
