/* Общие стили нового дизайна: шапка, картинка под меню, подвал, окно заявки. */
:root {
  --rrg-accent: #E85A1B;
  --rrg-text: #333333;
  --rrg-text-muted: #666666;
  --rrg-border: #e0e0e0;
  --rrg-font: 'Manrope', 'Verdana', sans-serif;
}

/* main.css задаёт всем <header> высоту 200px, фоновую картинку и ширину от 1005px. */
header.site-header {
  position: relative;
  z-index: 300;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 32px;
  height: auto;
  min-height: 80px;
  padding: 12px 40px;
  background: #fff;
  border-bottom: 1px solid var(--rrg-border);
  font-family: var(--rrg-font);
  box-sizing: border-box;
}

.site-header__logo {
  flex-shrink: 0;
  display: block;
}

.site-header__logo img {
  display: block;
  height: 48px;
  width: auto;
}

/* Меню и кнопка заявки для мобильной версии; на десктопе кнопка спрятана. */
.site-header__menu {
  flex: 1;
  display: flex;
  min-width: 0;
}

.site-header__cta--menu {
  display: none;
}

.site-nav {
  display: flex;
  flex: 1;
  justify-content: center;
  gap: 28px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav li {
  margin: 0;
  padding: 0;
}

.site-nav a {
  font-family: var(--rrg-font);
  font-size: 15px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--rrg-text);
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s;
}

.site-nav a:hover,
.site-nav .active > a {
  color: var(--rrg-accent);
}

/* Выпадающие подпункты: раскрываются при наведении и при переходе по Tab. */
.site-nav > li {
  position: relative;
  padding: 10px 0;
}

.site-nav ul {
  display: none;
  position: absolute;
  top: 100%;
  left: -20px;
  z-index: 200;
  width: max-content;
  min-width: 220px;
  max-width: 340px;
  margin: 0;
  padding: 10px 0;
  list-style: none;
  background: #fff;
  border-top: 2px solid var(--rrg-accent);
  box-shadow: 0 8px 24px rgba(0, 0, 0, .12);
}

.site-nav > li:hover > ul,
.site-nav > li:focus-within > ul {
  display: block;
}

/* У последних пунктов список прижат к правому краю, чтобы не уходил за экран. */
.site-nav > li:nth-last-child(-n+2) > ul {
  left: auto;
  right: -20px;
}

.site-nav ul a {
  display: block;
  padding: 7px 20px;
  font-size: 14px;
  white-space: normal;
}

.site-nav ul a:hover {
  background: #f6f6f6;
}

.has-sub > a::after {
  content: '';
  display: inline-block;
  width: 5px;
  height: 5px;
  margin: 0 0 3px 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg);
}

/* Кнопка раскрытия подпунктов в мобильном меню (добавляется скриптом). */
.site-nav__toggle {
  display: none;
}

.site-header__contacts {
  flex-shrink: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  text-align: right;
}

.site-header__phone {
  font-family: var(--rrg-font);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--rrg-accent);
  text-decoration: none;
  white-space: nowrap;
}

/* Ссылка, открывающая окно с формой заявки (site/_zayavka.php). */
.site-header__cta {
  font-family: var(--rrg-font);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: var(--rrg-text);
  text-decoration: none;
  border-bottom: 1px dashed currentColor;
  white-space: nowrap;
  transition: color .2s;
}

.site-header__cta:hover {
  color: var(--rrg-accent);
}

/* Изображение под меню на всю ширину страницы. */
.site-hero img {
  display: block;
  width: 100%;
  /* Вдвое ниже исходных пропорций картинки (1832×858). */
  aspect-ratio: 1832 / 429;
  height: auto;
  min-height: 140px;
  max-height: 35vh;
  object-fit: cover;
}

/* Кнопка мобильного меню, видна только на узких экранах. */
.site-header__burger {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 8px;
  background: none;
  border: none;
  cursor: pointer;
}

.site-header__burger span {
  display: block;
  height: 2px;
  background: var(--rrg-text);
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}

