.product-detail__state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  min-height: 360px;
  color: var(--color-secondary);
}

.product-detail__back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--color-primary);
  font-size: 14px;
  font-weight: 600;
  transition: opacity 0.2s ease;
}

.product-detail__back:hover {
  opacity: 0.75;
}

.product-detail__top {
  padding-top: 12px;
}

.product-detail .page-header {
  margin-top: 8px;
}

.product-detail .page-header__breadcrumbs {
  display: block;
}

.product-detail__state--error {
  color: #9b2c2c;
}

.product-detail__spinner {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  border: 3px solid rgba(143, 65, 12, 0.15);
  border-top-color: var(--color-primary);
  animation: spin 0.8s linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

.product-detail__grid {
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: 24px;
  align-items: start;
  margin-top: 64px;
  margin-bottom: 80px;
}

.product-images {
  display: grid;
  grid-template-columns: 1fr 3.25fr;
  gap: 16px;
  align-items: start;
}

.product-images__main img,
.product-images__thumbs img {
  aspect-ratio: 1 / 1;
  width: 100%;
  object-fit: cover;
  display: block;
  border-radius: 16px;
}

.product-images__thumbs {
  display: flex;
  flex-direction: column;
  gap: 12px;
  order: -1;
}

.product-images__thumbs button {
  border: 1px solid transparent;
  background: none;
  padding: 0;
  border-radius: 16px;
  overflow: hidden;
  cursor: pointer;
}

.product-images__thumbs button.is-active {
  border-color: var(--color-primary);
}

.product--name {
  color: var(--color-gray-400);
  font-size: clamp(18px, 4vw, 28px);
  font-weight: 400;
  margin: 0 0 12px;
}

.product-detail__meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 28px;
}

.product-detail__rating {
  display: flex;
  gap: 2px;
  color: var(--color-secondary);
}

.product--price {
  color: var(--color-primary);
  font-size: clamp(17px, 4vw, 35px);
  white-space: nowrap;
}

.product--currency-unit {
  color: var(--color-gray-400);
  font-size: clamp(12px, 4vw, 19px);
}

.product-detail__block {
  margin-bottom: 20px;
}

.caption__title {
  color: var(--color-primary);
  font-size: clamp(9px, 3vw, 18px);
  margin-bottom: 8px;
}

.caption__title .caption__text {
  display: inline;
}

.caption__text {
  color: var(--color-secondary);
  font-size: clamp(8px, 3vw, 16px);
  line-height: 30px;
  text-align: justify;
  margin: 0;
}

.product-detail__cart-wrap {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 12px;
}

.product-detail__cart {
  margin-top: 0;
}

.qty-stepper {
  display: inline-flex;
  align-items: center;
  gap: 0;
  border: 1px solid rgba(143, 65, 12, 0.18);
  border-radius: 12px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.55);
}

.qty-stepper__btn {
  width: 40px;
  height: 42px;
  border: none;
  background: transparent;
  color: var(--color-primary);
  display: grid;
  place-items: center;
}

.qty-stepper__btn:hover {
  background: rgba(143, 65, 12, 0.06);
}

.qty-stepper__input {
  width: 64px;
  height: 42px;
  border: none;
  border-inline: 1px solid rgba(143, 65, 12, 0.12);
  background: transparent;
  text-align: center;
  font-family: inherit;
  font-size: 15px;
  color: var(--color-primary);
  font-weight: 700;
  -moz-appearance: textfield;
}

.qty-stepper__input::-webkit-outer-spin-button,
.qty-stepper__input::-webkit-inner-spin-button {
  -webkit-appearance: none;
  margin: 0;
}

.product-detail__description {
  margin-top: 48px;
  margin-bottom: 24px;
  padding-top: 32px;
  border-top: 1px solid rgba(143, 65, 12, 0.12);
}

.product-detail__description-body {
  color: var(--color-secondary);
  font-family: Doran, sans-serif !important;
  font-size: clamp(13px, 2.2vw, 16px);
  line-height: 1.9;
  text-align: justify;
}

.product-detail__description-body,
.product-detail__description-body :where(*) {
  font-family: Doran, sans-serif !important;
}

.product-detail__description-body :where(p, ul, ol, h1, h2, h3, h4, h5, h6, div) {
  margin: 0 0 12px;
}

.product-detail__description-body :where(h1, h2, h3, h4, h5, h6) {
  color: var(--color-primary);
  font-weight: 700;
  line-height: 1.5;
}

.product-detail__description-body :where(ul, ol) {
  padding-inline-start: 1.4em;
}

.product-detail__description-body :where(li) {
  margin-bottom: 6px;
}

.product-detail__description-body :where(a) {
  color: var(--color-primary);
  text-decoration: underline;
}

.product-detail__description-body :where(img) {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  margin: 12px 0;
}

.product-detail__description-body :where(b, strong) {
  color: var(--color-gray-400);
  font-weight: 700;
}

.product-detail__related {
  margin-top: 80px;
  padding-bottom: 60px;
}

.product-detail__related-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 40px;
}

.product-detail__related-icon {
  width: 70px;
  height: auto;
}

.product-detail__related-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}

.product-detail__related-empty {
  color: var(--color-secondary);
  text-align: center;
  padding: 40px 0;
}

.product-detail__related-actions {
  display: flex;
  justify-content: center;
  margin-top: 36px;
}

@media (max-width: 1024px) {
  .product-detail__grid {
    grid-template-columns: 1fr;
    margin-top: 20px;
    margin-bottom: 48px;
    gap: 20px;
  }

  .product-images {
    grid-template-columns: 1fr;
  }

  .product-images__thumbs {
    order: 1;
    flex-direction: row;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: 4px;
  }

  .product-images__thumbs button {
    width: 72px;
    flex-shrink: 0;
  }

  .product-detail__related-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .product-detail__related-icon {
    display: none;
  }

  .product-detail__related {
    margin-top: 48px;
    padding-bottom: 40px;
  }

  .product-detail__related-title {
    margin-bottom: 24px;
    justify-content: center;
  }

  .product-detail .page-header {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    margin-bottom: 16px;
  }

  .product-detail .page-header__breadcrumbs {
    display: block;
    width: 100%;
  }

  .product-detail .page-header__breadcrumbs ol {
    justify-content: center;
    padding: 8px 0 0;
    font-size: 12px;
  }
}

@media (max-width: 600px) {
  .product-detail__top {
    padding-top: 8px;
  }

  .product-detail__back {
    font-size: 13px;
  }

  .product-detail__meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 10px;
    margin-bottom: 20px;
  }

  .product-detail__cart-wrap {
    width: 100%;
    justify-content: stretch;
    flex-direction: column;
    align-items: stretch;
  }

  .product-detail__cart-wrap .qty-stepper {
    width: 100%;
    justify-content: space-between;
  }

  .product-detail__cart-wrap .qty-stepper__btn {
    width: 48px;
    height: 46px;
  }

  .product-detail__cart-wrap .qty-stepper__input {
    flex: 1;
    height: 46px;
  }

  .product-detail__cart {
    width: 100%;
    justify-content: center;
  }

  .caption__text {
    line-height: 1.7;
  }

  .product-detail__description {
    margin-top: 28px;
    padding-top: 20px;
  }
}
