/* Product detail layout.
   Scope: product detail page only.
   Header, homepage, reviews and recommendations are not touched.
   CSS/UI policy: no forced CSS overrides, no override-kasha. */

:root {
  --agro-green: #10c44c;
  --agro-green-dark: #0d9f3e;
  --agro-border: #e7edf0;
  --agro-text: #1f2933;
  --agro-muted: #667085;
  --agro-link-blue: #0099f7;
  --agro-link-red: #ff4053;
}

/* Верх карточки: два фото слева, инфо-куб справа. */
.product-detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 980px) minmax(460px, 500px);
  gap: 16px;
  align-items: stretch;
  justify-content: space-between;
  width: calc(100% - 24px);
  margin: 0 12px 18px;
}

.product-detail-hero .top_product_card {
  width: 100%;
  max-width: 980px;
  margin-left: 0;
  margin-right: 0;
}

.product-detail-photos {
  min-width: 0;
  overflow: hidden;
}

.product-detail-photos .photos,
.top_product_card.product-detail-photos .photos {
  gap: 10px;
  column-gap: 10px;
  row-gap: 10px;
  align-items: stretch;
}

.product-detail-sidebar {
  align-self: stretch;
  justify-self: end;
  width: 100%;
  max-width: 500px;
  min-width: 0;
    align-self: stretch;
  display: flex;
min-height: 0;
  overflow: hidden;
}

.product-detail-panel {
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  min-height: 0;
  overflow: hidden;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid var(--agro-border);
  border-radius: 14px;
  padding: 14px 20px 12px;
  box-shadow: none;
}

.product-detail-panel__title {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin: 0 0 8px;
  color: var(--agro-text);
  font-size: 24px;
  line-height: 1.22;
  font-weight: 800;
}

.product-detail-panel__price {
  margin: 2px 0 10px;
  color: var(--agro-green);
  font-size: 24px;
  line-height: 1.1;
  font-weight: 800;
}

.product-detail-panel__unit {
  color: var(--agro-text);
  font-size: 15px;
  font-weight: 700;
}

.product-detail-meta {
  display: grid;
    min-height: 0;
  overflow: hidden;
gap: 8px;
  min-height: 0;
  overflow: hidden;
  color: #4b5563;
  font-size: 16px;
  line-height: 1.28;
}

.product-detail-meta__row {
  display: flex;
  align-items: flex-start;
  gap: 9px;
  min-width: 0;
  margin: 2px 0;
  color: #4b5563;
  font-size: 16px;
}

.product-detail-meta__icon {
  flex: 0 0 auto;
  width: 18px;
  color: #98a2b3;
  text-align: center;
}

.product-detail-meta__row a,
.product-detail-meta__row span:not(.product-detail-meta__icon) {
  min-width: 0;
  overflow: hidden;
  color: #4b5563;
  font-size: 16px;
  white-space: nowrap;
  text-overflow: ellipsis;
  text-decoration: none;
}

.product-detail-meta__row a:hover {
  color: #1f2933;
  text-decoration: none;
}

.product-detail-meta__divider {
  height: 1px;
  margin: 5px 0;
  background: var(--agro-border);
}

.product-detail-panel .contract-download__button {
  color: #4b5563;
  border-color: #d0d5dd;
  background: #fff;
  box-shadow: none;
  text-decoration: none;
}

.product-detail-panel .contract-download__button:hover {
  color: #1f2933;
  border-color: #98a2b3;
  background: #f9fafb;
  text-decoration: none;
}

.product-detail-panel .product-detail-meta a.outline {
  color: var(--agro-link-blue);
  font-size: 16px;
  text-decoration: none;
}

.product-detail-panel .product-detail-meta a.outline:hover {
  color: var(--agro-link-red);
  text-decoration: none;
}

.product-detail-hero a,
.product-detail-hero a:hover,
.product-detail-description-only a,
.product-detail-description-only a:hover,
.product-contact a,
.product-contact a:hover {
  text-decoration: none;
}

.product-detail-hidden {
  display: none;
}

.product-detail-description-only {
  width: calc(100% - 24px);
  max-width: none;
  margin-left: 12px;
  margin-right: 12px;
}

.product-detail-description-only > :not(:first-child) {
  display: none;
}

.product-detail-description-only > div:first-child {
  width: 100%;
  box-sizing: border-box;
  background: #fff;
  border: 1px solid var(--agro-border);
  border-radius: 12px;
  padding: 16px;
  color: #2f343b;
  line-height: 1.55;
}

.product-contact__button {
  border-radius: 12px;
  background: var(--agro-green);
  box-shadow: 0 6px 14px rgba(16, 196, 76, .18);
  text-decoration: none;
}

.product-contact__button:hover {
  background: var(--agro-green-dark);
  text-decoration: none;
}

