/*
 * Rexsun brand network refinement — 0.22.8
 * Loaded only on /commerce/, the ten corporate brand pages, and the HAWE / KRACHT
 * category routes. Every selector requires an explicit page body scope so these
 * rules cannot leak into Infine, Elementor templates, the header, or the footer.
 */

/* Remove layout whitespace introduced by legacy Elementor wrappers around the
   shortcode surface, while preserving the full-width header background. */
body.rxp-brand-unified :is(
  .elementor-section,
  .elementor-container,
  .elementor-column,
  .elementor-widget-wrap,
  .elementor-widget-shortcode,
  .elementor-widget-container
):has(.rxp-brand-page) {
  margin-block-start: 0 !important;
  padding-block-start: 0 !important;
}

body.rxp-brand-unified .rxp-brand-page {
  margin-block-start: 0 !important;
}

body.rxp-commerce-unified :is(
  .site-content,
  .content-area,
  .site-main,
  article,
  .entry-content
) {
  width: 100% !important;
  max-width: none !important;
  margin: 0 !important;
  padding: 0 !important;
}

body.rxp-commerce-unified :is(
  .elementor-section,
  .elementor-container,
  .elementor-column,
  .elementor-widget-wrap,
  .elementor-widget-shortcode,
  .elementor-widget-container
):has(.rxco-page) {
  margin-block-start: 0 !important;
  padding-block-start: 0 !important;
}

body.rxp-commerce-unified .rxco-hero {
  padding-block: clamp(58px, 5.5vw, 76px) clamp(64px, 6vw, 82px);
}

body.rxp-commerce-unified .rxco-hero__grid {
  min-height: 520px;
}

/* A tighter but still calm desktop rhythm shared by all brand pages. */
body.rxp-brand-unified .rxp-brand-page:not(.rxp-category-page) .rxp-brand-section {
  padding-block: clamp(64px, 5.6vw, 78px);
}

body.rxp-brand-unified .rxp-brand-page .rxp-brand-section__head {
  margin-bottom: clamp(28px, 3.5vw, 38px);
}

body.rxp-brand-unified .rxp-brand-page .rxp-brand-section__head > span {
  max-width: 760px;
}

/* Keep the commercial and brand-page content on the same desktop measure as
   the global header. The background bands remain full width; only their inner
   content gets the safer 48–80px edge clearance. */
@media (min-width: 981px) {
  body.rxp-commerce-unified .rxco-page .rxp-container,
  body.rxp-brand-unified .rxp-brand-page .rxp-brand-container {
    width: min(1280px, calc(100% - 96px)) !important;
  }
}

/* Theme and lazy-load rules must not let the final proof images keep their
   intrinsic desktop width after the layout collapses to one column. */
body.rxp-commerce-unified .rxco-final__media,
body.rxp-commerce-unified .rxco-final__media figure,
body.rxp-commerce-unified .rxco-final__media picture,
body.rxp-commerce-unified .rxco-final__media img {
  min-width: 0 !important;
  max-width: 100% !important;
}

body.rxp-commerce-unified .rxco-final__media figure,
body.rxp-commerce-unified .rxco-final__media picture,
body.rxp-commerce-unified .rxco-final__media img {
  width: 100% !important;
}

/* Infine applies a mobile link colour late in the cascade. Pin the two CTA
   variants to their intended accessible contrast inside the commerce page. */
body.rxp-commerce-unified .rxco-page a.rxco-button--primary,
body.rxp-commerce-unified .rxco-page a.rxco-button--primary:visited {
  color: #fff !important;
}

body.rxp-commerce-unified .rxco-page a.rxco-button--secondary,
body.rxp-commerce-unified .rxco-page a.rxco-button--secondary:visited {
  color: var(--rxco-navy) !important;
}

/* Verified products from the Rexsun shop. The cards intentionally avoid product
   thumbnails because the shop currently contains a few mismatched legacy media
   records; exact titles and links remain the reliable source of identity. */
body.rxp-brand-unified .rxp-brand-shop {
  background:
    radial-gradient(circle at 12% 18%, rgba(229, 37, 42, .055), transparent 27%),
    #eef3f8;
}

body.rxp-brand-unified .rxp-brand-shop__head {
  max-width: 860px;
  margin-inline: auto;
  text-align: center;
}

body.rxp-brand-unified .rxp-brand-shop__head > span {
  margin-inline: auto;
}

