.chat,
.chat * {
  box-sizing: border-box;
  font-family: var(--cw-font-family, Arial), Arial, sans-serif;
  margin: 0;
  padding: 0;
}

.chat [hidden] {
  display: none !important;
}

.chat {
  position: fixed;
  z-index: 99999;
  right: 0;
  bottom: 0;
  padding: 30px 15px;
}

@media (min-width: 768px) {
  .chat {
    right: calc(60px + var(--cw-scroll-width, 0px));
    bottom: 60px;
    padding: 0;
  }
}

@media (min-width: 1200px) {
  .chat {
    bottom: 80px;
    right: calc(80px + var(--cw-scroll-width, 0px));
  }
}

.chat__trigger {
  position: relative;
  display: block;
  width: 60px;
  height: 60px;
  // transition: background-color .3s ease-in-out;
  transition: opacity .3s ease-in-out;
  border-radius: 50%;
  background: var(--cw-primary-color);
  border: none;
  color: #fff;
  cursor: pointer;
}

@media (min-width: 768px) {
  .chat__trigger {
    width: 70px;
    height: 70px;
  }
}

.chat__trigger:not(:last-child) {
  margin-bottom: 15px;
  display: none;
  opacity: 0;
}

@media (min-width: 768px) {
  .chat__trigger:not(:last-child) {
    margin-bottom: 25px;
  }
}

.chat__trigger[data-trigger="controls"] {
  animation: pulse 1s infinite;
}

.chat__trigger[data-trigger="controls"]:hover {
  animation: none;
}

.chat__trigger.is-telegram {
  background: #2199F3;
}

.chat__trigger.is-max {
  background: linear-gradient(90deg, #2B4AFA 0.07%, #9C4DDC 100.07%);
}

.chat__trigger.is-telegram:hover svg,
.chat__trigger.is-max:hover svg {
  transform: translate(-50%, -50%) scale(1.15);
}

.chat__trigger.is-whatsapp {
  transition: none;
  background: linear-gradient(0deg, #1FAF38 -9900%, #60D669 100%);
}

.chat__trigger.is-whatsapp:hover svg {
  transform: translate(-50%, -50%) scale(1.15);
}

.chat__trigger.is-callback {
  // background: #153997;
  filter: brightness(0.8);
}

.chat__trigger-icon {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 25px;
  height: 25px;
  transform: translate(-50%, -50%);
  transition: transform .3s ease-in-out;
}

@media (min-width: 768px) {
  .chat__trigger-icon {
    width: 30px;
    height: 30px;
  }
}

.chat__trigger-icon:not(:first-child) {
  display: none;
}

.chat__main {
  position: absolute;
  right: 0;
  bottom: 0;
  visibility: hidden;
  transition: opacity .3s ease-in-out, 
              transform .3s ease-in-out;
  transform: scale(.1) translateY(0);
  transform-origin: right bottom;
  opacity: 0;
  max-height: 80vh;
  width: 100vw;
}

@media (min-width: 768px) {
  .chat__main {
    right: 0;
    bottom: 70px;
    padding: 0;
    width: auto;

    /* max-height: calc(100vh - var(--bottom-gap, 0) - 120px); */
    max-height: calc(100vh - 60px - 130px);
  }
}

@media (min-width: 992px) {
  .chat__main {
    max-height: calc(100vh - 80px - 130px);
  }
}

/**
 * Opened States START
 */
.chat.is-active .chat__trigger[data-trigger="controls"] {
  animation: none;
  background: var(--cw-primary-color, #2f69ff);
}

.chat.is-active [data-trigger="controls"] .chat__trigger-icon {
  display: block;
}

.chat.is-active [data-trigger="controls"] .chat__trigger-icon:first-child {
  display: none;
}

.chat.is-active .chat__trigger:not(:last-child) {
  display: block;
}

.chat.is-active .chat__trigger {
  animation: fadeInUp .3s forwards;
}

.chat.is-active .chat__trigger:nth-last-child(2) {
  animation-delay: .1s;
}

.chat.is-active .chat__trigger:nth-last-child(3) {
  animation-delay: .3s;
}

.chat.is-active .chat__trigger:nth-last-child(4) {
  animation-delay: .5s;
}

.chat.is-active .chat__trigger:nth-last-child(5) {
  animation-delay: .7s;
}

.chat.is-active .chat__trigger:nth-last-child(6) {
  animation-delay: .9s;
}

.chat.is-active .chat__trigger:nth-last-child(7) {
  animation-delay: 1.1s;
}

.chat.is-active .chat__trigger:nth-last-child(8) {
  animation-delay: 1.3s;
}

.chat.is-active .chat__trigger:nth-last-child(8) {
  animation-delay: 1.5s;
}

.chat.is-callback-active [data-panel="callback"]
/*.chat.is-chat-active [data-panel="chat"]*/ {
  z-index: 3;
  visibility: visible;
  transform: scale(1);
  opacity: 1;
}

@media (min-width: 768px) {
  .chat.is-callback-active [data-panel="callback"]
  /*.chat.is-chat-active [data-panel="chat"]*/ {
    transform: scale(1) translate3d(0, -15px, 0);
  }
}
/**
 * Opened States END
 */

/**
 * Overlay START
 */
.chat-overlay {
  background: rgba(217, 217, 217, .8);
  transition: opacity .5s ease-in-out;
  position: fixed;
  left: 0;
  top: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
}
/**
 * Overlay END
 */

/**
 * Chat Scrollbar START
 */
.chat .scrollbar::-webkit-scrollbar {
  width: 4px;
  height: 4px;
  margin-bottom: 40px;
  background-color: #e2e2ea;
  border-radius: 4px;
}

.chat .scrollbar::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background-color: var(--cw-primary-color);
}

.chat .scrollbar::-webkit-scrollbar-track {
  border-radius: 4px;
  background-color: #e2e2ea;
}

/**
 * Chat Scrollbar END
 */

@keyframes pulse {
  0% {
    box-shadow: 0 0 0 0 var(--cw-primary-color);
  }

  70% {
    box-shadow: 0 0 0 15px transparent;
  }

  to {
    box-shadow: 0 0 0 0 transparent;
  }
}

@keyframes fadeInUp {
  from {
    opacity: 0;
    transform: translate3d(0, 30px, 0);
  }
  
  to {
    transform: translate3d(0, 0, 0);
    opacity: 1;
  }
}

[class*="jivoMobileButton"] {
  display: none !important;
}