/* ============================================================
   Auto4travel - новая шапка и подвал (header-footer.css)
   ============================================================ */

:root {
  --a4t-green: #15945f;
  --a4t-green-dark: #0d6d47;
  --a4t-green-soft: #edf7f1;
  --a4t-ink: #17231d;
  --a4t-muted: #647069;
  --a4t-line: #e3e9e5;
}

/* Компенсация фиксированной шапки из старой темы не нужна */
body {
  padding-top: 0 !important;
}

/* Шапка прилипает к верху при скролле (как старая fixed-шапка) */
html, body {
  overflow-x: clip; /* вместо hidden из betheme responsive.css - иначе ломается sticky */
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 999;
}

body.admin-bar .site-header {
  top: 32px;
}

@media (max-width: 782px) {
  body.admin-bar .site-header {
    top: 46px;
  }
}

.shell {
  width: min(1360px, 100%);
  margin: auto;
  padding: 0 32px;
  box-sizing: border-box;
}

/* ---------- Header ---------- */

.site-header {
  background: #fff;
  border-bottom: 1px solid var(--a4t-line);
  font-family: "Montserrat", Arial, sans-serif;
  color: var(--a4t-ink);
}

.site-header a {
  color: inherit;
  text-decoration: none;
}

.site-header .topbar {
  display: grid;
  grid-template-columns: 300px 1fr auto;
  align-items: center;
  gap: 32px;
  min-height: 112px;
}

.site-header .brand {
  display: flex;
  align-items: center;
}

.site-header .brand img {
  width: 268px;
  height: auto;
}

.site-header .head-contacts {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  gap: 28px;
}

.site-header .address {
  font-size: 13px;
  line-height: 1.55;
  color: var(--a4t-muted);
  max-width: 245px;
}

.site-header .phone small {
  display: block;
  font-size: 11px;
  color: var(--a4t-muted);
  margin-bottom: 3px;
}

.site-header .phone a {
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.4px;
  color: var(--a4t-ink);
}

.site-header .phone a:hover {
  color: var(--a4t-green);
}

/* Выбор города */
.site-header .city {
  position: relative;
  display: flex;
  align-items: center;
}

.site-header .city summary {
  list-style: none;
  display: flex;
  align-items: center;
  gap: 12px;
  height: 46px;
  padding: 0 14px 0 16px;
  border: 1px solid transparent;
  border-radius: 9px;
  background: var(--a4t-green-soft);
  color: var(--a4t-green-dark);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.2s, background 0.2s;
  box-sizing: border-box;
}

.site-header .city summary::-webkit-details-marker {
  display: none;
}

.site-header .city summary::after {
  content: "";
  width: 7px;
  height: 7px;
  margin-top: -4px;
  border-right: 1.5px solid var(--a4t-green-dark);
  border-bottom: 1.5px solid var(--a4t-green-dark);
  transform: rotate(45deg);
  transition: transform 0.2s;
}

.site-header .city[open] summary {
  border-color: #b8d9c7;
  background: #fff;
}

.site-header .city[open] summary::after {
  margin-top: 4px;
  transform: rotate(225deg);
}

.site-header .city-menu {
  position: absolute;
  top: 54px;
  right: 0;
  min-width: 190px;
  padding: 7px;
  background: #fff;
  border: 1px solid var(--a4t-line);
  border-radius: 12px;
  box-shadow: 0 12px 32px rgba(23, 61, 43, 0.09);
  z-index: 100;
  box-sizing: border-box;
}

.site-header .city-option {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  min-height: 42px;
  padding: 0 11px;
  margin-bottom: 4px;
  border-radius: 7px;
  font-size: 12px;
  font-weight: 600;
  color: var(--a4t-green-dark);
  box-sizing: border-box;
}

.site-header .city-option:last-child {
  margin-bottom: 0;
}

.site-header .city-option.is-current {
  background: var(--a4t-green-soft);
}

.site-header .city-option.is-current::after {
  content: "";
  width: 7px;
  height: 12px;
  border-right: 2px solid var(--a4t-green);
  border-bottom: 2px solid var(--a4t-green);
  transform: rotate(45deg);
}

.site-header a.city-option:hover {
  background: var(--a4t-green-soft);
}

/* Кнопка звонка */
.site-header .call-btn {
  display: grid;
  place-items: center;
  text-align: center;
  margin: 0;
  border: 0;
  border-radius: 8px;
  background: var(--a4t-green);
  color: #fff;
  min-height: 46px;
  padding: 0 20px;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  box-sizing: border-box;
}

.site-header .call-btn:hover {
  background: var(--a4t-green-dark);
  color: #fff;
}

.site-header .call-btn:active {
  transform: translateY(1px);
}

