:root {
--max-width: 1000px;
--gap: 1.5rem;
--slider-height: 350px;
--apple-blue: #007AFF;
--apple-blue-dark: #0051d5;
--hover-fill: rgba(0, 122, 255, 0.1);
--gradient-primary: linear-gradient(135deg, var(--apple-blue) 0%, var(--apple-blue-dark) 100%);
}

/* Стили для кнопок в шапке */
nav .header-button,
.mobile-menu .header-button {
  padding: 0.6rem 1.2rem !important;
  background: var(--gradient-primary) !important;
  color: white !important;
  border: none !important;
  border-radius: 0.8rem !important;
  font-weight: 600 !important;
  font-size: 0.9rem !important;
  text-decoration: none !important;
  transition: all 0.3s ease !important;
  display: inline-flex !important;
  align-items: center !important;
  gap: 0.5rem !important;
  position: relative !important;
  z-index: 1 !important;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3) !important;
  overflow: hidden !important;
  vertical-align: middle !important;
}

nav .header-button::before,
.mobile-menu .header-button::before {
  content: '';
  position: absolute;
  top: 0;
  left: -100%;
  width: 100%;
  height: 100%;
  background: linear-gradient(90deg, transparent, rgba(255,255,255,0.2), transparent);
  transition: left 0.5s;
}

nav .header-button:hover::before,
.mobile-menu .header-button:hover::before {
  left: 100%;
}

nav .header-button:hover,
.mobile-menu .header-button:hover {
  transform: translateY(-2px) !important;
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4) !important;
}

nav .header-button:active,
.mobile-menu .header-button:active {
  transform: translateY(0) !important;
}

nav .telegram-bot,
.mobile-menu .telegram-bot {
  background: var(--gradient-primary) !important;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3) !important;
}

nav .telegram-bot:hover,
.mobile-menu .telegram-bot:hover {
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4) !important;
}

/* ВРЕМЕННО: Скрыть кнопку telegram-bot */
nav .telegram-bot,
.mobile-menu .telegram-bot {
  display: none !important;
}

nav .telegram-channel,
.mobile-menu .telegram-channel {
  background: var(--gradient-primary) !important;
  box-shadow: 0 4px 16px rgba(0, 122, 255, 0.3) !important;
}

