/*  */
/* detail grid */
/*  */
.product-detail__container {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20.75rem;
  align-items: flex-start;
  gap: 2rem 1.5rem;
  .title_block {
    margin-bottom: 0;
  }
  .title_block,
  .product-detail__img-grid {
    grid-column: 1 / -1;
  }
  @media (width <= 991px) {
    grid-template-columns: minmax(0, 1fr);
  }
  @media (width <= 768px) {
    gap: 1.5rem;
  }
}

.product-detail {
  .product-detail__block {
    font-size: 0.875rem;
    line-height: 1.42857;
  }
  .rating {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-weight: 500;
    svg {
      color: var(--orange);
    }
    &:not(:last-child) {
      padding-right: 1.5rem;
      margin-right: 1.5rem;
      border-right: 1px solid var(--light-gray);
    }
  }
  .advantages {
    display: flex;
    flex-wrap: wrap;
    gap: 1.5rem;
    font-weight: 500;
    color: var(--black-sec);
    .advantages-item {
      display: flex;
      gap: 0.5rem;
      &:not(:last-child) {
        padding-right: 1.5rem;
        border-right: 1px solid var(--light-gray);
      }
    }
    .advantages-item-ico {
      width: 1.5rem;
      height: 1.5rem;
      flex-shrink: 0;
    }
    .advantages-item-text {
      margin: auto 0;
    }
  }
  .characteristics {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem 1rem;
    .characteristics-item {
      display: flex;
      gap: 0.5rem;
    }
    .characteristics-item-ico {
      width: 1.5rem;
      height: 1.5rem;
      color: var(--orange);
      flex-shrink: 0;
    }
    .characteristics-item-text {
      color: var(--black-sec);
      margin: auto 0;
    }
    @media (width <= 768px) {
      grid-template-columns: minmax(0, 1fr);
    }
  }
  @media (width <= 768px) {
    .rating {
      margin-right: auto;
      &:not(:last-child) {
        padding-right: 0;
        margin-right: auto;
        border-right: none;
      }
    }
    .advantages {
      flex-direction: column;
      .advantages-item {
        &:not(:last-child) {
          padding-right: 0;
          border-right: none;
        }
      }
    }
  }
}

/*  */
/* detail gallery */
/*  */
.product-detail__img-grid {
  --swiper-theme-color: #fff;
  --swiper-navigation-size: 32px;
  --swiper-navigation-sides-offset: 1rem;
  --swiper-pagination-bullet-size: 8px;
  --swiper-pagination-bullet-horizontal-gap: 1px;
  --swiper-navigation-top-offset: 50%;
  margin-bottom: 2rem;
  .product-detail__img-slider {
    position: relative;
    z-index: 1;
    border-radius: 1.5rem;
    overflow: clip;
    .swiper:not(.swiper-initialized) .swiper-slide:not(:first-child) {
      display: none;
    }
    .swiper-slide {
      height: auto;
      aspect-ratio: 1044 / 438;
      img {
        display: block;
        width: 100%;
        height: 100%;
        object-fit: cover;
      }
    }
  }
  .product-detail__img-thumbs {
    position: relative;
    margin-top: 0.5rem;
    .swiper:not(.swiper-initialized) .swiper-slide:not(:first-child) {
      display: none;
    }
    .swiper-slide {
      height: auto;
      max-width: 203px;
      img {
        display: block;
        width: 100%;
        height: 100%;
        border-radius: 1.5rem;
        object-fit: cover;
      }
    }
  }
  .swiper-pagination {
    display: none;
  }
  @media (width <= 768px) {
    position: relative;
    margin-bottom: 1.5rem;
    .swiper-pagination {
      display: block;
    }
    .product-detail__img-slider {
      .swiper-slide {
        aspect-ratio: 343 / 230;
      }
    }
    .product-detail__img-thumbs {
      position: static;
      .swiper {
        display: none;
      }
    }
  }
}

/*  */
/* detail mainpart */
/*  */
.product-detail__block {
  &.--inline-block {
    display: inline-flex;
    @media (width <= 768px) {
      display: flex;
    }
  }
}
.product-detail__body {
  .white-block {
    margin-bottom: 1rem;
    &:first-child {
      margin-top: 0;
    }
    &:last-child {
      margin-bottom: 0;
    }
  }
  .text-content {
    margin-top: 2rem;
  }
  @media (width <= 768px) {
    .text-content {
      margin-top: 1.5rem;
    }
  }
}