/* Строка меню */
.site-header .navrow {
  border-top: 1px solid var(--a4t-line);
}

.site-header .navinner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.site-header .hf-menu {
  display: flex;
  align-items: center;
  gap: 32px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.site-header .hf-menu > li > a {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 64px;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  color: var(--a4t-ink);
}

.site-header .hf-menu > li > a::after {
  content: "";
  position: absolute;
  left: 0;
  right: 100%;
  bottom: -1px;
  height: 2px;
  background: var(--a4t-green);
  transition: right 0.2s;
}

.site-header .hf-menu > li > a:hover::after,
.site-header .hf-menu > li.current-menu-item > a::after,
.site-header .hf-menu > li.current_page_item > a::after {
  right: 0;
}

.site-header .hf-menu > li.current-menu-item > a,
.site-header .hf-menu > li.current_page_item > a {
  color: var(--a4t-green);
  font-weight: 600;
}

/* Выделенный пункт "Идеи для поездок" */
.site-header .hf-menu > li.hf-ideas > a {
  margin-left: 4px;
  padding: 0 16px;
  background: var(--a4t-green-soft);
  border-radius: 7px;
  min-height: 40px;
  color: var(--a4t-green-dark);
}

.site-header .hf-menu > li.hf-ideas > a::after {
  display: none;
}

/* Соцсети в строке меню */
.site-header .actions {
  display: flex;
  gap: 8px;
}

.site-header .actions .icon-link {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  transition: background 0.2s;
}

.site-header .icon-link::before,
.site-footer .icon-link::before {
  content: none;
}

.site-header .actions .icon-link:hover {
  background: var(--a4t-green-soft);
}

.site-header .actions .icon-link img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.site-header .mobile-phone {
  display: none;
}

.site-header .menu-btn {
  display: none;
  margin: 0;
  background: transparent;
  border: 0;
  width: 48px;
  height: 48px;
  cursor: pointer;
}

.site-header .menu-btn svg {
  width: 24px;
  stroke: var(--a4t-ink);
}

/* Мобильная панель */
.site-header .mobile-panel {
  display: none;
}

/* ---------- Footer ---------- */

.site-footer {
  background: #123c2c;
  color: #f5faf7;
  font-family: "Montserrat", Arial, sans-serif;
}

.site-footer a {
  color: inherit;
  text-decoration: none;
}

.site-footer .footer-main {
  display: grid;
  grid-template-columns: 1.35fr 0.8fr 1fr 1.1fr;
  gap: 64px;
  padding-top: 64px;
  padding-bottom: 56px;
}

.site-footer .footer-brand img {
  width: 235px;
  height: auto;
  background: #fff;
  border-radius: 8px;
}

.site-footer .footer-brand p {
  max-width: 310px;
  margin-top: 20px;
  color: #c7d8cf;
  font-size: 13px;
  line-height: 1.7;
}

.site-footer .footer-title {
  margin: 0 0 20px;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.site-footer .footer-links {
  display: grid;
  gap: 12px;
}

.site-footer .footer-links a {
  width: max-content;
  max-width: 100%;
  color: #d6e4dc;
  font-size: 13px;
  line-height: 1.5;
  transition: color 0.2s;
}

.site-footer .footer-links a:hover {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 4px;
}

.site-footer .footer-contact {
  display: grid;
  gap: 14px;
  align-content: start;
}

.site-footer .footer-phone {
  font-size: 21px;
  font-weight: 700;
  letter-spacing: -0.5px;
  color: #fff;
}

.site-footer .footer-contact p {
  margin: 0;
  color: #c7d8cf;
  font-size: 13px;
  line-height: 1.65;
}

.site-footer .footer-call {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: max-content;
  min-height: 44px;
  margin: 0;
  margin-top: 4px;
  padding: 0 18px;
  border: 1px solid #6e9582;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: background 0.2s;
  box-sizing: border-box;
}

.site-footer .footer-call:hover {
  background: #24533f;
}

.site-footer .footer-socials {
  display: flex;
  gap: 6px;
  margin-top: 8px;
}

.site-footer .footer-socials a {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 50%;
  transition: background 0.2s;
}

.site-footer .footer-socials a:hover {
  background: #24533f;
}

.site-footer .footer-socials img {
  width: 24px;
  height: 24px;
  object-fit: contain;
}

.site-footer .footer-bottom {
  border-top: 1px solid #315743;
}

.site-footer .footer-bottom-inner {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 32px;
  padding-top: 24px;
  padding-bottom: 28px;
}

.site-footer .footer-legal {
  max-width: 710px;
  color: #a9c1b4;
  font-size: 11px;
  line-height: 1.7;
}

.site-footer .footer-privacy {
  color: #d6e4dc;
  font-size: 11px;
  text-decoration: underline;
  text-underline-offset: 4px;
}

/* ---------- Планшет ---------- */

@media (max-width: 1100px) {
  .site-footer .footer-main {
    grid-template-columns: 1.2fr 1fr 1fr;
    gap: 40px;
  }

  .site-footer .footer-brand {
    grid-column: 1 / -1;
  }

  .site-footer .footer-brand p {
    max-width: 520px;
  }

  .site-header .topbar {
    grid-template-columns: 240px 1fr;
  }

  .site-header .brand img {
    width: 225px;
  }

  .site-header .address {
    display: none;
  }

  .site-header .head-contacts {
    gap: 20px;
  }

  .site-header .hf-menu {
    gap: 20px;
  }

  .site-header .hf-menu > li > a {
    font-size: 12px;
  }

  .site-header .actions {
    display: none;
  }
}

/* ---------- Мобильные ---------- */

@media (max-width: 767px) {
  .shell {
    padding: 0 18px;
  }

  .site-footer .footer-main {
    grid-template-columns: 1fr 1fr;
    gap: 36px 24px;
    padding-top: 44px;
    padding-bottom: 40px;
  }

  .site-footer .footer-brand {
    grid-column: 1 / -1;
  }

  .site-footer .footer-contact {
    grid-column: 1 / -1;
  }

  .site-footer .footer-title {
    margin-bottom: 16px;
  }

  .site-footer .footer-links {
    gap: 10px;
  }

  .site-footer .footer-links a {
    font-size: 12px;
  }

  .site-footer .footer-phone {
    font-size: 20px;
  }

  .site-footer .footer-bottom-inner {
    display: grid;
    gap: 14px;
    padding-top: 20px;
  }

  .site-header .topbar {
    grid-template-columns: 1fr auto auto;
    min-height: 78px;
    gap: 4px;
  }

  .site-header .brand img {
    width: 155px;
  }

  .site-header .mobile-phone {
    display: block;
    font-size: 11px;
    font-weight: 700;
    white-space: nowrap;
  }

  .site-header .head-contacts {
    display: none;
  }

  .site-header .menu-btn {
    display: grid;
    place-items: center;
    width: 44px;
  }

  .site-header .navrow {
    display: none;
  }

  .site-header .mobile-panel {
    position: absolute;
    left: 0;
    right: 0;
    top: 78px;
    background: #fff;
    border-top: 1px solid var(--a4t-line);
    padding: 12px 18px 20px;
    box-shadow: 0 18px 30px rgba(23, 35, 29, 0.07);
    z-index: 90;
    box-sizing: border-box;
  }

  .site-header .mobile-panel.open {
    display: block;
  }

  .site-header .mobile-panel .hf-menu {
    display: block;
  }

  .site-header .mobile-panel .hf-menu > li > a {
    display: flex;
    align-items: center;
    min-height: 48px;
    border-bottom: 1px solid var(--a4t-line);
    font-size: 14px;
    font-weight: 500;
    color: var(--a4t-ink);
  }

  .site-header .mobile-panel .hf-menu > li > a::after {
    display: none;
  }

  .site-header .mobile-panel .hf-menu > li.hf-ideas > a {
    margin-left: 0;
    padding: 0;
    background: transparent;
    border-radius: 0;
    min-height: 48px;
    color: var(--a4t-green);
    font-weight: 600;
  }

  .site-header .mobile-city {
    display: block;
    border-bottom: 1px solid var(--a4t-line);
  }

  .site-header .mobile-city summary {
    height: 48px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: var(--a4t-green-dark);
    font-size: 14px;
    justify-content: space-between;
  }

  .site-header .mobile-city[open] summary {
    border: 0;
    background: transparent;
  }

  .site-header .mobile-city .city-menu {
    position: static;
    min-width: 0;
    margin: 0 0 10px;
    padding: 6px;
    box-shadow: none;
  }

  .site-header .mobile-city .city-option {
    min-height: 44px;
  }

  .site-header .mobile-contact {
    padding-top: 16px;
    display: grid;
    grid-template-columns: 1fr auto;
    gap: 12px;
    align-items: center;
  }

  .site-header .mobile-contact > a:first-child {
    font-size: 17px;
    font-weight: 700;
  }

  .site-header .mobile-contact .call-btn {
    min-height: 44px;
    padding: 0 16px;
  }

  .site-header .mobile-socials {
    display: flex;
    justify-content: center;
    gap: 14px;
    padding-top: 18px;
  }

  .site-header .mobile-socials .icon-link {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border: 0;
  }

  .site-header .mobile-socials .icon-link img {
    width: 30px;
    height: 30px;
    object-fit: contain;
  }
}

@media (prefers-reduced-motion: reduce) {
  .site-header *,
  .site-footer * {
    transition: none !important;
  }
}
