/*
 * HAWE + KRACHT visual refinement — 0.22.5
 * Loaded only on the two brand directories and their five category routes.
 * Selectors deliberately require both the body and page scope to avoid
 * leaking into Infine, Elementor, the global header, or the global footer.
 */

body.rxp-brand-unified .rxp-brand-page.rxp-catalog-page {
  --rxp-polish-ease: cubic-bezier(.22, .8, .24, 1);
  --rxp-polish-shadow: 0 18px 44px rgba(10, 31, 59, .09);
}

/* Brand directory hero: keep the verified collage, but restore visual balance. */
body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero {
  padding-block: clamp(44px, 4.5vw, 58px);
}

body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero__grid {
  grid-template-columns: minmax(0, 1.08fr) minmax(390px, .82fr);
  gap: clamp(36px, 5vw, 64px);
}

body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero__media {
  height: 410px;
  grid-template-rows: repeat(2, minmax(0, 1fr));
  gap: 12px;
  min-height: 0;
}

body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero__tile {
  min-height: 0;
  border-radius: 19px;
}

body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero__tile img {
  min-height: 0;
  padding: 20px;
}

body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-logo {
  min-height: 70px;
  margin-bottom: 18px;
}

body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-logo img {
  height: 46px;
}

body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero h1 {
  max-width: 700px;
  margin-bottom: 14px;
  font-size: clamp(34px, 3vw, 50px);
  line-height: 1.34;
}

body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-lead {
  margin-bottom: 22px !important;
  font-size: 15px;
  line-height: 1.92;
}

body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-request-strip {
  margin-top: 21px !important;
  padding-top: 15px !important;
}

/* Fix the parent-page selection block whose category class caused white text
   and translucent cards to render on a white background. */
