/* Product detail: balanced hero layout and a clean, contained image gallery. */

main > div:has(#product-overview) {
  padding-top: 0 !important;
}

main > div:has(#product-overview) > section:first-child > div,
#product-overview > div {
  max-width: 1280px !important;
}

#product-overview > div {
  grid-template-columns: minmax(0, 1.08fr) minmax(380px, 0.92fr) !important;
  align-items: start !important;
  gap: 56px !important;
  padding-top: 48px !important;
  padding-bottom: 48px !important;
}

/* Gallery frame */
#product-overview > div > div:first-child {
  min-height: 560px !important;
  align-items: stretch !important;
}

#product-overview > div > div:first-child.hongxin-product-detail-logo::after {
  content: "";
  position: absolute;
  top: 28px;
  left: 28px;
  z-index: 15;
  width: clamp(78px, 6vw, 96px);
  aspect-ratio: 1;
  border: 0;
  border-radius: 13%;
  background-color: transparent;
  background-image: var(
    --hongxin-series-product-logo,
    url("../../dist/assets/images/brand/hongxin-logo-transparent.png")
  );
  background-position: center;
  background-size: 76% auto;
  background-repeat: no-repeat;
  filter: drop-shadow(0 4px 8px rgba(6, 31, 36, 0.2));
  pointer-events: none;
}

#product-overview > div > div:first-child > div:first-of-type {
  min-height: 560px !important;
  padding: 36px 76px 132px !important;
}

#product-overview > div > div:first-child > div:first-of-type > img {
  width: auto !important;
  height: auto !important;
  max-width: 92% !important;
  max-height: 405px !important;
}

#product-overview > div > div:first-child > button {
  top: 43% !important;
}

/* Thumbnail rail: keep it inside the gallery and hide native scrollbars. */
#product-overview > div > div:first-child > div:last-child {
  bottom: 24px !important;
  width: max-content !important;
  max-width: calc(100% - 112px) !important;
  gap: 10px !important;
  overflow-x: auto !important;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
  -ms-overflow-style: none;
  padding: 9px !important;
}

#product-overview > div > div:first-child > div:last-child::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

#product-overview > div > div:first-child > div:last-child > button {
  width: 68px !important;
  height: 68px !important;
  scroll-snap-align: center;
}

/* Product information hierarchy */
#product-overview > div > div:nth-child(2) {
  padding-top: 20px !important;
  padding-bottom: 0 !important;
}

#product-overview > div > div:nth-child(2) > h1 {
  margin-top: 14px !important;
  max-width: 100%;
  font-size: clamp(40px, 4vw, 56px) !important;
  line-height: 1.04 !important;
  letter-spacing: -0.025em;
}

#product-overview > div > div:nth-child(2) > h1 + p {
  max-width: 590px !important;
  margin-top: 24px !important;
  font-size: 18px !important;
  line-height: 1.75 !important;
}

/* Product specifications: one consistent two-column table on every product. */
#technical-data > div {
  max-width: 1210px !important;
}

#technical-data h2 {
  font-size: clamp(30px, 3vw, 38px) !important;
  line-height: 1.15 !important;
  font-weight: 700 !important;
  letter-spacing: -0.02em;
}

#technical-data > div > div {
  margin-top: 34px !important;
  border: 1px solid #c9cdd3 !important;
  background: transparent;
}

#technical-data section + section {
  margin-top: 0 !important;
}

#technical-data h3 {
  display: none !important;
}

#technical-data section > div {
  margin-top: 0 !important;
}

#technical-data section > div > div {
  display: grid !important;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
  column-gap: 0 !important;
  align-items: stretch !important;
  min-height: 60px;
  padding: 0 !important;
  border-bottom: 1px solid #c9cdd3 !important;
  color: #3f4b5b !important;
}

#technical-data section:last-child > div > div:last-child {
  border-bottom: 0 !important;
}

#technical-data section > div > div > span {
  min-width: 0;
  font-size: 17px !important;
  line-height: 1.6 !important;
  display: flex;
  align-items: center;
  padding: 14px 28px !important;
}

#technical-data section > div > div > span:first-child {
  color: #3f4b5b !important;
  font-weight: 400 !important;
  white-space: normal;
  border-right: 1px solid #c9cdd3 !important;
  justify-content: flex-start;
  text-align: left;
}

#technical-data section > div > div > span.mx-1 {
  display: none !important;
}

#technical-data section > div > div > span:last-child {
  color: #3f4b5b !important;
  font-weight: 600 !important;
  white-space: pre-line !important;
  overflow-wrap: anywhere;
}

