/* Local support controls; the compact mobile bar opens a native contact dialog. */
.support-widgets {
  --support-red: #c52026;
  --support-blue: #1677ff;
  --support-icon-cutout: #1677ff;
}
.support-floating {
  position: fixed;
  left: max(20px, env(safe-area-inset-left, 0px));
  bottom: calc(24px + env(safe-area-inset-bottom, 0px));
  z-index: 30;
  display: flex;
  flex-direction: column;
  gap: 16px;
  align-items: flex-start;
}
.support-action { -webkit-tap-highlight-color: transparent; text-decoration: none; }
.support-widgets [hidden] { display: none !important; }
.support-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  isolation: isolate;
  flex: none;
}
.support-icon svg { display: block; flex: none; width: 26px; height: 26px; }
.support-floating-action {
  display: flex;
  position: relative;
  min-width: 52px;
  min-height: 52px;
  align-items: center;
  gap: 12px;
  color: #fff;
}
.support-floating-action .support-icon {
  width: 52px;
  height: 52px;
  color: #fff;
  background: var(--support-channel);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 4px 16px #152e4933;
}
.support-phone { --support-channel: #c52026; --support-icon-cutout: #c52026; }
.support-messenger { --support-channel: #1677ff; --support-icon-cutout: #1677ff; }
.support-zalo { --support-channel: #0573e1; --support-icon-cutout: #0573e1; }
.support-floating-action .support-label {
  padding: 6px 13px;
  background: #fff;
  color: #263144;
  border: 1px solid #e3e8ef;
  box-shadow: 0 3px 12px #152e4917;
  border-radius: 20px;
  font-size: 13px;
  line-height: 1.4;
  font-weight: 700;
  opacity: 0;
  visibility: hidden;
  transform: translateX(-5px);
  transition: opacity .18s, transform .18s, visibility .18s;
}
.support-floating-action:hover .support-label,
.support-floating-action:focus-visible .support-label { opacity: 1; visibility: visible; transform: none; }
.support-floating-action:hover,
.support-floating-action:focus-visible { color: #fff; }
.support-animated .support-floating-action .support-icon::before,
.support-animated .support-mobile-action.support-phone:not(.support-unavailable) .support-icon::before {
  content: '';
  position: absolute;
  inset: -5px;
  border: 2px solid var(--support-channel);
  border-radius: 50%;
  z-index: -1;
  pointer-events: none;
  animation: support-ring 3.5s ease-out infinite;
}
.support-animated .support-floating-action:nth-child(2) .support-icon::before { animation-delay: 1.15s; }
.support-animated .support-floating-action:nth-child(3) .support-icon::before { animation-delay: 2.3s; }
.support-animated .support-phone:not(.support-unavailable) .support-icon svg { animation: support-phone-wave 6s ease-in-out infinite; transform-origin: center; }
.support-mobile-bar { display: none; }
@keyframes support-ring {
  0% { opacity: .5; transform: scale(.9); }
  65%, 100% { opacity: 0; transform: scale(1.38); }
}
@keyframes support-phone-wave {
  0%, 76%, 100% { transform: rotate(0); }
  80%, 88% { transform: rotate(-12deg); }
  84%, 92% { transform: rotate(12deg); }
  96% { transform: rotate(-5deg); }
}
@keyframes support-chat-float {
  0%, 72%, 84%, 96%, 100% { transform: translateY(0); }
  78%, 90% { transform: translateY(-3px); }
}
@media (hover: none) and (min-width: 768px) {
  .support-floating-action .support-label { opacity: 1; visibility: visible; transform: none; }
}
/* The native dialog is inert and hidden while closed; the mobile nav has a contact-page fallback. */
.support-mobile-sheet { display: none; }
@media (max-width: 767px) {
  body.support-mobile-enabled {
    --support-bar-space: calc(72px + env(safe-area-inset-bottom, 0px));
    padding-bottom: var(--support-bar-space);
  }
  .support-mobile-enabled #main { scroll-margin-bottom: var(--support-bar-space); }
  .support-mobile-enabled input,
  .support-mobile-enabled select,
  .support-mobile-enabled textarea,
  .support-mobile-enabled button,
  .support-mobile-enabled a { scroll-margin-bottom: var(--support-bar-space); }
  body.support-mobile-enabled .back-top,
  body.support-mobile-enabled .reference-support,
  .support-floating { display: none; }
  .support-mobile-bar {
    position: fixed;
    bottom: 0; left: 0; right: 0;
    z-index: 150;
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    min-height: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 6px max(8px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom, 0px)) max(8px, env(safe-area-inset-left, 0px));
    border-top: 1px solid #e5e8ef;
    border-radius: 0;
    background: #fff;
    box-shadow: 0 -3px 15px #18243a08;
    transition: transform .18s ease, visibility .18s;
  }
  .support-mobile-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    min-width: 0;
    min-height: 52px;
    margin: 0; padding: 0 2px;
    border: 0; border-radius: 9px;
    background: transparent;
    color: #758197;
    font: inherit; line-height: 1.25; text-align: center;
  }
  .support-mobile-action .support-icon { width: 48px; height: 29px; color: inherit; border-radius: 10px; }
  .support-mobile-action .support-icon svg { width: 24px; height: 24px; }
  .support-mobile-action .support-label {
    display: -webkit-box;
    -webkit-box-orient: vertical; -webkit-line-clamp: 2;
    overflow: hidden; max-width: 100%;
    color: inherit; font-size: 11px; font-weight: 500; line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .support-mobile-action:hover { color: #bd1023; background: #fff6f7; }
  .support-mobile-action.support-quick-order { color: #ce1025; }
  .support-mobile-action.support-quick-order .support-icon { background: #fff0f3; }
  .support-mobile-action.support-quick-order .support-label { font-weight: 750; }
  .support-mobile-action:focus-visible { outline: 3px solid #c7a153; outline-offset: 0; }
  body.support-input-active .support-mobile-bar,
  body.support-nav-open .support-mobile-bar { transform: translateY(125%); visibility: hidden; pointer-events: none; }
  body.support-nav-open .site-header nav { max-height: calc(100dvh - 100px); }
  body.support-sheet-open { overflow: hidden; }
  dialog.support-mobile-sheet[open] {
    display: block;
    position: fixed;
    inset: auto 0 0;
    width: min(100%, 480px);
    max-width: 100%;
    max-height: 85vh;
    max-height: min(86dvh, 640px);
    margin: 0 auto;
    padding: 29px 20px calc(22px + env(safe-area-inset-bottom, 0px));
    border: 0; border-radius: 21px 21px 0 0;
    background: #fff; color: #18243a;
    box-shadow: 0 -8px 40px #18243a24;
    box-sizing: border-box;
    overflow: auto; overscroll-behavior: contain;
  }
  .support-mobile-sheet::backdrop { background: #18243a66; }
  .support-sheet-handle { display: block; width: 46px; height: 4px; margin: -16px auto 24px; border-radius: 5px; background: #d6dce6; }
  #mobile-support-sheet .support-sheet-close {
    position: absolute; right: 10px; top: 10px;
    display: grid; place-items: center;
    width: 44px; height: 44px;
    border: 0; border-radius: 50%;
    background: transparent; color: #778297;
    cursor: pointer;
  }
  #mobile-support-sheet .support-sheet-close svg { width: 21px; height: 21px; }
  #mobile-support-sheet h2 { margin: 0 30px 8px 0; color: #18243a; font-size: 22px; line-height: 1.4; font-weight: 800; }
  #mobile-support-sheet > p { margin: 0 0 19px; color: #6d788b; font-size: 14px; line-height: 1.6; }
  .support-sheet-channels { display: grid; gap: 5px; }
  #mobile-support-sheet .support-sheet-action {
    display: flex; align-items: center; gap: 13px;
    min-height: 58px;
    padding: 10px 4px;
    border-radius: 9px;
    color: #18243a; font-size: 15px; font-weight: 700;
    line-height: 1.45; text-decoration: none;
    box-sizing: border-box;
  }
  #mobile-support-sheet .support-sheet-action > .support-icon { width: 30px; height: 30px; color: var(--support-channel); }
  #mobile-support-sheet .support-sheet-action .support-icon svg { width: 25px; height: 25px; }
  #mobile-support-sheet .support-sheet-action.support-messenger .support-icon { --support-icon-cutout: #fff; }
  #mobile-support-sheet .support-sheet-action.support-zalo .support-icon { --support-icon-cutout: #fff; }
  .support-sheet-chevron { margin-left: auto; color: #9ba5b4; }
  .support-sheet-chevron svg { width: 16px; height: 16px; }
  #mobile-support-sheet .support-sheet-action:hover { background: #fff5f6; }
  #mobile-support-sheet .support-unavailable { color: #8b95a6; background: none; }
  #mobile-support-sheet .support-unavailable > .support-icon { color: #a0a8b5; }
  #mobile-support-sheet .support-unavailable small { margin-left: 8px; font-size: 12px; font-weight: 400; }
  #mobile-support-sheet .support-sheet-contact {
    display: flex; align-items: center; justify-content: center;
    min-height: 44px; margin-top: 14px; padding: 8px 14px;
    border: 1px solid #e2d3b4; border-radius: 9px;
    color: #8c6a32; font-size: 14px; font-weight: 700; text-decoration: none;
    box-sizing: border-box;
  }
  #mobile-support-sheet a:focus-visible,
  #mobile-support-sheet button:focus-visible { outline: 3px solid #c7a153; outline-offset: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  .support-widgets *, .support-widgets *::before, .support-widgets *::after { animation: none !important; transition: none !important; }
  .support-animated .support-icon::before { display: none; }
}