body.rxp-brand-unified .rxp-brand-shop__grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-items: stretch;
  gap: 18px;
}

body.rxp-brand-unified .rxp-brand-shop__card {
  display: flex;
  min-width: 0;
  min-height: 220px;
  padding: 24px;
  flex-direction: column;
  justify-content: space-between;
  gap: 24px;
  border: 1px solid var(--rxb-line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 14px 34px rgba(12, 32, 61, .07);
}

body.rxp-brand-unified .rxp-brand-shop__card > div > span {
  display: inline-flex;
  margin-bottom: 13px;
  padding: 5px 10px;
  border-radius: 999px;
  background: #fff0f1;
  color: var(--rxb-red);
  font-size: 11px;
  font-weight: 850;
  line-height: 1.7;
}

body.rxp-brand-unified .rxp-brand-shop__card h3 {
  margin: 0;
  color: var(--rxb-navy) !important;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.85;
  text-wrap: pretty;
}

body.rxp-brand-unified .rxp-brand-shop__card > a {
  display: inline-flex;
  min-height: 46px;
  width: fit-content;
  align-items: center;
  justify-content: center;
  padding: 9px 16px;
  border: 1px solid var(--rxb-line);
  border-radius: 13px;
  color: var(--rxb-navy) !important;
  background: #f8fafc;
  font-size: 13px;
  font-weight: 850;
  line-height: 1.7;
  text-decoration: none !important;
  transition: transform .22s cubic-bezier(.22, .8, .24, 1), border-color .22s ease, color .22s ease, box-shadow .22s ease;
}

body.rxp-brand-unified .rxp-brand-shop__footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: 22px;
  padding: 20px 22px;
  border: 1px solid rgba(229, 37, 42, .18);
  border-radius: 18px;
  background: #fff;
}

body.rxp-brand-unified .rxp-brand-shop__footer p {
  margin: 0 !important;
  color: var(--rxb-muted);
  font-size: 13px;
  font-weight: 650;
  line-height: 1.9;
}

body.rxp-brand-unified .rxp-brand-shop__footer .rxp-brand-button {
  flex: 0 0 auto;
  white-space: nowrap;
}

@media (hover: hover) and (pointer: fine) {
  body.rxp-brand-unified .rxp-brand-shop__card {
    transition: transform .24s cubic-bezier(.22, .8, .24, 1), border-color .24s ease, box-shadow .24s ease;
  }

  body.rxp-brand-unified .rxp-brand-shop__card:hover {
    border-color: rgba(229, 37, 42, .3);
    box-shadow: 0 20px 46px rgba(12, 32, 61, .11);
    transform: translateY(-3px);
  }

  body.rxp-brand-unified .rxp-brand-shop__card > a:hover {
    border-color: rgba(229, 37, 42, .45);
    color: var(--rxb-red) !important;
    box-shadow: 0 10px 24px rgba(12, 32, 61, .08);
    transform: translateY(-2px);
  }
}

@media (max-width: 980px) {
  body.rxp-commerce-unified .rxco-hero__grid {
    min-height: 0;
  }

  body.rxp-brand-unified .rxp-brand-shop__grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 620px) {
  body.rxp-commerce-unified .rxco-hero {
    padding-block: 34px 50px;
  }

  body.rxp-brand-unified .rxp-brand-page:not(.rxp-category-page) .rxp-brand-section {
    padding-block: 52px;
  }

  body.rxp-brand-unified .rxp-brand-page .rxp-brand-container {
    width: calc(100% - 28px);
  }

  body.rxp-brand-unified .rxp-brand-shop__grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  body.rxp-brand-unified .rxp-brand-shop__card {
    min-height: 0;
    padding: 20px 18px;
    gap: 20px;
    border-radius: 18px;
  }

  body.rxp-brand-unified .rxp-brand-shop__card h3 {
    font-size: 16px;
    line-height: 1.9;
  }

  body.rxp-brand-unified .rxp-brand-shop__card > a {
    width: 100%;
  }

  body.rxp-brand-unified .rxp-brand-shop__footer {
    display: grid;
    grid-template-columns: 1fr;
    gap: 16px;
    padding: 18px;
  }

  body.rxp-brand-unified .rxp-brand-shop__footer .rxp-brand-button {
    width: 100%;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.rxp-brand-unified .rxp-brand-shop__card,
  body.rxp-brand-unified .rxp-brand-shop__card > a {
    transition: none !important;
  }
}
