/* Home RFQ CTAs — keep the in-page #factories-rfq landing at 28px in both
 * header states.
 *
 * Global rule: html { scroll-padding-top: calc(var(--dsr-header-height) + 28px) }
 * (revamp-v3.css:35-37). While the fixed header is visible that is 142/132/106px,
 * and the home hero keeps its 100svh height, so main's padding-top
 * (114/104/78px, home-hero-rail-v4.css:56-58) collapses when
 * body.dsr-header-hidden is set and the target moves up by the same amount.
 * The hero CTA is clicked while heroHoldsHeader() still shows the header, so
 * the net landing is 28px.
 *
 * The bottom CTA in .home-cta is clicked when the header is already hidden:
 * there is no remaining layout shift, so the global 142/132/106px offset would
 * leave a header-height gap above the RFQ. 28px is the correct offset then.
 *
 * Scope to the home page so other pages keep their current anchor contract.
 */
html:has(body.page-home.dsr-header-hidden) {
  scroll-padding-top: 28px;
}

/* --------------------------------------------------------------------------
 * Home shared RFQ CTA (execution / catalog / network, hero-parity).
 *
 * Keep the visual tokens in sync with:
 *   static/assets/css/pages/home-hero-globe.css:257-355 (base / hover / focus)
 *   static/assets/css/pages/home-hero-globe.css:751-893 (responsive)
 *   static/assets/css/pages/home-hero-globe.css:953-964 (<=420 full width)
 *
 * Deliberately NOT using .home-button / .btn--primary:
 *   - catalog intro forces .home-button to the dark catalog ink;
 *   - network forces .btn--primary to jade;
 *   - hero .home-button--primary is scoped to .home-hero--globe.
 * ----------------------------------------------------------------------- */
.home-rfq-cta {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-width: 244px;
  min-height: clamp(48px, 5.74vh, 58px);
  padding: 0 26px;
  border: 1px solid #ff6a00;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(180deg, #ff7412 0%, #ff6a00 55%, #f96100 100%);
  box-shadow:
    0 14px 30px rgba(255, 106, 0, 0.25),
    inset 0 1px 0 rgba(255, 255, 255, 0.25);
  font-family: "DSR Manrope", "DSR Inter", ui-sans-serif, system-ui, sans-serif;
  font-size: 15.5px;
  font-weight: 800;
  letter-spacing: 0.01em;
  line-height: 1;
  text-align: center;
  text-decoration: none;
  text-transform: none;
  white-space: nowrap;
  cursor: pointer;
  /* motion-item 的 inline transform 会覆盖这里；显式 none 只用于
     防止 JS 失败时 .btn:hover 的 translateY(-1px) 与 translate 叠加成 -2px。 */
  transform: none;
  transition:
    translate 0.2s ease,
    box-shadow 0.2s ease,
    background-color 0.2s ease,
    border-color 0.2s ease;
}

.home-rfq-cta svg {
  width: 18px;
  height: 18px;
  flex: 0 0 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform 0.2s ease;
}

.home-rfq-cta:hover,
.home-rfq-cta:focus-visible {
  color: #fff;
  background: linear-gradient(180deg, #ff7c20 0%, #ff6d05 55%, #fc6503 100%);
  box-shadow:
    0 18px 36px rgba(255, 106, 0, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
  translate: 0 -1px;
  transform: none;
}

.home-rfq-cta:hover svg {
  transform: translateX(3px);
}

.home-rfq-cta:active {
  translate: 0 1px;
  transform: none;
}

.home-rfq-cta:focus-visible {
  outline: none;
  box-shadow:
    0 0 0 2px #fff,
    0 0 0 5px rgba(255, 106, 0, 0.55),
    0 14px 30px rgba(255, 106, 0, 0.25);
}

html[dir="rtl"] .home-rfq-cta {
  font-family: "DSR Vazirmatn", "DSR Inter", ui-sans-serif, sans-serif;
  font-size: 14.5px;
  letter-spacing: 0;
}

html[dir="rtl"] .home-rfq-cta svg {
  transform: scaleX(-1);
}

html[dir="rtl"] .home-rfq-cta:hover svg {
  transform: translateX(-3px) scaleX(-1);
}

@media (min-width: 1200px) and (max-width: 1439px) {
  .home-rfq-cta {
    min-width: 220px;
    padding-inline: 22px;
  }
}

@media (min-width: 768px) and (max-width: 1199px) {
  .home-rfq-cta {
    min-width: 212px;
    padding-inline: 20px;
    font-size: 14.5px;
  }
}

@media (max-width: 767px) {
  .home-rfq-cta {
    min-width: 0;
    min-height: 48px;
    padding-inline: 18px;
    font-size: 13.5px;
  }

  .home-rfq-cta svg {
    width: 16px;
    height: 16px;
    flex-basis: 16px;
  }
}

@media (max-width: 480px) {
  .home-rfq-cta {
    width: 100%;
  }
}

/* Execution header: two-row grid on desktop; stacked after the copy on mobile. */
@media (min-width: 1021px) {
  .home-execution .home-section__header {
    grid-template-rows: auto auto;
    row-gap: 18px;
  }

  .home-execution .home-section__header > div {
    grid-column: 1;
    grid-row: 1 / span 2;
  }

  .home-execution .home-section__header > p {
    grid-column: 2;
    grid-row: 2;
    align-self: end;
  }

  .home-execution__header-cta {
    grid-column: 2;
    grid-row: 1;
    justify-self: end;
    align-self: start;
  }
}

@media (min-width: 1440px) {
  .home-execution__header-cta {
    margin-top: var(--home-execution-cta-offset, 22px);
  }
}

@media (max-width: 1020px) {
  .home-execution__header-cta {
    justify-self: start;
    margin-top: 0;
  }
}

@media (max-width: 480px) {
  .home-execution__header-cta {
    width: 100%;
  }
}
