/* Shared preview fixes. Kept after the original prototype baseline and WP integration. */

/* Product titles remain complete in the document; only their compact displays truncate. */
.product-detail-banner h1 {
  display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  overflow: hidden; overflow-wrap: anywhere;
}
.is-product-detail-page .rank-math-breadcrumb { width: 100%; min-width: 0; }
.is-product-detail-page .rank-math-breadcrumb p { flex-wrap: nowrap; min-width: 0; }
.is-product-detail-page .rank-math-breadcrumb p > a,
.is-product-detail-page .rank-math-breadcrumb .last {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.is-product-detail-page .rank-math-breadcrumb p > a { flex: 0 1 auto; }
.is-product-detail-page .rank-math-breadcrumb p > a:first-child,
.is-product-detail-page .rank-math-breadcrumb .separator { flex: 0 0 auto; }
.is-product-detail-page .rank-math-breadcrumb .last { flex: 1 1 0; min-width: 3em; }
@media (min-width: 901px) {
  .product-detail-grid > .bh-product-sticky {
    position: sticky; top: var(--bh-product-sticky-top, 106px); align-self: start;
  }
}
@media (max-width: 900px) {
  .product-detail-grid > .bh-product-sticky { position: relative; top: auto; }
  .is-product-detail-page .rank-math-breadcrumb p { gap: 8px; }
}

/* Video has no panel chrome; keep the shared certificate viewer unchanged. */
#media-dialog:has(.bh-media-content > iframe) {
  background: transparent; padding: 48px 0 0; border-radius: 0; box-shadow: none;
}
#media-dialog:has(.bh-media-content > iframe) > .bh-dialog-close { top: 0; right: 0; }

/* Certificate panel follows the document, not the wide video-player canvas. */
#media-dialog:has(.bh-media-content > figure) {
  width: fit-content; max-width: calc(100vw - 24px); padding: 48px 12px 14px;
}
#media-dialog:has(.bh-media-content > figure) .bh-media-content { gap: 10px; }
#media-dialog .bh-media-content > figure { flex: 0 1 auto; }
#media-dialog .bh-media-content > figure img {
  display: block; width: auto; height: auto;
  max-width: calc(100vw - 156px); max-height: min(75vh, calc(90dvh - 136px));
}
#media-dialog .bh-media-content > figure figcaption {
  width: 0; min-width: 100%; overflow-wrap: anywhere; line-height: 1.4;
}
#media-dialog:has(.bh-media-content > figure) .bh-media-content > button {
  flex: 0 0 44px; width: 44px; height: 44px; padding: 0; display: grid; place-items: center;
}

/* WP empty states use h2 and a navigation link instead of the prototype h3/button. */
.product-category-empty > h2 { margin: 0 0 12px; }
.product-category-empty > p { margin: 0; line-height: 1.6; }
.product-category-empty > a.button { margin: 20px 0 0; }

/* The 18px, letter-spaced label must fit inside the established-year badge. */
.is-about-page .about-year-mark {
  width: max-content; min-width: 160px;
  right: 25%; transform: translateX(50%);
  gap: 12px;
}
.is-about-page .about-year-mark > span { white-space: nowrap; }
@media (max-width: 760px) {
  .is-about-page .about-year-mark {
    min-width: 126px; max-width: calc(100% - 28px);
    right: 14px; transform: none;
  }
}

/* The original React animation set visibility in JS; native WP accordions own it here. */
.custom-faq-answer {
  visibility: hidden;
  transition: height .38s ease, opacity .3s ease, visibility 0s .38s;
}
.custom-faq-item.is-open > .custom-faq-answer {
  visibility: visible;
  transition-delay: 0s;
}
.custom-faq-answer > div { padding: 0 0 24px; }
.custom-faq-answer p { padding: 0 32px 0 0; margin: 0 0 12px; }
.custom-faq-answer p:last-child { margin-bottom: 0; }

/* Keep the h3 hierarchy while restoring the original category title treatment. */
.catalog-card > a > h3 {
  min-height: 74px; margin: 0; padding: 20px 18px;
  display: flex; align-items: center; justify-content: center;
  font: 700 18px/1.35 var(--serif); color: var(--primary); text-align: center;
  overflow-wrap: anywhere;
}
.product-category-search.product-category-search-mobile { display: none; }
@media (max-width: 720px) {
  .product-category-search.product-category-search-mobile { display: flex; margin-bottom: 24px; }
  .catalog-card > a > h3 { min-height: 76px; padding: 16px 10px; }
}

