/* Brand theme (#0f2744) + typography on top of Bootstrap */
:root,
[data-bs-theme="light"] {
  --bs-primary: #0f2744;
  --bs-primary-rgb: 15, 39, 68;
  --bs-link-color: #0f2744;
  --bs-link-hover-color: #0c2138;
  --bs-primary-text-emphasis: #081829;
  --bs-primary-bg-subtle: #e8edf2;
  --bs-primary-border-subtle: #c5d0dc;
  --bs-focus-ring-color: rgba(15, 39, 68, 0.25);
}

.btn-primary {
  --bs-btn-color: #fff;
  --bs-btn-bg: #0f2744;
  --bs-btn-border-color: #0f2744;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #0c2138;
  --bs-btn-hover-border-color: #0a1d32;
  --bs-btn-focus-shadow-rgb: 15, 39, 68;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #0a1d32;
  --bs-btn-active-border-color: #091a2d;
  --bs-btn-disabled-color: #fff;
  --bs-btn-disabled-bg: #0f2744;
  --bs-btn-disabled-border-color: #0f2744;
}

.btn-outline-primary {
  --bs-btn-color: #0f2744;
  --bs-btn-border-color: #0f2744;
  --bs-btn-hover-color: #fff;
  --bs-btn-hover-bg: #0f2744;
  --bs-btn-hover-border-color: #0f2744;
  --bs-btn-focus-shadow-rgb: 15, 39, 68;
  --bs-btn-active-color: #fff;
  --bs-btn-active-bg: #0c2138;
  --bs-btn-active-border-color: #0a1d32;
  --bs-btn-disabled-color: #0f2744;
  --bs-btn-disabled-border-color: #0f2744;
}

.pagination {
  --bs-pagination-active-color: #fff;
  --bs-pagination-active-bg: #0f2744;
  --bs-pagination-active-border-color: #0f2744;
  --bs-pagination-focus-box-shadow: 0 0 0 0.25rem rgba(15, 39, 68, 0.25);
}

.dropdown-menu {
  --bs-dropdown-link-active-color: #fff;
  --bs-dropdown-link-active-bg: #0f2744;
}

