/* ==========================================================================
   Yiran homepage header module
   Extracted from yiran-home.css for safer long-term maintenance
   ========================================================================== */

/* =========================================================================
   HEADER — transparent over hero, solid sticky on scroll
   ========================================================================= */
.yiran-header-shell { position: sticky; top: 0; z-index: 1000; }
.admin-bar .yiran-header-shell { top: 32px; }
.yiran-header-main { position: relative; transition: background 0.3s ease, box-shadow 0.3s ease, backdrop-filter 0.3s ease; }
.yiran-header-main > .yiran-header-grid {
  width: min(1800px, calc(100% - clamp(48px, 7.5vw, 144px)));
  max-width: 1800px !important;
  margin-inline: auto !important;
  gap: clamp(22px, 2vw, 40px);
}

@media (min-width: 1000px) {
  .wp-block-columns.is-layout-flex.yiran-header-grid {
    display: grid !important;
    grid-template-columns: minmax(190px, 280px) minmax(0, 1fr) max-content;
    align-items: center;
  }

  .wp-block-columns.is-layout-flex.yiran-header-grid > .wp-block-column {
    width: auto !important;
    min-width: 0;
    flex: none !important;
    flex-basis: auto !important;
    margin: 0 !important;
  }

  .yiran-header-grid > .yiran-cta-col {
    justify-self: end;
  }

  /* Keep the logo as the left anchor while the navigation and actions read as
     one continuous right-side cluster, matching the reference header rhythm. */
  .yiran-header-grid .yiran-main-nav,
  .yiran-header-grid .yiran-main-menu {
    justify-content: flex-end;
  }
}

/* Many high-resolution desktops report a 1280–1499px CSS viewport after OS
   scaling. Switch to the compact content-sized composition in that range too,
   instead of leaving a flexible empty track between the Logo and menu. */
@media (min-width: 1280px) {
  .wp-block-columns.is-layout-flex.yiran-header-grid {
    grid-template-columns: max-content max-content max-content;
    justify-content: center;
  }
}
.yiran-custom-logo-link {
  display: inline-flex;
  flex: 0 0 auto;
  align-items: center;
  text-decoration: none;
}
.yiran-custom-logo {
  display: block;
  height: auto;
  max-width: 260px;
  max-height: 54px;
  object-fit: contain;
  border-radius: 0;
}

/* Home and selected listing pages: float transparently over the hero */
.home .yiran-header-shell,
.yr-transparent-header-page .yiran-header-shell { position: fixed; left: 0; right: 0; }
.home .yiran-header-shell:not(.is-stuck) .yiran-header-main,
.yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-header-main {
  background: transparent;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}
