/* Salduma Messenger Chat */
#smc.smc {
  --smc-color: #0866FF;
  --smc-x: 20px;
  --smc-y: 20px;
  --smc-y-m: 16px;
  position: fixed;
  bottom: calc(var(--smc-y) + env(safe-area-inset-bottom, 0px));
  z-index: 99990;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 12px;
  max-width: calc(100vw - 2 * var(--smc-x));
  font-family: inherit;
  line-height: 1.4;
  pointer-events: none;
}
#smc.smc *,
#smc.smc *::before,
#smc.smc *::after { box-sizing: border-box; }
#smc.smc--right { right: var(--smc-x); }
#smc.smc--left { left: var(--smc-x); align-items: flex-start; }

/* Button */
#smc .smc-btn {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  justify-content: flex-start;
  min-width: 60px;
  height: 60px;
  padding: 0 15px;
  border-radius: 999px;
  overflow: hidden;
  background: var(--smc-color);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 6px 20px rgba(0, 0, 0, .22);
  transition: transform .2s ease, box-shadow .2s ease, filter .2s ease, padding .3s ease;
  -webkit-tap-highlight-color: transparent;
}
#smc .smc-btn:hover,
#smc .smc-btn:focus-visible {
  color: #fff;
  text-decoration: none;
  transform: translateY(-2px);
  box-shadow: 0 10px 26px rgba(0, 0, 0, .26);
  filter: brightness(1.06);
}
#smc .smc-btn:focus-visible { outline: 3px solid rgba(255, 255, 255, .9); outline-offset: 2px; }
#smc .smc-icon { width: 30px; height: 30px; flex: 0 0 auto; display: block; }
/* Label: hidden; on computers it slides out to the left when the button is hovered / focused.
   grid 0fr -> 1fr animates to the label's exact width, so the motion is even from start to end. */
#smc .smc-label {
  display: grid;
  grid-template-columns: 0fr;
  margin-left: 0;
  opacity: 0;
  /* collapsing: text fades out first, then the button closes */
  transition:
    grid-template-columns .55s cubic-bezier(.4, 0, .2, 1) .05s,
    margin-left .55s cubic-bezier(.4, 0, .2, 1) .05s,
    opacity .2s ease;
}
#smc .smc-label > span { min-width: 0; overflow: hidden; white-space: nowrap; }
@media (hover: hover) and (min-width: 768px) {
  #smc.smc--labeled:not(.smc--mobile) .smc-btn {
    transition: transform .3s ease, box-shadow .3s ease, filter .3s ease, padding .7s cubic-bezier(.22, 1, .36, 1);
  }
  #smc.smc--labeled:not(.smc--mobile) .smc-btn:hover,
  #smc.smc--labeled:not(.smc--mobile) .smc-btn:focus-visible { padding-right: 22px; }
  #smc.smc--labeled:not(.smc--mobile) .smc-btn:hover .smc-label,
  #smc.smc--labeled:not(.smc--mobile) .smc-btn:focus-visible .smc-label {
    grid-template-columns: 1fr;
    margin-left: 10px;
    opacity: 1;
    /* expanding: soft ease-out, text appears once the button has started opening */
    transition:
      grid-template-columns .7s cubic-bezier(.22, 1, .36, 1),
      margin-left .7s cubic-bezier(.22, 1, .36, 1),
      opacity .45s ease .2s;
  }
}

/* Device filter before JS runs (JS then decides precisely) */
@media (max-width: 1024px) { #smc.smc--dev-desktop:not(.smc--ready) { display: none; } }
@media (min-width: 1025px) { #smc.smc--dev-mobile:not(.smc--ready) { display: none; } }

/* Greeting bubble */
#smc .smc-greet {
  pointer-events: auto;
  position: relative;
  width: 280px;
  max-width: 100%;
  padding: 14px 34px 14px 16px;
  border-radius: 14px;
  background: #fff;
  color: #1c1e21;
  font-size: 15px;
  box-shadow: 0 8px 28px rgba(0, 0, 0, .18);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity .25s ease, transform .25s ease;
}
#smc .smc-greet[hidden] { display: none; }
#smc .smc-greet.smc-greet--show { opacity: 1; transform: none; }
#smc .smc-greet::after {
  content: "";
  position: absolute;
  bottom: -7px;
  right: 24px;
  width: 14px;
  height: 14px;
  background: #fff;
  transform: rotate(45deg);
  box-shadow: 3px 3px 6px rgba(0, 0, 0, .06);
}
#smc.smc--left .smc-greet::after { right: auto; left: 24px; }
#smc .smc-greet-text,
#smc .smc-greet-text:hover { display: block; color: inherit; text-decoration: none; }
#smc .smc-greet-close {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: #65676b;
  font-size: 20px;
  line-height: 26px;
  cursor: pointer;
}
#smc .smc-greet-close:hover { background: #f0f2f5; }

/* Phones */
@media (max-width: 767px) {
  #smc.smc { bottom: calc(var(--smc-y-m) + env(safe-area-inset-bottom, 0px)); }
  #smc .smc-btn { min-width: 56px; height: 56px; padding: 0 14px; }
  #smc .smc-icon { width: 28px; height: 28px; }
  #smc .smc-greet { width: 250px; font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  #smc .smc-btn,
  #smc .smc-label,
  #smc .smc-greet { transition: none; }
}
@media print { #smc.smc { display: none !important; } }
