.modal__gallery {
  width: 100%;
  height: 100%;
  max-width: 1280px;
  overflow: auto;
  gap: 0 !important;
  padding-top: 0 !important;
}

.modal__gallery .modal__header {
  padding: 15px 0 !important;
}

.gallery-cat-swiper {
  height: auto !important;
}

.modal__gallery::-webkit-scrollbar {
  width: 6px;
}

.modal__gallery::-webkit-scrollbar-thumb {
  background: linear-gradient(to bottom, #fff, #1f78ff);
  border-radius: 6px;
}

.modal__gallery::-webkit-scrollbar-thumb:hover {
  background: linear-gradient(to bottom, #fff, #1f78ff);
}

.modal__gallery::-webkit-scrollbar-track {
  background: #fff;
}

.modal__gallery--switch {
  z-index: 1;
  position: sticky;
  top: 75px;
  background: #fff;
}

.images-header {
  text-align: center;
  font-size: 24px;
  font-weight: bold;
  color: #4a4a4a;
  position: relative;
}

.images-header::before {
  position: absolute;
  content: "";
  width: 100%;
  right: 0;
  height: 1px;
  background-color: #f0f0f0;
  top: 21px;
  z-index: 1;
}

.images-header--title {
  background-color: #fff;
  z-index: 2;
  position: relative;
  padding: 0 17px;
}

.images-header::before {
  left: 0;
  right: unset;
}

.gallery__switch--images,
.gallery__switch--videos {
  text-align: center;
  font-weight: 500;
  font-size: 1rem;
  padding: 10px;
  cursor: pointer;
  user-select: none;
  flex-grow: 1;
  border-bottom: 2px solid transparent;
}

.gallery-cat-swiper .swiper-wrapper {
  margin: 15px 0;
  height: auto !important;
}

.gallery-cat-swiper .swiper-slide {
  width: max-content;
  flex-shrink: 0;
}

.gallery__category-item {
  display: flex;
  align-items: center;
  gap: 5px;
  min-width: max-content;
  width: max-content;
  position: relative;
  background: #f8f8f8;
  border-radius: 16px;
  padding: 8px 15px;
}

.gallery__category--icon {
  width: 18px;
  height: 18px;
}

.gallery__category--title {
  font-size: 16px;
  color: #4a4a4a;
  font-weight: 400;
}

.gallery__category-item.active {
  background: #4e85da1f;
  color: #2563eb;
  font-weight: bold;
  pointer-events: none;
}

.gallery__category-item.active .gallery__category--title {
  font-weight: bold;
  color: #0059ff;
}

.gallery__category-item.active .gallery__category--icon {
  filter: var(--filter-priymary-color);
  -webkit-filter: var(--filter-priymary-color);
}

.modal__gallery .modal__content {
  display: flex;
  flex-direction: column;
  gap: 15px;
  overflow: unset !important;
}

.modal__gallery--img-tab {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(5, auto);
  gap: 14px;
}

.modal__gallery--video {
  grid-column: span 2;
}

.modal__gallery--video-tab {
  display: none;
}

.modal__gallery--item {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.modal__gallery--label {
  display: flex;
  width: max-content;
  align-items: center;
  gap: 8px;
  padding: 12px 35px;
  background-color: var(--body-back);
  border-radius: var(--border-radius-btn);
}

.modal__gallery--label .gallery__label--title {
  color: var(--gray-dark);
  font-size: 1rem;
  font-weight: 500;
}

.modal__gallery--images {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  grid-template-rows: repeat(5, auto);
  gap: 4px;
}

.modal__gallery--img-tab a {
  outline: none;
  overflow: hidden;
  display: block;
  border-radius: 16px;
  position: relative;
}

.modal__gallery--img {
  max-height: 300px;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 16px;
  cursor: pointer;
  transform: scale(1.15);
  transition: transform var(--time-fast);
  background: #eee;
}

.modal__gallery--video-tab .plyr {
  border-radius: var(--border-radius-img);
}

.videos__tab .modal__gallery--categories {
  display: none;
}

.videos__tab .modal__gallery--img-tab {
  display: none;
}

.videos__tab .modal__gallery--video-tab {
  display: grid;
  gap: 5px;
  grid-template-columns: repeat(auto-fit, minmax(calc(290px - 0.3rem), 1fr));
}

.images__tab .gallery__switch--images,
.videos__tab .gallery__switch--videos {
  background-color: var(--body-back);
  color: var(--text-blue);
  border-color: var(--text-blue);
}

#galleryModal {
  opacity: 1;
  transition: opacity 0.2s ease;
  margin: 10px 0;
}

#galleryModal.is-filtering {
  opacity: 0;
}

.gallery .swiper-slide video {
  width: 100%;
  height: 100%;
}

.gallery .swiper-slide img,
.gallery .swiper-slide video {
  background-color: var(--gray);
  aspect-ratio: 16 / 9;
}

/* Start Gallery */
.gallery-swiper .swiper-pagination {
  bottom: var(--swiper-pagination-bottom, 8px);
  transition: all var(--time-fast);
}

.gallery-swiper .plyr__controls {
  bottom: -40px;
  transition: all var(--time-fast);
}
.gallery-swiper .plyr.show .plyr__controls {
  bottom: 0;
}

.gallery-swiper .swiper-slide {
  border-radius: 12px;
  overflow: hidden;
  -webkit-border-radius: 12px;
  -moz-border-radius: 12px;
  -ms-border-radius: 12px;
  -o-border-radius: 12px;
}

.gallery__icons {
  display: flex;
  align-items: center;
  gap: 5px;
  position: absolute;
  bottom: 15px;
  right: 15px;
  z-index: 11;
  transition: all var(--time-fast);
}

.gallery__icons--hidden {
  opacity: 0;
  visibility: hidden;
}

.gallery__icons--item {
  padding: 0;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: var(--border-radius-card);
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  /* display: none; */
}

.gallery__hover::after {
  content: "";
  position: absolute;
  width: 100%;
  height: 100%;
  z-index: 2;
  top: 0;
}

.gallery__active--content {
  position: absolute;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  width: 100%;
  height: 100%;
  background-color: rgba(0, 0, 0, 0.5);
  z-index: 2;
  top: 0;
  right: 0;
  font-size: 1.2rem;
  color: var(--white);
  font-weight: 500;
}

.gallery .plyr__video-wrapper,
.gallery .plyr__poster {
  background-color: var(--gray);
}
.gallery .plyr__poster {
  background-size: cover;
}
.gallery .plyr--fullscreen-enabled .plyr__poster {
  pointer-events: none;
}

.gallery-swiper {
  height: 300px;
  width: 100%;
}
.gallery-swiper figure {
  position: relative;
}

.gallery-poster {
  position: absolute;
  top: 0;
  right: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: 1;
  transition: opacity var(--time-fast);
}

.gallery-swiper.video__playing .gallery-poster {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.gallery-swiper .plyr--video,
.gallery-swiper figure {
  height: 100%;
}

.gallery-swiper .swiper-pagination-bullet {
  background: var(--white);
  opacity: 0.4;
  transition: width var(--time-fast);
}

.gallery-swiper .swiper-pagination-bullet-active {
  width: 24px;
  opacity: 0.8;
  border-radius: var(--radius-big);
}

.number__slider {
  position: absolute;
  bottom: 15px;
  left: 15px;
  padding: 6px 8px;
  z-index: 11;
  background-color: rgba(255, 255, 255, 0.6);
  border-radius: 8px;
  font-size: 0.8rem;
  color: var(--text-dark);
  display: flex;
  align-items: center;
  gap: 5px;
  transition: bottom 0.2s;
  height: 34px;
}

.number__slider.off,
.gallery__icons.off {
  bottom: -60px;
}

.number__slider span {
  height: 17px;
  color: #101828;
}

.gallery-swiper-button-prev,
.gallery-swiper-button-next {
  background: rgba(255, 255, 255, 0.6);
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

.gallery-swiper-button-prev:after,
.gallery-swiper-button-next:after {
  color: #333 !important;
  font-size: 17px;
}

/* به‌جای swiper-button-disabled، از کلاس اختصاصی خودمون استفاده می‌کنیم */
.gallery-swiper-button-prev.nav-btn-hidden,
.gallery-swiper-button-next.nav-btn-hidden {
  opacity: 0;
  pointer-events: none;
}

@media screen and (min-width: 801px) {
  .gallery .swiper-slide img:not(.gallery-poster):not(.control__video--play) {
    display: block;
    width: 103%;
    height: 100%;
    object-fit: cover;
    top: 0px;
    left: 5px;
    position: relative;
  }
  .gallery__category-item {
    cursor: pointer;
  }

  .modal__gallery {
    height: auto !important;
    max-height: 90% !important;
  }
}

@media screen and (max-height: 640px) {
  .images-header--title {
    display: none;
  }

  .modal__gallery--switch {
    position: unset;
  }

  .gallery-cat-swiper {
    margin-top: 35px;
  }
}

@media screen and (min-width: 800px) {
  .gallery-swiper-button-prev,
  .gallery-swiper-button-next {
    display: none !important;
  }
}

@media screen and (max-width: 800px) {
  .control__video {
    width: 35px;
    height: 35px;
  }
  .control__video img {
    width: 20px !important;
  }
  .gallery .swiper-slide img:not(.gallery-poster):not(.control__video--play) {
    display: block;
    object-fit: cover;
    position: relative;
    width: 103%;
    height: 100%;
    left: 7px;
    transform: scaleX(1.15);
  }
  .gallery .swiper-slide video {
    width: 103% !important;
  }
  .gallery-swiper .swiper-slide {
    border-radius: 0;
    -webkit-border-radius: 0;
    -moz-border-radius: 0;
    -ms-border-radius: 0;
    -o-border-radius: 0;
  }
  :root {
    --panoramaPhotoHeight: 222px;
  }

  .images-header {
    font-size: 18px;
  }

  .gallery__category--title {
    font-size: 14px;
  }

  .ab-galleryThumbnails {
    margin-bottom: 15px;
    gap: 20px;
  }

  .panorama {
    padding: 1px !important;
  }

  .modal__gallery--img-1 {
    grid-row: span 1;
    height: 90px;
  }

  .modal__gallery--img-2 {
    height: 190px;
    grid-row: span 2;
  }

  .modal__gallery--img-3 {
    height: 190px;
    grid-row: span 2;
  }

  .modal__gallery--img-4 {
    grid-row: span 1;
    height: 90px;
  }

  .modal__gallery--img-5 {
    grid-row: span 2;
    grid-column: span 2;
    height: 185px;
  }
}

.modal__gallery .modal__header {
  position: sticky;
  top: 0;
  background: #fff;
  z-index: 6;
  width: 100%;
  border: none !important;
}

@media screen and (min-width: 520px) and (max-width: 800px) {
  .modal__gallery--img-1 {
    grid-row: span 1;
    height: 130px;
  }

  .modal__gallery--img-4 {
    grid-row: span 1;
    height: 130px;
  }
}
