/* static/website/css/contacts.css */

/* 1) Reset */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}

ul,
ol {
  list-style: none;
}

a {
  text-decoration: none;
  color: inherit;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-size: inherit;
  font-weight: inherit;
  margin: 0;
}

/* 2) Base */
body {
  font-family: 'Roboto Condensed', sans-serif;
  margin: 0;
  padding: 0;
  background: #fff;
  color: #303030;
}

/* 3) Layout */
.contacts-container {
  max-width: 1160px; /* desktop baseline */
  width: 100%;
  margin: 0 auto;
  margin-bottom: 16px;
}

.contacts-header {
  margin-bottom: 20px;
}

.breadcrumbs {
  font-size: 14px;
  color: #888;
  margin-bottom: 50px;
  padding-top: 18px;
}

.breadcrumbs a:hover {
  color: #C2181F;
}

.contacts-header h1 {
  font-size: 36px;
  margin: 0 0 20px 0;
}

.city-switcher {
  display: flex;
  align-items: center;
  gap: 16px;
}

.city-switcher button {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #555;
  padding: 4px 8px;
  border-radius: 6px;
  transition: color .2s ease, background-color .2s ease;
}

.city-switcher button:hover {
  color: #C2181F;
  background: #f7f7f7;
}

.city-switcher button:focus-visible {
  outline: 2px solid #C2181F;
  outline-offset: 2px;
}

.city-switcher button.active {
  color: #C2181F;
  font-weight: 500;
  background: #fff0f1;
}

/* 4) Top block: branches + map */
.contacts-content{
  display:flex;
  gap:40px;
  align-items:stretch; /* важно: растягиваем колонки по одной высоте */
}

.branches-block,
.contacts-map{
  height:540px; /* один уровень с картой */
}

.branches-block{
  flex:0 0 340px;
  border:1px solid #eee;
  padding:20px;
  overflow-y:auto;
  overflow-x:hidden;
  -webkit-overflow-scrolling:touch;
}

.branch {
  border-bottom: 1px solid #eee;
  padding: 20px 0;
  display: flex;
  flex-direction: column;
  gap: 8px;

  border-left: 3px solid transparent;
  transition: background-color .2s ease, border-left-color .2s ease;
}

.branch:hover {
  background-color: #fbfbfb;
  cursor: pointer;
  border-left-color: #C2181F;
}

.branch:last-child {
  border-bottom: none;
}

.branch h3 {
  font-size: 18px;
  margin-bottom: 10px;
}

/* небольшой отступ слева у контента карточек (не трогаем border-left) */
.branch > * {
  padding-left: 12px;
}

/* визуально отличим корпоративный отдел чуть мягче */
.branch.branch-corporate h3 {
  color: #111;
}

/* красная ссылка "Подробнее" */
.branch a.corp-more {
  display: inline-block;
  margin-top: 6px;
  color: #C2181F;
  font-weight: 500;
  text-decoration: underline;
  text-underline-offset: 2px;
}

.branch a.corp-more:hover {
  color: #a81218;
}

.contacts-map{
  flex:1 1 auto;
  min-width:0; /* важно для правильного сжатия */
}

.map-container {
  width: 100%;
  height: 100%;
  border: 1px solid #eee;
  border-radius: 8px;
  overflow: hidden;
}

/* Leaflet мелкие правки */
.leaflet-container {
  font-family: inherit;
}
.leaflet-control-attribution,
.leaflet-control-scale {
  font-size: 12px;
}
.leaflet-touch .leaflet-bar a {
  border-radius: 8px;
}
.leaflet-bar a {
  width: 30px;
  height: 30px;
  line-height: 30px;
}
.leaflet-control-attribution {
  display: none;
}

/* 5) Bottom descriptions */
.contacts-description {
  margin-top: 60px;
}

.city-description {
  display: none;
}

.city-description.active {
  display: block;
}

.description-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 40px;
  margin-bottom: 40px;
  max-height: 300px;
}

.description-text {
  flex: 1;
}

.description-image {
  flex: 2;
}

.description-text h2 {
  font-size: 24px;
  margin-bottom: 16px;
}

.description-text p {
  font-size: 16px;
}

.description-image img {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #ddd;
  object-fit: cover;
  max-height: 270px;
}

/* 6) inline icons */
.inline-icon {
  width: 18px;
  height: 18px;
  flex-shrink: 0;
}

/* 7) Small effects */
.whatsapp-link:hover {
  transform: scale(1.05);
  filter: drop-shadow(0 0 1px rgba(37, 211, 102, 0.4));
  transition: all 0.2s ease;
}

/* =========================
   contact-line: иконка слева, текст справа
   (работает и в .branch)
   ========================= */
p.contact-line{
  display: grid;
  grid-template-columns: 18px 1fr;
  column-gap: 8px;
  align-items: start;
}

p.contact-line > .inline-icon{
  grid-column: 1;
  width: 18px;
  height: 18px;
  margin-top: 2px;
}

p.contact-line > :not(.inline-icon){
  grid-column: 2;
}

p.contact-line strong{
  display: inline;
  margin: 0;
  font-weight: 500;
  white-space: nowrap;
}

p.contact-line a{
  display: inline;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* 8) Responsive (baseline) */
@media (max-width: 1279px) {
  .contacts-container {
    max-width: 944px;
  }

  .container {
    max-width: 944px;
    margin: 0 auto;
  }
}

@media (max-width: 1023px) {
  .contacts-container {
    max-width: none;
    width: 94%;
  }

  .contacts-content {
    gap: 24px;
    min-height: 480px;
  }

  .branches-block {
    flex-basis: 32%;
  }

  .branch p {
    font-size: 14px;
  }

  .contacts-map {
    max-width: calc(100% - 32% - 24px);
    height: 420px;
  }

  .container {
    max-width: 96%;
    margin: 0 auto;
  }
}

@media (max-width: 768px) {
  .contacts-header h1 {
    font-size: 28px;
  }
}

@media (max-width: 767px) {
  .contacts-content {
    flex-direction: column;
    min-height: 0;
    gap: 20px;
  }

  .branches-block {
    width: 100%;
    flex-basis: auto;
    max-width: 100%;
  }

  .contacts-map {
    width: 100%;
    max-width: 100%;
    height: auto;
  }

  .map-container {
    height: 320px;
  }

  .description-row {
    flex-direction: column;
    align-items: stretch;
    gap: 16px;
    max-height: none;
  }

  .description-image,
  .description-text {
    flex: none;
    width: 100%;
  }

  .description-image img {
    max-height: none;
    height: auto;
  }

  .description-text h2 {
    font-size: 20px;
    margin-bottom: 8px;
  }

  .description-text p {
    font-size: 16px;
  }

  .container {
    max-width: 96%;
    margin: 0 auto;
  }

  .branches-block,
  .contacts-map{
    height:auto;
  }
}

@media (max-width: 479px) {
  .contacts-container {
    width: 94%;
    padding: 16px;
  }

  .breadcrumbs {
    margin-bottom: 28px;
  }

  .contacts-header h1 {
    font-size: 24px;
  }
}
