:root {
--max-width: 1000px;
--gap: 1.5rem;
--slider-height: 350px;
--apple-blue: #007AFF;
--hover-fill: rgba(0, 122, 255, 0.1);
}
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: 1rem 2rem;
box-shadow: 0 2px 10px rgba(0,0,0,0.05);
position: sticky;
top: 0;
z-index: 10;
}
.logo { font-weight: 600; }
nav { display: flex; gap: 1.5rem; }
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(4,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;
border-bottom: 1px solid #eee;
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;
}


.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;
      }
}
