/*
 * V359 — authoritative site-wide content contract.
 * Loaded last on every PHP page so legacy page CSS cannot override it.
 */

/* Normal content copy is black. Header/footer navigation is intentionally excluded. */
body.v64-medtech-layout main :is(
  p, li, span, label, figcaption, small, dt, dd, td, th
),
body.v64-medtech-layout > section :is(
  p, li, span, label, figcaption, small, dt, dd, td, th
) {
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
}

/* White content boxes: black Times New Roman headings and black body copy. */
:is(
  .card, .category-card, .commercial-card, .complete-vet-card, .contact-box,
  .dental-cat-card, .dental-modal-card, .dental-page-card, .dental-ref-card,
  .dental-reference-panel, .division, .doc-card, .feature.light,
  .homepage-implant-card, .implant-card, .matched-product-card, .process-card,
  .product-card, .product-modal-card, .real-product-card, .ref-dropdown-card,
  .rfq-card, .surg-cat-card, .surg-modal-card, .surg-page-card,
  .surg-ref-card, .surg-reference-panel, .ths-box-visible,
  .ths-division-visual, .ths-facility-card, .ths-floating-box, .v54-trust,
  .vet-cat-card, .vet-page-modal-card, .vet-product-card,
  .vet-reference-panel, .vet-summary-card, .certificate-access-card,
  .certificate-viewer-card, .buyer-step, .about-value, .check, .step, .note
) {
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
}

:is(
  .card, .category-card, .commercial-card, .complete-vet-card, .contact-box,
  .dental-cat-card, .dental-modal-card, .dental-page-card, .dental-ref-card,
  .dental-reference-panel, .division, .doc-card, .feature.light,
  .homepage-implant-card, .implant-card, .matched-product-card, .process-card,
  .product-card, .product-modal-card, .real-product-card, .ref-dropdown-card,
  .rfq-card, .surg-cat-card, .surg-modal-card, .surg-page-card,
  .surg-ref-card, .surg-reference-panel, .ths-box-visible,
  .ths-division-visual, .ths-facility-card, .ths-floating-box, .v54-trust,
  .vet-cat-card, .vet-page-modal-card, .vet-product-card,
  .vet-reference-panel, .vet-summary-card, .certificate-access-card,
  .certificate-viewer-card, .buyer-step, .about-value, .check, .step, .note
) :is(h1, h2, h3, h4, h5, h6, b, strong) {
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  font-family: "Times New Roman", Times, serif !important;
  font-weight: 700 !important;
}

/* Permanent box-heading rule: headings inside every visual box remain bold. */
html body.v64-medtech-layout :is(
  [class*="card"], [class*="box"], [class*="panel"],
  .division, .feature, .step, .buyer-step, .check, .fact, .facts,
  .notice, .note, .cta, .quality-main, .rfq-list
) :is(h1, h2, h3, h4, h5, h6) {
  font-weight: 700 !important;
}

:is(
  .card, .category-card, .commercial-card, .complete-vet-card, .contact-box,
  .dental-cat-card, .dental-modal-card, .dental-page-card, .dental-ref-card,
  .dental-reference-panel, .division, .doc-card, .feature.light,
  .homepage-implant-card, .implant-card, .matched-product-card, .process-card,
  .product-card, .product-modal-card, .real-product-card, .ref-dropdown-card,
  .rfq-card, .surg-cat-card, .surg-modal-card, .surg-page-card,
  .surg-ref-card, .surg-reference-panel, .ths-box-visible,
  .ths-division-visual, .ths-facility-card, .ths-floating-box, .v54-trust,
  .vet-cat-card, .vet-page-modal-card, .vet-product-card,
  .vet-reference-panel, .vet-summary-card, .certificate-access-card,
  .certificate-viewer-card, .buyer-step, .about-value, .check, .step, .note
) :is(p, li, span, label, figcaption, small, dt, dd, td, th, a) {
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
}

/* True page and section headings match the Index “About us” rule. */
:is(main, .hero, .page-hero, .category-hero, .banner)
  h1:not(:is(.card, .panel, .modal, .product-modal-card) h1),
main > section > h2,
main > section > .wrap > h2,
main > section > div > h2,
body > section > .wrap > h2,
.section-title,
.category-page-main-heading,
.professional-purchasing-title-black,
#cutting-edge-facility .ths-facility-wrap > h2 {
  margin: 0 0 14px !important;
  padding: 0 !important;
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
  font-family: "Times New Roman", Times, serif !important;
  font-size: 36px !important;
  font-style: normal !important;
  font-weight: 400 !important;
  line-height: 1.18 !important;
  letter-spacing: 0 !important;
  text-align: left !important;
  text-transform: none !important;
  text-shadow: none !important;
}

/* Genuine maroon content boxes always retain white copy. */
:is(
  .hero-panel, .quality-main, .about-card, .rfq-list,
  .feature:not(.light), .vet-benefit, .certificate-warning,
  .dark-card, .dark-panel, .dark-section
),
:is(
  .hero-panel, .quality-main, .about-card, .rfq-list,
  .feature:not(.light), .vet-benefit, .certificate-warning,
  .dark-card, .dark-panel, .dark-section
) * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
  text-decoration-color: currentColor !important;
}

/* International Supply purchasing panel is a white box, not a maroon panel. */
body.v64-medtech-layout main.international-supply-with-banner .cta,
body.v64-medtech-layout main.international-supply-with-banner .cta * {
  color: #000000 !important;
  -webkit-text-fill-color: #000000 !important;
}

