@media (min-width: 1280px) { html { scrollbar-gutter: stable; } }
.site-header { background: #fff; }
.site-header .primary-navigation > a,
.site-header .primary-navigation > .dropdown > a {
  position: relative;
  border-bottom: none;
  font-weight: 500;
  transition: color 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

/* WhatsApp 风格的平滑展开下划线动画 */
.site-header .primary-navigation > a::after,
.site-header .primary-navigation > .dropdown > a::after {
  content: "";
  position: absolute;
  bottom: 0;
  left: 10px;
  right: 10px;
  height: 2px;
  background-color: #1d1917;
  border-radius: 9999px;
  opacity: 0;
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.2s ease;
  pointer-events: none;
}

/* 悬停、获取焦点或下拉菜单激活时平滑展开 */
.site-header .primary-navigation > a:hover::after,
.site-header .primary-navigation > .dropdown:hover > a::after,
.site-header .primary-navigation > a:focus-visible::after,
.site-header .primary-navigation > .dropdown > a:focus-visible::after {
  opacity: 1;
  transform: scaleX(1);
}

/* 当前页面常驻高亮显示 */
.site-header .primary-navigation > a[aria-current="page"],
.site-header .primary-navigation > .dropdown > a[aria-current="page"] {
  color: #1d1917;
  border-bottom: none;
}
.site-header .primary-navigation > a[aria-current="page"]::after,
.site-header .primary-navigation > .dropdown > a[aria-current="page"]::after {
  opacity: 1;
  transform: scaleX(1);
}
.site-header #langBtn { min-width: 108px; justify-content: center; }
.site-header .site-quote { min-width: 148px; width: auto; padding-left: 14px; padding-right: 14px; text-align: center; white-space: nowrap; }
.site-header .mobile-navigation a[aria-current="page"] { color: #1d1917; background: #faf8f5; }
.mobile-navigation { display: none; }
.primary-navigation { display: none; }
.desktop-utility { display: none; }
@media (min-width: 1280px) {
  .desktop-utility { display: block; }
  .primary-navigation { display: flex; white-space: nowrap; }
  .primary-navigation > a, .primary-navigation > .dropdown > a { padding-left: 8px; padding-right: 8px; }
  .header-actions { flex-shrink: 0; }
}
.product-mega-menu {
  display: none;
  position: absolute;
  top: 100%;
  left: 50%;
  transform: translateX(-50%);
  z-index: 50;
  width: min(520px, calc(100vw - 32px));
  padding: 14px;
  border: 1px solid #eae5dc;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 16px 32px #2924211f;
  white-space: normal;
}
.product-mega-trigger:not([data-dismissed]):is(:hover, :focus-within) > .product-mega-menu { display: grid; }
.product-mega-menu { grid-template-columns: minmax(0, 1fr) minmax(0, 1.55fr); gap: 20px; align-items: start; }
.product-mega-list { display: grid; align-content: start; gap: 3px; }
.product-mega-category { display: block; padding: 10px 12px; border-radius: 8px; color: #443e3a; font-size: 13px; }
.product-mega-category:is(:hover, :focus-visible) { background: #f5f0e9; color: #1d1917; }
.product-mega-preview { min-width: 0; }
.product-mega-example { display: grid; gap: 8px; color: #292421; font-size: 13px; font-weight: 600; }
.product-mega-example[hidden] { display: none; }
.product-mega-example img { display: block; width: 100%; height: auto; aspect-ratio: 4 / 3; object-fit: cover; border-radius: 8px; background: #f4f0ea; }
.product-mega-all {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 44px;
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 8px;
  background: var(--accent-olive);
  color: var(--bg-cream);
  font-size: 13px;
  font-weight: 700;
}
.product-mega-all:is(:hover, :focus-visible) { background: var(--accent-olive-hover); }
.product-mega-all-arrow { flex: none; font-size: 17px; line-height: 1; }
.product-mega-menu a:focus-visible { outline: 2px solid #a3704c; outline-offset: 1px; }

@media (max-width: 1279px) {
  header > div:first-child { gap: 12px; }
  header > div:first-child > a { min-width: 0; }
  header > div:first-child > .flex:last-child { flex-shrink: 0; }
  header > div:first-child > .flex:last-child > a { display: none; }
  .mobile-navigation { display: block; position: relative; border-top: 1px solid #eae5dc; background: white; }
  .mobile-navigation summary { cursor: pointer; padding: 12px 20px; font-size: 14px; font-weight: 600; }
  .mobile-navigation summary:focus-visible { outline: 2px solid #a3704c; outline-offset: -3px; }
  .mobile-navigation nav { position: absolute; top: 100%; left: 0; right: 0; max-height: 65vh; overflow-y: auto; padding: 8px 16px 16px; background: white; border-bottom: 1px solid #eae5dc; box-shadow: 0 12px 18px #29242114; }
  .mobile-navigation nav a { display: block; padding: 12px; border-radius: 8px; font-size: 14px; }
  .mobile-navigation nav a:hover, .mobile-navigation nav a:focus-visible { background: #faf8f5; }
  .mobile-nav-submenu { margin: 0 12px 8px 24px; border-left: 1px solid #eae5dc; padding-left: 8px; }
  .mobile-navigation nav .mobile-nav-submenu a { font-size: 13px; color: #78716c; }
  .site-header .mobile-navigation .mobile-nav-submenu a[aria-current="page"]:not(:hover, :focus-visible) {
    background: transparent;
    color: #78716c;
  }
  .mobile-navigation nav > a { font-weight: 600; }
  .mobile-nav-group > summary { padding: 12px; border-radius: 8px; }
  #langBtn { min-height: 44px; }
  .lang-menu button { min-height: 44px; }
  /* Touch browsers can retain hover/focus after a tap; use the explicit toggle state. */
  header .lang-dropdown:not(.open) .lang-menu { display: none !important; }
  header .lang-dropdown.open .lang-menu { display: block !important; }
  .mobile-navigation nav {
    max-height: min(65vh, calc(100dvh - 128px));
    overscroll-behavior-y: contain;
  }
}
@media (max-width: 359px) {
  header > div:first-child > a > div:first-child { font-size: 18px; white-space: nowrap; }
  header > div:first-child > a > div:last-child { font-size: 8px; }
}
@media (pointer: coarse), (max-width: 639px) {
  /* A 16px field font avoids focus zoom in iOS Safari while keeping browser zoom available. */
  input, select, textarea { font-size: 16px; }
  a, button, summary { touch-action: manipulation; }
}
@media (max-width: 639px) {
  #inquiry-form { font-size: 14px; }
  #inquiry-form input, #inquiry-form select, #inquiry-form textarea { min-width: 0; width: 100%; font-size: 16px; }
  #inquiry-form textarea { min-height: 160px; }
  #inquiry-form { scroll-margin-top: 136px !important; }
  #inquiry-preview { padding: 16px; overflow-wrap: anywhere; }
  #inquiry-preview a, #inquiry-preview button { min-height: 44px; }
  #inquiry-mail-body { min-height: 320px; }
}

/* Floating WhatsApp Widget */
.whatsapp-floating-widget {
  position: fixed;
  bottom: max(22px, env(safe-area-inset-bottom));
  right: 24px;
  transform: none;
  z-index: 990;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* 可选：若需要切换至左下角，可在容器上添加 left-bottom 类；RTL 语系自动贴靠左下角避免遮挡页脚 */
.whatsapp-floating-widget.left-bottom,
html[dir="rtl"] .whatsapp-floating-widget:not([data-positioned]) {
  right: auto;
  left: 28px;
}

.whatsapp-floating-widget[data-positioned] {
  inset: var(--whatsapp-top) auto auto var(--whatsapp-left);
  transform: none;
}

.whatsapp-float-btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 58px;
  height: 58px;
  background: linear-gradient(135deg, #25D366 0%, #20BA5A 100%);
  color: #ffffff;
  border-radius: 50%;
  box-shadow: 0 6px 18px rgba(31, 27, 24, 0.2), 0 2px 6px rgba(31, 27, 24, 0.1);
  text-decoration: none;
  transition: transform 0.25s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.25s ease;
  user-select: none;
  cursor: grab;
  touch-action: none;
  -webkit-touch-callout: none;
  -webkit-user-drag: none;
  -webkit-tap-highlight-color: transparent;
}

.whatsapp-floating-widget[data-dragging] .whatsapp-float-btn {
  cursor: grabbing;
  transform: none;
}

.whatsapp-float-btn:hover {
  transform: translateY(-3px) scale(1.06);
  box-shadow: 0 10px 24px rgba(31, 27, 24, 0.26), 0 4px 10px rgba(31, 27, 24, 0.14);
  color: #ffffff;
}

.whatsapp-float-btn:active {
  transform: scale(0.95);
}

.whatsapp-float-btn .whatsapp-icon {
  width: 36px;
  height: 36px;
  fill: #ffffff;
  position: relative;
  z-index: 2;
  pointer-events: none;
  filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.12));
}

/* Quiet hover interaction without distracting pulse ring */
.whatsapp-float-btn .whatsapp-pulse {
  display: none;
}

@keyframes wa-pulse-ring {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.28);
    opacity: 0;
  }
  100% {
    transform: scale(1.3);
    opacity: 0;
  }
}

/* 提示气泡 Tooltip */
.whatsapp-float-btn .whatsapp-tooltip {
  position: absolute;
  right: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%) translateX(6px);
  background: #1d1917;
  color: #ffffff;
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.18);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.whatsapp-float-btn .whatsapp-tooltip::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 100%;
  transform: translateY(-50%);
  border-width: 5px;
  border-style: solid;
  border-color: transparent transparent transparent #1d1917;
}

.whatsapp-floating-widget:is(.left-bottom:not([data-positioned]), [data-tooltip-right]) .whatsapp-tooltip,
html[dir="rtl"] .whatsapp-floating-widget:not([data-positioned]) .whatsapp-tooltip {
  right: auto;
  left: calc(100% + 12px);
  transform: translateY(-50%) translateX(-6px);
}

.whatsapp-floating-widget:is(.left-bottom:not([data-positioned]), [data-tooltip-right]) .whatsapp-tooltip::after,
html[dir="rtl"] .whatsapp-floating-widget:not([data-positioned]) .whatsapp-tooltip::after {
  left: auto;
  right: 100%;
  border-color: transparent #1d1917 transparent transparent;
}

.whatsapp-floating-widget:not([data-dragging]) .whatsapp-float-btn:hover .whatsapp-tooltip {
  opacity: 1;
  visibility: visible;
  transform: translateY(-50%) translateX(0);
}

@media (max-width: 639px) {
  .whatsapp-floating-widget {
    bottom: max(14px, env(safe-area-inset-bottom));
    right: 14px;
    z-index: 46;
  }
  .whatsapp-floating-widget.left-bottom:not([data-positioned]),
  html[dir="rtl"] .whatsapp-floating-widget:not([data-positioned]) {
    left: 14px;
    right: auto;
  }
  .whatsapp-float-btn {
    width: 48px;
    height: 48px;
  }
  .whatsapp-float-btn .whatsapp-icon {
    width: 28px;
    height: 28px;
  }
  .whatsapp-float-btn .whatsapp-tooltip {
    display: none;
  }
}
