:root {
    --gap: 20px;
    --items-visible: 3;
}

.main-container {
    
    justify-content: center;
    align-items: flex-start;
    gap: 30px;
     max-width:90%; 
    
}

/* Карусель */
.modern-carousel {
    display: flex;
    align-items: center;
    flex-grow: 1;
    position: relative;
    max-width:100%; 
}

.m-viewport {
    overflow: hidden;
    width: 100%;
    border-radius: 20px;
}

.m-track {
    display: flex;
    gap: var(--gap);
    transition: transform 0.5s cubic-bezier(0.25, 1, 0.5, 1);
    padding: 10px 0;
}

.m-item {
    flex: 0 0 calc((100% - (var(--gap) * (var(--items-visible) - 1))) / var(--items-visible));
    aspect-ratio: 4 / 3; /* Большие элементы */
    border-radius: 15px;
    overflow: hidden;
    cursor: pointer;
    box-shadow: 0 10px 20px rgba(0,0,0,0.1);
    transition: 0.3s;
}

.m-item:hover { transform: translateY(-5px); box-shadow: 0 15px 30px rgba(0,0,0,0.2); }
.m-item img { width: 100%; height: 100%; object-fit: cover; }

.m-nav-btn {
    background: white; border: none; width: 45px; height: 45px; border-radius: 50%;
    cursor: pointer; box-shadow: 0 4px 10px rgba(0,0,0,0.1); font-size: 18px;
    position: absolute; z-index: 10; transition: 0.3s;
}
.m-nav-btn:hover { background: #007bff; color: white; }
.m-nav-btn.prev { left: -25px; }
.m-nav-btn.next { right: -25px; }
.m-nav-btn:disabled { opacity: 0; pointer-events: none; }

.xoverlay {
	position: relative;
	overflow: hidden;
	perspective: 300px;	
	margin: 10px;
}

.x-zoom .xoverlay-box { 
  width: 100%; 
  height: 100%; 
  position: absolute; 
  left: 0; 
  right: 0; 
  bottom: 0; 
  top: 0; 
  overflow: hidden; 
  transform: scale(0, 0);  
  transition: all .3s; 
  display: flex;
  justify-content: center;
  align-items: center;
} 


.x-zoom:hover .xoverlay-box { 
  width: 100%; 
  height: 100%; 
  position: absolute; 
  left: 0; 
  right: 0; 
  bottom: 0; 
  top: 0; 
  overflow: hidden; 
  background: #1d4fd8a7; 
  transform: scale(1, 1); 
  z-index: 3; 
}


.xoverlay-box .gallery-icon {
  background-image: url("../images/gallery.a0c8df5341ef.svg"); 
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain; 
  position: relative; 
  z-index: 5; 
  width: 50px; 
  height: 50px;
}


.lightbox-overlay {
    position: fixed;
    top: 0; left: 0; width: 100vw; height: 100vh;
    background: rgba(0, 0, 0, 0.70);
    display: none; justify-content: center; align-items: center;
    z-index: 999999 !important; 
    backdrop-filter: blur(10px);
}

.lb-image-stage {
    position: relative; width: 90%; height: 85%;
    display: flex; flex-direction: column; align-items: center; justify-content: center;
}

#lb-main-img {
    max-width: 100%; max-height: 100%;
    object-fit: contain; animation: zoomIn 0.3s ease;
}

@keyframes zoomIn { from { opacity: 0; transform: scale(0.7); } to { opacity: 1; transform: scale(1); } }

.lightbox-overlay {
    position: fixed;
    top: 0; 
    left: 0; 
    width: 100%; 
    height: 100%;
    background: rgba(0, 0, 0, 0.9);
    display: none; /* БЫЛО flex, СТАЛО none */
    justify-content: center; 
    align-items: center;
    z-index: 99999; 
    backdrop-filter: blur(10px);
}


.lb-nav-btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 50px;
    height: 50px;
    background-color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
    z-index: 10001;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;    
    
    font-size: 0; 
    color: #333;
    outline: none;
}


.lb-nav-btn::after {
    content: '';
    display: block;
    width: 12px;
    height: 12px;
    border-top: 3px solid currentColor;
    border-right: 3px solid currentColor;
}


.lb-prev {
    left: 25px;
}
.lb-prev::after {
    transform: rotate(-135deg);
    margin-left: 5px; 
}


.lb-next {
    right: 25px;
}
.lb-next::after {
    transform: rotate(45deg);
    margin-right: 5px; 
}


.lb-nav-btn:hover {
    background-color: #007bff;
    color: white;
    transform: translateY(-50%) scale(1.1);
}


.lb-nav-btn:disabled {
    opacity: 0.3;
    cursor: default;
    pointer-events: none;
}


.lb-info {
    color: white;
    text-align: center;
    margin-top: 15px;
    font-family: sans-serif;
    font-size: 14px;
    opacity: 0.8;
}


#lb-main-img {
    max-width: 90vw;
    max-height: 80vh;
    border-radius: 4px;
    box-shadow: 0 0 30px rgba(0,0,0,0.5);
}

.lb-close-btn { position: absolute; top: 20px; right: 30px; color: white; font-size: 50px; cursor: pointer; }
.lb-counter { color: #888; margin-top: 20px; font-size: 18px; letter-spacing: 2px; }