.product-detail-trustline {
  display: flex;
  align-items: center;
  gap: 5px;
  max-width: 100%;
  margin-top: 2px;
  color: #667085;
  font-size: 12px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-detail-trustline span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
}

.product-detail-trustline__sep {
  flex: 0 0 auto;
  opacity: .65;
}

.product-detail-panel .trustmark-details {
  margin-top: 2px;
  min-width: 0;
  overflow: hidden;
}

.product-detail-panel .trustmark-badge-line {
  line-height: 1.15;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.publication_time {
  margin-top: 2px;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

@media (max-width: 1180px) {
  .product-detail-hero {
    grid-template-columns: minmax(0, 1fr) minmax(300px, 360px);
    gap: 16px;
  }

  .product-detail-sidebar {
    max-width: 360px;
  }

  .product-detail-panel__title {
    font-size: 21px;
  }
}

@media (max-width: 991px) {
  .product-detail-hero {
    display: block;
    width: calc(100% - 20px);
    max-width: 720px;
    margin: 0 auto 14px;
  }

  .product-detail-hero .top_product_card {
    max-width: 720px;
    margin: 0 auto 12px;
  }

  .product-detail-sidebar {
    max-width: none;
    overflow: visible;
  }

  .product-detail-panel {
    height: auto;
    margin-top: 12px;
    padding: 14px;
    overflow: visible;
  }

  .product-detail-panel__title {
    font-size: 20px;
  }

  .product-detail-panel__price {
    font-size: 22px;
  }

  .product-detail-description-only {
    width: calc(100% - 20px);
    max-width: 720px;
    margin-left: auto;
    margin-right: auto;
  }
}

/* Product detail equal-height behavior: info cube mirrors photo row. */
@media (min-width: 992px) {
  .product-detail-sidebar .product-detail-panel {
    flex: 1 1 auto;
  }

  .product-detail-meta__row,
  .product-detail-meta__row a,
  .product-detail-meta__row span:not(.product-detail-meta__icon),
  .publication_time,
  .product-detail-trustline {
    max-width: 100%;
    min-width: 0;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .product-detail-meta__row {
    align-items: center;
  }

  .product-detail-panel__title {
    text-overflow: ellipsis;
  }
}

/* AGRO_CARD_DETAIL_EQUAL_ROW_V12_START */
@media (min-width: 1181px) {
  .product-detail-hero {
    --agro-detail-row-height: clamp(315px, calc(50vw - 275px), 485px);
    align-items: stretch;
  }

  .product-detail-photos,
  .product-detail-sidebar {
    height: var(--agro-detail-row-height);
    max-height: var(--agro-detail-row-height);
    min-height: var(--agro-detail-row-height);
    overflow: hidden;
  }

  .product-detail-photos .photos,
  .top_product_card.product-detail-photos .photos {
    height: 100%;
    min-height: 0;
    gap: 10px;
    column-gap: 10px;
    row-gap: 10px;
    align-items: stretch;
  }

  .product-detail-photos .photos > div,
  .top_product_card.product-detail-photos .photos > div {
    height: 100%;
    min-height: 0;
    overflow: hidden;
  }

  .product-detail-photos img,
  .product-detail-photos .photos img {
    width: 100%;
    height: 100%;
    max-height: var(--agro-detail-row-height);
    object-fit: cover;
  }

  .product-detail-sidebar {
    display: flex;
    align-self: stretch;
  }

  .product-detail-sidebar .product-detail-panel {
    flex: 1 1 auto;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
  }
}

@media (min-width: 992px) and (max-width: 1180px) {
  .product-detail-hero {
    --agro-detail-row-height: clamp(300px, calc(50vw - 205px), 386px);
    align-items: stretch;
  }

  .product-detail-photos,
  .product-detail-sidebar {
    height: var(--agro-detail-row-height);
    max-height: var(--agro-detail-row-height);
    min-height: var(--agro-detail-row-height);
    overflow: hidden;
  }

  .product-detail-photos .photos,
  .top_product_card.product-detail-photos .photos {
    height: 100%;
    gap: 10px;
    column-gap: 10px;
    row-gap: 10px;
  }

  .product-detail-photos .photos > div,
  .top_product_card.product-detail-photos .photos > div,
  .product-detail-photos img,
  .product-detail-photos .photos img {
    height: 100%;
  }

  .product-detail-sidebar {
    display: flex;
    align-self: stretch;
  }

  .product-detail-sidebar .product-detail-panel {
    flex: 1 1 auto;
    height: 100%;
    max-height: 100%;
    min-height: 0;
    overflow: hidden;
  }
}

@media (max-width: 991px) {
  .product-detail-photos,
  .product-detail-sidebar,
  .product-detail-sidebar .product-detail-panel {
    height: auto;
    max-height: none;
    min-height: 0;
    overflow: visible;
  }
}
/* AGRO_CARD_DETAIL_EQUAL_ROW_V12_END */