/* Static reference: 60 × 22px pill with an 8px dot, 24px dash and 8px gap. */
.hero > .hero-dots { z-index: 5; gap: 8px; padding: 7px 10px; }
.hero .hero-dot {
  position: relative; width: 8px; height: 8px; flex: 0 0 auto;
  background: rgba(10,52,95,.3); transform: none;
  transition: width .24s ease, background-color .24s ease;
}
.hero .hero-dot.is-active { width: 24px; background: var(--primary); }
/* Transparent hit area does not enlarge the visible pill or overlap its neighbor. */
.hero .hero-dot::after { content: ""; position: absolute; inset: -8px -4px; }
.hero .hero-dot:hover { background: var(--primary); }
.hero .hero-dot:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.product-pagination button { position: relative; }
.product-pagination button::after { content: ""; position: absolute; inset: -8px -5px; }
.proof-image-wrap > span > svg { width: 18px; height: 18px; min-width: 18px; flex: 0 0 18px; }

.bh-form-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px 24px; padding-bottom: 23px; margin-bottom: 24px; border-bottom: 1px solid var(--line);
}
.bh-form-header .bh-form-heading, .bh-form-header .bh-form-heading-note { margin: 0; }
.bh-form-header .bh-form-heading { font-family: var(--serif); }
.bh-form-header .bh-form-heading-note { text-align: right; font-weight: 700; }
.is-home-page .inquiry-grid > .bh-form-general { padding: 38px; border: 1px solid var(--line); }
/* Fluent Forms supplies its own button size/margins; restore the static form footer. */
.bh-form-general .fluentform .ff_submit_btn_wrapper,
.bh-form-modal .fluentform .ff_submit_btn_wrapper { margin: 21px 0 0; }
.bh-form-general .fluentform .ff-el-group:has(+ .ff_submit_btn_wrapper),
.bh-form-modal .fluentform .ff-el-group:has(+ .ff_submit_btn_wrapper) { margin-bottom: 0; }
.bh-form-general .fluentform .ff-btn-submit,
.bh-form-modal .fluentform .ff-btn-submit {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; min-height: 50px; padding: 10px 20px !important; margin: 0;
  font-size: 18px !important; font-weight: 700 !important; line-height: 1.5 !important;
}
/* Fluent Forms owns ::after while .ff-working displays its submission progress. */
.bh-form-general .fluentform .ff-btn-submit:not(.ff-working)::after,
.bh-form-modal .fluentform .ff-btn-submit:not(.ff-working)::after {
  content: ""; width: 18px; height: 18px; flex: 0 0 18px; background: currentColor;
  mask: url("../icons/paper-plane-tilt.svg") center / contain no-repeat;
  -webkit-mask: url("../icons/paper-plane-tilt.svg") center / contain no-repeat;
}
.bh-form-general .fluentform .ff-btn-submit:hover,
.bh-form-modal .fluentform .ff-btn-submit:hover { background: var(--accent) !important; }
.bh-form-general > .bh-form-note,
.bh-form-modal > .bh-form-note {
  margin: 13px 0 0; display: flex; align-items: center; justify-content: center; gap: 6px;
  color: #7d8791; font-size: 18px; line-height: 1.5; text-align: center;
}
.bh-form-note > svg { width: 15px; height: 15px; flex: 0 0 15px; }
/* Reference modal: 860px panel, 38px side padding, split header and 44px fields. */
#inquiry-dialog {
  box-sizing: border-box; width: 860px; max-width: calc(100vw - 24px);
  max-height: calc(100dvh - 28px); padding: 34px 38px 36px;
  overscroll-behavior: contain;
}
#inquiry-dialog .bh-dialog-close { top: 18px; right: 18px; width: 42px; height: 42px; z-index: 2; }
#inquiry-dialog .bh-dialog-close:hover { background: var(--accent); color: white; }
#inquiry-dialog .bh-dialog-close:focus-visible { outline: 2px solid var(--primary); outline-offset: 3px; }
#inquiry-dialog .bh-inquiry-header {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 20px; padding: 0 54px 23px 0; margin-bottom: 24px; border-bottom: 1px solid var(--line);
}
#inquiry-dialog .bh-inquiry-header h2 { margin: 0; font: 700 20px/1.3 var(--serif); }
#inquiry-dialog .bh-inquiry-header p { margin: 0; color: var(--accent); font: 700 18px/1.5 var(--sans); text-align: right; }
#inquiry-dialog .ff-t-container { gap: 18px; }
#inquiry-dialog .ff-el-group { margin-bottom: 17px; }
#inquiry-dialog .ff-el-input--label { margin-bottom: 7px; }
#inquiry-dialog .ff-el-input--label label { margin: 0; color: #324050; font-size: 18px; font-weight: 700; line-height: 1.3; letter-spacing: .02em; }
#inquiry-dialog .ff-el-form-control {
  min-height: 44px; height: 44px; padding: 0 12px; background: #fbfbfa;
  border-color: #d7dce0; font-size: 18px; font-weight: 700; line-height: 1.4;
}
#inquiry-dialog .ff-el-form-control::placeholder { color: #787878; font-weight: 700; opacity: 1; }
#inquiry-dialog .ff-el-is-error .ff-el-form-control { border-color: #b42318; }
#inquiry-dialog textarea.ff-el-form-control { min-height: 122px; height: 122px; padding: 12px; resize: vertical; }
#inquiry-dialog .ff-el-group:has(+ .ff_submit_btn_wrapper) { margin-bottom: 0; }
#inquiry-dialog .ff_submit_btn_wrapper { margin: 26px 0 0; }
@media (max-width: 767px) {
  #inquiry-dialog { padding: 24px 16px 26px; max-height: calc(100dvh - 24px); }
  #inquiry-dialog .bh-inquiry-header { flex-direction: column; align-items: flex-start; gap: 7px; padding-right: 46px; }
  #inquiry-dialog .bh-inquiry-header p { text-align: left; }
  #inquiry-dialog .ff-t-container { gap: 10px; }
  #inquiry-dialog .ff-t-container.bh-mobile-full { gap: 0; }
  #inquiry-dialog .bh-form-note { align-items: flex-start; text-align: left; }
  #inquiry-dialog .bh-form-note > svg { margin-top: 6px; }
}
/* Adapt the static category card to Fluent Forms' nested label/button wrappers. */
.category-inquiry-heading > h2 {
  margin: 0; color: white; font: 700 27px/1.2 var(--serif);
}
.category-inquiry-heading > strong {
  display: block; margin-top: 9px; color: #ffac89; font-size: 18px; font-weight: 700;
}
.category-inquiry-form > p {
  margin: 18px 0 24px; color: rgba(255,255,255,.75); font-size: 18px; line-height: 1.65;
}
.category-inquiry-form .bh-form-category .ff-el-group { margin: 0 0 15px; }
.category-inquiry-form .bh-form-category .ff-el-input--label { margin: 0 0 7px; }
.category-inquiry-form .bh-form-category .ff-el-input--label label {
  display: inline-block; margin: 0; color: rgba(255,255,255,.82); font-weight: 700;
}
.category-inquiry-form .bh-form-category .ff-el-group:has(+ .ff_submit_btn_wrapper) { margin-bottom: 0; }
.category-inquiry-form .bh-form-category .ff_submit_btn_wrapper { margin: 22px 0 0; }
.category-inquiry-form .bh-form-category .ff-btn-submit {
  display: flex; align-items: center; justify-content: center; gap: 9px;
  width: 100%; min-height: 48px; margin: 0; padding: 10px 14px !important;
  font-size: 18px !important; font-weight: 700 !important; line-height: 1.5 !important;
}
.category-inquiry-form .bh-form-category .ff-btn-submit:not(.ff-working)::after {
  content: ""; width: 18px; height: 18px; flex: 0 0 18px; background: currentColor;
  mask: url("../icons/paper-plane-tilt.svg") center / contain no-repeat;
  -webkit-mask: url("../icons/paper-plane-tilt.svg") center / contain no-repeat;
}
.category-inquiry-form .bh-form-category > .bh-form-note {
  margin: 15px 0 0; display: flex; align-items: flex-start; gap: 7px;
  color: rgba(255,255,255,.7); font-size: 18px; line-height: 1.5; text-align: left;
}
.category-inquiry-form .bh-form-note > svg { margin-top: 6px; }
.bh-form .ff-el-form-control, .bh-form .ff-el-form-control::placeholder {
  font-family: var(--sans); font-size: 18px; line-height: 1.5;
}
.bh-whatsapp-icon { color: #18ad61; flex-shrink: 0; }
.product-whatsapp-link { display: inline-flex; gap: 8px; align-items: center; }
.product-gallery-main { position: relative; }
.bh-gallery-status {
  position: absolute; left: 16px; right: 16px; bottom: 16px; padding: 10px 14px;
  background: rgba(255,255,255,.94); color: var(--primary); text-align: center;
  pointer-events: none; border-radius: 3px; font: 500 18px/1.5 var(--sans);
}

/* Two horizontal cards only when there is room for square images AND readable copy. */
.news-directory-card { container-type: normal; }
.news-directory-card > a {
  grid-template-columns: minmax(0,1fr) minmax(0,1fr);
  min-height: 0; height: auto; aspect-ratio: 2 / 1;
}
.news-directory-media { width: 100%; aspect-ratio: 1; min-height: 0; height: 100%; }
.news-directory-copy { padding: 32px; gap: 12px; min-width: 0; min-height: 0; }
.news-directory-copy > * { flex-shrink: 0; }
.news-directory-copy > p, .news-directory-copy > h3, .news-directory-copy > div { margin: 0; }
.news-directory-copy > p { font-size: 18px; line-height: 1.3; letter-spacing: .06em; }
.news-directory-copy h3 { font-size: clamp(20px,1.45vw,25px); line-height: 1.3; }
.news-directory-copy > div { font-size: 18px; line-height: 1.6; }
.news-directory-link { margin-top: auto; line-height: 1.4; }
@media (min-width: 768px) and (max-width: 1439px) {
  .news-directory-grid { grid-template-columns: minmax(0,980px); justify-content: center; }
  .news-directory-copy h3 { font-size: 26px; }
}
@media (max-width: 767px) {
  .is-home-page .inquiry-grid > .bh-form-general { padding: 24px 18px; }
  .bh-form-header { flex-direction: column; align-items: flex-start; gap: 8px; }
  .bh-form-header .bh-form-heading-note { text-align: left; }
  .news-directory-card > a { grid-template-columns: 1fr; aspect-ratio: auto; }
  .news-directory-media { aspect-ratio: 1; height: auto; }
  .news-directory-copy { padding: 24px; gap: 14px; }
  .news-directory-copy h3 { font-size: 24px; }
  .news-directory-link { margin-top: 8px; }
}
@media (prefers-reduced-motion: reduce) {
  .custom-faq-answer, .custom-faq-item.is-open > .custom-faq-answer { transition: none; }
}

/* Successful catalogue inquiries: separate and center the download action. */
#inquiry-dialog > [data-catalogue-result] {
  display: flex;
  width: fit-content;
  max-width: 100%;
  margin: 28px auto 0;
  text-align: center;
}
.bh-form-note a { color: inherit; text-decoration: underline; text-underline-offset: 3px; }

