.photo-gallery {
    display: flex;
    gap: 10px;
    border-radius: 12px;
    overflow: hidden;
    margin: 0px 16px 20px;
}

@media (max-width: 744px) {
    .photo-gallery {
        border-radius: 0px;
    }
}

.main-photo {
    flex: 1;
    position: relative;
    height: 400px;
    width: 50%;
}

.main-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    cursor: pointer;
}

.thumbnails {
    display: flex;
    flex-direction: row;
    gap: 10px;
    width: 50%;
    height: 400px;
    flex-wrap: wrap;
}

.thumbnails .thumbnail {
    flex: 1 1 calc(50% - 10px);
    box-sizing: border-box;
    height: calc(50% - 5px);
}

.thumbnail {
    position: relative;
    cursor: pointer;
    background-color: #f0f0f0;
}

.thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.more-photos-button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.65);
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
}

.mobile-more-photos-button {
    position: absolute;
    bottom: 10px;
    right: 10px;
    padding: 5px 10px;
    background-color: rgba(0, 0, 0, 0.65);
    color: #fff;
    border-radius: 5px;
    cursor: pointer;
    display: none; /* По умолчанию скрыта */
}

/* Модальное окно */
.modal {
    display: none;
    position: fixed;
    z-index: 1000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: #000;
    overflow-y: auto;
    border-radius: 0 !important;
}

.modal-header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    background-color: #000;
    display: flex;
    align-items: center;
    padding: 0 20px;
    z-index: 1001;
    border-radius: 0px !important;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 16px;
    flex: 1;
}

.object-title {
    flex: 1;
    text-align: left;
    color: #fff;
    font-size: 18px;
    margin: 0;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    padding-right: 20px;
}

.share-button {
    width: 40px;
    display: flex;
    justify-content: flex-end;
}

.back-button,
.share-button {
    background: none;
    border: none;
    padding: 8px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color 0.3s;
    border-radius: 50%;
}

.back-button:hover,
.share-button:hover {
    background-color: rgba(255, 255, 255, 0.1);
}

.modal-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: #000;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1001;
    border-radius: 0px !important;
}

.modal-call-block {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: #fff;
}

.phone-icon {
    font-size: 24px;
}

.call-us-block h3 {
    margin: 0;
    font-size: 16px;
    font-weight: normal;
}

.call-us-block .phone {
    color: #fff;
    text-decoration: none;
    font-size: 18px;
    font-weight: 500;
}

.call-us-block .phone:hover {
    text-decoration: underline;
}

.modal-photos {
    padding-top: 60px;
    padding-bottom: 100px; /* Отступ для плашки звонка */
    display: flex;
    flex-direction: column;
    gap: 2px;
    max-width: 960px;
    margin: 0 auto;
}

.modal-photo {
    width: 100%;
    height: auto;
    display: flex;
    justify-content: center;
    align-items: center;
}

/* Стили для видео в модальном окне */
.modal-video {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 56.25%; /* 16:9 соотношение сторон */
    background-color: #000;
    margin-bottom: 16px;
}

.modal-video .video-container {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
}

.modal-photo-image {
    width: 100%;
    height: auto;
    object-fit: contain;
}

/* Медиа-запрос для экранов меньше 744px */
@media (max-width: 743px) {
    .photo-gallery {
        flex-direction: column;
    }

    .main-photo {
        width: 100%;
        height: 300px;
    }

    .thumbnails {
        display: none; /* Скрываем миниатюры при маленьком разрешении */
    }

    .mobile-more-photos-button {
        display: block; /* Показываем кнопку только на мобильных */
    }

    .modal-photos {
        padding: 60px 16px 100px 16px;
        max-width: 100%;
        gap: 16px;
    }

    .modal-photo {
        height: auto;
    }

    .modal-photo-image {
        max-height: none;
    }

    .object-title {
        font-size: 16px;
        padding-right: 10px;
    }

    .header-left {
        gap: 8px;
    }

    .back-button,
    .share-button {
        padding: 6px;
    }
}