body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-section--selection {
  padding-block: clamp(62px, 6vw, 82px);
  background:
    radial-gradient(circle at 12% 18%, rgba(229, 37, 42, .16), transparent 27%),
    linear-gradient(125deg, #08172c, #102b4f);
}

body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-selection-grid {
  align-items: stretch;
}

body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-selection-copy,
body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-criteria,
body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-applications {
  align-self: stretch;
}

/* Category hero: keep the evidence-first composition while fitting the first
   desktop viewport more comfortably. */
body.rxp-brand-unified .rxp-category-page .rxp-category-hero {
  padding-block: clamp(38px, 4vw, 56px);
}

body.rxp-brand-unified .rxp-category-page .rxp-category-hero__grid {
  grid-template-columns: minmax(0, 1.18fr) minmax(320px, .72fr);
  gap: clamp(36px, 5vw, 66px);
}

body.rxp-brand-unified .rxp-category-page .rxp-category-brand {
  margin-block: 18px 15px;
  padding-block: 8px;
}

body.rxp-brand-unified .rxp-category-page .rxp-category-brand img {
  max-width: 136px;
  height: 31px;
}

body.rxp-brand-unified .rxp-category-page .rxp-category-hero h1 {
  max-width: 720px;
  margin-bottom: 14px;
  font-size: clamp(36px, 4.2vw, 54px);
  line-height: 1.3;
  text-wrap: balance;
}

body.rxp-brand-unified .rxp-category-page .rxp-category-hero__copy > p {
  margin-bottom: 21px;
  font-size: clamp(14px, 1.2vw, 17px);
  line-height: 1.9;
}

body.rxp-brand-unified .rxp-category-page .rxp-category-stats {
  margin-top: 20px;
}

body.rxp-brand-unified .rxp-category-page .rxp-category-stats > div {
  min-height: 72px;
}

body.rxp-brand-unified .rxp-category-page .rxp-category-hero__media {
  width: min(100%, 390px);
  padding: clamp(26px, 3vw, 38px);
  border-radius: clamp(25px, 3vw, 34px);
  box-shadow: 0 26px 64px rgba(0, 0, 0, .24);
}

/* Product families: reduce unused height and make repeated technical cards
   easier to scan without changing verified product data or URLs. */
body.rxp-brand-unified .rxp-category-page .rxp-category-products {
  padding-block: clamp(58px, 6vw, 82px);
}

body.rxp-brand-unified .rxp-category-page .rxp-category-family-list {
  gap: 18px;
  margin-top: 28px;
}

body.rxp-brand-unified .rxp-category-page .rxp-category-family {
  align-self: start;
  border-radius: 22px;
  box-shadow: var(--rxp-polish-shadow);
}

body.rxp-brand-unified .rxp-category-page .rxp-category-family > header {
  gap: 22px;
  padding: 20px 23px;
}

body.rxp-brand-unified .rxp-category-page .rxp-category-product-grid {
  align-items: stretch;
  gap: 12px;
  padding: 14px;
}

body.rxp-brand-unified .rxp-category-page .rxp-category-product {
  min-height: 198px;
  padding: 19px;
}

body.rxp-brand-unified .rxp-category-page .rxp-category-product > p {
  margin-block: 14px 17px;
}

body.rxp-brand-unified .rxp-category-page .rxp-category-selection,
body.rxp-brand-unified .rxp-category-page .rxp-category-documents {
  padding-block: clamp(58px, 6vw, 82px);
}

body.rxp-brand-unified .rxp-category-page .rxp-category-document-list {
  margin-top: 25px;
}

body.rxp-brand-unified .rxp-category-page .rxp-category-document-list article {
  min-height: 84px;
}

/* One coherent interaction grammar for mouse users. */
@media (hover: hover) and (pointer: fine) {
  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero__tile,
  body.rxp-brand-unified .rxp-category-page .rxp-category-product,
  body.rxp-brand-unified .rxp-category-page .rxp-category-document-list article {
    transition:
      transform .24s var(--rxp-polish-ease),
      border-color .24s ease,
      box-shadow .24s var(--rxp-polish-ease);
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero__tile:hover,
  body.rxp-brand-unified .rxp-category-page .rxp-category-document-list article:hover {
    border-color: rgba(229, 37, 42, .3);
    box-shadow: 0 22px 46px rgba(10, 31, 59, .13);
    transform: translateY(-3px);
  }
}

@media (max-width: 1024px) {
  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero__grid {
    grid-template-columns: minmax(0, 1fr) minmax(350px, .78fr);
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-hero__grid {
    grid-template-columns: minmax(0, 1fr) 310px;
  }
}

@media (max-width: 767px) {
  body.rxp-brand-unified .rxp-brand-page.rxp-catalog-page .rxp-brand-container {
    width: calc(100% - 28px) !important;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero {
    padding-block: 28px 32px;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero__grid {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero__copy {
    text-align: center;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-breadcrumb {
    justify-content: center;
    margin-bottom: 13px;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-logo {
    width: min(206px, 68%);
    min-height: 60px;
    margin: 0 auto 13px;
    padding: 9px 14px;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-logo img {
    height: 39px;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-eyebrow {
    margin-bottom: 8px !important;
    font-size: 11.5px;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero h1 {
    margin-bottom: 11px;
    font-size: clamp(27px, 7.8vw, 33px) !important;
    line-height: 1.42 !important;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-lead {
    margin-bottom: 17px !important;
    font-size: 13px;
    line-height: 1.85;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-actions {
    gap: 8px;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-request-strip {
    gap: 8px 14px;
    margin-top: 17px !important;
    padding-top: 13px !important;
    text-align: start;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero__media {
    height: 298px;
    grid-template-rows: repeat(2, minmax(0, 1fr));
    gap: 8px;
    min-height: 0;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-hero__tile img {
    padding: 12px;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-section--selection {
    padding-block: 52px;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-selection-copy {
    text-align: center;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-selection-copy h2 {
    font-size: 27px;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-applications {
    padding: 19px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-hero {
    padding-block: 27px 34px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-hero__grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-hero .rxp-brand-breadcrumb {
    margin-bottom: 12px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-brand {
    margin-block: 12px 13px;
    padding: 8px 12px;
    border-radius: 14px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-brand img {
    max-width: 108px;
    height: 28px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-hero h1 {
    margin-bottom: 11px;
    font-size: clamp(28px, 8vw, 34px) !important;
    line-height: 1.4 !important;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-hero__copy > p {
    margin-bottom: 17px;
    font-size: 12.5px;
    line-height: 1.82;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-hero .rxp-brand-actions {
    gap: 8px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-stats {
    gap: 6px;
    margin-top: 15px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-stats > div {
    min-height: 66px;
    padding-inline: 4px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-stats strong {
    font-size: 20px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-hero__media {
    width: min(250px, 72vw);
    padding: 24px;
    border-radius: 25px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-products,
  body.rxp-brand-unified .rxp-category-page .rxp-category-selection,
  body.rxp-brand-unified .rxp-category-page .rxp-category-documents {
    padding-block: 50px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-family > header {
    gap: 9px;
    padding: 17px 15px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-product-grid {
    gap: 8px;
    padding: 8px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-product {
    min-height: 0;
    padding: 15px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-product__top {
    align-items: flex-start;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-product__actions a {
    min-height: 44px;
    padding-inline: 9px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-selection__grid {
    gap: 12px;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-document-list article {
    gap: 12px;
  }

  body.rxp-brand-unified .rxp-brand-page.rxp-catalog-page .rxp-brand-final-cta {
    padding-bottom: calc(26px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 380px) {
  body.rxp-brand-unified .rxp-brand-page.rxp-catalog-page .rxp-brand-container {
    width: calc(100% - 22px) !important;
  }

  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-request-strip,
  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-applications ul,
  body.rxp-brand-unified .rxp-brand-directory-page .rxp-brand-master-doc > div:last-child,
  body.rxp-brand-unified .rxp-category-page .rxp-category-product__actions {
    grid-template-columns: 1fr;
  }

  body.rxp-brand-unified .rxp-category-page .rxp-category-product__actions .rxp-catalog-rfq {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  body.rxp-brand-unified .rxp-brand-page.rxp-catalog-page *,
  body.rxp-brand-unified .rxp-brand-page.rxp-catalog-page *::before,
  body.rxp-brand-unified .rxp-brand-page.rxp-catalog-page *::after {
    scroll-behavior: auto !important;
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
}