.site-header--open .site-header__burger span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-header--open .site-header__burger span:nth-child(2) { opacity: 0; }
.site-header--open .site-header__burger span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* На широких экранах меню остаётся в одну строку. */
@media (max-width: 1280px) {
  header.site-header { gap: 24px; padding: 12px 24px; }
  .site-nav { gap: 18px; }
  .site-nav a { font-size: 14px; }
}

@media (max-width: 1150px) {
  header.site-header { gap: 16px; padding: 10px 16px; }
  .site-header__logo img { height: 40px; }
  .site-nav { gap: 13px; }
  .site-nav a { font-size: 13px; }
  .site-header__phone { font-size: 16px; }
}

/* Планшеты и телефоны: меню прячется под кнопку и раскрывается списком. */
@media (max-width: 1023px) {
  header.site-header { gap: 12px; padding: 10px 16px; min-height: 0; }
  .site-header__logo img { height: 36px; }
  .site-header__contacts { margin-left: auto; }
  .site-header__burger { display: flex; }
  .site-header__contacts .site-header__cta { display: none; }

  /* Меню открывается поверх страницы, а не сдвигает её вниз. */
  .site-header__menu {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    padding: 0 16px 24px;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    border-top: 1px solid var(--rrg-border);
    box-shadow: 0 12px 24px rgba(0, 0, 0, .15);
  }
  .site-header--open .site-header__menu { display: flex; }
  .site-nav { flex: none; flex-direction: column; gap: 0; }

  .site-header__cta--menu {
    display: block;
    margin-top: 20px;
    padding: 14px;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    color: #fff;
    background: var(--rrg-accent);
    border: none;
    border-radius: 4px;
  }
  .site-header__cta--menu:hover { color: #fff; background: #c94a10; }
  .site-nav > li { padding: 0; border-bottom: 1px solid var(--rrg-border); }
  .site-nav a {
    display: block;
    padding: 12px 0;
    font-size: 16px;
  }
  .has-sub > a { margin-right: 48px; }
  .has-sub > a::after { display: none; }

  .site-nav__toggle {
    display: block;
    position: absolute;
    top: 0;
    right: 0;
    width: 48px;
    height: 46px;
    background: none;
    border: none;
    cursor: pointer;
  }
  .site-nav__toggle::before {
    content: '';
    display: block;
    width: 8px;
    height: 8px;
    margin: -4px auto 0;
    border-right: 2px solid var(--rrg-text);
    border-bottom: 2px solid var(--rrg-text);
    transform: rotate(45deg);
    transition: transform .2s;
  }
  .site-nav .open > .site-nav__toggle::before { margin-top: 4px; transform: rotate(-135deg); }

  /* В мобильном меню подпункты раскрываются только кнопкой, не наведением. */
  .site-nav > li:hover > ul,
  .site-nav > li:focus-within > ul { display: none; }
  .site-nav > li.open > ul { display: block; }
  .site-nav ul,
  .site-nav > li:nth-last-child(-n+2) > ul {
    position: static;
    width: auto;
    min-width: 0;
    max-width: none;
    padding: 0 0 10px 16px;
    border-top: none;
    box-shadow: none;
  }
  .site-nav ul a { padding: 8px 0; font-size: 15px; }
  .site-nav ul a:hover { background: none; }
}

@media (max-width: 400px) {
  .site-header__phone { font-size: 14px; }
}

/* Окно «Отправить заявку» (site/_zayavka.php); main.css задаёт ему ширину 400px. */
#zayavka {
  width: 420px;
  max-width: calc(100vw - 40px);
  padding: 28px;
  box-sizing: border-box;
  font-family: var(--rrg-font);
}

#zayavka h2 {
  margin: 0 0 20px;
  font-family: var(--rrg-font);
  font-size: 22px;
  font-weight: 700;
  color: var(--rrg-text);
}

#zayavka .form-group {
  margin-bottom: 12px;
}

#zayavka .form-group input,
#zayavka .form-group 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;
}

#zayavka .form-group input:focus,
#zayavka .form-group textarea:focus {
  border-color: var(--rrg-accent);
  outline: none;
}

#zayavka .errorMessage {
  margin-top: 4px;
  font-size: 12px;
  color: #c00;
}

#zayavka .zayavka_submit {
  width: 100%;
  padding: 14px;
  font-family: var(--rrg-font);
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  background: var(--rrg-accent);
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#zayavka .zayavka_submit:hover {
  background: #c94a10;
}