/* Product-box headings and all text descendants are maroon site-wide. */
html body.v64-medtech-layout :is(
  .division, .category-card, .product-card, .real-product-card,
  .matched-product-card, .surg-page-card, .dental-page-card, .full-vet-page,
  .homepage-implant-card, .implant-card, .vet-product-card, .vet-cat-card,
  .surg-cat-card, .dental-cat-card, .complete-vet-card, .vet-summary-card,
  .surg-ref-card, .dental-ref-card, .surg-reference-panel,
  .dental-reference-panel, .vet-reference-panel
),
html body.v64-medtech-layout :is(
  .division, .category-card, .product-card, .real-product-card,
  .matched-product-card, .surg-page-card, .dental-page-card, .full-vet-page,
  .homepage-implant-card, .implant-card, .vet-product-card, .vet-cat-card,
  .surg-cat-card, .dental-cat-card, .complete-vet-card, .vet-summary-card,
  .surg-ref-card, .dental-ref-card, .surg-reference-panel,
  .dental-reference-panel, .vet-reference-panel
) * {
  color: #76172f !important;
  -webkit-text-fill-color: #76172f !important;
  text-decoration-color: #76172f !important;
}

/* Every box on generated product-detail pages uses maroon typography. */
html body.v64-medtech-layout.product-detail-page :is(
  .panel, .facts, .fact, .notice, .related .card, .cards .card
),
html body.v64-medtech-layout.product-detail-page :is(
  .panel, .facts, .fact, .notice, .related .card, .cards .card
) * {
  color: #76172f !important;
  -webkit-text-fill-color: #76172f !important;
  text-decoration-color: #76172f !important;
}

/* Generic cards are product boxes on category and Beauty catalogue pages. */
html body.v64-medtech-layout.product-listing-page .card,
html body.v64-medtech-layout.product-listing-page .card *,
html body.v64-medtech-layout.category-catalogue-page .card,
html body.v64-medtech-layout.category-catalogue-page .card * {
  color: #76172f !important;
  -webkit-text-fill-color: #76172f !important;
  text-decoration-color: #76172f !important;
}

/* Buttons preserve the universal maroon/white and beige/maroon interaction. */
html body.v64-medtech-layout :is(
  .btn, .small-btn, .v55-detail-link, .view-range-btn, .surg-view-range,
  .dental-view-range, .prompt-rfq-btn, .filter-btn, .main-view-range,
  .external-email-link, .commercial-btn-primary, .commercial-btn-secondary,
  .ths-visitor-stats__button, .division-actions button,
  button:not(.top-products-btn), input[type="submit"], input[type="button"],
  input[type="reset"], a[role="button"]:not(.top-products-btn)
):not(:hover):not(:focus-visible),
html body.v64-medtech-layout :is(
  .btn, .small-btn, .v55-detail-link, .view-range-btn, .surg-view-range,
  .dental-view-range, .prompt-rfq-btn, .filter-btn, .main-view-range,
  .external-email-link, .commercial-btn-primary, .commercial-btn-secondary,
  .ths-visitor-stats__button, .division-actions button,
  button:not(.top-products-btn), input[type="submit"], input[type="button"],
  input[type="reset"], a[role="button"]:not(.top-products-btn)
):not(:hover):not(:focus-visible) * {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body.v64-medtech-layout :is(
  .btn, .small-btn, .v55-detail-link, .view-range-btn, .surg-view-range,
  .dental-view-range, .prompt-rfq-btn, .filter-btn, .main-view-range,
  .external-email-link, .commercial-btn-primary, .commercial-btn-secondary,
  .ths-visitor-stats__button, .division-actions button,
  button:not(.top-products-btn), input[type="submit"], input[type="button"],
  input[type="reset"], a[role="button"]:not(.top-products-btn)
):is(:hover, :focus-visible),
html body.v64-medtech-layout :is(
  .btn, .small-btn, .v55-detail-link, .view-range-btn, .surg-view-range,
  .dental-view-range, .prompt-rfq-btn, .filter-btn, .main-view-range,
  .external-email-link, .commercial-btn-primary, .commercial-btn-secondary,
  .ths-visitor-stats__button, .division-actions button,
  button:not(.top-products-btn), input[type="submit"], input[type="button"],
  input[type="reset"], a[role="button"]:not(.top-products-btn)
):is(:hover, :focus-visible) * {
  color: #76172f !important;
  -webkit-text-fill-color: #76172f !important;
}

/* Product-page buttons remain outside the product-text colour contract. */
html body.v64-medtech-layout.product-detail-page .btn:not(:hover):not(:focus-visible),
html body.v64-medtech-layout.product-detail-page .btn:not(:hover):not(:focus-visible) *,
html body.v64-medtech-layout.product-listing-page
  .beauty-category-button:not(:hover):not(:focus-visible) {
  color: #ffffff !important;
  -webkit-text-fill-color: #ffffff !important;
}

html body.v64-medtech-layout.product-detail-page .btn:is(:hover, :focus-visible),
html body.v64-medtech-layout.product-detail-page .btn:is(:hover, :focus-visible) *,
html body.v64-medtech-layout.product-listing-page
  .beauty-category-button:is(:hover, :focus-visible) {
  color: #76172f !important;
  -webkit-text-fill-color: #76172f !important;
}

@media (max-width: 760px) {
  :is(main, .hero, .page-hero, .category-hero, .banner)
    h1:not(:is(.card, .panel, .modal, .product-modal-card) h1),
  main > section > h2,
  main > section > .wrap > h2,
  main > section > div > h2,
  body > section > .wrap > h2,
  .section-title,
  .category-page-main-heading,
  .professional-purchasing-title-black,
  #cutting-edge-facility .ths-facility-wrap > h2 {
    font-size: 36px !important;
    line-height: 1.18 !important;
  }
}