/* Keep orange decoration; use a darker orange for readable text on light surfaces. */
.eyebrow, .accent-underline, .news-card-content > p { color: #b83b0f; }
.factory-content .eyebrow, .footer .eyebrow, .inquiry-card .eyebrow { color: #ff9a70; }
.process-step > span { color: #778694; }
.footer-bottom { color: #adbed0; }
/* Small visible dots retain their appearance inside real, non-overlapping targets. */
.product-pagination { gap: 2px; flex-wrap: wrap; }
.product-pagination button,
.buyer-dots button {
  width: 24px; height: 24px; min-width: 24px; flex: 0 0 24px;
  display: grid; place-items: center; background: transparent; border: 0;
  box-shadow: none; transform: none; border-radius: 3px;
}
.product-pagination button::before {
  content: ''; width: 8px; height: 8px; border-radius: 50%;
  background: #7b8fa3; transition: transform 180ms ease;
}
.product-pagination button:is(:hover,.is-active) { background: transparent; transform: none; }
.product-pagination button:is(:hover,.is-active)::before { background: var(--primary); transform: scale(1.25); }
.buyer-dots { gap: 2px; }
.buyer-dots button::before {
  content: ''; width: 10px; height: 10px; border-radius: 50%;
  background: rgba(255,255,255,.58); border: 1px solid white;
}
.buyer-dots button:is(:hover,.is-active) { background: transparent; box-shadow: none; transform: none; }
.buyer-dots button:is(:hover,.is-active)::before { background: white; box-shadow: 0 0 0 4px rgba(255,255,255,.2); }
.product-pagination button:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.buyer-dots button:focus-visible { outline: 2px solid white; outline-offset: 1px; }
