/* Support controls are local assets. No floating panel takes over the page. */
.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; }
}
@media (max-width: 767px) {
  body.support-mobile-enabled {
    --support-bar-space: calc(104px + 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); }
  /* The toolbar Menu already returns to the header; a second floating button
     would cover checkout actions on narrow screens. */
  .support-mobile-enabled .back-top { display: none; }
  .support-floating { display: none; }
  .support-mobile-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 35;
    display: grid;
    grid-template-columns: repeat(5, minmax(0, 1fr));
    min-height: calc(68px + env(safe-area-inset-bottom, 0px));
    padding: 6px max(4px, env(safe-area-inset-right, 0px)) calc(5px + env(safe-area-inset-bottom, 0px)) max(4px, env(safe-area-inset-left, 0px));
    border-top: 1px solid #ece4e4;
    border-radius: 16px 16px 0 0;
    background: #fff;
    box-shadow: 0 -5px 24px #28324212;
    transition: transform .18s ease, visibility .18s;
  }
  .support-mobile-action {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-end;
    gap: 4px;
    min-width: 0;
    min-height: 54px;
    margin: 0;
    padding: 0 1px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: #3f4b5b;
    font: inherit;
    line-height: 1.25;
    text-align: center;
  }
  .support-mobile-action .support-icon { width: 28px; height: 28px; color: var(--support-channel, #c52026); }
  .support-mobile-action .support-icon svg { width: 25px; height: 25px; }
  .support-mobile-action.support-messenger .support-icon { --support-icon-cutout: #fff; }
  .support-mobile-action.support-zalo .support-icon { --support-icon-cutout: #fff; }
  .support-animated .support-mobile-action.support-messenger:not(.support-unavailable) .support-icon,
  .support-animated .support-mobile-action.support-zalo:not(.support-unavailable) .support-icon { animation: support-chat-float 6s ease-in-out infinite; }
  .support-animated .support-mobile-action.support-zalo:not(.support-unavailable) .support-icon { animation-delay: 1.4s; }
  .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: 10px;
    font-weight: 600;
    line-height: 1.25;
    overflow-wrap: anywhere;
  }
  .support-mobile-action:hover { color: #a81920; background: #fff5f5; }
  .support-mobile-action.support-phone { justify-content: flex-end; color: #a81920; }
  .support-mobile-action.support-phone .support-icon {
    width: 56px;
    height: 56px;
    margin-top: -24px;
    border: 5px solid #fff;
    border-radius: 50%;
    background: var(--support-channel);
    color: #fff;
    box-shadow: 0 2px 9px #c5202640;
  }
  .support-mobile-action.support-phone .support-icon svg { width: 25px; height: 25px; }
  .support-mobile-action.support-phone .support-label { font-weight: 700; }
  .support-mobile-action.support-unavailable { color: #8b929c; cursor: default; background: none; }
  .support-mobile-action.support-unavailable .support-icon { color: #a2a9b3; }
  .support-mobile-action.support-phone.support-unavailable .support-icon { background: #e4e7eb; color: #818a97; box-shadow: none; }
  .support-mobile-action:focus-visible { outline: 3px solid #1e73be; outline-offset: 1px; }
  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); }
}
@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; }
}
