/* ======================================================================
   /assets/css/view.css — ОРГАНИЗОВАННЫЕ СТИЛИ
   ====================================================================== */

/* ======================================================================
   1) БАЗА / ОБНУЛЕНИЕ
   ====================================================================== */
*, *::before, *::after { 
    box-sizing: border-box; 
    -webkit-tap-highlight-color: transparent; /* Убираем системный прямоугольник при тапе на мобилках */
}

html, body { max-width: 100vw; }

body {
    font-family: 'Montserrat', 'Inter', sans-serif;
    background: #ffffff;
    color: #374151;
    line-height: 1.4;
    font-weight: 400;
    font-size: 14px;
}

.container {
    max-width: 1200px;
    width: 100%;
    margin: 0 auto;
    padding: 0 15px;
}

/* Убираем конфликт z-index с картами */
.ymaps-2-1-79-map, .ymaps-map, [class*="ymaps"], [class*="yandex-map"] {
    z-index: 0 !important;
}

/* ======================================================================
   2) ХЛЕБНЫЕ КРОШКИ
   ====================================================================== */
.breadcrumbs { margin: 10px 0; font-size: 13px; color: #6b7280; }
.breadcrumbs a { color: #6b7280; text-decoration: none; }
.breadcrumbs a:hover { text-decoration: underline; text-decoration-color: #9ca3af; text-underline-offset: 2px; }
.breadcrumbs span { margin: 0 4px; }

/* ======================================================================
   3) ГАЛЕРЕЯ (главное фото + миниатюры)
   ====================================================================== */
.photos-section-wrapper {
    margin: 0 -15px 30px -15px;
    position: relative;
}

.photos-section {
    display: flex;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    height: 450px; /* фикс на ПК */
    width: 100%;
    background: #f3f4f6;
}

/* Главное фото */
.main-photo-container {
    position: relative;
    flex: 0 0 60%;
    width: 60%;
    height: 100%;
    overflow: hidden;
    touch-action: pan-y;
}
.main-photo-container .photo-wrapper {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}
.main-photo {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

/* Счётчик */
.photo-counter {
    position: absolute;
    top: 10px;
    right: 10px;
    background: rgba(0, 0, 0, 0.6);
    color: white;
    padding: 4px 10px;
    border-radius: 12px;
    font-size: 12px;
    backdrop-filter: blur(4px);
    z-index: 3;
}

/* Миниатюры */
.thumbnails-container {
    flex: 1;
    display: flex;
    position: relative;
    overflow: hidden;
    height: 100%;
}

.thumbnails-grid {
    display: grid;
    grid-template-rows: 1fr 1fr;
    grid-template-columns: 1fr 1fr;
    width: 100%;
    height: 100%;
    gap: 0;
    overflow: hidden;
}

/* Вариант-лента, если миниатюр больше 4 */
.thumbnails-grid.is-slider {
    grid-template-columns: none;
    grid-auto-columns: 50%;
    grid-auto-flow: column;
    overflow-x: auto;
    scroll-behavior: smooth;
    scroll-snap-type: x mandatory;
    -ms-overflow-style: none;
    scrollbar-width: none;
}
.thumbnails-grid.is-slider::-webkit-scrollbar { display: none; }

.thumbnails-grid .photo-wrapper {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    background: #f3f4f6;
}
.thumbnails-grid.is-slider .photo-wrapper { scroll-snap-align: start; }

.thumbnails-grid .thumbnail {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: filter 0.2s;
}
.thumbnails-grid .photo-wrapper:hover .thumbnail { filter: brightness(0.85); }

/* Карта-заглушка в миниатюрах */
.map-slide-wrapper { position: relative; width: 100%; height: 100%; cursor: pointer; background: #f3f4f6; }
.map-slide-wrapper img { width: 100%; height: 100%; object-fit: cover; cursor: inherit; }

/* Слой клика */
.photo-click-layer {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: transparent;
    cursor: pointer;
}
.photo-click-layer:hover { background: rgba(0, 0, 0, 0.15); }
.main-photo-container .photo-click-layer:hover { background: transparent !important; }

/* Запрещаем перетаскивание/выделение картинки */
.main-photo, .thumbnail {
    pointer-events: none !important;
    user-select: none !important;
    -webkit-user-drag: none !important;
    -webkit-touch-callout: none !important;
}

/* ======================================================================
   3.1) СТРЕЛКИ миниатюр — одна версия (без дублей)
   ====================================================================== */
.thumbnail-nav-btn {
    position: absolute;
    top: 50%;
    left: auto;
    right: auto;
    transform: translateY(-50%) !important;

    width: 36px;
    height: 36px;
    border-radius: 50%;

    background: transparent !important;
    border: none !important;
    color: #374151;
    cursor: pointer;

    display: flex;
    align-items: center;
    justify-content: center;

    z-index: 10;
    padding: 0;

    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}

.thumbnail-nav-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.85);
    border: 1px solid #e5e7eb;
    border-radius: 50%;
    z-index: -1;
    transition: transform 0.2s ease-out, background 0.2s;
}
.thumbnail-nav-btn:hover::before {
    transform: scale(1.15);
    background: rgba(255, 255, 255, 0.95);
}
.thumbnail-nav-btn > * { transform: none !important; }

.prev-btn { left: 8px; }
.next-btn { right: 8px; }
.thumbnail-nav-btn.hidden { display: none !important; }

/* ======================================================================
   3.2) АДАПТАЦИЯ галереи
   ====================================================================== */
/* Адаптация галереи */
@media (max-width: 768px) {
    /* Отрицательные отступы — прилипаем к краям экрана */
    .photos-section-wrapper { 
        margin-right: -15px; 
        margin-left: -15px; 
    }
    
    /* Скругление углов остается */
    .photos-section { 
        flex-direction: column; 
        height: auto; 
        border-radius: 8px; /* Чуть увеличили скругление для красоты на телефонах */
        overflow: hidden; 
    }
    
    .main-photo-container { width: 100%; flex: none; height: 300px !important; }
    .thumbnails-container { height: 100px !important; }
    .thumbnails-grid .photo-wrapper { height: 100px !important; max-height: 100px !important; min-height: 100px !important; overflow: hidden !important; }
    .thumbnails-grid .thumbnail { height: 100px !important; width: 100% !important; object-fit: cover !important; }
}

/* ======================================================================
   4) СЕТКА КОНТЕНТА / ТЕКСТЫ
   ====================================================================== */
.content-grid {
    display: grid;
    grid-template-columns: 60% 40%;
    gap: 20px;
    width: 100%;
}
@media (max-width: 992px) { .content-grid { grid-template-columns: 1fr; gap: 15px; } }

.left-column { display: flex; flex-direction: column; gap: 15px; }

.property-title { font-size: 22px; color: #111827; font-weight: 700; margin-bottom: 12px; line-height: 1.3; }
.section-title { font-size: 14px; color: #111827; margin-bottom: 8px; font-weight: 500; }

/* Описание + “показать больше” */
.brief-description {
    background: #fff;
    padding: 0 15px 15px 0;
    margin-bottom: 15px;
    position: relative;
}
.brief-text-wrapper { position: relative; overflow: hidden; transition: max-height 0.3s ease; }
.brief-text-wrapper.collapsed { max-height: 130px; }
.brief-text-wrapper.collapsed::after {
    content: '';
    position: absolute; bottom: 0; left: 0; right: 0; height: 50px;
    background: linear-gradient(to top, rgba(255,255,255,1), rgba(255,255,255,0));
    pointer-events: none;
}
.brief-text {color: #1f2937; font-size: 14px; line-height: 1.5; }
.desc-paragraph { margin: 0; line-height: 1.5; color: #1f2937; }
.desc-paragraph + .desc-paragraph { margin-top: 5px; }

.toggle-description-link {
    color: #2563eb;
    font-size: 13px;
    font-weight: 500;
    text-decoration: none;
    cursor: pointer;
    margin-top: 0;
    display: inline-flex;
    align-items: center;
    gap: 4px;
}
.toggle-description-link:hover { opacity: 0.8; }
.toggle-description-link i { font-size: 10px; transition: transform 0.2s; }

/* ======================================================================
   5) ХАРАКТЕРИСТИКИ / УСЛОВИЯ СДЕЛКИ
   ====================================================================== */
.characteristics-section, .deal-conditions {
    background: #fff;
    padding: 15px 15px 45px 15px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    border-radius: 8px;
    margin-bottom: 40px;
}
.deal-conditions { margin-bottom: 0; }

.char-item, .deal-item {
    display: flex;
    justify-content: flex-start;
    padding: 8px 0;
    font-size: 12px;
    border-bottom: 1px solid #f3f4f6;
    line-height: 1.3;
}

.char-group-title {
    font-size: 13px;
    color: #111827;
    margin: 15px 0 8px;
    font-weight: 500;
    padding-top: 12px;
}

.char-label, .deal-label {
    color: #6b7280;
    flex: 0 0 35%;
    max-width: 35%;
    padding-right: 10px;
    word-wrap: break-word;
    -webkit-hyphens: auto;
    hyphens: auto;
}
.char-value, .deal-value {
    color: #111827;
    font-weight: 500;
    flex: 1;
    text-align: left;
    word-break: break-word;
}
@media (max-width: 992px) {
    .char-label, .deal-label { flex: 0 0 38% !important; max-width: 38% !important; }
}

/* ======================================================================
   6) ПРАВАЯ КОЛОНКА / КОНТАКТЫ
   ====================================================================== */
.right-column {
    display: flex;
    flex-direction: column;
    gap: 15px;
    padding-top: 10px;
    top: 20px;
    align-self: flex-start;
    z-index: 10;
}

.contact-block {
    background: #E3FCEE;
    padding: 15px;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

.contact-header { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.agent-avatar-wrapper { position: relative; width: 40px; height: 40px; flex-shrink: 0; }
.agent-avatar { width: 100%; height: 100%; border-radius: 50%; object-fit: cover; background: #fff; display: block; }
.agent-details h3 { font-size: 14px; color: #111827; font-weight: 500; margin-bottom: 2px; }
.agent-details p { color: #6b7280; font-size: 12px; }

/* Кнопки контактов */
.contact-buttons { display: flex; gap: 8px; margin-bottom: 12px; }
@media (max-width: 480px) {
    .contact-buttons { flex-direction: column; }
    .contact-btn { width: 100% !important; }
}

.contact-btn {
    padding: 10px;
    border-radius: 6px;
    border: none;
    font-family: 'Montserrat', 'Inter', sans-serif;
    font-size: 13px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;

    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;

    flex: 1;
    width: 50%;
    min-width: 0;
    white-space: nowrap;
}

/* фикс иконок (чтобы кнопки не “прыгали”) */
.contact-btn i,
.contact-btn svg {
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    width: 16px !important;
    height: 16px !important;
    font-size: 14px !important;
    line-height: 1 !important;
    margin: 0 !important;
    padding: 0 !important;
    vertical-align: middle !important;
}

.contact-btn.is-phone-visible { font-size: 13px; font-weight: 600; letter-spacing: 0.3px; }

.btn-primary { background: #1E90FF; color: white; }
.btn-primary:hover { background: #007bff; }

.btn-max { background: #374151; color: white; transition: background 0.2s; }
.btn-max:hover { background: #000000; }

.btn-secondary { background: #94A3B8; color: #fff; }
.btn-secondary:hover { background: #6C7C94; }

.contact-btn:active, .btn-modal:active {
    transform: scale(0.985);
    transition: transform 0.05s ease;
}

/* номер телефона внутри кнопки — строго в одну строку */
#showPhoneBtn .phone-inline { white-space: nowrap !important; }

/* ======================================================================
   7) ТЕГИ / ПОХОЖИЕ ОБЪЯВЛЕНИЯ (карточки)
   ====================================================================== */
.property-tags-wrapper { margin-top: -50px; margin-bottom: 50px; }
.property-tags-container { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.tags-label { font-size: 12px; color: #6b7280; margin-right: 8px; font-weight: 500; white-space: nowrap; }

.property-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag { 
    padding: 4px 10px;         
    background: #f3f4f6; 
    color: #64748b; 
    border: 1px solid #f3f4f6; 
    border-radius: 50px;       
    font-size: 11px;           
    font-weight: 500;
    text-decoration: none;
    display: inline-flex; 
    align-items: center; 
    white-space: nowrap;
    transition: background-color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

/* Hover тегов: мягкий голубой (в стиле сайта) */
.tag:hover,
.tag:focus-visible {
    background: #EBF7FF;   /* очень светлый голубой E0F3FF*/
    border-color: #EBF7FF; /* голубая рамка */

}

.properties-section { padding-top: 0; padding-bottom: 60px; }
.properties-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 30px; margin-top: 25px; }

.property-card {
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.05);
    text-decoration: none;
    display: flex;             /* Было block. Теперь карточка гибкая */
    flex-direction: column;    /* Картинка сверху, текст снизу */
    transition: box-shadow 0.3s ease, border-color 0.3s ease;
    height: 100%;
    cursor: pointer;
    border: 1px solid #f3f4f6;
}

.property-card:hover {
    box-shadow: 0 12px 20px rgba(0, 0, 0, 0.08);
    border-color: #e5e7eb;
}

.property-card-img {
    width: 100%;
    height: 180px;
    position: relative;
    overflow: hidden;
}

.property-card-img img {
    transition: transform 0.5s ease-out !important;
    will-change: transform;
}

.property-card:hover .property-card-img img { 
    transform: scale(1.08) !important; 
}

/* Контент внутри карточки */
.property-card-content { 
    padding: 20px; 
    display: flex;
    flex-direction: column;
    flex-grow: 1; /* Заставляет этот блок занять всю оставшуюся высоту */
}

/* ===== ИДЕАЛЬНОЕ ВЫРАВНИВАНИЕ КАРТОЧЕК ===== */
.properties-grid {
    align-items: stretch; /* Карточки одинаковой высоты */
}

/* Заголовок: резервируем место ровно под 2 строки */
.property-card-title {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    min-height: 39px; /* Добавили минимальную высоту */
}

/* Адрес: резервируем место ровно под 2 строки */
.property-card-location span {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: normal;
    min-height: 34px; /* Добавили минимальную высоту */
}

@media (max-width: 1024px) { 
    .properties-grid { grid-template-columns: repeat(2, 1fr); } 
}
@media (max-width: 768px) { 
    .properties-grid { grid-template-columns: 1fr; } 
}

/* ======================================================================
   8) АДМИН-БЛОКИ
   ====================================================================== */
.admin-plot-bar {
    background: #0f172a;
    color: #fff;
    padding: 10px 15px;
    border-radius: 8px;
    margin-bottom: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 12px;
    font-size: 13px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}

.status-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
}
.status-badge.draft { background: #f59e0b; color: #fff; }
.status-badge.published { background: #10b981; color: #fff; }
.status-badge.sold, .status-badge.rented { background: #3b82f6; color: #fff; }
.status-badge.archived { background: #64748b; color: #fff; }
.status-badge.deleted { background: #ef4444; color: #fff; }

.admin-internal-block {
    max-width: 1200px;
    margin: 30px auto;
    padding: 16px;
    background: #fffbeb;
    border: 1px dashed #f59e0b;
    border-radius: 8px;
    font-size: 13px;
}
.admin-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    padding-bottom: 8px;
    border-bottom: 1px solid #fde68a;
}
.admin-edit-btn { background: #f59e0b; color: #fff; padding: 4px 10px; border-radius: 4px; text-decoration: none; font-size: 12px; }
.admin-value.note { background: #fef3c7; padding: 10px 12px; margin: 0; line-height: 1.5; font-weight: 400; border-radius: 6px; font-size: 13px; color: #451a03; }

/* ======================================================================
   9) МОДАЛКИ (этапы сделки)
   ====================================================================== */
.modal { display: none; position: fixed; inset: 0; background: rgba(0, 0, 0, 0.5); z-index: 1000; overflow-y: auto; padding: 20px; }
.modal.show { display: block; }
.modal-content { background: #fff; border-radius: 12px; max-width: 450px; margin: 50px auto; box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2); animation: modalSlideIn 0.3s ease; }
@keyframes modalSlideIn { from { opacity: 0; transform: translateY(-20px); } to { opacity: 1; transform: translateY(0); } }
.modal-header { padding: 20px 20px 15px; border-bottom: 1px solid #e5e7eb; display: flex; justify-content: space-between; align-items: center; }
.modal-body { padding: 20px; }
.modal-footer { padding: 15px 20px 20px; border-top: 1px solid #e5e7eb; display: flex; justify-content: flex-end; }
.btn-modal { padding: 10px 20px; border-radius: 6px; border: none; font-family: 'Montserrat', 'Inter', sans-serif !important; font-size: 14px; cursor: pointer; font-weight: 500; }

.modal-title {
    font-size: 18px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    margin: 0 !important;
    -webkit-font-smoothing: antialiased;
}
.step-title {
    font-size: 15px !important;
    font-weight: 700 !important;
    color: #111827 !important;
    -webkit-font-smoothing: antialiased;
}

/* Крестик в модалке “этапы сделки” (CSS) */
.modal-close {
    background: transparent !important;
    border: none !important;
    position: relative;
    z-index: 2001;
    width: 32px !important;
    height: 32px !important;
    outline: none !important;
    box-shadow: none !important;
    cursor: pointer;
    padding: 0 !important;
    transition: transform 0.2s ease-out !important;
}
.modal-close::before,
.modal-close::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 16px;
    height: 2px;
    background-color: #94a3b8;
    transition: background-color 0.2s ease-out !important;
}
.modal-close::before { transform: translate(-50%, -50%) rotate(45deg); }
.modal-close::after  { transform: translate(-50%, -50%) rotate(-45deg); }
.modal-close:hover { transform: scale(1.4) !important; }
.modal-close:hover::before,
.modal-close:hover::after { background-color: #111827; }

/* ======================================================================
   10) ФОТО/КАРТА — МОДАЛКА (фиксированный чёрный фон)
   ====================================================================== */
@keyframes photoModalFadeIn {
    from { opacity: 0; transform: scale(0.985); }
    to   { opacity: 1; transform: scale(1); }
}

.photo-modal {
    display: none;
    position: fixed;
    inset: 0;
    background: #000 !important; /* фиксированный чёрный фон */
    z-index: 2000;
    cursor: pointer;
    overflow: hidden;
    overscroll-behavior: contain;
}
.photo-modal.show { display: block; }

.photo-modal-content {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    touch-action: pan-y;
    background: transparent !important;
}

/* контейнер медиа (двигаем его свайпом) */
.modal-media {
    will-change: transform;
    backface-visibility: hidden !important;
    -webkit-backface-visibility: hidden !important;
    transform: translateZ(0);
    perspective: 1000px;
    background: transparent !important;
}

.photo-modal-img {
    width: 90vw !important;
    height: 80vh !important;
    max-width: 90vw !important;
    max-height: 80vh !important;
    object-fit: contain !important;
    border-radius: 6px !important;
    box-shadow: 0 0 30px rgba(0,0,0,0.5) !important;
    animation: photoModalFadeIn 0.3s ease;
    background: transparent !important;
}

/* Крестик закрытия фото/карты */
.photo-modal-close {
    position: absolute;
    top: 25px;
    right: 40px;
    color: #ffffff !important;
    background: transparent !important;
    font-size: 32px !important;
    line-height: 1 !important;
    z-index: 2001;
    width: 44px !important;
    height: 44px !important;
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    border: none !important;
    outline: none !important;
    padding: 0 !important;
    margin: 0 !important;
    appearance: none !important;
    cursor: pointer;
    filter: none !important;
    backface-visibility: hidden !important;
    transform: translateZ(0) !important;
    -webkit-font-smoothing: antialiased !important;
    will-change: transform !important;
    transition: transform 0.2s ease-out !important;
    -webkit-tap-highlight-color: transparent !important;
}
.photo-modal-close:hover { transform: scale(1.4) translateZ(0) !important; }

/* Стрелки в модалке (одна версия, без дублей) */
.photo-modal-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%) !important;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2001;
    background: transparent !important;
    border: none !important;
    color: #374151 !important;
    -webkit-tap-highlight-color: transparent !important;
    outline: none !important;
}
.photo-modal-nav::before {
    content: '';
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    border: 2px solid #e5e7eb;
    border-radius: 50%;
    z-index: -1;
    transition: transform 0.2s ease-out;
}
.photo-modal-nav:hover::before { transform: scale(1.15); }
.photo-modal-nav > * { transform: none !important; }

.photo-modal-prev { left: 30px; }
.photo-modal-next { right: 30px; }

.photo-modal-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0,0,0,0.7);
    color: #fff;
    padding: 6px 16px;
    border-radius: 20px;
    z-index: 2001;
}

/* Контейнер Яндекс-карты */
#yandexMapModal .photo-modal-nav { display: none; }
#yandexMapContainer.map-container-modal {
    width: 90vw;
    height: 80vh;
    margin: auto;
    border-radius: 6px;
    background: #f3f4f6;
    overflow: hidden;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
    animation: photoModalFadeIn 0.3s ease;
}
#yandexMapContainer { width: 100%; height: 100%; }

/* Мобилка: модалка на весь экран, без стрелок */
@media (max-width: 768px) {
    .photo-modal { z-index: 9999 !important; }

    .photo-modal-content,
    #yandexMapContainer.map-container-modal {
        width: 100vw !important;
        height: 100vh !important;
        height: 100dvh !important;
        border-radius: 0 !important;
    }

    .photo-modal-nav { display: none !important; }

    .photo-modal-img {
        width: 100vw !important;
        height: 100vh !important;
        max-width: 100vw !important;
        max-height: 100vh !important;
        border-radius: 0 !important;
        object-fit: contain !important;
        box-shadow: none !important; /* убираем “второй тёмный фон” вокруг фото */
    }

    .photo-modal-close {
        top: 15px !important;
        right: 15px !important;
        width: 40px !important;
        height: 40px !important;
        font-size: 35px !important;
        background: rgba(0, 0, 0, 0.6) !important;
        border-radius: 50% !important;
        filter: none !important;
        transform: none !important;
        padding: 0 !important;
        margin: 0 !important;
    }
    .photo-modal-close:hover { transform: none !important; }
}

/* ======================================================================
   11) МОДАЛКА “Этапы сделки” — шаги
   ====================================================================== */
.process-step {
    display: flex;
    gap: 16px;
    padding: 16px 0;
    border-bottom: 1px solid #f3f4f6;
}
.process-step:last-child { border-bottom: none; }
.step-number {
    flex-shrink: 0;
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: #3b82f6;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 600;
    margin-top: 2px;
}
.step-content { display: flex; flex-direction: column; gap: 4px; }
.step-desc { font-size: 13px; color: #64748b; line-height: 1.4; }

/* ======================================================================
   12) ССЫЛКИ: комиссия / этапы / поделиться
   ====================================================================== */
.commission-btn {
    color: #6b7280;
    text-decoration: underline;
    text-underline-offset: 2px;
    text-decoration-color: #94a3b8;
    transition: color 0.2s ease;
}
.commission-btn:hover { text-decoration: none; }

.buyer-costs-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    color: #6b7280;
    font-weight: 500;
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 2px;
    transition: color 0.2s ease;
}
.buyer-costs-btn:hover { text-decoration: none; }

.share-btn {
    color: #6b7280;
    font-weight: 500;
    text-decoration: none;
    text-underline-offset: 2px;
    display: inline-flex;
    align-items: center;
    transition: color 0.2s ease;
}
.share-btn:hover { text-decoration: underline; text-decoration-color: #94a3b8; }

/* ======================================================================
   13) МОБИЛЬНАЯ ПЛАВАЮЩАЯ ПАНЕЛЬ
   ====================================================================== */
.mobile-floating-bar { display: none; }

@media (max-width: 768px) {
    /* Открепляем шапку на мобильных (чтобы уезжала вверх при скролле) */
    header, .header, .site-header {
        position: relative !important;
        top: auto !important;
    }

    .mobile-floating-bar {
        display: flex;
        justify-content: space-between;
        align-items: center;
        position: fixed;
        bottom: 0; left: 0; right: 0;
        background: #ffffff;
        padding: 10px 15px;
        box-shadow: 0 -4px 20px rgba(0, 0, 0, 0.08);
        z-index: 1000;
        padding-bottom: calc(10px + env(safe-area-inset-bottom));
        border-top: 1px solid #f3f4f6;
        gap: 10px;
    }

    body { padding-bottom: calc(75px + env(safe-area-inset-bottom)); }

    .mfb-contact-info {
        display: flex;
        align-items: center;
        gap: 10px;
        overflow: hidden;
        flex-grow: 1;
    }
    .mfb-avatar {
        width: 40px;
        height: 40px;
        border-radius: 50%;
        object-fit: cover;
        flex-shrink: 0;
        background: #f3f4f6;
    }
    .mfb-text { display: flex; flex-direction: column; overflow: hidden; }
    .mfb-role {
        font-size: 11px;
        color: #64748b;
        font-weight: 500;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        margin-bottom: 2px;
    }
    .mfb-name {
        font-size: 14px;
        font-weight: 700;
        color: #111827;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
        line-height: 1.1;
    }

    /* Кнопка “Позвонить” (зелёная) */
    .mfb-call-btn {
        background: #10b981;
        color: #fff;
        padding: 10px 16px;
        border-radius: 8px;
        text-decoration: none;
        font-weight: 600;
        font-size: 14px;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        flex-shrink: 0;
        flex: 1;
    }
    .mfb-call-btn:active { background: #059669; }

    /* Мобилка: скрываем НЕактивную MAX-кнопку */
    .contact-buttons button[disabled][title*="MAX"],
    .contact-buttons .contact-btn.is-disabled,
    .contact-buttons [aria-disabled="true"],
    button.hide-on-mobile,
    .hide-on-mobile {
        display: none !important;
    }

    /* мелкие поджатия отступов */
    .brief-description { margin-bottom: 5px !important; padding-bottom: 15px !important; }
    
    /* Убираем "карточный" вид и двойные отступы у таблиц на мобильных */
    .characteristics-section {
        padding: 0 !important;
        margin: 0 0 15px 0 !important;
        background: transparent !important;
        box-shadow: none !important;
    }
    
    /* Параметры предложения: добавляем отступ сверху (25px), чтобы не прилипало */
    .deal-conditions {
        padding: 0 !important;
        margin: 25px 0 15px 0 !important; 
        background: transparent !important;
        box-shadow: none !important;
    }

    /* Отступ сверху для заголовка "Похожие объявления" на мобильных */
    .properties-section {
        padding-top: 25px !important;
    }

    /* Чтобы текст характеристик был вровень с остальным текстом */
    .char-item, .deal-item {
        padding-left: 0 !important;
        padding-right: 0 !important;
    }

    .property-tags-wrapper { margin-top: -15px !important; margin-bottom: 16px !important; }
    .property-tags-container { margin-top: 2px !important; }

    /* Карусель (горизонтальный свайп) для похожих объектов на мобильных */
    .properties-grid {
        display: flex !important;      /* Отключаем сетку, включаем линию */
        flex-wrap: nowrap !important;  /* Запрещаем перенос на новую строку */
        overflow-x: auto;              /* Включаем горизонтальный скролл */
        scroll-snap-type: x mandatory; /* Включаем "примагничивание" карточек */
        gap: 15px;
        padding-bottom: 15px;          /* Место для тени карточек */
        
        /* Растягиваем блок от края до края экрана */
        margin-right: -15px !important;
        margin-left: -15px !important;
        padding-left: 15px;
        padding-right: 15px;
        
        /* Прячем системный ползунок скролла */
        -ms-overflow-style: none;
        scrollbar-width: none;
    }
    .properties-grid::-webkit-scrollbar { display: none; }
    
    .properties-grid .property-card {
        flex: 0 0 85% !important;      /* Карточка занимает 85% экрана (видно краешек следующей) */
        scroll-snap-align: center;     /* При свайпе карточка магнитится по центру */
    }
}

/* ======================================================================
   14) ПЕЧАТЬ
   ====================================================================== */
@media print {
    @page { margin: 12mm; }

    .header, footer, .breadcrumbs, .mobile-floating-bar,
    .thumbnail-nav-btn, .photo-click-layer,
    .properties-section,
    .admin-plot-bar, .admin-internal-block,
    .contact-buttons {
        display: none !important;
    }

    html, body {
        background: #fff !important;
        margin: 0 !important;
        padding: 0 !important;
        color: #000 !important;
    }

    .content-grid { display: block !important; }
    .left-column, .right-column { display: block !important; }

    .brief-description { margin: 0 0 10px 0 !important; padding: 0 !important; }
    .brief-text-wrapper { max-height: none !important; overflow: visible !important; }
    .brief-text-wrapper::after { display: none !important; }
    .toggle-description-link { display: none !important; }

    .photos-section-wrapper { margin: 0 0 10px 0 !important; }
    .photos-section {
        height: 260px !important;
        box-shadow: none !important;
        border-radius: 0 !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
    }
    .thumbnails-container { display: none !important; }
    .main-photo-container { width: 100% !important; flex: none !important; }

    .characteristics-section, .deal-conditions {
        box-shadow: none !important;
        border-radius: 0 !important;
        margin: 0 0 12px 0 !important;
        page-break-inside: auto !important;
        break-inside: auto !important;
    }

    h1, h2, h3 { page-break-after: avoid !important; break-after: avoid !important; }

    .char-item, .deal-item {
        page-break-inside: avoid !important;
        break-inside: avoid !important;
    }
}

/* Пока открыта модалка — скрываем нижнюю мобильную панель */
body.modal-open .mobile-floating-bar { display: none !important; }

/* ===== ИСПРАВЛЕННЫЕ CSS-СТРЕЛКИ ===== */
/* 1. Рисуем уголок (верхнюю и правую грань) */
.thumbnail-nav-btn .nav-chevron,
.photo-modal-nav .nav-chevron {
    width: 10px !important;
    height: 10px !important;
    display: inline-block !important;
    border: solid currentColor !important;
    border-width: 2px 2px 0 0 !important; 
    transition: transform 0.2s ease-out !important;
}

/* 2. Задаем правильный поворот и пробиваем старую блокировку (!important) */
.prev-btn .nav-chevron,
.photo-modal-prev .nav-chevron { 
    --rot: -135deg; 
    transform: rotate(-135deg) !important; 
    margin-left: 4px; /* Оптически центрируем */
}

.next-btn .nav-chevron,
.photo-modal-next .nav-chevron { 
    --rot: 45deg; 
    transform: rotate(45deg) !important; 
    margin-right: 4px; /* Оптически центрируем */
}

/* 3. Анимация увеличения при наведении */
.thumbnail-nav-btn:hover .nav-chevron,
.photo-modal-nav:hover .nav-chevron {
    transform: rotate(var(--rot)) scale(1.3) !important;
}

@keyframes revealText {
    from { opacity: 0; transform: translateX(-5px); }
    to { opacity: 1; transform: translateX(0); }
}
.reveal-anim {
    display: inline-block;
    animation: revealText 0.3s ease-out forwards;
}

/* ======================================================================
   ОТКЛЮЧЕНИЕ АНИМАЦИЙ (Accessibility / prefers-reduced-motion)
   ====================================================================== */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* Линия под заголовком */
.title-divider {
    width: 70%;
    border-bottom: 1px solid #e2e8f0;
    margin-bottom: 5px;
}

@media (max-width: 768px) {
    .title-divider {
        width: 80%;
    }
}