.catalog-detail {
  display: flex;
  flex-direction: row;
  position: relative;
}
.catalog-detail img {
  display: inline-block;
  margin: 0 auto;
  max-height: 100%;
  max-width: 100%;
}

.catalog-detail__item .catalog-detail__main {
  min-width: 0;

  flex-grow: 1;
  flex-shrink: 0;
  flex-basis: 358px;

  container: side-info / inline-size;
}
.gallery-size-normal .catalog-detail__main {
  flex-basis: 56%;
}
.visible-by-container-rule {
  display: none;
}
@container side-info (width < 600px) {
  .catalog-detail__main .catalog-detail__main-parts {
    flex-direction: column;
    gap: 24px;
  }
  .catalog-detail__main .catalog-detail__main-part--right {
    max-width: none;
  }
  .visible-by-container-rule {
    display: block;
  }
  .hidden-by-container-rule {
    display: none;
  }
}

body .catalog-detail__main-parts {
  align-items: flex-start;
}
.catalog-detail__main-part--right {
  max-width: 358px;
  width: 100%;
}

@media (min-width: 1200px) {
  .catalog-detail__item,
  .catalog-detail__right-info {
    min-width: 0;
  }
}

@media (max-width: 1199px) {
  body .catalog-detail {
    display: block;
  }
}

@media (max-width: 1199px) and (min-width: 992px) {
  .catalog-detail__item .catalog-detail__top-info > div {
    flex: 1;
  }
}
@media (max-width: 991px) {
  .catalog-detail__item .catalog-detail__top-info {
    gap: 20px;
  }
  .catalog-detail__item .catalog-detail__main {
    flex-basis: 300px;
  }
}
@media (max-width: 767px) {
  .catalog-detail__item .catalog-detail__top-info {
    flex-direction: column;
  }
}


/* Product certificate block */
.product-certificate {
    background: #f8f8f8;
    border-radius: 12px;
    padding: 16px;
    text-align: center;
    transition: all 0.3s ease;
}

.product-certificate__title {
    color: var(--dark_text, #1a1a1a);
}

.product-certificate__image-wrapper {
    position: relative;
    cursor: pointer;
    display: inline-block;
    max-width: 100%;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    padding: 12px;
}

.product-certificate__image {
    max-width: 100%;
    max-height: 150px;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.product-certificate__image-wrapper:hover .product-certificate__image {
    transform: scale(1.05);
}

.product-certificate__zoom {
    position: absolute;
    bottom: 8px;
    right: 8px;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 50%;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.product-certificate__image-wrapper:hover .product-certificate__zoom {
    opacity: 1;
}

.product-certificate__placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 8px;
    color: #999;
    font-size: 12px;
    padding: 20px;
}

/* Modal window for product certificate */
.certificate-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 999999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.certificate-modal__overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.95);
    cursor: pointer;
    backdrop-filter: blur(8px);
}

.certificate-modal__container {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    z-index: 1000000;
}

.certificate-modal__close {
    position: absolute;
    top: -45px;
    right: 0;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    color: #fff;
    opacity: 0.8;
    transition: all 0.3s ease;
    z-index: 1000001;
    display: flex;
    align-items: center;
    justify-content: center;
}

.certificate-modal__close:hover {
    opacity: 1;
    transform: rotate(90deg);
    background: rgba(255, 255, 255, 0.3);
}

.certificate-modal__content {
    max-width: 100%;
    max-height: 90vh;
    overflow: auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.certificate-modal__image {
    max-width: 100%;
    max-height: 85vh;
    object-fit: contain;
    animation: modalFadeIn 0.3s ease;
    border-radius: 8px;
}

.certificate-modal__caption {
    margin-top: 16px;
    color: #fff;
    font-size: 14px;
    text-align: center;
    background: rgba(0, 0, 0, 0.6);
    padding: 6px 16px;
    border-radius: 30px;
}

@keyframes modalFadeIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

@media screen and (max-width: 576px) {
    .certificate-modal__close {
        top: 10px;
        right: 10px;
    }

    .certificate-modal__caption {
        font-size: 12px;
        margin-top: 12px;
    }
}