#zayavka .zayavka_submit[disabled] {
  opacity: .6;
}

/* Подвал (layouts/_footer.php): графитовый фон из логотипа, оранжевые акценты.
   main.css задаёт всем <footer> оранжевый фон, центровку и ширину от 1005px. */
footer.site-footer {
  --footer-bg: #312c4f;
  --footer-text: rgba(255, 255, 255, .75);
  --footer-muted: rgba(255, 255, 255, .5);
  min-width: 0;
  height: auto;
  padding: 56px 40px 24px;
  text-align: left;
  font-family: var(--rrg-font);
  font-size: 14px;
  line-height: 1.5;
  color: var(--footer-text);
  background: var(--footer-bg);
  border-top: 4px solid var(--rrg-accent);
}

.site-footer a {
  color: var(--footer-text);
  text-decoration: none;
  transition: color .2s;
}

.site-footer a:hover {
  color: var(--rrg-accent);
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer__main {
  display: grid;
  grid-template-columns: minmax(200px, 1.1fr) 3fr minmax(200px, 1fr);
  gap: 48px;
}

.site-footer__logo img {
  display: block;
  height: 52px;
  width: auto;
}

.site-footer__text {
  margin: 16px 0 20px;
  color: var(--footer-muted);
}

.site-footer__social {
  display: flex;
  gap: 10px;
}

.site-footer__social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  font-size: 17px;
  color: #fff;
  background: rgba(255, 255, 255, .1);
  border-radius: 50%;
  transition: background .2s;
}

.site-footer__social a:hover {
  color: #fff;
  background: var(--rrg-accent);
}

/* newstyle.css (внутренние страницы) переводит .fa на Font Awesome 5, где нет значков Telegram и YouTube. */
.site-footer .fa {
  font-family: FontAwesome;
  font-weight: normal;
}

.site-footer__links {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
}

.site-footer__title {
  margin: 0 0 14px;
  font-family: var(--rrg-font);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #fff;
}

.site-footer__col li {
  margin: 0 0 8px;
}

.site-footer__phone {
  display: block;
  font-size: 20px;
  font-weight: 700;
  color: #fff !important;
}

.site-footer__phone:hover {
  color: var(--rrg-accent) !important;
}

.site-footer__email {
  display: inline-block;
  margin-top: 4px;
}

.site-footer__address {
  margin: 12px 0 18px;
  color: var(--footer-muted);
}

.site-footer__cta {
  display: inline-block;
  padding: 10px 20px;
  font-weight: 700;
  color: #fff !important;
  background: var(--rrg-accent);
  border-radius: 4px;
  transition: background .2s;
}

.site-footer__cta:hover {
  background: #c94a10;
}

.site-footer__bottom {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
  margin-top: 48px;
  padding-top: 20px;
  font-size: 13px;
  color: var(--footer-muted);
  border-top: 1px solid rgba(255, 255, 255, .12);
}

.site-footer__bottom a {
  color: var(--footer-muted);
}

@media (max-width: 1100px) {
  .site-footer__main { grid-template-columns: 1fr 1fr; }
  .site-footer__links { grid-column: 1 / -1; grid-row: 2; }
}

@media (max-width: 767px) {
  footer.site-footer { padding: 40px 16px 20px; }
  .site-footer__main { grid-template-columns: 1fr; gap: 32px; }
  .site-footer__links { grid-row: auto; grid-template-columns: 1fr 1fr; gap: 24px 16px; }
  .site-footer__links .site-footer__col:last-child { grid-column: 1 / -1; }
  .site-footer__bottom { flex-direction: column; margin-top: 32px; }
}

.site-hero {
  position: relative;
  overflow: hidden;
  min-width: 0;
}
@media (min-width: 1024px) {
  .site-hero img {
    height: 400px;
    max-height: none;
  }
}
.site-hero [hidden] {
  display: none;
}
.site-hero__controls {
  z-index: 2;
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: flex;
  gap: 4px;
}
.site-hero__controls button {
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, .72);
  color: white;
  font: 24px/1 sans-serif;
  cursor: pointer;
}
