/**
 * Block Styles: Two Column Content
 *
 * Clean 2-column layout:
 * - left WYSIWYG
 * - right gallery or WYSIWYG
 * - optional mirror
 */

.text-gallery {
  position: relative;
  overflow: hidden;
}

/* если spacing уже идет через agency_get_block_spacing,
   тут не ставим padding, чтобы не было лишних отступов */
.text-gallery .container {
  position: relative;
}

.text-gallery__row {
  align-items: center;
}

.text-gallery__col {
  min-width: 0;
}

/* Text */
.text-gallery__text,
.text-gallery__right-text {
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
}

.text-gallery .text-content {
  margin-bottom: 0;
}

.text-gallery .text-content p,
.text-gallery .text-content li {
  color: var(--brand-primary-text-color);
  font-size: 1rem;
  line-height: 1.65;
}

.text-gallery .text-content p:last-child,
.text-gallery .text-content ul:last-child,
.text-gallery .text-content ol:last-child {
  margin-bottom: 0;
}

.text-gallery .text-content ul {
  padding-left: 1.5rem;
  list-style: disc;
}

.text-gallery .text-content ol {
  padding-left: 1.5rem;
  list-style: decimal;
}

.text-gallery .text-content li {
  margin-bottom: 0.6rem;
}

.text-gallery .text-content strong,
.text-gallery .text-content b {
  font-weight: 800;
}

.text-gallery .text-content h2,
.text-gallery .text-content h3,
.text-gallery .text-content h4 {
  color: var(--brand-header-text-color);
  font-weight: 800;
  letter-spacing: -0.035em;
}

.text-gallery .text-content h2 {
  font-size: clamp(1.6rem, 2.4vw, 2.25rem);
  line-height: 1.15;
}

.text-gallery .text-content h3 {
  font-size: clamp(1.35rem, 2vw, 1.75rem);
  line-height: 1.15;
}

/* Gallery wrapper */
.text-gallery__gallery,
.text-gallery .custom-product-gallery {
  width: 100%;
  background: transparent;
  border: 0;
  box-shadow: none;
  padding: 0;
  margin: 0;
  overflow: visible;
}

/* Main image */
.text-gallery .custom-product-main-image {
  padding: 0;
  min-height: 340px;

  display: flex;
  align-items: center;
  justify-content: center;
}

.text-gallery .custom-product-main-image img {
  display: block;
  width: auto;
  height: auto;
  min-height: 300px !important;
  min-width: 300px !important;
  max-width: 300px !important;
  max-height: 300px !important;
  object-fit: contain;
}

/* Thumbnails row */
.text-gallery .custom-product-thumbs-wrap {
  position: relative;
  width: 100%;
  min-width: 0;

  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1rem;

  margin-top: 2rem;
}

.text-gallery .custom-product-thumbs {
  display: flex;
  justify-content: center;
  gap: 1rem;

  flex: 0 1 auto;
  min-width: 0;
  max-width: calc(100% - 96px);

  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
}

.text-gallery .custom-product-thumbs::-webkit-scrollbar {
  display: none;
}

.text-gallery .custom-product-thumb {
  width: 90px;
  height: 90px;
  flex: 0 0 90px;

  display: flex;
  align-items: center;
  justify-content: center;

  border: 1px solid #eee;
  background: #fff;
  padding: 8px;

  cursor: pointer;
  transition:
    border-color 0.2s ease,
    transform 0.2s ease;
}

.text-gallery .custom-product-thumb:hover {
  transform: translateY(-2px);
}

.text-gallery .custom-product-thumb.is-active {
  border-color: var(--brand-accent-color);
}

.text-gallery .custom-product-thumb img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* Gallery arrows */
.text-gallery .gallery-scroll-btn {
  width: 32px;
  height: 32px;
  flex: 0 0 32px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  border: 0;
  border-radius: 999px;
  background: var(--brand-accent-color);
  color: #fff;

  cursor: pointer;
  transition:
    transform 0.2s ease,
    background-color 0.2s ease;
}

.text-gallery .gallery-scroll-btn:hover {
  transform: translateY(-1px);
  background: var(--brand-accent-color-hover, var(--brand-accent-color));
}

.text-gallery .gallery-scroll-btn svg {
  width: 20px;
  height: 20px;
}

/* Light text variant */
.light-text .text-gallery .text-content p,
.light-text .text-gallery .text-content li {
  color: rgba(255, 255, 255, 0.85);
}

.light-text .text-gallery .text-content h2,
.light-text .text-gallery .text-content h3,
.light-text .text-gallery .text-content h4 {
  color: #fff;
}

/* Responsive */
@media (max-width: 991.98px) {
  .text-gallery__row {
    row-gap: 3rem;
  }

  .text-gallery .custom-product-main-image {
    min-height: 300px;
  }

  .text-gallery .custom-product-main-image img {
    max-height: 300px !important;
    max-width: 300px !important;
  }

  .text-gallery .custom-product-thumbs-wrap {
    margin-top: 1.5rem;
  }
}

@media (max-width: 575.98px) {
  .text-gallery__row {
    row-gap: 2rem;
  }

  .text-gallery .custom-product-main-image {
    min-height: 240px;
  }

  .text-gallery .custom-product-main-image img {
    max-height: 260px;
  }

  .text-gallery .custom-product-thumbs-wrap {
    gap: 0.65rem;
    margin-top: 1.25rem;
  }

  .text-gallery .custom-product-thumbs {
    max-width: calc(100% - 76px);
    gap: 0.65rem;
  }

  .text-gallery .custom-product-thumb {
    width: 72px;
    height: 72px;
    flex-basis: 72px;
  }

  .text-gallery .gallery-scroll-btn {
    width: 30px;
    height: 30px;
    flex-basis: 30px;
  }
}
