.complex-gallery-section {
    display: flex;
    gap: 20px;
    margin-bottom: 30px;
    background-color: white;
    padding: 4vh;
    margin-top: 2vh;
    align-items: center;
}
.nb_round {
    min-width: 16px;
    min-height: 16px;
    background: #ffcc00;
    border-radius: 50%;
    display: inline-block;
    margin-right: 8px;
}
.main-gallery {
    position: relative;
    width: 450px;
    height: 500px;
    flex-shrink: 0;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
}
.pagination {
  width: 100%;
  display: flex;
  justify-content: center;
  margin: 20px 0;
}
.pagination-list {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;         
}
.pagination-item {
  min-width: 40px;
}
.pagination-link {
  display: block;
  padding: 8px 12px;
  text-decoration: none;
  font-size: 14px;
  line-height: 1;
  border: 1px solid #ccc;
  border-radius: 4px;
  color: #333;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.pagination-item:not(.disabled) .pagination-link:hover {
  background-color: #f0f0f0;
  border-color: #999;
  color: #000;
}
.pagination-item.active .pagination-link {
  background-color: #007bff;
  border-color: #007bff;
  color: #fff;
  cursor: default;
}
.pagination-item.disabled .pagination-link {
  background-color: #e9ecef;
  border-color: #dee2e6;
  color: #6c757d;
  cursor: default;
}
.pagination-item:first-child .pagination-link,
.pagination-item:last-child .pagination-link {
  font-weight: bold;
}
@media (max-width: 768px) {
  .pagination-link {
    padding: 6px 10px;
    font-size: 13px;
  }
  .pagination-item {
    min-width: 36px;
  }
}
@media (max-width: 480px) {
  .pagination-list {
    gap: 4px;
  }
  .pagination-link {
    padding: 4px 8px;
    font-size: 12px;
  }
  .pagination-item {
    min-width: 32px;
  }
}
.current-main-image {
    width: 450px;
    height: 500px;
    object-fit: cover;
    background: #f5f5f5;
    image-rendering: -webkit-optimize-contrast;
    image-rendering: crisp-edges;
    display: block;
}
.thumbnails-column {
    display: none;
}
.main-image-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 40px;
    height: 40px;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #333;
}
.complex-description{
    margin-left: 2vh;
    font-size: 20px;
    font-weight: bold;
    margin-bottom: 20px;
    display: inline-block;
}
.main-image-nav:hover {
    background: white;
    box-shadow: 0 3px 8px rgba(0, 0, 0, 0.3);
    transform: translateY(-50%) scale(1.05);
}
.main-image-nav.prev {
    left: 5%;
}
.main-image-nav.next {
    right: 5%;
}
.gallery-and-thumbnail{
    display: flex;
    flex-direction: row;
    gap: 2vh;
}
.thumbnails-column {
    display: flex;
    flex-direction: column;
    gap: 2vh;
    margin-top: 0;
}
.thumbnail {
    min-width: 150px;
    min-height: 150px;
    max-width: 150px;
    max-height: 150px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s ease;
    image-rendering: crisp-edges;
    background: #f5f5f5;
}
.thumbnail:hover {
    border-color: #007bff;
    transform: scale(1.05);
}
.thumbnail.active {
    border-color: #007bff;
    box-shadow: 0 3px 6px rgba(0, 123, 255, 0.2);
}
.complex-info-block {
    flex: 1;
    margin-left: 30px;
}
.complex-header {
    display: flex;
    align-items: baseline;
    gap: 1vh;
}
.complex-title {
    font-size: 24px;
    margin: 0;
}
.meta-grid {
    display: flex;
    gap: 15px 30px;
    margin-bottom: 4vh;
    margin-left: 2vh;
}
.scrollable-description {
    max-height: 150px;
    margin-left: 2vh;
    overflow-y: auto;
    margin-bottom: 4vh;
    padding-right: 10px;
    font-size: 1.8vh;
}
.specs-grid {
    display: grid;
    margin-left: 2vh;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    max-width: 90vh;
}
.spec-item {
    padding: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    flex: 1;
    border-radius: 50px;
    box-sizing: border-box;
    max-height: 7vh;
    min-width: 30vh;
}
.spec-image {
    width: 50px;
    height: 50px;
    object-fit: cover;
}
table {
    width: 80%;
    max-width: 1000px;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin-bottom: 20px;
}
th {
    background: #007bff;
    color: #fff;
    padding: 12px;
    text-align: left;
    font-size: 16px;
}
td {
    padding: 12px;
    border-bottom: 1px solid #ddd;
}
tr:nth-child(even) {
    background: #f9f9f9;
}
a[href="complex_form.php"] {
    display: inline-block;
    margin-top: 10px;
    background: #007bff;
    padding: 10px 15px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 6px;
}
a[href="complex_form.php"]:hover {
    background: #0056b3;
}
.lightbox-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 10000;
    cursor: pointer;
}
.lightbox-content {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    cursor: default;
}
.lightbox-image {
    max-width: 100%;
    max-height: 90vh;
    object-fit: cover;
    background: #000;
    transition: transform 0.3s ease;
    cursor: grab;
}
.lightbox-image:active {
    cursor: grabbing;
}
.lightbox-close {
    position: absolute;
    top: -40px;
    right: -40px;
    background: none;
    border: none;
    color: white;
    font-size: 40px;
    cursor: pointer;
    padding: 10px;
}
.lightbox-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.9);
    border: none;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
}
.complex-full-description{
    display: flex;
    flex-direction: column;
    background-color: white;
    padding-top: 4vh;
}
.complex-full-description-cards {
    display: flex;
    justify-content: center;
    gap: 2vh;
}
.complex-full-description-card{
    display: flex;
    flex-direction: column;
    padding-top: 10vh;
    padding-bottom: 15vh;
}
.complex-full-description-img {
    width: 400px;
    height: 400px;
    object-fit: cover;
    flex-shrink: 0;
}
.complex-full-description-scroll {
    overflow-y: auto;
    overflow-x: hidden;
    height: 300px;
    padding: 10px;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    font-size: 1.8vh;
    white-space: pre-wrap;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
}
.complex-info-card {
    background: rgba(238, 238, 238, 0.3);
    border-radius: 10px;
    overflow: hidden;
    height: 300px;
    width: 400px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: left;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
}
.newbuilding-section-button:hover{
    background-color: #f1c40f;
}
.complex-full-description-scroll::-webkit-scrollbar {
    width: 6px;
}
.complex-full-description-scroll::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 3px;
}
.complex-full-description-scroll::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 3px;
}
.complex-full-description-scroll::-webkit-scrollbar-thumb:hover {
    background: #555;
}
.lightbox-nav.prev { left: -80px; }
.lightbox-nav.next { right: -80px; }
.modal-and-map{
    display: flex;
    background-color: white;
    flex-direction: row-reverse;
}
.secondary-description{
    display: flex;
    flex-direction: column;
    width: 45%;
    margin-left: 10vh;
    margin-top: 10vh;
    margin-bottom: 10vh;
    gap: 4vh;
}
.secondary-description-card {
    position: relative; 
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: white;
    overflow: hidden;
    box-shadow: 0px 1px 10px 10px rgba(0, 0, 0, 0.1);
    z-index: 1000;
    transition: color 0.5s ease;
    min-height: 200px;
    padding: 10px;
}
.secondary-description-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 0;
    background: #f1c40f;
    transition: height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: -1;
}
.secondary-description-card:hover {
    color: #000 !important;
}
.secondary-description-card:hover::before {
    height: 100%;
}
.secondary-description-card * {
    position: relative;
    transition: color 0.3s ease 0.1s;
    z-index: 2;
}
.secondary-description-card:hover * {
    color: inherit !important;
}
.spec-item:hover{
    transform: scale(1.05);
    z-index: 2; 
}
.complex-full-description-card:hover{
    transform: scale(1.05);
    z-index: 2;
}
.complex-video.main-slide {
    position: relative;
    width: 100%;
    height: 100vh;
}
.video-wrapper video {
    width: 100%;
    height: 85%;
    object-fit: cover;
    padding: 5vh;
}
.secondary-description-scroll {
    overflow-y: auto;
    display: flex;
    overflow-x: hidden;
    height: 30vh;
    font-size: 22px;
    margin-left: 4vh;
    margin-right: 4vh;
    word-wrap: break-word;
    overflow-wrap: anywhere;
    hyphens: auto;
    white-space: pre-wrap;
    scrollbar-width: thin;
    scrollbar-color: #888 #f1f1f1;
    align-items: center;
}
.secondary-description-card h3{
    padding-top: 4vh;
}
.modal-map {
    min-height: 100%;
    width: 100%;
}
.leaflet-container {
    background: #f8f9fa;
}
.catalog-map-container{
    height: 100vh;
    width: 50%;
    margin-top: 2vh;
    margin-bottom: 2vh;
    box-shadow: inset 0px 1px 20px 20px rgba(0, 0, 0, 0.1);
}
.complex-layouts{
    background-color: white;
    padding-bottom: 7vh;
}
.layout-card{
    width: 400px;
    margin-bottom: 4vh;
}
.layout-card:hover {
    transform: scale(1.05); /* Увеличение на 5% */
    z-index: 2; /* Поднимаем элемент над остальными */
}
.complex-layout-info-card{
    background: rgba(238, 238, 238, 0.3);
    overflow: hidden;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.1);
    text-align: left;
    padding: 20px;
    display: flex;
    flex-direction: column;
    position: relative;
}
.card-footer {
    font-weight: bold;
    margin-top: 4vh;
    border-top: 1px solid #aaa;
    padding-top: 10px;
    display: flex;
    justify-content: space-between;
    align-items: center;
}
.layout-image img{
    height: 400px;
    width: 400px;
    object-fit: contain;
}
.layouts-grid{
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    margin: 4vh; 
    justify-items: center;
}
.place-info{
   display: flex;
   font-size: 24px;
   font-weight: 500;
   color: black;
}
.complex-layout-param{
    margin-right: 1vh;
    margin-top: 1vh;
    color: #4B4B4B;
}
.complex-video {
    background-color: white;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    margin-top: 2vh; 
    padding-top: 2vh; 
}
.building-info{
    display: flex;
    flex-direction: column;
    background-color: white;
}
.building-info-card-images {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    justify-content: space-evenly;
    margin-bottom: 10vh;
}
.image-container {
    height: var(--image-height, 300px);
    position: relative;
    overflow: hidden;
    object-fit: cover;
}
.image-container img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-top-left-radius: 10px;
    border-top-right-radius: 10px;
    border-bottom-left-radius: 0;
    border-bottom-right-radius: 0;
}
.date {
    font-size: 16px;
    font-weight: bold;
    background: rgba(0, 0, 0, 0.5);
    color: white;
    padding: 5px 10px;
    border-radius: 5px;
    position: absolute;
    bottom: 10px;
    left: 10px;
}
.layout-image:hover{
    cursor: pointer;
}
.main-gallery{
    cursor: pointer;
}
@media (max-width: 1700px) {
    .layouts-grid {
        display: grid;
        grid-template-columns: repeat(3, 1fr);
        margin: 4vh;
        justify-items: center;
    }
    .complex-full-description-cards {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 2vh;
        justify-items: center;
    }
    .gallery-and-thumbnail{
    flex-direction: column;
    align-items: center;
    }

    .thumbnails-column {
        flex-direction: row;
    }
    .specs-grid {
        display: grid;
        margin-left: 2vh;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;
        max-width: 90vh;}
}
@media (max-width: 1600px) {
    .complex-gallery-section {
        flex-direction: column;
        align-items: center;
    }
}
@media (max-width: 1250px) {
    .layouts-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    margin: 4vh;
    justify-items: center;
    }
}
@media (max-width: 1024px) {
    .modal-and-map {
    display: flex;
    background-color: white;
    flex-direction: column;
    align-content: center;
    align-items: center;
    }
    .main-gallery {
        width: 100%;
        height: auto;
    }
    .current-main-image {
        width: 100%;
        height: auto;
    }
    .thumbnails-column {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: unset;
        gap: 10px;
        margin-top: 20px;
    }
    .thumbnail {
        width: 150px;
        height: 150px;
    }
    .specs-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    .complex-full-description-cards {
        flex-direction: column;
        align-items: center;
    }
    .complex-full-description-card {
        width: 90%;
        padding-top: 5vh;
        padding-bottom: 5vh;
    }
    .complex-info-card{
        padding-top: 5vh;
        padding-bottom: 5vh;
    }
    .layout-card {
        width: 90%;
    }
    .layout-image img {
        width: 100%;
    }
    .secondary-description {
        width: 90%;
        margin-left: 0;
        margin-right: 0;
    }
    .building-info-card-images {
        flex-direction: column;
        align-items: center;
        gap: 4vh;
    }
    .catalog-map-container {
        width: 100%;
        height: 50vh;
    }
}
@media (max-width: 768px) {
    .meta-grid {
        flex-direction: column;
        gap: 10px;
    }
    .thumbnail {
        max-width: 100px !important;
        max-height: 100px !important;
        min-width: 100px !important;
        min-height: 100px !important;
    }
    .complex-layout-param {
    margin-right: 1vh;
    margin-top: 1vh;
    color: #4B4B4B;
    font-size: medium;
    }
    .complex-info-block {
    flex: 1;
    margin: 0;
    }
    .complex-full-description-cards {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        gap: 2vh;
        justify-items: center;
    }
    .specs-grid {
        grid-template-columns: 1fr;
        margin: 0;
    }
    .secondary-description-scroll {
        font-size: 18px;
    }
    .card-footer {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
    }
    .complex-info-card {
        width: 100%;
        padding: 1vh;
    }
    .complex-full-description-card {
        width: 100%;
        padding: 5vh;
        display: flex;
        align-items: center;
    }
    .complex-full-description-img {
    object-fit: cover;
    flex-shrink: 0;
    }
    .complex-title {
        font-size: 20px;
    }
    .place-info {
        font-size: 20px;
    }
    .video-wrapper video {
        height: 60%;
        padding: 2vh;
    }
    .main-image-nav {
        width: 30px;
        height: 30px;
        font-size: 20px;
    }
    .lightbox-nav {
        width: 40px;
        height: 40px;
        font-size: 24px;
    }
    .lightbox-nav.prev {
        left: 10px;
    }
    .lightbox-nav.next {
        right: 10px;
    }
}
@media (max-width: 480px) {
    .secondary-description-card h3 {
        padding-top: 4vh;
        font-size: 13px;
    }
    .thumbnail {
        max-width: 60px !important;
        max-height: 60px !important;
        min-width: 60px !important;
        min-height: 60px !important;
    }
    .spec-item {
    padding: 5px;
    display: flex;
    align-items: center;
    gap: 10px;
    background: white;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    text-align: center;
    flex: 1;
    border-radius: 50px;
    box-sizing: border-box;
    max-height: 7vh;
    max-width: 40vh;
    min-width: 0vh;
    }
    .complex-description {
        font-size: 16px;
        margin-left: 0;
    }
    .scrollable-description,
    .complex-full-description-scroll {
        font-size: 16px;
        max-height: 200px;
    }
    .spec-image {
        width: 40px;
        height: 40px;
    }
    .image-container {
        width: 100%;
        height: 200px;
    }
    .modal-and-map {
        flex-direction: column;
    }
    .layouts-grid {
        display: grid;
        grid-template-columns: repeat(1, 1fr);
        margin: 4vh;
        justify-items: center;
    }
    .secondary-description {
        width: 100%;
    }
    .complex-layout-info-card {
        padding: 10px;
    }
}