/**
 * Карточка товара: product__top-info + product__buy-info
 * <link href="/static/css/product-hero.css?v=30" rel="stylesheet">
 */

/* ——— top-info ——— */
.product.print-visible {
  max-width: 100%;
  min-width: 0;
  overflow-x: clip;
}

.product.print-visible > .product__top-info {
  align-items: flex-start;
  gap: 22px;
  margin-bottom: 20px;
  max-width: 100%;
  min-width: 0;
}

.product__top-info .product__summary {
  flex: 1 1 auto;
  min-width: 0;
  max-width: 100%;
}

.product__top-info .product__title.hidden-sm {
  font-size: 26px;
  line-height: 1.25;
  margin: 0 0 12px;
  color: #1a1a1a;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.product__top-info .product__description {
  font-size: 14px;
  line-height: 1.55;
  color: #3d4a52;
  margin: 0;
  max-width: 100%;
  overflow-wrap: break-word;
}

.product__top-info .product-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  grid-template-areas:
    "desc cert"
    "btn  cert";
  gap: 14px 18px;
  align-items: start;
  /* сброс negative margins / absolute из dop.css — иначе гориз. скролл */
  margin-left: 0;
  margin-right: 0;
  padding-right: 0;
  position: relative;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.product__top-info .product-col {
  margin-left: 0;
  margin-right: 0;
  margin-top: 0;
  width: auto;
  max-width: 100%;
  box-sizing: border-box;
  float: none;
  position: static;
  right: auto;
}

/* кнопка «Узнать цену» */
.product__top-info .product-col:not(.product-col--greedy):not(.product-col--last) {
  grid-area: btn;
}

/* описание слева, сертификат справа в одной строке */
.product__top-info .product-col--greedy {
  grid-area: desc;
  min-width: 0;
}

.product__top-info .product-col--last {
  grid-area: cert;
  justify-self: end;
}

.product__top-info .btn--square {
  min-width: 150px;
  padding: 12px 24px;
  font-weight: 600;
}

.product__top-info .product-certificate {
  display: block;
  border: 1px solid #d7e2e8;
  border-radius: 0;
  padding: 4px;
  background: #fff;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.product__top-info .product-certificate:hover {
  border-color: #015479;
  box-shadow: 0 2px 10px rgba(1, 84, 121, 0.12);
}

.product__top-info .product-certificate img {
  display: block;
  max-width: 88px;
  height: auto;
}