/* Secondary actions read as a matched control group. */
#product-overview > div > div:nth-child(2) > div:nth-last-child(2) {
  margin-top: 24px !important;
  gap: 10px !important;
}

#product-overview > div > div:nth-child(2) > div:nth-last-child(2) > button,
#product-overview > div > div:nth-child(2) > div:nth-last-child(2) > div > button {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid #cbd7e5;
  background: rgba(255, 255, 255, 0.72);
  color: #34475f;
}

/* Service support is intentionally removed; keep the Downloads control. */
#product-overview > div > div:nth-child(2) > div:nth-last-child(2) > button {
  display: none !important;
}

#product-overview > div > div:nth-child(2) > div:nth-last-child(2) > button:hover,
#product-overview > div > div:nth-child(2) > div:nth-last-child(2) > div > button:hover {
  border-color: #2f86f6;
  background: #fff;
  color: #106ce2;
}

#product-overview > div > div:nth-child(2) > div:last-child {
  margin-top: 14px !important;
}

#product-overview > div > div:nth-child(2) > div:last-child > button {
  min-width: 220px !important;
  min-height: 54px;
  padding: 0 30px !important;
}

/* The case module is opt-in per product. Pending and disabled modules stay
   hidden; an enabled module with no cards keeps its heading available. */
#industry-cases.hongxin-industry-cases-pending,
#industry-cases.hongxin-industry-cases-disabled {
  display: none !important;
}

#industry-cases.hongxin-industry-cases-empty > div > div:last-child {
  display: none !important;
}

#industry-cases.hongxin-industry-cases-empty > div > div:first-child {
  margin-bottom: 0 !important;
}

@media (max-width: 1023px) {
  #product-overview > div {
    grid-template-columns: minmax(0, 1fr) !important;
    gap: 32px !important;
    padding-top: 32px !important;
    padding-bottom: 38px !important;
  }

  #product-overview > div > div:first-child,
  #product-overview > div > div:first-child > div:first-of-type {
    min-height: 500px !important;
  }

  #product-overview > div > div:first-child > div:first-of-type {
    padding: 30px 70px 122px !important;
  }

  #product-overview > div > div:nth-child(2) {
    padding-top: 0 !important;
  }
}

@media (max-width: 639px) {
  #technical-data > div > div {
    margin-top: 24px !important;
  }

  #technical-data section > div > div {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) !important;
    row-gap: 0 !important;
    min-height: 54px;
    padding: 0 !important;
  }

  #technical-data section > div > div > span {
    padding: 11px 12px !important;
  }

  #technical-data section > div > div > span:first-child {
    font-size: 15px !important;
  }

  #technical-data section > div > div > span:last-child {
    font-size: 16px !important;
  }

  main > div:has(#product-overview) > section:first-child > div {
    padding-top: 14px !important;
    padding-bottom: 14px !important;
  }

  #product-overview > div {
    gap: 26px !important;
    padding-top: 24px !important;
    padding-bottom: 32px !important;
  }

  #product-overview > div > div:first-child,
  #product-overview > div > div:first-child > div:first-of-type {
    min-height: 410px !important;
  }

  #product-overview > div > div:first-child > div:first-of-type {
    padding: 24px 48px 106px !important;
  }

  #product-overview > div > div:first-child.hongxin-product-detail-logo::after {
    top: 12px;
    left: 12px;
    width: 68px;
  }

  #product-overview > div > div:first-child > div:first-of-type > img {
    max-width: 96% !important;
    max-height: 275px !important;
  }

  #product-overview > div > div:first-child > button {
    top: 41% !important;
    width: 42px !important;
    height: 42px !important;
  }

  #product-overview > div > div:first-child > div:last-child {
    bottom: 16px !important;
    max-width: calc(100% - 32px) !important;
    gap: 8px !important;
    padding: 7px !important;
  }

  #product-overview > div > div:first-child > div:last-child > button {
    width: 58px !important;
    height: 58px !important;
  }

  #product-overview > div > div:nth-child(2) > h1 {
    font-size: 38px !important;
  }

  #product-overview > div > div:nth-child(2) > h1 + p {
    margin-top: 18px !important;
    font-size: 16px !important;
    line-height: 1.68 !important;
  }

  #product-overview > div > div:nth-child(2) > div:nth-last-child(2) {
    align-items: stretch !important;
    gap: 8px !important;
  }

  #product-overview > div > div:nth-child(2) > div:last-child > button {
    width: 100%;
  }
}
