/* === Основные стили === */
.gallery-wrapper {
  position: relative;
  background: #f8f9fa;
  /*border-radius: 16px;*/
  overflow: hidden;
  padding: 10px;
}

.gallery-main {
  position: relative;
  overflow: hidden;
  height: 550px;
  display: flex;
  justify-content: center;
  align-items: center;
}

.gallery-img {
  display: none;
  object-fit: contain;
  width: 100%;
  height: 100%;
  border-radius: 12px;
  transition: opacity 0.4s ease;
}

.gallery-img.active {
  display: block;
  opacity: 1;
}

.gallery-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(0, 0, 0, 0.5);
  border: none;
  color: white;
  font-size: 2rem;
  padding: 0.5rem 1rem;
  border-radius: 50%;
  cursor: pointer;
  z-index: 5;
  transition: background 0.3s;
}

.gallery-btn:hover {
  background: rgba(0, 0, 0, 0.8);
}

.prev-btn { left: 15px; }
.next-btn { right: 15px; }

.gallery-top-info {
  position: absolute;
  top: 10px;
  left: 15px;
  right: 15px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: #fff;
  font-weight: bold;
  z-index: 10;
}

#zoomToggle {
  background: rgba(255, 255, 255, 0.9);
  border-radius: 8px;
  border: none;
  cursor: pointer;
}

.gallery-thumbs {
  gap: 8px;
  overflow-x: auto;
  padding: 8px;
}

.gallery-main .gallery-img { display: none; }
.gallery-main .gallery-img.active { display: block; }
.gallery-thumbs .thumb-img.active { outline: 2px solid #64c1b1; outline-offset: 2px; }

.thumb-img {
  height: 80px;
  width: 100px;
  object-fit: cover;
  border-radius: 8px;
  opacity: 0.7;
  cursor: pointer;
  transition: transform 0.3s, opacity 0.3s;
}

.thumb-img:hover {
  opacity: 1;
  transform: scale(1.05);
}

.thumb-img.active {
  border: 2px solid #007bff;
  opacity: 1;
}

/* === Полноэкранный режим === */
/* fullscreen overlay */
#fullscreenOverlay { 
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  background: rgba(0,0,0,0.95);
  z-index: 9999; 
  flex-direction: column; 
  padding: 20px;
}
#fullscreenOverlay img.fs-image {
  max-width: 95%;
  max-height: 80vh;
  object-fit: contain; 
}
#fullscreenOverlay.d-block { display: flex !important; }

/* large nav in fullscreen */
.fs-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
}
.fs-prev { left: 20px; }
.fs-next { right: 20px; }

.fs-controls { position: absolute; top: 12px; left: 12px; right: 12px; display:flex; justify-content:space-between; align-items:center; color:#fff; z-index:10000; }
.fs-controls #fsCounter { background: rgba(0,0,0,0.5); padding:6px 10px; border-radius:8px; }

.fullscreen-active .gallery-main {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.95);
  z-index: 2000;
  display: flex;
  align-items: center;
  justify-content: center;
}

.fullscreen-active .gallery-img {
  object-fit: contain;
  max-height: 100vh;
  max-width: 100vw;
}

.fullscreen-active .gallery-btn {
  font-size: 2.5rem;
}

.fullscreen-active #zoomToggle {
  background: rgba(255, 255, 255, 0.8);
}

/* === Кнопка Добавить в корзину === */
#addToCartBtn {
  border-radius: 10px;
  font-weight: 600;
  transition: all 0.3s ease;
}

#addToCartBtn:hover {
  background-color: #198754;
  color: white;
}


.similar_items {
    /*box-shadow: 0px 0px 9px 0px black;*/
    /*margin: 10px;*/
}

.name_zag {
    height: 70%;
}

/*.styled-hr {*/
/*    position: relative;*/
/*    border: 1px solid black;*/
/*    background-image: url(../img/888.png);*/
/*    height: 1px;*/
/*    background-color: #000000;*/
/*    margin: 5% auto;*/
/*    width: 100%;*/
/*}*/


/*.styled-hr {*/
/*    display: block;*/
/*    width: 100%;*/
/*    height: 40px;*/
/*    background: url(../img/888.png ) no-repeat center!important;*/
/*    position: relative;*/
/*}*/

/*.styled-hr:before, .styled-hr:after {*/
/*    display: block;*/
/*    width: 46%;*/
/*    height: 1px;*/
/*    background: #d6dee2;*/
/*    position: absolute;*/
/*    top: 50%;*/
/*    content: "";*/
/*}*/

/*.styled-hr:after, .styled-hr:before {*/
/*    display: block;*/
/*    width: 46%;*/
/*    height: 1px;*/
/*    background: #d6dee2;*/
/*    position: absolute;*/
/*    top: 50%;*/
/*    content: "";*/
/*}*/


/* === Адаптивность === */

/* До 425px (мобильные) */
@media (max-width: 425px) {
  .gallery-main {
    height: 320px;
  }
  .thumb-img {
    height: 60px;
    width: 70px;
  }
  .gallery-btn {
    font-size: 1.4rem;
  }
  .zag {font-size: 30px;}
  .styled-hr { margin: 30% auto 10% auto; }
  .logo { display:none!important; }
  .imast { display:none!important; }
  .fs-nav { top: 20%;}
}

/* 425–768px (смартфоны/малые планшеты) */
@media (min-width: 426px) and (max-width: 768px) {
  .gallery-main {
    height: 380px;
  }
  .thumb-img {
    height: 70px;
    width: 85px;
  }
  .logo , .imast { display:none; }
  .fs-nav { top: 40%;}
}

/* 768–992px (планшеты) */
@media (min-width: 769px) and (max-width: 992px) {
  .gallery-main {
    height: 450px;
  }
    .fs-nav { top: 50%;}
    .logo , .imast { display:none; }
}

/* 992–1200px (ноутбуки) */
@media (min-width: 993px) and (max-width: 1200px) {
  .gallery-main {
    height: 520px;
  }
  .logo , .imast { display:none; }
}

/* >1200px (большие экраны) */
@media (min-width: 1201px) {
  .gallery-main {
    height: 600px;
  }
  
  #searchForm { padding-bottom: 0!important;}

/* fullscreen overlay */
#fullscreenOverlay { 
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  background: rgba(0,0,0,0.95);
  z-index: 9999; 
  flex-direction: column; 
  padding: 20px;
}
#fullscreenOverlay img.fs-image {
  max-width: 95%;
  max-height: 80vh;
  object-fit: contain; 
}
#fullscreenOverlay.d-block { display: flex !important; }

/* large nav in fullscreen */
.fs-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 3rem;
  color: #fff;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 8px 16px;
}
.fs-prev { left: 20px; }
.fs-next { right: 20px; }

.fs-controls { position: absolute; top: 12px; left: 12px; right: 12px; display:flex; justify-content:space-between; align-items:center; color:#fff; z-index:10000; }
.fs-controls #fsCounter { background: rgba(0,0,0,0.5); padding:6px 10px; border-radius:8px; }

/* ensure big gallery nav buttons visible on mobile */
.gallery-btn { width: 56px; height: 56px; font-size: 1.6rem; }
@media (max-width:425px) {
  .gallery-btn { width: 44px; height: 44px; font-size: 1.2rem; }
}