body {
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.lang-zh {
  font-family: "Noto Sans SC", "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", sans-serif;
}

.language-switcher .btn-link.disabled {
  opacity: 1;
}

/* Footer: light icons on dark background (primary blue has poor contrast here) */
footer .footer-icon {
  color: rgba(255, 255, 255, 0.72);
  flex-shrink: 0;
}

footer a:hover .footer-icon {
  color: #fff;
}

/* Brand wordmark + small overrides on top of Bootstrap */
.nav-item {
  padding: 0 0.5rem !important;
}
.logo-zw {
  color: #0f2744;
}

.logo-rest {
  color: #000;
}

.logo-a {
  position: relative;
  display: inline-block;
}

.logo-a::after {
  content: "";
  position: absolute;
  right: 2px;
  top: 4px;
  width: 3px;
  height: 10px;
  background: #e11d48;
  border-radius: 1px;
}

/* Navbar: keep active underline only on simple links (not dropdown toggles) */
@media (min-width: 992px) {
  .navbar-nav .nav-link.active.border-bottom {
    padding-bottom: calc(0.5rem - 2px);
  }
}

/* Anchor targets clear sticky navbar */
main [id] {
  scroll-margin-top: 5.5rem;
}

/*
 * Home hero: one viewport minus sticky navbar (tune --site-banner-offset if nav height changes).
 * Uses svh for stable mobile initial viewport; lh unit not needed.
 */
:root {
  --site-banner-offset: 5.5rem;
}

.home-banner .carousel-item {
  min-height: calc(100vh - var(--site-banner-offset));
  min-height: calc(100svh - var(--site-banner-offset));
}

.home-banner__link {
  position: relative;
  display: block;
  min-height: calc(100vh - var(--site-banner-offset));
  height: calc(100vh - var(--site-banner-offset));
  min-height: calc(100svh - var(--site-banner-offset));
  height: calc(100svh - var(--site-banner-offset));
}

@supports (height: 100dvh) {
  .home-banner .carousel-item {
    min-height: calc(100dvh - var(--site-banner-offset));
  }

  .home-banner__link {
    min-height: calc(100dvh - var(--site-banner-offset));
    height: calc(100dvh - var(--site-banner-offset));
  }
}

.home-banner__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Home: hot products — text left, image right */
.home-hot-products__visual {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem 0.75rem;
  min-height: 11.5rem;
  text-align: center;
  overflow: hidden;
}

.home-hot-products__img {
  display: block;
  width: auto;
  max-width: 14rem;
  height: auto;
  max-height: 11.5rem;
  margin-inline: auto;
  object-fit: contain;
  object-position: center;
  transform: scale(1);
  transform-origin: center center;
  transition: transform 0.45s cubic-bezier(0.22, 1, 0.36, 1);
}

.home-hot-products__visual:hover .home-hot-products__img,
.home-hot-products__visual:focus-within .home-hot-products__img {
  transform: scale(1.12);
}

@media (min-width: 992px) {
  .home-hot-products__visual {
    min-height: 13rem;
  }

  .home-hot-products__img {
    max-width: 16rem;
    max-height: 13rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-hot-products__img {
    transition: none;
  }

  .home-hot-products__visual:hover .home-hot-products__img,
  .home-hot-products__visual:focus-within .home-hot-products__img {
    transform: scale(1);
  }
}

/* Home: certificates strip (above FAQs) */
.home-certificates {
  background: linear-gradient(180deg, #f0f3f7 0%, #fff 55%, #fff 100%);
}
.home-certificates__kicker {
  letter-spacing: 0.12em;
}
.home-certificates__figure {
  display: flex;
}
.home-certificates__trigger {
  cursor: zoom-in;
  -webkit-tap-highlight-color: transparent;
}
.home-certificates__trigger:focus-visible {
  outline: 0;
  box-shadow: 0 0 0 0.2rem rgba(15, 39, 68, 0.35);
}
.home-certificates__frame {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 9.5rem;
  padding: 0.75rem 0.65rem;
  background: #fff;
  border: 1px solid rgba(15, 39, 68, 0.08);
  border-radius: 0.75rem;
  box-shadow: 0 0.35rem 1rem rgba(15, 39, 68, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
.home-certificates__trigger:hover .home-certificates__frame,
.home-certificates__trigger:focus-visible .home-certificates__frame {
  transform: translateY(-3px);
  box-shadow: 0 0.65rem 1.75rem rgba(15, 39, 68, 0.12);
  border-color: rgba(15, 39, 68, 0.22);
}
.home-certificates__img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 7.5rem;
  object-fit: contain;
  object-position: center;
}
@media (min-width: 576px) {
  .home-certificates__frame {
    min-height: 10.5rem;
    padding: 1rem 0.85rem;
  }
  .home-certificates__img {
    max-height: 8.5rem;
  }
}
@media (min-width: 992px) {
  .home-certificates__frame {
    min-height: 11.5rem;
    padding: 1.1rem 1rem;
  }
  .home-certificates__img {
    max-height: 9.25rem;
  }
}
@media (min-width: 1200px) {
  .home-certificates__frame {
    min-height: 10rem;
    padding: 1rem 0.75rem;
  }
  .home-certificates__img {
    max-height: 7.75rem;
  }
}
@media (prefers-reduced-motion: reduce) {
  .home-certificates__frame {
    transition: none;
  }
  .home-certificates__trigger:hover .home-certificates__frame,
  .home-certificates__trigger:focus-visible .home-certificates__frame {
    transform: none;
  }
}

/* Home: certificate lightbox (modal) */
.certificate-lightbox-dialog {
  max-width: min(94vw, 52rem);
}
.certificate-lightbox-content {
  overflow: hidden;
  border-radius: 0.75rem;
}
.certificate-lightbox-header {
  background: #0f2744;
}
.certificate-lightbox-close {
  filter: invert(1) grayscale(100%);
  opacity: 0.9;
}
.certificate-lightbox-close:hover {
  opacity: 1;
}
.certificate-lightbox-body {
  background: #f8fafc;
  min-height: 10rem;
}
.certificate-lightbox__img {
  width: auto;
  max-width: 100%;
  max-height: min(82vh, 880px);
  height: auto;
  object-fit: contain;
}
@media (max-width: 575.98px) {
  .modal-fullscreen-sm-down .certificate-lightbox-content {
    border-radius: 0;
  }
  .modal-fullscreen-sm-down .certificate-lightbox__img {
    max-height: min(72vh, 1200px);
  }
}

/* Pagination: visible gaps between items (Bootstrap joins items by default) */
.pagination.pagination-spaced {
  gap: 0.5rem;
}
.pagination.pagination-spaced .page-item .page-link {
  margin-left: 0;
}

/* Rich text from TinyMCE / admin (|safe) — keep layout inside container */
.product-detail-html {
  overflow-x: auto;
  font-size: 0.95rem;
  line-height: 1.6;
}
.product-detail-html img,
.product-detail-html video,
.product-detail-html iframe {
  max-width: 100%;
  height: auto;
}
.product-detail-html table {
  width: 100% !important;
  max-width: 100%;
}

/* About page: reference visual + values panel */
.about-visual-figure__img {
  max-height: min(70vh, 520px);
  width: auto;
  margin-left: auto;
  margin-right: auto;
}
.about-core-values__rule {
  width: 3rem;
  height: 3px;
  background: var(--bs-primary);
  border-radius: 2px;
}
.about-core-values__grid-panel {
  background-color: #fff;
  background-image: radial-gradient(rgba(15, 39, 68, 0.07) 1px, transparent 1px);
  background-size: 14px 14px;
  box-shadow: 0 0.5rem 2rem rgba(15, 39, 68, 0.08);
}
.about-value-card {
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.about-value-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 0.75rem 2rem rgba(15, 39, 68, 0.12) !important;
}
.about-gallery-tile {
  aspect-ratio: 4 / 3;
}
.about-gallery-tile img {
  height: 100%;
}

.about-value-card__icon .mdi {
  line-height: 1;
  vertical-align: middle;
}

/* Legal pages (privacy, terms) */
.legal-page section {
  max-width: 48rem;
}
.legal-page h2 {
  margin-top: 0.25rem;
}

/* OEM page: workflow step numbers */
.oem-step-badge {
  width: 2.75rem;
  height: 2.75rem;
  font-size: 1.1rem;
  line-height: 1;
}

/* Contact page: embedded map (iframe inside .ratio) */

.contact-map-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
}
.contact-map-frame:focus-within {
  outline: 0.2rem solid rgba(15, 39, 68, 0.45);
  outline-offset: 0.15rem;
}

/* About: statistics strip (counter animation targets #about-stats) */
.about-stats-panel {
  position: relative;
  overflow: hidden;
}
.about-stats-panel__dots {
  position: absolute;
  top: 0;
  right: 0;
  width: 42%;
  height: 55%;
  max-height: 12rem;
  pointer-events: none;
  background-image: radial-gradient(rgba(15, 39, 68, 0.08) 1px, transparent 1px);
  background-size: 12px 12px;
  mask-image: linear-gradient(to bottom left, black 40%, transparent 72%);
  -webkit-mask-image: linear-gradient(to bottom left, black 40%, transparent 72%);
}
.about-stats-col:not(:last-child) {
  border-bottom: 1px solid var(--bs-border-color, #dee2e6);
}
@media (min-width: 768px) {
  .about-stats-col:not(:last-child) {
    border-bottom: none;
    border-right: 1px solid var(--bs-border-color, #dee2e6);
  }
}
.about-stat__accent {
  width: 2.5rem;
  height: 4px;
  background: var(--bs-primary);
  border-radius: 2px;
}
.about-stat__suffix {
  font-weight: inherit;
}
@media (prefers-reduced-motion: reduce) {
  .about-value-card {
    transition: none;
  }
  .about-value-card:hover {
    transform: none;
  }
}