nav .telegram-channel:hover,
.mobile-menu .telegram-channel:hover {
  box-shadow: 0 8px 24px rgba(0, 122, 255, 0.4) !important;
}
body {
margin: 0;
font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
background-color: #F8F8F8;
color: #1C1C1E;
}
header {
background: rgba(255,255,255,0.7);
backdrop-filter: blur(10px);
display: flex;
justify-content: space-between;
align-items: center;
padding: 0.3rem 2rem;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
position: sticky;
top: 0;
z-index: 10;
}
.logo { 
  font-weight: 600; 
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.logo-icon {
  height: 60px;
  width: auto;
  transition: transform 0.2s ease;
}

.logo:hover .logo-icon {
  transform: scale(1.05);
}

.logo-text {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.logo-main {
  font-size: 1.2rem;
  font-weight: 500;
  color: #1C1C1E;
  margin: 0;
}

.logo-sub {
  font-size: 0.9rem;
  color: rgb(142, 142, 147);
  font-weight: 300;
  margin: 0;
}
nav { 
  display: flex; 
  gap: 1.5rem; 
  align-items: center;
}
nav a { color: var(--apple-blue); text-decoration: none; font-weight: 500; }
.burger { display: none; flex-direction: column; gap: 4px; cursor: pointer; }
.burger div { width: 22px; height: 2px; background: #1C1C1E; }
.mobile-menu {
display: none;
position: fixed;
top: 0; right: 0;
width: 200px; height: 100vh;
background: white;
box-shadow: -2px 0 10px rgba(0,0,0,0.1);
padding: 2rem 1rem;
z-index: 999;
flex-direction: column; gap: 1rem;
}
.mobile-menu .close {
align-self: flex-end;
width: 22px; height: 22px;
display: flex; align-items: center; justify-content: center;
cursor: pointer;
position: relative;
}
.mobile-menu .close::before,
.mobile-menu .close::after {
content: '';
position: absolute;
width: 18px; height: 2px;
background: #1C1C1E;
}
.mobile-menu .close::before { transform: rotate(45deg); }
.mobile-menu .close::after { transform: rotate(-45deg); }
.mobile-menu a { color: var(--apple-blue); text-decoration: none; font-weight: 500; }
.container { max-width: var(--max-width); margin: 0 auto; padding: var(--gap); display: flex; flex-direction: column; gap: var(--gap); }
.desktop-grid { display: flex; flex-direction: column; gap: var(--gap); }
@media (min-width: 1024px) {
.desktop-grid { display: grid; grid-template-columns: 3fr 2fr; gap: var(--gap); }
nav { display: flex; }
.burger { display: none; }
}

.left, .right { display: flex; flex-direction: column; gap: var(--gap); }
.card-header, .metric, .section, .map {
background: rgba(255,255,255,0.6); backdrop-filter: blur(12px);
border-radius: 1rem; box-shadow: 0 4px 16px rgba(0,0,0,0.04);
padding: 1.2rem;
}
.card-header h1 { font-size: 1.6rem; margin: 0 0 0.25rem; }
.card-header .id { font-size: 0.9rem; color: #8E8E93; margin-bottom: 1.5rem; }
.card-header .price-label { font-size: 0.9rem; color: #8E8E93; }
.card-header .price-value { font-size: 1.6rem; font-weight: bold; margin-top: 0.25rem; }
.cian-button {
margin-top: 1rem; padding: 0.5rem 1rem;
background-color: transparent; color: var(--apple-blue);
border: 2px solid var(--apple-blue); border-radius: 0.6rem;
font-weight: 600; font-size: 0.9rem;
cursor: pointer; text-decoration: none;
transition: background-color 0.2s ease, color 0.2s ease;
display: inline-block;
}
.cian-button:hover { background-color: var(--apple-blue); color: white; }
.metrics { display: grid; grid-template-columns: repeat(2,1fr); gap: 1rem; }
@media (min-width:768px) { .metrics { grid-template-columns: repeat(2,1fr); } }
.metric strong { display: block; font-weight: bold; font-size: 0.95rem; }
.metric span { font-size: 1.4rem; color: var(--apple-blue); display: block; margin-top: 0.3rem; }
.metric:hover { background-color: var(--hover-fill); }
.slider {
position: relative; height: var(--slider-height);
overflow: hidden; border-radius: 1rem;
}
.slider img {
width: 100%; height: var(--slider-height);
object-fit: cover; cursor: pointer;
display: block; transition: transform 0.3s ease;
}
.slider img:hover { transform: scale(1.01); }
.slider button {
position: absolute; top: 50%; transform: translateY(-50%);
background: #fff; border: none;
border-radius: 50%; padding: 0.3rem 0.6rem;
color: var(--apple-blue);
box-shadow: 0 2px 6px rgba(0,0,0,0.1); cursor: pointer;
}
.slider .prev { left: 1rem; } .slider .next { right: 1rem; }
.slider button svg { width: 20px; height: 20px; fill: var(--apple-blue); }
.map { height: var(--slider-height); display:flex; align-items:center; justify-content:center; font-size:1.1rem; }
.section h2 { font-size:1.2rem; margin-bottom:0.5rem; }
.section ul { list-style:none; padding:0; margin:0; }
.section li { padding:0.4rem 0; display:flex; justify-content:space-between; border-bottom:1px solid #eee; font-size:0.9rem; }
.modal {
display:none; position:fixed; top:0; left:0; width:100vw; height:100vh;
background:rgba(0,0,0,0.8); backdrop-filter: blur(4px);
justify-content:center; align-items:center; z-index:9999;
}
.modal .close {
position:absolute; top:1rem; right:1rem;
width:24px; height:24px;
display:flex; align-items:center; justify-content:center;
cursor:pointer;
}
.modal .close::before,
.modal .close::after {
content: '';
position: absolute;
width: 18px; height: 2px;
background: #1C1C1E;
}
.modal .close::before { transform: rotate(45deg); }
.modal .close::after { transform: rotate(-45deg); }
.modal img {
max-width:90%; max-height:90vh;
border-radius:1rem; cursor: pointer;
}
.modal button {
position:absolute; top:50%; transform:translateY(-50%);
background: #fff; border:none; border-radius:50%; padding: 0.3rem 0.6rem;
color: var(--apple-blue);
box-shadow:0 2px 6px rgba(0,0,0,0.1); cursor:pointer;
}
.modal .prev { left:1rem; } .modal .next { right:1rem; }
.modal button svg { width:20px; height:20px; fill: var(--apple-blue); }

/*Стили для блока Похожие квартиры*/
@media (min-width:1024px) {
.desktop-grid .section.full-width {
grid-column: 1 / -1;
font-size: 0.8rem;
}
}

/* Thumbnail styles as table cells */
.similar-block li img {
display: block;        /* чтобы img вел себя как прямоугольник, а не ячейка */
width: 30px;
height: 30px;
object-fit: cover;
border-radius: 0.25rem; /* скругление углов */
overflow: hidden;       /* на случай, если img окажется больше контейнера */
margin: 0.5rem;         /* отступ, чтобы не прилипать к краям */
font-size: 0.8rem;
}

/* Table layout */
.similar-block ul {
display: table;
width: 100%;
table-layout: fixed;
border-collapse: collapse;
margin: 0;
padding: 0;
}

.similar-block li {
display: table-row;
}
.similar-block li span {
display: table-cell;
padding: 0.5rem;
vertical-align: middle;
font-size:0.8rem;
overflow-wrap: break-word;
}

.sim-link-button {
margin-top: 1rem; padding: 0.5rem 1rem;
background-color: transparent; color: var(--apple-blue);
border: 2px solid var(--apple-blue); border-radius: 0.6rem;
font-weight: 600; font-size: 0.9rem;
cursor: pointer; text-decoration: none;
transition: background-color 0.2s ease, color 0.2s ease;
display: inline-block;
}

.sim-link-button:hover { background-color: var(--apple-blue)!important; color: white; }

/* Button styling with consistent border */
.similar-block li a.sim-link-button {
display: inline-block !important;
margin: 0.25rem 0.5rem;
padding: 0.3rem 0.8rem;
font-size: 0.6rem;
border-radius: 0.6rem;
white-space: nowrap;
vertical-align: middle;
border: 1px solid #eee;
}

/* Remove bottom border from non-button cells in last row only */
.similar-block ul li:last-child span,
.similar-block ul li:last-child img {
border-bottom: none;
}

/* Header row styles */
.similar-block li.similar-header span {
font-weight: 500;
background: rgba(255,255,255,0.6);
}

/* базовая иконка */
.sim-link-icon {
display: inline-block;
width: 16px;
height: 16px;
background-image: url("icons/external_link_blue.png")!important;
background-size: contain;
background-repeat: no-repeat;
}

/* при hover меняем на белый вариант */
.sim-link-icon:hover {
background-image: url("icons/external_link_white.png")!important;
}

.similar-block li a.sim-link-button.sim-link-icon {
width: auto !important;
height: auto !important;
background-position: center center !important;
background-size: 0.7rem !important;
margin: 0.25rem 0.5rem;
padding: 0.7rem 1rem;
border: 1px solid #eee;
}

.icon-metro {
background: url(icons/icon-metro-50x50.png);
background-position: center center !important;
background-size: 1.4rem !important;
margin: 0rem 0.3rem 0rem 0.5rem;
padding: 0.1rem 0.5rem;
background-repeat: no-repeat;
background-color: transparent;
}

@media (max-width: 1023px) {
nav { display: none; }
.burger { display: flex; }

/* 1) Включаем прокрутку у обёртки */
.similar-block {
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}

/* 2) Делаем ul не «table», а «inline-table» */
.similar-block ul {
display: block;  /* вместо table */
width: auto;            /* пусть сам себе подберёт нужную ширину */
table-layout: auto;    /* если нужен фиксированный layout */
}

}

.contacts {
  backdrop-filter: blur(12px);
    border-radius: 1rem;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
    padding: 2rem 2rem 0rem;
    background: rgba(255, 255, 255, 0.6);
    grid-column: 1 / -1;
    display: grid;
    place-items: center;
}

/* Стили для массива цен в заголовках */
.price-m2-array {
  display: inline-block;
  padding: 0.5rem 0.8rem;
  margin: 0.25rem 0.5rem;
  background-color: var(--apple-blue);
  color: #eee;
  border-radius: 0.6rem;
  font-size: 0.8rem;
  white-space: nowrap;
  vertical-align: middle;
}

.contacts-button {
  padding: 0.9rem 2.2rem;
    background: transparent;
    color: var(--apple-blue);
    border: 2px solid var(--apple-blue);
    border-radius: 0.8rem;
    font-weight: 600;
    text-decoration: none;
    transition: background 0.2s, color 0.2s;
    display: inline-flex;
    align-items: center;
    margin: 2rem 2rem;

}

.contacts-button:hover {
      background: var(--apple-blue);
      color: #fff;
    }

.contacts-button img {
      width: 1.3em;
      margin-right: 0.6em;
    }

@media (max-width: 600px) {
.contacts-button {
        width: 60%;
        justify-content: center;
        padding: 1rem 0;
        font-size: 1rem;
      }
}

/* Стили для иконок информации и подсказок */
.metric-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.3rem;
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.section h2 {
  font-size: 1.5rem;
}

.info-icon {
  width: 16px;
  height: 16px;
  cursor: pointer;
  transition: all 0.2s ease;
  margin-left: 8px;
  flex-shrink: 0;
  opacity: 0.6;
}

.info-icon:hover {
  opacity: 1;
  transform: scale(1.1);
}

/* Стили для всплывающих подсказок */
.tooltip {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  padding: 20px;
  box-sizing: border-box;
}

.tooltip-content {
  background: white;
  border-radius: 12px;
  max-width: 500px;
  width: 100%;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.3);
  animation: tooltipFadeIn 0.3s ease;
}

@keyframes tooltipFadeIn {
  from {
    opacity: 0;
    transform: scale(0.9) translateY(-20px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
  }
}

.tooltip-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 20px 1rem 20px;
  border-bottom: 1px solid #e5e5e7;
}

.tooltip-header h3 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 600;
  color: #1C1C1E;
}

.tooltip-close {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background-color: #f2f2f7;
  color: #8e8e93;
  font-size: 16px;
  font-weight: bold;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.2s ease;
}

.tooltip-close:hover {
  background-color: #e5e5e7;
  color: #1C1C1E;
}

.tooltip-body {
  padding: 20px;
  line-height: 1.6;
  color: #3a3a3c;
  font-size: 0.95rem;
}

.tooltip-link {
  color: var(--apple-blue);
  text-decoration: none;
  font-weight: 500;
  font-size: 0.9rem;
  display: inline-block;
  margin-top: 8px;
  padding: 6px 12px;
  border: 1px solid var(--apple-blue);
  border-radius: 6px;
  transition: all 0.2s ease;
}

.tooltip-link:hover {
  background-color: var(--apple-blue);
  color: white;
  text-decoration: none;
}

/* Адаптивность для мобильных устройств */
@media (max-width: 768px) {
  .tooltip-content {
    margin: 20px;
    max-width: none;
  }
  
  .tooltip-header {
    padding: 15px 15px 1rem 15px;
  }
  
  .tooltip-body {
    padding: 15px;
  }
  
  .info-icon {
    width: 14px;
    height: 14px;
  }
}

/* Стили для разделителя */
.section-divider-thick {
  border: none;
  height: 2px;
  background: linear-gradient(90deg, transparent, #E5E5EA, transparent);
  margin: 3rem 0;
}

/* Стили для Telegram CTA блока */
.telegram-cta {
  background: #FFFFFF;
  border: 1px solid #E5E5EA;
  border-radius: 1rem;
  padding: 2rem;
  margin: 2rem 0;
  box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}

.telegram-cta-content {
  text-align: center;
  max-width: 600px;
  margin: 0 auto;
}

.telegram-icon-wrapper {
  margin-bottom: 1.5rem;
}

.telegram-main-icon {
  width: 48px;
  height: 48px;
}

.telegram-cta-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1C1C1E;
  margin: 0 0 1rem 0;
}

.telegram-cta-description {
  color: #8E8E93;
  font-size: 1rem;
  line-height: 1.6;
  margin: 0 0 2rem 0;
}

.telegram-cta-benefits {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1rem;
  margin-bottom: 2rem;
}

.telegram-benefit {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding: 1rem;
  background: #F8F8F8;
  border-radius: 0.75rem;
}

.benefit-icon {
  font-size: 1.5rem;
}

.benefit-text {
  font-size: 0.9rem;
  color: #1C1C1E;
  font-weight: 500;
  text-align: center;
}

.telegram-cta-button {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  background: var(--apple-blue);
  color: #FFFFFF;
  text-decoration: none;
  padding: 0.75rem 1.5rem;
  border-radius: 0.5rem;
  font-weight: 600;
  font-size: 1rem;
  transition: all 0.2s ease;
}

.telegram-cta-button:hover {
  background: #0056b3;
  color: #FFFFFF;
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(0, 122, 255, 0.3);
}

/* Стили для футера */
.footer {
  background: #FFFFFF;
  color: #1C1C1E;
  padding: 3rem 0 0;
  margin-top: 4rem;
  border-top: 1px solid #E5E5EA;
}

.footer-content {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 2fr;
  gap: 2rem;
  align-items: start;
}

.footer-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-brand {
  display: flex;
  align-items: baseline;
  gap: 0.25rem;
  margin-bottom: 0.5rem;
}

.footer-brand-structura {
  font-size: 1.5rem;
  font-weight: 700;
  color: #1C1C1E;
}

.footer-brand-capital {
  font-size: 1rem;
  font-weight: 300;
  color: #8E8E93;
}

.footer-description {
  color: #8E8E93;
  font-size: 0.9rem;
  line-height: 1.5;
  margin: 0;
}

.footer-title {
  font-size: 1.1rem;
  font-weight: 600;
  color: #1C1C1E;
  margin: 0 0 1rem 0;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.footer-link {
  color: #8E8E93;
  text-decoration: none;
  font-size: 0.9rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  transition: color 0.2s ease;
}

.footer-link:hover {
  color: var(--apple-blue);
  text-decoration: none;
}

.footer-link img {
  width: 16px;
  height: 16px;
  opacity: 0.7;
}

.footer-info-content {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-info-item {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
}

.footer-info-label {
  color: #8E8E93;
  font-size: 0.85rem;
  font-weight: 500;
}

.footer-info-value {
  color: #1C1C1E;
  font-size: 0.9rem;
}

.footer-bottom {
  border-top: 1px solid #E5E5EA;
  margin-top: 2rem;
  padding: 1.5rem 0;
}

.footer-copyright {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  text-align: center;
}

.footer-copyright span {
  color: #8E8E93;
  font-size: 0.85rem;
}

/* Адаптивность для Telegram CTA */
@media (max-width: 768px) {
  .telegram-cta {
    margin: 1rem;
    padding: 1.5rem;
  }
  
  .telegram-cta-title {
    font-size: 1.25rem;
  }
  
  .telegram-cta-description {
    font-size: 0.9rem;
  }
  
  .telegram-cta-benefits {
    grid-template-columns: 1fr;
    gap: 0.75rem;
  }
  
  .telegram-benefit {
    padding: 0.75rem;
  }
  
  .telegram-cta-button {
    width: 100%;
    justify-content: center;
    padding: 1rem;
  }
}

/* Адаптивность футера */
@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 2rem;
    padding: 0 1rem;
  }
  
  .footer-section {
    text-align: center;
  }
  
  .footer-links {
    align-items: center;
  }
  
  .footer-info-item {
    text-align: center;
  }
}