/* ——— buy-info ——— */
.product__buy-info.egs-product-buy {
  margin: 0 0 28px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.product__buy-info.egs-product-buy .noornament,
.product__buy-info.egs-product-buy .ornament__inner,
.product__buy-info.egs-product-buy .ornament__left {
  display: block;
  width: 100%;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.product__buy-info.egs-product-buy .ornament__left > .icon {
  display: none !important;
}

.egs-product-panel {
  display: flex;
  flex-direction: column;
  border: 0;
  background: transparent;
  overflow: visible;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

/* Строка 1: кредит / доставка / телефон / почта */
.egs-product-services {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0;
  border: 0;
  background: #fff;
  margin-bottom: 5px;
  max-width: 100%;
  min-width: 0;
  box-sizing: border-box;
}

.egs-product-svc {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border: 0;
  text-decoration: none;
  color: inherit;
  background: #fff;
  transition: background 0.15s ease;
  min-width: 0;
}

a.egs-product-svc:hover,
.egs-product-svc--contact:hover {
  background: #f7fbfd;
  text-decoration: none;
  color: inherit;
}

a.egs-product-svc__icon {
  text-decoration: none;
  color: inherit;
}

.egs-product-svc__icon {
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(1, 84, 121, 0.1);
  color: #015479;
}

.egs-product-svc__icon svg {
  width: 24px;
  height: 24px;
}

.egs-product-svc__text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.egs-product-svc__title {
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: #1a1a1a;
}

.egs-product-svc__note {
  font-size: 13px;
  line-height: 1.3;
  color: #6a7a83;
}

.egs-product-svc--contact {
  align-items: center;
  -webkit-user-select: text !important;
  user-select: text !important;
}

.egs-product-svc--contact .egs-product-svc__text {
  justify-content: center;
}

.egs-product-svc__value {
  display: inline;
  font-size: 16px;
  font-weight: 700;
  line-height: 1.25;
  color: #015479;
  overflow-wrap: anywhere;
  word-break: break-word;
  white-space: normal;
  text-decoration: none;
  -webkit-user-select: text !important;
  user-select: text !important;
  cursor: text;
}

a.egs-product-svc__value:hover {
  color: #015479;
  text-decoration: none;
}

.egs-product-svc--contact .egs-product-svc__value {
  font-size: 18px;
  line-height: 1.2;
}

/* Телефон + почта в одной ячейке (блок после описания) */
.egs-product-svc--contacts .egs-product-svc__text {
  gap: 4px;
}

.egs-product-svc--contacts .egs-product-svc__value {
  font-size: 16px;
}

.egs-product-svc__mail {
  display: block;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.25;
  color: #015479;
  text-decoration: none;
  overflow-wrap: anywhere;
  word-break: break-word;
  -webkit-user-select: text !important;
  user-select: text !important;
  cursor: text;
}

a.egs-product-svc__mail:hover {
  color: #015479;
  text-decoration: none;
}

/* Кнопка «Узнать цену» вместо почты */
.egs-product-svc--cta {
  justify-content: center;
  align-items: center;
  padding: 12px 14px;
}

.egs-product-svc--cta:hover {
  background: #fff;
}

.egs-product-cta.btn--square,
.egs-product-svc--cta .btn--square {
  width: 100%;
  max-width: 220px;
  min-width: 0;
  margin: 0;
  padding: 12px 20px;
  font-weight: 600;
  white-space: nowrap;
}

/* Строка 2: гарантия + 5 преимуществ */
.egs-product-warranty {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(160deg, #f5f9fc 0%, #eaf3f8 100%);
  border: 1px solid #d7e2e8;
  text-decoration: none;
  color: inherit;
  transition: background 0.15s ease;
}

.egs-product-warranty:hover {
  background: linear-gradient(160deg, #eaf3f8 0%, #e2eef5 100%);
  text-decoration: none;
  color: inherit;
}

.egs-product-warranty__head {
  display: flex;
  align-items: center;
  gap: 12px;
}

.egs-product-warranty__icon {
  width: 42px;
  height: 42px;
  flex: 0 0 42px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: #015479;
  color: #fff;
}

.egs-product-warranty__icon svg {
  width: 22px;
  height: 22px;
}

.egs-product-warranty__title {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  color: #015479;
}

.egs-product-warranty__adv {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.egs-product-warranty__adv li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px;
  background: #fff;
  border: 1px solid #d5e4ec;
  border-radius: 0;
  font-size: 11px;
  line-height: 1.25;
  color: #5a6b74;
}

.egs-product-warranty__adv strong {
  font-size: 13px;
  font-weight: 800;
  color: #015479;
}

.egs-product-warranty__adv span {
  display: block;
}

/* ≥1600: заголовок слева, преимущества справа */
@media (min-width: 1600px) {
  .egs-product-warranty {
    flex-direction: row;
    align-items: center;
    gap: 18px;
  }

  .egs-product-warranty__head {
    flex: 0 1 280px;
    min-width: 240px;
  }

  .egs-product-warranty__adv {
    flex: 1 1 auto;
    min-width: 0;
  }
}

/* 1600–1699: телефон и почта чуть компактнее */
@media (min-width: 1600px) and (max-width: 1699px) {
  .egs-product-svc--contact .egs-product-svc__value {
    font-size: 15px;
  }
}

@media (max-width: 1599px) {
  .egs-product-warranty__icon {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
  }

  .egs-product-warranty__icon svg {
    width: 14px;
    height: 14px;
  }

  /* доставка −10%, контакты/почта шире */
  .egs-product-services {
    grid-template-columns: 1fr 0.9fr 1fr 1.1fr;
  }

  .egs-product-buy--after .egs-product-services {
    grid-template-columns: 1fr 0.9fr 1.25fr 0.95fr;
  }

  .egs-product-svc--contacts .egs-product-svc__value {
    font-size: 14px;
  }

  .egs-product-svc__mail {
    font-size: 12px;
  }

  .egs-product-svc--cta {
    padding: 10px 8px;
  }

  .egs-product-cta.btn--square,
  .egs-product-svc--cta .btn--square {
    padding: 10px 14px;
    font-size: 14px;
  }

  .egs-product-svc {
    padding: 10px 8px;
    gap: 8px;
  }

  .egs-product-svc__icon {
    width: 40px;
    height: 40px;
    flex: 0 0 40px;
  }

  .egs-product-svc__icon svg {
    width: 20px;
    height: 20px;
  }

  .egs-product-svc__title {
    font-size: 15px;
  }

  .egs-product-svc__note {
    font-size: 12px;
  }

  .egs-product-svc--contact .egs-product-svc__value {
    font-size: 14px;
  }
}

@media (max-width: 1200px) {
  .egs-product-warranty__adv {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

/* <900: 2×2 + рамка блока и разделители */
@media (max-width: 899px) {
  .egs-product-services {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    border: 1px solid #d7e2e8;
  }

  .egs-product-services > .egs-product-svc:nth-child(1),
  .egs-product-services > .egs-product-svc:nth-child(3) {
    border-right: 1px solid #e6eef3;
  }

  .egs-product-services > .egs-product-svc:nth-child(1),
  .egs-product-services > .egs-product-svc:nth-child(2) {
    border-bottom: 1px solid #e6eef3;
  }
}

@media (max-width: 800px) {
  .product__top-info .product__title.hidden-sm {
    font-size: 22px;
  }

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