.detail-block {
  padding: 30px 0;
  max-width: 100%;
  overflow: hidden;
}

.detail-block__grid {
  display: flex;
  gap: 30px;
  max-width: 100%;
  max-height: 750px;
}

.detail-block__main-image {
  flex: 0 0 50%;
  position: relative;
  overflow: hidden;
  border-radius: 10px;
  max-height: 750px;
  max-width: 750px;
}

.detail-block__title-part {
  display: flex;
  flex-direction: column;
}

.detail-block__title {
  margin-bottom: 20px;
}

@media (max-width: 768px) {
  .detail-block__title {
    font-size: 22px;
  }
}

.detail-block__main-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  max-width: 100%;
}

.detail-block__right {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 30px;
  min-width: 0;
  max-width: 100%;
}

.detail-block__slider-wrapper {
  flex: 1;
  min-width: 0;
  max-width: 100%;
  display: flex;
  align-items: flex-end;
}

.detail-block__gallery-wrapper {
  flex: 0 0 230px;
  max-width: 230px;
  height: 100%;
  max-height: 750px;
  overflow: hidden;
  position: relative;
}

.detail-block__gallery {
  width: 100%;
  height: 100%;
}

.detail-block__gallery .swiper-wrapper {
  flex-direction: column;
  height: auto !important;
}

.detail-block__gal-item {
  width: 100%;
  height: 234px !important;
  flex-shrink: 0;
  position: relative;
  border-radius: 15px;
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
  border: 3px solid transparent;
}

.detail-block__gal-item.active {
  opacity: 1;
  border: 3px solid var(--colors-main);
}

.detail-block__gal-item .detail-block__img {
  width: 100%;
  height: 100%;
}

.detail-block__gal-item .detail-block__img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-block__gal-item-text {
  position: absolute;
  z-index: 2;
  bottom: 15px;
  left: 15px;
  border-radius: 5px;
  padding: 5px 10px;
  background: var(--bg-alt-main);
  color: var(--bg-primary-second);
  margin: 0;
  font-size: 14px;
}

.detail-block__gal-number {
  position: absolute;
  z-index: 2;
  top: 15px;
  left: 15px;
  font-size: 14px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  padding: 4px 10px;
  border-radius: 5px;
}

.detail-block .swiper {
  width: 100%;
  overflow: hidden;
  position: relative;
}

.detail-block .separator {
  height: 1px;
  width: 100%;
  background: var(--colors-main);
  margin-top: 10px;
  margin-bottom: 20px;
}

.detail-block .swiper-wrapper {
  width: 100%;
  display: flex;
  align-items: stretch;
}

.detail-block .swiper-slide {
  flex-shrink: 0;
  height: auto;
  box-sizing: border-box;
  overflow-wrap: break-word;
}

.detail-block .swiper-slide .h4 {
  margin-bottom: 20px;
}

.detail-block__slide-description {
  font-weight: 500;
  font-size: 17px;
  line-height: 140%;
  color: var(--text-primary-main);
}

.detail-block__counter-separator,
.detail-block__counter-total,
.slide-number .p1 {
  color: var(--colors-main);
}

.detail-block .slider-btn {
  border-radius: 100%;
  border: 1px solid var(--bg-alt-main);
  width: 54px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-primary-main);
  cursor: pointer;
  transition: var(--transition);
  flex-shrink: 0;
}

.detail-block .slider-btn svg {
  width: 16px;
  height: 16px;
  display: flex;
  flex-shrink: 0;
}

.detail-block .slider-btn svg path {
  stroke: var(--text-primary-head);
}

.detail-block .slider-btn:hover {
  background: var(--colors-main);
  border-color: var(--colors-main);
}

.detail-block .slider-btn:hover svg path {
  stroke: var(--bg-primary-main);
}

.detail-block .slider-btn--prev {
  transform: scale(-1);
}

.detail-block .swiper-button-disabled {
  border: 1px solid var(--bg-primary-second);
  background-color: var(--bg-primary-second);
  pointer-events: none;
  border-radius: 100%;
}

.detail-block .swiper-button-disabled svg path {
  stroke: var(--text-primary-second);
}

.detail-block .swiper-pagination {
  width: fit-content !important;
  position: relative;
  display: flex;
  margin-top: 0;
  justify-content: flex-start;
  bottom: 0 !important;
}

.detail-block .swiper-pagination-bullet {
  width: 10px;
  height: 10px;
  background-color: var(--bg-primary-stroke) !important;
  opacity: 1;
  border-radius: 50%;
  margin: 0 5px !important;
  cursor: pointer;
  transition: all 0.3s ease;
}

.detail-block .swiper-pagination-bullet-active {
  background-color: var(--bg-alt-main) !important;
}

.detail-block__nav-wrap {
  display: flex;
  align-items: center;
  gap: 20px;
  width: 100%;
}

.detail-block__bottom {
  margin-top: 30px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.detail-block__slider-btn-wrap {
  display: flex;
  width: 100%;
  justify-content: space-between;
  align-items: center;
  flex-shrink: 0;
}

@media (max-width: 1250px) {
  .detail-block__grid .detail-block__main-image,
  .detail-block__grid .detail-block__right,
  .detail-block__grid .detail-block__gallery-wrapper {
    order: 0 !important;
  }
  .detail-block__grid {
    flex-direction: column;
    max-height: unset;
    gap: 20px;
  }

  .detail-block__main-image {
    flex: 0 0 auto;
    max-width: 100%;
    aspect-ratio: 16/9;
  }

  .detail-block__right {
    flex-direction: column;
    gap: 20px;
  }

  .detail-block__gallery-wrapper {
    flex: 0 0 auto;
    max-width: 100%;
    height: auto;
    max-height: unset;
  }

  .detail-block__gallery .swiper-wrapper {
    flex-direction: row;
    height: auto !important;
  }

  .detail-block__gal-item {
    width: 200px;
    height: 200px;
    flex-shrink: 0;
  }
}

/* Мобилки */
@media (max-width: 600px) {
  .detail-block {
    padding: 30px 0;
  }

  .detail-block__slide-title {
    font-size: 28px;
    margin-bottom: 20px;
  }

  .detail-block__slide-description {
    font-size: 15px;
  }

  .detail-block__gal-item {
    width: 150px;
    height: auto !important;
  }

  .detail-block .slider-btn {
    width: 40px;
    height: 40px;
  }

  .detail-block .slider-btn svg {
    width: 12px;
    height: 12px;
  }

  .detail-block__nav-wrap {
    gap: 10px;
  }

  .detail-block__bottom {
    margin-top: 20px;
  }

  .detail-block__gal-item-text {
    font-size: 12px;
    bottom: 5px;
    left: 5px;
    padding: 3px 8px;
  }

  .detail-block__gal-number {
    font-size: 12px;
    top: 10px;
    left: 10px;
    padding: 2px 8px;
  }
}

/* Мелкие мобилки */
@media (max-width: 400px) {
  .detail-block__gal-item-text {
    font-size: 10px;
    padding: 1px 3px;
  }
  .detail-block__gal-item {
    width: 120px;
  }

  .detail-block__slide-title {
    font-size: 22px;
  }
}

/* Управление порядком элементов на десктопе */
.detail-block__main-image {
  order: 1;
}
.detail-block__right {
  order: 2;
}
.detail-block__gallery-wrapper {
  order: 3;
}

.location-left .detail-block__main-image {
  order: 2;
}
.location-left .detail-block__right {
  order: 1;
}

@media (max-width: 992px) {
  .detail-block__main-image,
  .detail-block__right,
  .detail-block__gallery-wrapper {
    order: 0;
  }
}
