/* Shared public-site surface rules. Product imagery and technical color keys are content. */
body.pb-white-ui {
  --pb-bg: #fff;
  --pb-card: #fff;
  --pb-muted: #666;
  --pb-table-head: #fff;
  --pb-table-line: #dedede;
  --pb-border: #dedede;
  --pb-line: #dedede;
  --pb-radius: 10px;
  --pb-shadow: none;
  --pb-soft-text-shadow: 0 1px 1px rgba(0, 0, 0, .12);
  background: #fff;
}

/* Apply one shadow layer: links own theirs, standalone headings own theirs. */
body.pb-white-ui a:not(:where(#wpadminbar, #wpadminbar *, .screen-reader-text)),
body.pb-white-ui :is(h1, h2, h3, h4, h5, h6):not(:where(
  #wpadminbar, #wpadminbar *, .screen-reader-text, a *
)):not(:has(a)) {
  text-shadow: var(--pb-soft-text-shadow);
}

body.pb-white-ui :is(
  [class^="pb-"], [class*=" pb-"], .wp-site-blocks, .wp-block-group,
  .wp-block-table, .wp-block-button__link, .wp-element-button, .page-numbers,
  main, header, footer, section, article, aside, nav, figure, figcaption, a,
  form, fieldset, details, summary, dialog, table, thead, tbody, tfoot, tr, th, td,
  button, input, select, textarea
):not(:where(#wpadminbar, #wpadminbar *, svg, svg *, .pb-ptfe-flare-explainer__swatch, .pb-header__shade)) {
  background-color: #fff !important;
  background-image: none !important;
  border-color: var(--pb-border) !important;
  box-shadow: none !important;
}

body.pb-white-ui :is(
  [class^="pb-"], [class*=" pb-"], .wp-block-button__link, .wp-element-button,
  .page-numbers, button, input, select, textarea, fieldset, dialog, details, summary
):not(:where(#wpadminbar, #wpadminbar *, svg, svg *, .pb-ptfe-flare-explainer__swatch)) {
  border-radius: var(--pb-radius) !important;
}

/* Changing a dark button's surface also requires changing its visited/hover text. */
body.pb-white-ui :is(
  .pb-button, .pb-header__cta, .wp-block-button__link, .wp-element-button,
  button, input[type="submit"], input[type="button"], input[type="reset"]
):not(:where(#wpadminbar *)) {
  background: #fff !important;
  color: #222 !important;
  border: 1px solid var(--pb-border) !important;
  border-radius: var(--pb-radius) !important;
}
body.pb-white-ui :is(input, select, textarea):not(:where(#wpadminbar *)) {
  color: #222 !important;
  border: 1px solid var(--pb-border) !important;
}
body.pb-white-ui :is(.pb-hero, .pb-gallery-lightbox, .pb-gallery-lightbox__caption,
  .pb-gallery-lightbox__counter, .page-numbers.current) { color: #222 !important; }

body.pb-white-ui :is(.pb-table-scroll, .pb-content-table-wrap, .pb-table-wrap) {
  border: 1px solid var(--pb-border) !important;
  border-radius: var(--pb-radius) !important;
}

/* Frame the outer gallery container so the full-height image cannot cover its edge. */
body.pb-white-ui .pb-gost-gallery__main {
  border: 1px solid var(--pb-border) !important;
}
body.pb-white-ui .pb-gost-gallery__main .pb-gost-gallery__open {
  border: 0 !important;
}

body.pb-white-ui .pb-gost-facts {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 24px;
  margin: 16px 0 12px;
  border: 0;
}
body.pb-white-ui .pb-gost-facts > div {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  min-width: 0;
  padding: 6px 0;
  border: 0;
  border-bottom: 1px solid var(--pb-border);
}
body.pb-white-ui .pb-gost-facts dt {
  min-width: 0;
  margin: 0;
  color: var(--pb-muted);
  font-size: 14px;
  line-height: 1.4;
}
body.pb-white-ui .pb-gost-facts dd {
  min-width: 0;
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
  text-align: right;
  overflow-wrap: anywhere;
}
@media (max-width: 820px) {
  body.pb-white-ui .pb-gost-facts {
    grid-template-columns: 1fr;
    column-gap: 0;
  }
}

/* GOST sections use a shared text grid and spacing instead of nested frames. */
body.pb-white-ui .pb-gost-page :is(
  .pb-gost-hero, .pb-gost-section, .pb-anchor-nav, .pb-gost-hero-details,
  .pb-gost-hero-materials, .pb-gost-buying-info, .pb-gost-buying-info > div,
  .pb-gost-facts, .pb-gost-facts > div, .pb-gost-selection,
  .pb-gost-selection__item, .pb-gost-order-brief, .pb-gost-technical-group,
  .pb-gost-designations-inline, .pb-gost-designations-inline li,
  .pb-table-scroll, .pb-table-wrap, .pb-content-table-wrap,
  .pb-gost-family-carousel__body, .pb-request-form__submit-row,
  .pb-gost-scheme-list img, .pb-gost-scheme img, .pb-gost-placeholder
) {
  border: 0 !important;
  border-radius: 0 !important;
  box-shadow: none !important;
}
body.pb-white-ui .pb-gost-page .pb-gost-gallery__nav {
  border: 0 !important;
}
body.pb-white-ui .pb-gost-page .pb-gost-hero { padding-bottom: 24px; }
body.pb-white-ui .pb-gost-page .pb-gost-section { padding: 28px 0; }
body.pb-white-ui .pb-gost-page .pb-gost-copy { max-width: none; }
body.pb-white-ui .pb-gost-page .pb-gost-copy :is(p, ul, ol) { max-width: 900px; }
body.pb-white-ui .pb-gost-page :is(h2, h3, h4) {
  font-weight: 600;
  line-height: 1.3;
}
body.pb-white-ui .pb-gost-page h2 { margin: 0 0 20px; font-size: 28px; }
body.pb-white-ui .pb-gost-page h3 { margin: 24px 0 12px; font-size: 22px; }
body.pb-white-ui .pb-gost-page h4 { margin: 0 0 10px; font-size: 17px; }
body.pb-white-ui .pb-gost-page :is(
  .pb-gost-selection__item, .pb-gost-order-brief, .pb-gost-technical-group,
  .pb-gost-table-block
) > h3 { margin-top: 0; }
body.pb-white-ui .pb-gost-page :is(
  .pb-gost-selection__heading, .pb-production-gallery__heading,
  .pb-gost-family-carousel__heading
) h2 { margin-bottom: 0; }
body.pb-white-ui .pb-gost-page .pb-gost-hero-details {
  margin: 20px 0 0;
  padding: 0;
}
body.pb-white-ui .pb-gost-page :is(.pb-gost-hero-materials > p, .pb-gost-buying-info dt) {
  margin: 0 0 8px;
  color: #222;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
}
body.pb-white-ui .pb-gost-page .pb-gost-buying-info dt::before { display: none; }
body.pb-white-ui .pb-gost-page .pb-gost-buying-info { padding: 0; row-gap: 16px; }
body.pb-white-ui .pb-gost-page .pb-gost-buying-info > div { padding: 0; }
body.pb-white-ui .pb-gost-page .pb-gost-selection { gap: 28px 32px; }
body.pb-white-ui .pb-gost-page .pb-gost-selection__item { padding: 0; }
body.pb-white-ui .pb-gost-page .pb-gost-selection__heading { margin-bottom: 24px; }
body.pb-white-ui .pb-gost-page .pb-gost-order-brief { margin-top: 28px; padding: 0; }
body.pb-white-ui .pb-gost-page .pb-gost-technical-group { padding: 0; }
body.pb-white-ui .pb-gost-page .pb-gost-technical-group + .pb-gost-technical-group { margin-top: 40px; }
body.pb-white-ui .pb-gost-page .pb-gost-designations-inline { padding: 0; }
body.pb-white-ui .pb-gost-page .pb-gost-designations-inline .pb-designation-list { gap: 16px; }
body.pb-white-ui .pb-gost-page .pb-gost-designations-inline li { padding: 0; }
body.pb-white-ui .pb-gost-page .pb-request-form__submit-row { margin-top: 20px; padding-top: 0; }
@media (max-width: 720px) {
  body.pb-white-ui .pb-gost-page .pb-gost-section { padding: 22px 0; }
  body.pb-white-ui .pb-gost-page h2 { font-size: 24px; margin-bottom: 16px; }
  body.pb-white-ui .pb-gost-page h3 { font-size: 20px; }
  body.pb-white-ui .pb-gost-page .pb-gost-hero-details { row-gap: 20px; }
}

/* Compound search fields have one outer frame, not several nested frames. */
body.pb-white-ui :is(.pb-header__search, .pb-search-bar) {
  border: 1px solid var(--pb-border) !important;
  border-radius: var(--pb-radius) !important;
  overflow: hidden;
}
body.pb-white-ui :is(.pb-header__search, .pb-search-bar) input {
  border: 0 !important;
  border-radius: 10px 0 0 10px !important;
}
body.pb-white-ui :is(.pb-header__search, .pb-search-bar) button {
  border-width: 0 0 0 1px !important;
  border-radius: 0 10px 10px 0 !important;
}

/* Menu selection and keyboard focus use typography, not frames. */
body.pb-white-ui .pb-header { border-bottom: 0; }
body.pb-white-ui .pb-header :is(
  .pb-header__drawer, .pb-header__nav, .pb-header__nav *,
  .pb-header__catalog, .pb-header__catalog *, .pb-header__back, .pb-header__toggle
):not(:where(svg, svg *)) {
  border: 0 !important;
  outline: none !important;
  box-shadow: none !important;
}
body.pb-white-ui .pb-header__groups > button[aria-expanded="true"] {
  font-weight: 700;
}
body.pb-white-ui .pb-header :is(.pb-header__nav, .pb-header__catalog, .pb-header__mobile-tools) :is(a, button):focus-visible {
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
body.pb-white-ui .pb-header__toggle:focus-visible svg { stroke-width: 3; }
body.pb-white-ui .pb-gost-gallery__thumb[aria-current="true"] {
  font-weight: 700;
  text-decoration: underline;
  text-underline-offset: 5px;
  outline: 2px solid var(--pb-border);
  outline-offset: -3px;
}
body.pb-white-ui :is(a, button, summary):hover { text-underline-offset: 4px; }
body.pb-white-ui :is(.pb-button, .pb-header a, .pb-header button):hover { text-decoration: underline; }
body.pb-white-ui :is(a, button, input, select, textarea, summary):focus-visible {
  outline: 2px solid var(--pb-border) !important;
  outline-offset: 3px;
}
body.pb-white-ui :is(a, button, summary):focus-visible { text-decoration: underline; }
/* PTFE thumbnails keep one frame in every state; color marks selection and focus. */
body.pb-white-ui .pb-ptfe-carousel__thumb[aria-current="true"] { border-color: #aaa !important; }
body.pb-white-ui .pb-ptfe-carousel__thumb:focus-visible {
  border-color: #555 !important;
  outline: none !important;
}
body.pb-white-ui .pb-header__search:focus-within { outline: 2px solid var(--pb-border); }
body.pb-white-ui .pb-header__groups > button + button { margin-top: 4px; }

body.pb-white-ui .pb-gallery-lightbox::backdrop { background: rgba(17,17,17,.3) !important; }
body.pb-white-ui main img {
  max-width: min(100%, 800px);
  max-height: 800px;
}
body.pb-white-ui main .pb-gallery-lightbox__image {
  max-width: min(100%, 800px);
  max-height: min(calc(70dvh - 132px), 800px);
}
body.pb-white-ui .pb-header__shade { border-radius: 0 !important; }
@media (max-width: 1120px) {
  body.pb-white-ui .pb-header__catalog { border: 0 !important; }
  body.pb-white-ui .pb-header__production-links { margin-top: 6px; }
}

/* Legacy fallback; native font-edge alignment below removes the optical offset. */
body.pb-white-ui main :is(h1, h2, h3, h4, h5, h6):not(:where(
  nav *, aside *, dialog *, [role="dialog"] *, .screen-reader-text
)) {
  position: relative;
  padding-inline-start: 14px;
}
:root body.pb-white-ui main :is(h1, h2, h3, h4, h5, h6):not(:where(
  nav *, aside *, dialog *, [role="dialog"] *, .screen-reader-text
)) {
  /* A painted stripe preserves the full-card links whose headings are position: static. */
  background-image: linear-gradient(#cc0605, #cc0605) !important;
  background-repeat: no-repeat;
  background-size: 2px calc(100% - 1lh + .72em);
  background-size: 2px calc(100% - 1lh + 1cap);
  background-position: 0 calc((1lh - .72em) / 2 - .014em);
  background-position: 0 calc((1lh - 1cap) / 2 - .014em);
}
body.pb-white-ui main :is(h1, h2, h3, h4, h5, h6):not(:where(
  nav *, aside *, dialog *, [role="dialog"] *, .screen-reader-text
))::before { content: none; }

/* Let the browser align the box to real font edges instead of an optical offset. */
@supports (text-box: trim-both cap alphabetic) {
  :root body.pb-white-ui main :is(h1, h2, h3, h4, h5, h6):not(:where(
    nav *, aside *, dialog *, [role="dialog"] *, .screen-reader-text
  )) {
    text-box: trim-both cap alphabetic;
    background-position: 0 0;
    background-size: 2px 100%;
  }
}

/* Repeated product/category cards keep a first-line accent regardless of title length. */
:root body.pb-white-ui main :where(
  .pb-home-tile, .pb-fittings-tile, .pb-ptfe-category, .pb-home-category,
  .pb-product-standard-card, .pb-product-catalog-card, .pb-family-card,
  .pb-type-card, .pb-catalog-section-tile, .pb-catalog-type-tile,
  .pb-directory-card, .pb-series-card
) :is(h1, h2, h3, h4, h5, h6):not(:where(
  nav *, aside *, dialog *, [role="dialog"] *, .screen-reader-text
)) {
  background-size: 2px .72em;
  background-size: 2px 1cap;
}

/* These titles contain block/flex links; share their first text baseline. */
body.pb-white-ui .pb-home-category h3 {
  display: flex;
  align-items: baseline;
}
body.pb-white-ui .pb-home-category h3::before { flex-shrink: 0; }
body.pb-white-ui .pb-home-category h3 > a { flex: 1; min-width: 0; }