.home .yiran-header-shell:not(.is-stuck) .yiran-brand-copy .wp-block-site-title a,
.home .yiran-header-shell:not(.is-stuck) .yiran-main-nav .wp-block-navigation-item > a,
.yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-brand-copy .wp-block-site-title a,
.yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-main-nav .wp-block-navigation-item > a {
  color: #fff;
}
.home .yiran-header-shell:not(.is-stuck) .yiran-brand-tagline,
.yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-brand-tagline { color: rgba(255, 255, 255, 0.72); }
.home .yiran-header-shell:not(.is-stuck) .yiran-main-nav .wp-block-navigation-item > a:hover,
.yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-main-nav .wp-block-navigation-item > a:hover {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

/* Slide the solid bar in when it sticks */
.home .yiran-header-shell.is-stuck,
.yr-transparent-header-page .yiran-header-shell.is-stuck { animation: yrHeaderDown 0.35s ease; }
.home .yiran-header-shell.is-stuck .yiran-header-main,
.yr-transparent-header-page .yiran-header-shell.is-stuck .yiran-header-main {
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 18px 44px rgba(16, 24, 40, 0.1);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}

/* Opening a desktop submenu is a first-class header state. Keep the complete
   navigation surface consistent even while the page is still over the hero. */
body.home .yiran-header-shell.has-open-submenu .yiran-header-main,
body.yr-transparent-header-page .yiran-header-shell.has-open-submenu .yiran-header-main {
  background: var(--yr-paper, #fff);
  box-shadow: 0 12px 32px rgba(12, 28, 54, 0.08);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

body.home .yiran-header-shell:not(.is-stuck).has-open-submenu .yiran-brand-copy .wp-block-site-title a,
body.home .yiran-header-shell:not(.is-stuck).has-open-submenu .yiran-nav-item > a,
body.yr-transparent-header-page .yiran-header-shell:not(.is-stuck).has-open-submenu .yiran-brand-copy .wp-block-site-title a,
body.yr-transparent-header-page .yiran-header-shell:not(.is-stuck).has-open-submenu .yiran-nav-item > a {
  color: var(--yr-ink);
}

body.home .yiran-header-shell:not(.is-stuck).has-open-submenu .yiran-brand-tagline,
body.yr-transparent-header-page .yiran-header-shell:not(.is-stuck).has-open-submenu .yiran-brand-tagline {
  color: color-mix(in srgb, var(--yr-ink) 62%, transparent);
}

body.home .yiran-header-shell:not(.is-stuck).has-open-submenu .yiran-header-search-toggle,
body.home .yiran-header-shell:not(.is-stuck).has-open-submenu .yiran-header-language-toggle,
body.yr-transparent-header-page .yiran-header-shell:not(.is-stuck).has-open-submenu .yiran-header-search-toggle {
  color: var(--yr-ink);
}

body.yr-transparent-header-page .yiran-header-shell:not(.is-stuck).has-open-submenu .yiran-header-language-toggle {
  color: var(--yr-ink);
}

body.home .yiran-header-shell:not(.is-stuck).has-open-submenu :is(.yiran-header-search-toggle, .yiran-header-language-toggle),
body.yr-transparent-header-page .yiran-header-shell:not(.is-stuck).has-open-submenu :is(.yiran-header-search-toggle, .yiran-header-language-toggle) {
  border-color: color-mix(in srgb, var(--yr-ink) 16%, transparent);
}

body.home .yiran-header-shell:not(.is-stuck).has-open-submenu .yiran-nav-item > a:hover,
body.home .yiran-header-shell:not(.is-stuck).has-open-submenu .yiran-nav-item > a:focus,
body.yr-transparent-header-page .yiran-header-shell:not(.is-stuck).has-open-submenu .yiran-nav-item > a:hover,
body.yr-transparent-header-page .yiran-header-shell:not(.is-stuck).has-open-submenu .yiran-nav-item > a:focus {
  background: color-mix(in srgb, var(--yr-accent) 9%, transparent);
  color: var(--yr-accent);
}
@keyframes yrHeaderDown { from { transform: translateY(-100%); } to { transform: translateY(0); } }

/* Header CTA -> azure, matching the new palette */
.yiran-header-button .wp-block-button__link {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: min(100%, 178px);
  height: 50px;
  min-height: 50px;
  margin: 0 !important;
  padding: 0 20px !important;
  line-height: 1.1 !important;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--yr-button-fill);
  box-shadow: 0 10px 24px var(--yr-accent-shadow);
}
.yiran-header-button .wp-block-button__link:hover,
.yiran-header-button .wp-block-button__link:focus { background: var(--yr-button-fill-hover); }

.yiran-header-actions {
  display: flex !important;
  align-items: center !important;
  gap: 10px;
}

.yiran-header-actions > *,
.yiran-header-actions .wp-block-button,
.yiran-header-actions .wp-block-button__link,
.yiran-header-cta-buttons {
  margin: 0 !important;
  margin-block-start: 0 !important;
  margin-block-end: 0 !important;
}

.yiran-header-cta-buttons {
  display: inline-flex !important;
  align-items: center !important;
  min-width: 0;
  max-width: 100%;
}

.yiran-header-search-toggle,
.yiran-header-language-toggle {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex: 0 0 50px;
  width: 50px;
  height: 50px;
  margin: 0 !important;
  padding: 0;
  border: 1px solid color-mix(in srgb, var(--yr-ink) 16%, transparent);
  border-radius: 50%;
  background: transparent;
  color: var(--yr-ink);
  cursor: pointer;
  font-family: var(--wp--preset--font-family--montserrat), sans-serif;
  font-size: 15px;
  font-weight: 500;
  line-height: 1;
  transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.yiran-header-search-toggle:hover,
.yiran-header-search-toggle:focus-visible,
.yiran-header-language-toggle:hover,
.yiran-header-language-toggle:focus-visible {
  border-color: var(--yr-accent);
  background: color-mix(in srgb, var(--yr-accent) 8%, transparent);
  color: var(--yr-accent);
  transform: translateY(-1px);
  outline: none;
}

.yiran-header-search-toggle svg {
  width: 23px;
  height: 23px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.home .yiran-header-shell:not(.is-stuck) .yiran-header-search-toggle,
.home .yiran-header-shell:not(.is-stuck) .yiran-header-language-toggle,
.yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-header-search-toggle,
.yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-header-language-toggle {
  border-color: rgba(255, 255, 255, 0.22);
  background: transparent;
  color: #fff;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

.home .yiran-header-shell:not(.is-stuck) .yiran-header-search-toggle:hover,
.home .yiran-header-shell:not(.is-stuck) .yiran-header-search-toggle:focus-visible,
.home .yiran-header-shell:not(.is-stuck) .yiran-header-language-toggle:hover,
.home .yiran-header-shell:not(.is-stuck) .yiran-header-language-toggle:focus-visible,
.yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-header-search-toggle:hover,
.yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-header-search-toggle:focus-visible,
.yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-header-language-toggle:hover,
.yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-header-language-toggle:focus-visible {
  border-color: rgba(255, 255, 255, 0.58);
  background: rgba(255, 255, 255, 0.09);
  color: #fff;
}

.yiran-header-search-panel[hidden] {
  display: none !important;
}

body.yiran-header-search-open {
  overflow: hidden;
  padding-right: var(--yr-search-scrollbar-width, 0px);
}

body.yiran-header-search-open .yiran-header-shell {
  right: var(--yr-search-scrollbar-width, 0px);
}

body.yiran-header-search-open .xzsc {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.yiran-header-search-panel {
  position: fixed;
  z-index: 99998;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 80px 24px;
  background: rgba(3, 10, 14, 0.9);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}

.yiran-header-search-panel.is-opening {
  animation: yrSearchOverlayIn 0.5s ease both;
}

.yiran-header-search-panel.is-closing {
  pointer-events: none;
  animation: yrSearchOverlayOut 0.5s ease both;
}

.yiran-header-search-card {
  box-sizing: border-box;
  width: min(900px, 100%);
  padding: clamp(62px, 7.4vw, 90px);
  background: color-mix(in srgb, var(--yr-accent) 12%, #fff);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.28);
}

.yiran-header-search-panel.is-opening .yiran-header-search-card {
  animation: yrSearchCardIn 0.5s ease both;
}

.yiran-header-search-panel.is-closing .yiran-header-search-card {
  animation: yrSearchCardOut 0.5s ease both;
}

@keyframes yrSearchOverlayIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes yrSearchOverlayOut {
  from { opacity: 1; }
  to { opacity: 0; }
}

@keyframes yrSearchCardIn {
  from {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
  to {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
}

@keyframes yrSearchCardOut {
  from {
    opacity: 1;
    transform: scale3d(1, 1, 1);
  }
  to {
    opacity: 0;
    transform: scale3d(0.3, 0.3, 0.3);
  }
}

@media (prefers-reduced-motion: reduce) {
  .yiran-header-search-panel.is-opening,
  .yiran-header-search-panel.is-closing,
  .yiran-header-search-panel.is-opening .yiran-header-search-card,
  .yiran-header-search-panel.is-closing .yiran-header-search-card {
    animation-duration: 0.01ms;
  }
}

.yiran-header-search-form {
  position: relative;
  display: block;
  width: 100%;
}

.yiran-header-search-form input {
  box-sizing: border-box;
  width: 100%;
  height: 80px;
  padding: 0 92px 0 28px;
  border: 0;
  border-radius: 999px;
  background: #fff;
  color: var(--yr-ink);
  font-size: 17px;
  outline: none;
}

.yiran-header-search-form input:focus {
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--yr-accent) 24%, transparent);
}

.yiran-header-search-form button {
  position: absolute;
  top: 6px;
  right: 6px;
  display: inline-grid;
  width: 68px;
  height: 68px;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: var(--yr-button-fill);
  color: #fff;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.yiran-header-search-form button svg {
  width: 30px;
  height: 30px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.yiran-header-search-form button:hover,
.yiran-header-search-form button:focus {
  background: var(--yr-button-fill-hover);
  transform: scale(1.03);
}

.yiran-header-search-close {
  position: fixed;
  top: 22px;
  right: 24px;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.78);
  cursor: pointer;
}

.admin-bar .yiran-header-search-close {
  top: 54px;
}

.yiran-header-search-close::before,
.yiran-header-search-close::after {
  content: "";
  position: absolute;
  top: 23px;
  left: 10px;
  width: 28px;
  height: 1px;
  background: currentColor;
}

.yiran-header-search-close::before { transform: rotate(45deg); }
.yiran-header-search-close::after { transform: rotate(-45deg); }

.yiran-header-search-close:hover,
.yiran-header-search-close:focus-visible {
  color: #fff;
  outline: none;
}

/* anchor offset so fixed header does not cover section tops */
.yr-section { scroll-margin-top: 96px; }

/* Custom B2B navigation with mega menu support */
.yiran-menu-wrap {
  width: 100%;
}

.yiran-menu-toggle {
  display: none;
}

.yiran-main-nav {
  display: flex;
  justify-content: center;
  width: 100%;
}

.yiran-main-menu {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.yiran-nav-item {
  margin: 0;
  padding: 0;
}

.yiran-nav-item > a {
  display: inline-flex;
  align-items: center;
  min-height: 42px;
  padding: 8px 13px;
  border-radius: 8px;
  color: var(--yr-ink);
  font-family: var(--wp--preset--font-family--montserrat), sans-serif;
  font-size: clamp(14px, 1vw, 16px);
  font-weight: 600;
  line-height: 1.2;
  white-space: nowrap;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.yiran-nav-item > a:hover,
.yiran-nav-item > a:focus {
  background: color-mix(in srgb, var(--yr-accent) 9%, transparent);
  color: var(--yr-accent);
  outline: none;
}

.yiran-submenu-toggle {
  display: none;
}

.home .yiran-header-shell:not(.is-stuck) .yiran-nav-item > a,
.yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-nav-item > a {
  color: #fff;
}

.home .yiran-header-shell:not(.is-stuck) .yiran-nav-item > a:hover,
.home .yiran-header-shell:not(.is-stuck) .yiran-nav-item > a:focus,
.yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-nav-item > a:hover,
.yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-nav-item > a:focus {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

.yiran-nav-item--mega,
.yiran-menu-wrap,
.yiran-main-nav,
.yiran-main-menu {
  position: static;
}

.yiran-nav-item--dropdown {
  position: relative;
}

.yiran-mega-panel,
.yiran-dropdown-panel {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s ease;
}

.yiran-nav-item--mega:hover .yiran-mega-panel,
.yiran-nav-item--mega:focus-within .yiran-mega-panel,
.yiran-nav-item--mega.is-submenu-open .yiran-mega-panel,
.yiran-nav-item--dropdown:hover .yiran-dropdown-panel,
.yiran-nav-item--dropdown:focus-within .yiran-dropdown-panel,
.yiran-nav-item--dropdown.is-submenu-open .yiran-dropdown-panel {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
  transform: translateY(0);
}

.yiran-mega-panel {
  position: absolute;
  z-index: 30;
  top: calc(100% - 2px);
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid rgba(12, 28, 54, 0.08);
  box-shadow: 0 30px 60px rgba(12, 28, 54, 0.14);
  transform: translateY(8px);
}

/* On short desktop viewports the catalogue must become its own scroll area.
   JavaScript supplies the exact distance from the panel top to the viewport
   bottom; the viewport calculation remains as a safe no-script fallback. */
@media (min-width: 1000px) {
  .yiran-mega-panel {
    max-height: var(--yr-mega-panel-max-height, calc(100vh - 96px));
    max-height: var(--yr-mega-panel-max-height, calc(100dvh - 96px));
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior-y: contain;
    -ms-overflow-style: none;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .yiran-mega-panel::-webkit-scrollbar {
    display: none;
    width: 0;
    height: 0;
  }

  /* Keep the outer catalogue geometry stable while switching categories.
     Product titles can wrap freely; overflow stays inside the product area. */
  .yiran-mega-layout {
    height: clamp(440px, 33.33vw, 485px);
    min-height: 0;
    overflow: hidden;
  }

  .yiran-mega-browser,
  .yiran-mega-product-content {
    min-height: 0;
  }

  .yiran-mega-product-content {
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-gutter: stable;
    scrollbar-width: thin;
  }
}

.yiran-nav-item--mega:hover .yiran-mega-panel,
.yiran-nav-item--mega:focus-within .yiran-mega-panel,
.yiran-nav-item--mega.is-submenu-open .yiran-mega-panel {
  transform: translateY(0);
}

.yiran-dropdown-panel {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Product mega menu: full-width information band + category rail + 4x2 grid. */
.yiran-mega-layout {
  display: grid;
  grid-template-columns: 22% minmax(0, 78%);
  width: 100%;
  min-height: clamp(440px, 33.33vw, 485px);
  font-family: var(--wp--preset--font-family--montserrat), sans-serif;
}

.yiran-mega-intro {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-width: 0;
  padding: clamp(28px, 2.02vw, 42px) clamp(30px, 3.03vw, 62px) clamp(18px, 1.02vw, 28px) clamp(38px, 4.04vw, 82px);
  overflow: hidden;
  background-color: var(--yr-accent);
  background-image:
    linear-gradient(115deg, color-mix(in srgb, var(--yr-accent) 54%, transparent), color-mix(in srgb, var(--yr-ink) 62%, transparent)),
    var(--yr-mega-intro-image, linear-gradient(115deg, color-mix(in srgb, var(--yr-accent) 96%, #fff), color-mix(in srgb, var(--yr-accent) 84%, var(--yr-ink))));
  background-position: center;
  background-size: cover;
  color: #fff;
}

.yiran-mega-intro::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(90deg, rgba(255, 255, 255, 0.045), transparent 55%, rgba(0, 0, 0, 0.045));
}

.yiran-mega-intro > * {
  position: relative;
  z-index: 1;
}

.yiran-mega-intro-title {
  display: block;
  margin: 0 0 12px;
  color: #fff;
  font-size: clamp(19px, 1.49vw, 30px);
  font-weight: 750;
  line-height: 2;
  text-transform: uppercase;
}

.yiran-mega-intro p {
  max-width: 25ch;
  margin: 0;
  color: rgba(255, 255, 255, 0.92);
  font-size: clamp(14px, 1.05vw, 20px);
  line-height: 1.8;
}

.yiran-mega-contact {
  display: grid;
  gap: clamp(18px, 2.05vw, 34px);
}

.yiran-mega-contact-item {
  min-width: 0;
}

.yiran-mega-contact-item span,
.yiran-mega-contact-item strong {
  display: block;
  overflow-wrap: anywhere;
}

.yiran-mega-contact-item span {
  margin-bottom: 4px;
  color: rgba(255, 255, 255, 0.64);
  font-size: clamp(13px, 1.05vw, 18px);
  font-weight: 450;
  line-height: 1.55;
}

.yiran-mega-contact-item strong,
.yiran-mega-contact-item a {
  color: #fff;
  font-size: clamp(14px, 1.05vw, 20px);
  font-weight: 540;
  line-height: 1.45;
  text-decoration: none;
}

.yiran-mega-contact-item a:hover,
.yiran-mega-contact-item a:focus {
  color: #fff;
  text-decoration: underline;
  text-underline-offset: 3px;
}

.yiran-mega-browser {
  display: grid;
  grid-template-columns: 20.8% minmax(0, 79.2%);
  min-width: 0;
  background: var(--yr-paper, #fff);
}

.yiran-mega-category-tabs {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: clamp(32px, 3.03vw, 62px) clamp(22px, 2.02vw, 42px);
}

.yiran-mega-category-tab {
  display: flex;
  align-items: center;
  min-height: clamp(52px, 4.12vw, 78px);
  color: color-mix(in srgb, var(--yr-heading) 88%, #fff);
  font-size: clamp(15px, 1.1vw, 21px);
  font-weight: 450;
  line-height: 1.35;
  text-decoration: none;
  transition: color 0.18s ease, transform 0.18s ease;
}

.yiran-mega-category-tab:hover,
.yiran-mega-category-tab:focus,
.yiran-mega-category-tab.is-active {
  color: var(--yr-accent);
  outline: none;
}

.yiran-mega-category-tab.is-active {
  font-weight: 750;
}

.yiran-mega-product-content {
  min-width: 0;
  padding: clamp(22px, 2.02vw, 42px) clamp(30px, 4.04vw, 82px) clamp(12px, 1.02vw, 24px) 0;
}

.yiran-mega-product-panel {
  display: none;
  min-width: 0;
}

.yiran-mega-product-panel.is-active {
  display: block;
  animation: yrMegaPanelIn 0.22s ease both;
}

@keyframes yrMegaPanelIn {
  from { opacity: 0; transform: translateX(8px); }
  to { opacity: 1; transform: translateX(0); }
}

.yiran-mega-mobile-category {
  display: none;
}

.yiran-mega-products-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(15px, 1.38vw, 28px);
}

/* Match the reference catalogue proportions on wide desktops instead of
   allowing four cards to grow indefinitely with the viewport. */
@media (min-width: 1400px) {
  .yiran-mega-layout {
    height: 485px;
    max-height: 485px;
    min-height: 0;
    grid-template-columns: 25.26% minmax(0, 74.74%);
    overflow: hidden;
  }

  .yiran-mega-intro {
    padding: 29px 44px 28px 59px;
  }

  .yiran-mega-intro-title {
    margin-bottom: 10px;
    font-size: 26px;
    line-height: 1.4;
  }

  .yiran-mega-intro p {
    font-size: 16px;
    line-height: 1.55;
  }

  .yiran-mega-contact {
    gap: 19px;
  }

  .yiran-mega-contact-item span {
    margin-bottom: 6px;
    font-size: 16px;
    line-height: 1.5;
  }

  .yiran-mega-contact-item strong,
  .yiran-mega-contact-item a {
    font-size: 16px;
    line-height: 1.6;
  }

  .yiran-mega-category-tabs {
    padding: 29px;
  }

  .yiran-mega-category-tab {
    min-height: 60px;
    font-size: 18px;
  }

  .yiran-mega-product-content {
    display: flex;
    justify-content: center;
    padding: 29px clamp(24px, 3vw, 59px) 15px 0;
  }

  .yiran-mega-product-panel.is-active {
    width: min(100%, 1050px);
  }

  .yiran-mega-products-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 20px;
  }

  .yiran-mega-products-grid .yiran-mega-product-card {
    min-height: 183px;
    height: auto;
  }

  .yiran-mega-products-grid .yiran-mega-product-media {
    height: 139px;
    aspect-ratio: auto;
  }

  .yiran-mega-products-grid .yiran-mega-product-title {
    box-sizing: border-box;
    min-height: 44px;
    height: auto;
    padding-top: 8px;
    font-size: 15px;
    line-height: 1.35;
  }
}

.yiran-mega-product-card {
  display: block;
  min-width: 0;
  color: var(--yr-heading);
  text-decoration: none;
}

.yiran-mega-product-media {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: #fff;
}

.yiran-mega-product-media img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.yiran-mega-product-placeholder {
  display: block;
  width: 100%;
  height: 100%;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--yr-accent) 8%, var(--yr-paper-2)), var(--yr-paper-2));
}

.yiran-mega-product-title {
  display: block;
  padding: 10px 2px 0;
  overflow: visible;
  color: var(--yr-heading);
  font-size: clamp(14px, 1.1vw, 21px);
  font-weight: 450;
  line-height: 1.5;
  overflow-wrap: anywhere;
  text-overflow: clip;
  white-space: normal;
  transition: color 0.18s ease;
}

.yiran-mega-product-card:hover .yiran-mega-product-media img,
.yiran-mega-product-card:focus .yiran-mega-product-media img {
  transform: none;
}

.yiran-mega-product-card:hover .yiran-mega-product-title,
.yiran-mega-product-card:focus .yiran-mega-product-title {
  color: var(--yr-accent);
}

.yiran-mega-product-card:focus {
  outline: none;
}

.yiran-mega-product-card:focus .yiran-mega-product-media {
  box-shadow: 0 0 0 3px var(--yr-accent-ring);
}

.yiran-mega-empty-link {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  color: var(--yr-accent);
  font-size: 15px;
  font-weight: 700;
  text-decoration: none;
}

.yiran-dropdown-panel {
  position: absolute;
  z-index: 35;
  top: calc(100% - 2px);
  left: 0;
  min-width: 190px;
  padding: 16px 10px 10px;
  border: 1px solid rgba(12, 28, 54, 0.08);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: 0 22px 50px rgba(12, 28, 54, 0.16);
}

.yiran-dropdown-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: 6px;
  font-family: var(--wp--preset--font-family--montserrat), sans-serif;
  font-size: 14px;
  font-weight: 600;
}

.yiran-dropdown-panel a:hover,
.yiran-dropdown-panel a:focus {
  background: color-mix(in srgb, var(--yr-accent) 9%, transparent);
}


/* -------------------------------------------------------------------------
   HEADER — collapse to a clean single-row bar (brand left, hamburger right).
   Two things have to be beaten here:
   1. WP core stacks columns on mobile by default via
      `.wp-block-columns:not(.is-not-stacked-on-mobile) > .wp-block-column`
      (specificity 0,3,0, !important). Our selectors use 4 classes (0,4,0) so
      they win regardless of stylesheet load order.
   2. The nav column's `flex-basis:auto` base size mis-resolves to the full row
      width (its only in-flow child is the hamburger, yet auto-sizing balloons),
      which collapsed the brand to 0 and pushed the hamburger off-screen. Giving
      the nav column an explicit fixed basis sidesteps that entirely.
   The WP hamburger itself is forced on at <=999px by legacy rules in style.css.
   ------------------------------------------------------------------------- */
@media (max-width: 999px) {
  .wp-block-columns.is-layout-flex.yiran-header-grid {
    display: flex !important;
    flex-wrap: nowrap !important;
    align-items: center;
    width: 100%;
    min-width: 0;
    gap: 10px;
  }
  /* side gutters so brand/hamburger aren't flush to the screen edges
     (overrides the inline left/right:0 padding on the header bar) */
  .yiran-header-main { padding-left: 16px !important; padding-right: 16px !important; }

  .wp-block-columns.is-layout-flex.yiran-header-grid > .yiran-brand-col { flex: 1 1 auto !important; min-width: 0; order: 1 !important; }
  .wp-block-columns.is-layout-flex.yiran-header-grid > .yiran-nav-col { flex: 0 0 42px !important; order: 3 !important; min-width: 42px; }
  .wp-block-columns.is-layout-flex.yiran-header-grid > .yiran-cta-col {
    display: block !important;
    flex: 0 0 42px !important;
    order: 2 !important;
    min-width: 42px;
  }
  .wp-block-columns.is-layout-flex.yiran-header-grid > .yiran-cta-col:has(.yiran-header-language-toggle) {
    flex-basis: 92px !important;
    min-width: 92px;
  }
  .yiran-header-actions { width: 42px; gap: 0; justify-content: flex-end !important; }
  .yiran-header-actions:has(.yiran-header-language-toggle) { width: 92px; gap: 8px; }
  .yiran-header-cta-buttons { display: none !important; }

  .yiran-brand-wrap {
    max-width: 100%;
    min-width: 0;
    gap: 10px;
    justify-content: flex-start !important;
  }
  .yiran-brand-wrap .wp-block-site-logo { flex: 0 0 auto; }
  .yiran-brand-wrap .custom-logo,
  .yiran-brand-wrap .wp-block-site-logo img {
    width: auto;
    max-width: 40px;
    height: auto;
  }
  .yiran-brand-wrap .yiran-custom-logo {
    width: auto;
    max-width: min(190px, 46vw);
    max-height: 44px;
    height: auto;
  }
  .yiran-brand-copy,
  .yiran-brand-copy .wp-block-site-title {
    min-width: 0;
    max-width: 100%;
    overflow: hidden;
  }
  .yiran-brand-copy .wp-block-site-title a {
    display: block;
    max-width: 100%;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  /* Menu control is pinned to the right and shares the circular action language. */
  .yiran-nav-col .wp-block-navigation { justify-content: flex-end !important; }
  .yiran-nav-col .wp-block-navigation__responsive-container-open {
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    width: 42px;
    height: 42px;
    padding: 0 !important;
    background: transparent !important;
    color: var(--yr-ink, #0c1c36) !important;
    border: 0 !important;
    transition: color 0.25s ease;
  }
  .yiran-nav-col .wp-block-navigation__responsive-container-open svg { width: 26px; height: 26px; fill: currentColor; }

  .yiran-header-search-toggle {
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
  }

  .yiran-header-language-toggle {
    display: inline-flex !important;
    width: 42px;
    height: 42px;
    flex: 0 0 42px;
    font-size: 13px;
  }

  /* over the hero (home, before it sticks): white icon, no box */
  .home .yiran-header-shell:not(.is-stuck) .wp-block-navigation__responsive-container-open,
  .yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .wp-block-navigation__responsive-container-open {
    background: transparent !important;
    color: #fff !important;
  }
}

@media (max-width: 600px) {
  .yiran-header-search-panel {
    inset: 0;
    width: 100%;
    padding: 64px 18px;
  }
  .yiran-header-search-card {
    padding: 38px 22px;
  }
  .yiran-header-search-form input {
    height: 62px;
    padding-right: 72px;
    padding-left: 20px;
    font-size: 15px;
  }
  .yiran-header-search-form button {
    top: 5px;
    right: 5px;
    width: 52px;
    height: 52px;
  }
  .yiran-header-search-form button svg {
    width: 24px;
    height: 24px;
  }
  .yiran-header-search-close {
    top: 12px;
    right: 12px;
  }
}

@media (max-width: 600px) {
  .yiran-header-main { padding-top: 12px !important; padding-bottom: 12px !important; }
  .yiran-brand-copy .wp-block-site-title { text-align: left !important; }
  .yiran-brand-copy .wp-block-site-title a { font-size: 22px !important; }
  .yiran-brand-tagline { display: none; }
}

@media (max-width: 480px) {
  .wp-block-columns.is-layout-flex.yiran-header-grid {
    gap: 8px;
  }
  .yiran-header-main {
    padding-left: 12px !important;
    padding-right: 12px !important;
  }
  .wp-block-columns.is-layout-flex.yiran-header-grid > .yiran-nav-col {
    flex-basis: 38px !important;
    min-width: 38px;
  }
  .wp-block-columns.is-layout-flex.yiran-header-grid > .yiran-cta-col {
    flex-basis: 38px !important;
    min-width: 38px;
  }
  .wp-block-columns.is-layout-flex.yiran-header-grid > .yiran-cta-col:has(.yiran-header-language-toggle) {
    flex-basis: 82px !important;
    min-width: 82px;
  }
  .yiran-header-actions {
    width: 38px;
    gap: 0;
  }
  .yiran-header-actions:has(.yiran-header-language-toggle) {
    width: 82px;
    gap: 6px;
  }
  .yiran-header-search-toggle,
  .yiran-header-language-toggle,
  .yiran-menu-toggle,
  .yiran-nav-col .wp-block-navigation__responsive-container-open {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }
  .yiran-header-search-toggle svg {
    width: 18px;
    height: 18px;
  }
  .yiran-nav-col .wp-block-navigation__responsive-container-open svg {
    width: 23px;
    height: 23px;
  }
  .yiran-brand-wrap {
    gap: 8px;
  }
  .yiran-brand-wrap .custom-logo,
  .yiran-brand-wrap .wp-block-site-logo img {
    max-width: 34px;
  }
  .yiran-brand-wrap .yiran-custom-logo {
    max-width: min(136px, 36vw);
  }
  .yiran-brand-copy .wp-block-site-title a {
    font-size: 20px !important;
  }
}

/* -------------------------------------------------------------------------
   MOBILE NAV OVERLAY — replace the flat navy list (harsh full-width hairlines
   + solid-white close box) with a refined full-screen menu: gradient surface,
   large Montserrat links, chevron affordances, a circular close button, and a
   staggered fade-up entrance. Scoped to the header nav so the footer nav and
   inner-page menus are untouched.
   ------------------------------------------------------------------------- */

/* BUGFIX: the stuck/solid header has `backdrop-filter: blur()`, which makes it
   a containing block for position:fixed descendants — that trapped the
   full-screen overlay menu inside the ~68px header bar (menu appeared "stuck"
   / clipped when opened after scrolling). WordPress flags an open overlay with
   `has-modal-open` on <html>, so drop the filter (and any transform) on the
   header while the menu is open; the bar is nearly opaque anyway and the menu
   covers it. */
html.has-modal-open .yiran-header-shell,
html.has-modal-open .yiran-header-main {
  -webkit-backdrop-filter: none !important;
  backdrop-filter: none !important;
  transform: none !important;
  /* instant, not transitioned — animating blur 16px->0 over 0.3s caused a
     visible stutter as the menu opened */
  transition: none !important;
  animation: none !important;
}

@media (max-width: 999px) {
  .yiran-nav-col .wp-block-navigation__responsive-container.is-menu-open {
    background:
      radial-gradient(130% 80% at 88% -10%, color-mix(in srgb, var(--yr-accent) 30%, transparent), transparent 56%),
      linear-gradient(160deg, #0b1830 0%, #122f59 100%) !important;
    padding: 0 !important;
    animation: yrMenuFade 0.42s ease both;
  }
  .yiran-nav-col .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-content {
    width: 100% !important;
    padding: clamp(104px, 17vh, 168px) 30px 56px !important;
    align-items: stretch !important;
    gap: 0 !important;
  }
  .yiran-nav-col .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__container {
    width: 100%;
    gap: 0 !important;
  }

  /* items + stagger */
  .yiran-nav-col .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
    width: 100% !important;
    margin: 0 !important;
    padding: 0 !important;
    border: 0 !important;
    border-bottom: 1px solid rgba(255, 255, 255, 0.10) !important;
    opacity: 0;
    transform: translateY(16px);
    animation: yrMenuItem 0.55s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  }
  .yiran-nav-col .is-menu-open .wp-block-navigation-item:nth-child(1) { animation-delay: 0.10s; }
  .yiran-nav-col .is-menu-open .wp-block-navigation-item:nth-child(2) { animation-delay: 0.17s; }
  .yiran-nav-col .is-menu-open .wp-block-navigation-item:nth-child(3) { animation-delay: 0.24s; }
  .yiran-nav-col .is-menu-open .wp-block-navigation-item:nth-child(4) { animation-delay: 0.31s; }
  .yiran-nav-col .is-menu-open .wp-block-navigation-item:nth-child(5) { animation-delay: 0.38s; }
  .yiran-nav-col .is-menu-open .wp-block-navigation-item:nth-child(6) { animation-delay: 0.45s; }

  .yiran-nav-col .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item > a {
    display: flex !important;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    padding: 21px 4px !important;
    font-family: var(--wp--preset--font-family--montserrat), sans-serif !important;
    font-size: clamp(23px, 6.6vw, 30px) !important;
    font-weight: 600;
    letter-spacing: 0;
    line-height: 1.1;
    color: #fff !important;
    background: transparent !important;
    border-radius: 0 !important;
    text-transform: none !important;
    transition: color 0.25s ease, padding-left 0.25s ease;
  }
  /* chevron affordance */
  .yiran-nav-col .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item > a::after {
    content: "";
    width: 11px;
    height: 11px;
    flex: none;
    margin-left: 16px;
    border-top: 2px solid rgba(255, 255, 255, 0.45);
    border-right: 2px solid rgba(255, 255, 255, 0.45);
    transform: rotate(45deg);
    transition: border-color 0.25s ease, transform 0.25s ease;
  }
  .yiran-nav-col .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item > a:hover,
  .yiran-nav-col .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item > a:focus {
    color: #fff !important;
    padding-left: 12px !important;
  }
  .yiran-nav-col .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item > a:hover::after {
    border-color: var(--yr-accent-2, #5a8cf0);
    transform: translateX(3px) rotate(45deg);
  }

  /* circular close button */
  .yiran-nav-col .wp-block-navigation__responsive-container-close {
    display: flex !important;
    align-items: center !important;
    justify-content: center !important;
    top: 20px !important;
    right: 22px !important;
    width: 46px !important;
    height: 46px !important;
    padding: 0 !important;
    color: #fff !important;
    background: rgba(255, 255, 255, 0.08) !important;
    border: 1px solid rgba(255, 255, 255, 0.22) !important;
    border-radius: 50% !important;
    transition: background 0.25s ease, transform 0.35s ease;
  }
  .yiran-nav-col .wp-block-navigation__responsive-container-close svg { fill: currentColor; width: 22px; height: 22px; }
  .yiran-nav-col .wp-block-navigation__responsive-container-close:hover { background: rgba(255, 255, 255, 0.18) !important; transform: rotate(90deg); }
}

@keyframes yrMenuFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes yrMenuItem { to { opacity: 1; transform: none; } }

@media (prefers-reduced-motion: reduce) {
  .yiran-nav-col .wp-block-navigation__responsive-container.is-menu-open,
  .yiran-nav-col .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation-item {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* Custom mobile menu for the B2B navigation. */
@media (max-width: 999px) {
  body.yiran-mobile-menu-open,
  body.yiran-mobile-menu-open .yiran-header-shell,
  body.yiran-mobile-menu-open .yiran-header-main {
    -webkit-backdrop-filter: none !important;
    backdrop-filter: none !important;
    transform: none !important;
    transition: none !important;
    animation: none !important;
  }

  body.yiran-mobile-menu-open {
    overflow: hidden;
  }

  .yiran-menu-wrap {
    display: flex;
    justify-content: flex-end;
  }

  .yiran-menu-toggle {
    box-sizing: border-box;
    display: inline-flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    width: 42px;
    height: 42px;
    padding: 0;
    border: 1px solid color-mix(in srgb, var(--yr-ink) 16%, transparent);
    border-radius: 50%;
    background: transparent;
    color: var(--yr-ink);
    cursor: pointer;
    transition: color 0.25s ease, border-color 0.25s ease, background 0.25s ease, transform 0.25s ease;
  }

  .yiran-menu-toggle span {
    display: block;
    width: 17px;
    height: 1.5px;
    border-radius: 999px;
    background: currentColor;
    transition: transform 0.22s ease, opacity 0.22s ease;
  }

  .yiran-menu-toggle:hover,
  .yiran-menu-toggle:focus-visible {
    border-color: var(--yr-accent);
    background: color-mix(in srgb, var(--yr-accent) 8%, transparent);
    color: var(--yr-accent);
    outline: none;
    transform: translateY(-1px);
  }

  .home .yiran-header-shell:not(.is-stuck) .yiran-menu-toggle,
  .yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-menu-toggle {
    border-color: rgba(255, 255, 255, 0.22);
    color: #fff;
  }

  .home .yiran-header-shell:not(.is-stuck) .yiran-menu-toggle:hover,
  .home .yiran-header-shell:not(.is-stuck) .yiran-menu-toggle:focus-visible,
  .yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-menu-toggle:hover,
  .yr-transparent-header-page .yiran-header-shell:not(.is-stuck) .yiran-menu-toggle:focus-visible {
    border-color: rgba(255, 255, 255, 0.58);
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
  }

  .yiran-header-shell.is-menu-open .yiran-menu-toggle {
    position: fixed;
    z-index: 1003;
    top: 20px;
    right: 22px;
    color: #fff;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.22);
    border-radius: 50%;
  }

  .admin-bar .yiran-header-shell.is-menu-open .yiran-menu-toggle {
    top: 52px;
  }

  .yiran-header-shell.is-menu-open .yiran-menu-toggle span:nth-child(1) {
    transform: translateY(5.5px) rotate(45deg);
  }

  .yiran-header-shell.is-menu-open .yiran-menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .yiran-header-shell.is-menu-open .yiran-menu-toggle span:nth-child(3) {
    transform: translateY(-5.5px) rotate(-45deg);
  }

  .yiran-main-nav {
    position: fixed;
    z-index: 1002;
    inset: 0;
    display: block;
    min-height: 100dvh;
    padding: 0;
    overflow: hidden;
    background: rgba(7, 19, 37, 0.68);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.28s ease;
  }

  .yiran-header-shell.is-menu-open .yiran-main-nav {
    opacity: 1;
    pointer-events: auto;
  }

  .yiran-main-menu {
    display: block;
    width: min(75vw, 380px);
    min-width: 280px;
    max-width: calc(100vw - 72px);
    height: 100dvh;
    margin: 0;
    padding: 56px 28px 42px;
    overflow-x: hidden;
    overflow-y: auto;
    background: #f7f9fc;
    box-shadow: 18px 0 48px rgba(2, 10, 24, 0.22);
    transform: translateX(-110%);
    transition: transform 0.34s cubic-bezier(0.16, 1, 0.3, 1);
  }

  .yiran-header-shell.is-menu-open .yiran-main-menu {
    transform: translateX(0);
  }

  .yiran-nav-item {
    width: 100%;
    border-bottom: 1px solid rgba(12, 28, 54, 0.09);
  }

  .yiran-nav-item--mega,
  .yiran-nav-item--dropdown {
    display: block;
  }

  .yiran-nav-item > a {
    display: inline-block;
    width: 100%;
    min-height: 0;
    padding: 17px 0;
    border: 0;
    border-radius: 0;
    color: var(--yr-ink) !important;
    background: transparent !important;
    font-size: 17px;
    font-weight: 740;
    letter-spacing: 0;
    line-height: 1.25;
    text-transform: uppercase;
  }

  .yiran-nav-item > a::after {
    display: none;
  }

  .yiran-submenu-toggle {
    display: none;
  }

  .yiran-mega-panel,
  .yiran-dropdown-panel {
    position: static;
    grid-column: 1 / -1;
    width: 100%;
    min-width: 0;
    max-height: 0;
    margin-top: 0;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: none;
    overflow: hidden;
    transition: max-height 0.24s ease, opacity 0.18s ease, visibility 0.18s ease;
  }

  .yiran-mega-panel {
    background: transparent;
    border-top: 0;
    box-shadow: none;
  }

  .yiran-nav-item.is-mobile-submenu-open > .yiran-mega-panel,
  .yiran-nav-item.is-mobile-submenu-open > .yiran-dropdown-panel {
    max-height: 2200px;
    margin-top: -3px;
    margin-bottom: 18px;
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
  }

  .yiran-mega-layout,
  .yiran-mega-browser {
    display: block;
    min-height: 0;
    background: transparent;
  }

  .yiran-mega-product-content {
    background: transparent;
  }

  .yiran-mega-intro,
  .yiran-mega-category-tabs {
    display: none;
  }

  .yiran-mega-product-content {
    padding: 2px 0 4px 16px;
  }

  .yiran-mega-product-panel,
  .yiran-mega-product-panel.is-active {
    display: block;
    animation: none;
  }

  .yiran-mega-mobile-category {
    display: block;
    padding: 8px 0 6px;
    color: #4f5b6b;
    font-size: 14px;
    font-weight: 620;
    line-height: 1.35;
    text-decoration: none;
  }

  .yiran-mega-products-grid {
    display: none;
  }

  .yiran-dropdown-panel {
    display: grid;
    gap: 0;
    margin: 0;
    padding: 0 0 0 16px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
  }

  .yiran-dropdown-panel a {
    display: flex;
    align-items: center;
    min-height: 0;
    padding: 7px 0;
    border: 0;
    border-radius: 0;
    color: #4f5b6b;
    background: transparent !important;
    font-size: 14px;
    font-weight: 560;
    line-height: 1.35;
  }

  .yiran-dropdown-panel a:hover,
  .yiran-dropdown-panel a:focus {
    background: transparent !important;
    color: var(--yr-accent);
  }
}

@media (max-width: 480px) {
  .yiran-main-nav {
    padding: 0;
  }

  .yiran-main-menu {
    width: min(78vw, 360px);
    min-width: 270px;
    padding: 52px 24px 38px;
  }
}

@media (max-width: 480px) {
  .yiran-menu-toggle {
    width: 38px;
    height: 38px;
    flex-basis: 38px;
  }

  .yiran-menu-toggle span {
    width: 15px;
  }
}

/* Global inquiry modal */
body.yr-inquiry-open {
  overflow: hidden;
}

body.yr-inquiry-open .xzsc {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
}

.yr-inquiry-modal[hidden] {
  display: none;
}

.yr-inquiry-modal {
  position: fixed;
  inset: 0;
  z-index: 100000;
  display: grid;
  place-items: center;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  padding: clamp(12px, 2.4vw, 24px);
  overflow: hidden;
}

.yr-inquiry-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 9, 20, 0.58);
  backdrop-filter: blur(8px);
}

.yr-inquiry-dialog {
  box-sizing: border-box;
  position: relative;
  z-index: 1;
  width: min(100%, 720px);
  max-width: calc(100vw - 24px);
  max-height: calc(100vh - 32px);
  max-height: calc(100dvh - 32px);
  padding: clamp(26px, 4vw, 44px);
  overflow-x: hidden;
  overflow-y: auto;
  border: 1px solid rgba(226, 233, 242, 0.9);
  border-radius: 8px;
  background: #fff;
  color: var(--yr-text);
  box-shadow: 0 28px 80px rgba(3, 9, 20, 0.28);
}

.yr-inquiry-dialog:focus {
  outline: 0;
}

/* Keep modal content scrollable while removing the heavy browser scrollbar. */
.yr-inquiry-dialog,
.yr-inquiry-form {
  -ms-overflow-style: none;
  scrollbar-width: none;
}

.yr-inquiry-dialog::-webkit-scrollbar,
.yr-inquiry-form::-webkit-scrollbar {
  display: none;
  width: 0;
  height: 0;
}

.yr-inquiry-close {
  position: absolute;
  top: 16px;
  right: 16px;
  display: inline-grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--yr-line);
  border-radius: 999px;
  background: #fff;
  color: var(--yr-heading);
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.yr-inquiry-close:hover,
.yr-inquiry-close:focus {
  border-color: color-mix(in srgb, var(--yr-accent) 45%, transparent);
  color: var(--yr-accent);
  outline: 0;
  box-shadow: 0 0 0 3px var(--yr-accent-ring);
}

.yr-inquiry-copy {
  max-width: 620px;
  margin-bottom: 24px;
  padding-right: 44px;
}

.yr-inquiry-copy .yr-eyebrow {
  margin-bottom: 10px;
}

.yr-inquiry-copy h2 {
  margin: 0;
  color: var(--yr-heading);
  font-family: var(--wp--preset--font-family--montserrat), sans-serif;
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 800;
  line-height: 1.14;
  letter-spacing: 0;
}

.yr-inquiry-copy p:not(.yr-eyebrow) {
  margin: 14px 0 0;
  color: var(--yr-muted);
  font-size: 16px;
  line-height: 1.7;
}

.yr-inquiry-form {
  padding-top: 24px;
  border-top: 1px solid var(--yr-line);
}

.yr-inquiry-notice {
  margin-bottom: 16px;
  padding: 12px 14px;
  border: 1px solid rgba(176, 98, 30, 0.2);
  border-radius: var(--yr-radius);
  background: rgba(176, 98, 30, 0.08);
  color: var(--yr-heading);
  font-size: 14px;
  line-height: 1.7;
}

.yr-inquiry-form :where(.fluentform, form) {
  margin: 0;
}

.yr-inquiry-form .ff-el-group {
  margin-bottom: 18px;
}

.yr-inquiry-form .ff-el-input--label label,
.yr-inquiry-form label {
  color: var(--yr-heading);
  font-family: var(--wp--preset--font-family--montserrat), sans-serif;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

.yr-inquiry-form :where(input[type="text"], input[type="email"], input[type="tel"], input[type="url"], input[type="number"], select, textarea),
.yr-inquiry-form .ff-el-form-control {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--yr-line);
  border-radius: var(--yr-radius);
  background: #fff;
  color: var(--yr-heading);
  font-size: 15px;
  line-height: 1.4;
  box-shadow: none;
}

.yr-inquiry-form textarea,
.yr-inquiry-form textarea.ff-el-form-control {
  min-height: 116px;
  resize: vertical;
}

.yr-inquiry-form :where(input, select, textarea):focus,
.yr-inquiry-form .ff-el-form-control:focus {
  border-color: var(--yr-accent);
  outline: 0;
  box-shadow: 0 0 0 3px var(--yr-accent-ring);
}

.yr-inquiry-form .ff-btn-submit,
.yr-inquiry-form :where(button[type="submit"], input[type="submit"]),
.yr-inquiry-fallback__button {
  box-sizing: border-box;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  max-width: 100%;
  min-height: 48px;
  padding: 0 22px;
  border: 0;
  border-radius: var(--yr-radius);
  background: var(--yr-button-fill);
  color: #fff;
  font-family: var(--wp--preset--font-family--montserrat), sans-serif;
  font-size: 14px;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0;
  text-align: center;
  text-decoration: none;
  white-space: normal;
  overflow-wrap: anywhere;
  cursor: pointer;
}

.yr-inquiry-form .ff-btn-submit:hover,
.yr-inquiry-form :where(button[type="submit"], input[type="submit"]):hover,
.yr-inquiry-fallback__button:hover {
  background: var(--yr-button-fill-hover);
  color: #fff;
  transform: translateY(-1px);
  box-shadow: 0 12px 28px var(--yr-accent-shadow);
}

.yr-inquiry-fallback {
  display: grid;
  gap: 12px;
}

.yr-inquiry-fallback h3 {
  margin: 0;
  color: var(--yr-heading);
  font-family: var(--wp--preset--font-family--montserrat), sans-serif;
  font-size: 20px;
  line-height: 1.3;
}

.yr-inquiry-fallback p {
  max-width: 560px;
  margin: 0;
  color: var(--yr-text);
  font-size: 15px;
  line-height: 1.7;
}

.yr-inquiry-submit-row {
  margin-bottom: 0 !important;
}

@media (max-width: 640px) {
  .yr-inquiry-modal {
    align-items: end;
    padding: 8px;
  }

  .yr-inquiry-dialog {
    width: 100%;
    max-width: none;
    max-height: calc(100dvh - 16px);
    padding: 24px 18px 20px;
  }

  .yr-inquiry-close {
    top: 12px;
    right: 12px;
  }

  .yr-inquiry-copy {
    margin-bottom: 18px;
    padding-right: 44px;
  }

  .yr-inquiry-copy h2 {
    font-size: clamp(22px, 6.4vw, 28px);
  }

  .yr-inquiry-copy p:not(.yr-eyebrow) {
    display: none;
  }

  .yr-inquiry-form {
    padding-top: 18px;
  }
}