/*  */
/* detail sidebar */
/*  */
.product-detail__sidebar {
  position: sticky;
  top: 0;
  z-index: 2;
  grid-row: span 2;
  .current-price-old {
    font-size: 0.875rem;
    line-height: 1.4285714285714286;
    font-weight: 500;
    color: var(--gray-sec);
    white-space: nowrap;
    text-decoration: line-through;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  .current-price {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 2rem;
    line-height: 1.2;
    font-weight: bold;
    color: var(--black);
    white-space: nowrap;
    text-overflow: ellipsis;
    overflow: hidden;
  }
  .price-detail {
    display: none;
  }
  .buttons-section {
    margin-top: 0.5rem;
    .btn {
      width: 100%;
    }
  }

  .product-detail-sidebar__block-container {
    .product-detail-sidebar__block-header {
      display: none;
      font-size: 1.25rem;
      line-height: 1.33333;
      font-weight: 600;
    }
  }
  .price-section {
    margin-top: 1.5rem;
    .price-section-subtitle {
      font-weight: 600;
    }
    .price-section-items {
      margin-top: 1rem;
    }
    .price-section-subtitle {
      color: var(--black);
      font-weight: bold;
    }
    .price-section-item {
      display: flex;
      gap: 0.5rem;
      margin-top: 0.5rem;
      font-size: 0.875rem;
      line-height: 1.4285714285714286;
      font-weight: 500;
      color: var(--black-sec);
    }
    .price-section-dots {
      position: relative;
      flex-grow: 1;
      min-width: 1rem;
      overflow: hidden;
      &:after {
        content: "";
        position: absolute;
        top: 0.75rem;
        left: -25%;
        width: 150%;
        height: 0;
        border-bottom: 1px dashed var(--gray-sec);
      }
    }
    .price-section-val {
      flex-shrink: 0;
      font-weight: 600;
    }
  }
  @media (width <= 768px) {
    position: fixed;
    right: 0;
    left: 0;
    top: auto;
    bottom: 0;
    padding: 0.75rem 1rem;
    background: #fff;
    z-index: 201;
    transition: translate 0.2s ease;
    &.--hidden {
      translate: 0 100%;
    }
    .current-price {
      margin-top: 0;
      font-size: 1rem;
      line-height: 1.2;
    }
    .price-detail {
      display: block;
    }
    .buttons-section {
      margin-top: 0;
    }
    .product-detail-sidebar__header {
      display: grid;
      grid-template-columns: repeat(2, minmax(0, 1fr));
      gap: 1rem;
    }
    .product-detail-sidebar__block-container {
      position: fixed;
      top: 0;
      left: 0;
      width: 0;
      height: 0;
      background: #000c;
      z-index: -1000;
      opacity: 0;
      overflow: hidden;
      transition: opacity 0.2s ease;
      &.active {
        width: 100%;
        height: 100%;
        opacity: 1;
        overflow: auto;
        z-index: 200;
      }
      .product-detail-sidebar__block {
        margin: 1rem;
        padding: 1rem;
        background: #fff;
        border-radius: 1.5rem;
      }
      .product-detail-sidebar__block-header {
        display: flex;
        align-items: center;
        justify-content: space-between;
      }
    }
    .price-section {
      margin-top: 1rem;
    }
  }
}

/*  */
/* product-detail__epilog */
/*  */
.product-detail__epilog {
}

/*  */
/* page-detail */
/*  */
.page-detail-img {
  display: block;
  border-radius: 1.5rem;
  background: var(--light-gray-bg);
  margin-bottom: 2rem;
  img {
    display: block;
    height: 27.375rem;
    width: 100%;
    border-radius: 1.5rem;
    object-fit: cover;
  }
  @media (width <= 768px) {
    margin-bottom: 1rem;
    img {
      height: 14.375rem;
    }
  }
}
.page-detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 2rem;
  .page-detail-tag {
    font-size: 0.875rem;
    line-height: 1.4285714285714286;
    font-weight: 600;
    color: var(--black);
    padding: 0.75rem 1rem;
    border-radius: 2rem;
    background: var(--light-gray-bg);
    color: var(--black);
  }
  @media (width <= 768px) {
    margin-bottom: 1rem;
  }
}
