/* =========================================
   Floating Dock Styles
   FILE: /assets/css/floating-dock.css
========================================= */

:root{
  --browser-footer-offset: 0px;
  --cartbar-live-h: 0px;
  --floating-safe-bottom: calc(env(safe-area-inset-bottom, 0px) + var(--browser-footer-offset));
  --floating-dock-bottom: calc(2px + var(--floating-safe-bottom) + var(--cartbar-live-h));
}

.storefront-floating-dock{
  position: fixed;
  left: 10px;
  right: 10px;
  bottom: var(--floating-dock-bottom);
  z-index: 1002;
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) 46px;
  align-items: end;
  gap: 8px;
  pointer-events: none;
}

.storefront-floating-dock > *{
  pointer-events: auto;
}

.telegram-support-wrap{
  position: relative;
  width: 46px;
  height: 46px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: visible;
}

.telegram-support-btn{
  position: relative;
  z-index: 3;
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: #229ED9;
  color: #fff;
  text-decoration: none;
  box-shadow:
    0 6px 20px rgba(0,0,0,0.25),
    0 0 0 0 rgba(34,158,217,0.35);
  transition: transform 0.2s ease, filter 0.2s ease, box-shadow 0.2s ease;
  animation: telegramPulse 2.6s ease-in-out infinite;
}

.telegram-support-btn:hover{
  color: #fff;
  transform: translateY(-3px) scale(1.04);
  filter: brightness(1.03);
}

.telegram-support-btn i{
  font-size: 21px;
  line-height: 1;
}

.telegram-chat-bubble{
  position: absolute;
  left: 14px;
  bottom: calc(100% + 10px);
  transform: scale(0.85) translateY(6px);
  z-index: 2;
  display: inline-flex;
  opacity: 0;
  transition: all .35s ease;
  align-items: center;
  gap: 6px;
  background: #ffffff;
  color: #173b63;
  border: 2px solid #229ED9;
  border-radius: 999px;
  padding: 6px 10px;
  min-height: 30px;
  font-size: 11.5px;
  font-weight: 800;
  line-height: 1;
  white-space: nowrap;
  box-shadow: 0 8px 24px rgba(0,0,0,0.14);
  pointer-events: none;
  animation: chatBubbleFloat 2.8s ease-in-out infinite;
}

.telegram-chat-bubble::before{
  content: "";
  position: absolute;
  left: 14px;
  bottom: -6px;
  width: 10px;
  height: 10px;
  background: #fff;
  border-right: 2px solid #229ED9;
  border-bottom: 2px solid #229ED9;
  transform: rotate(45deg);
  border-bottom-right-radius: 1px;
}

.telegram-chat-bubble::after{
  content: none;
}

.telegram-chat-bubble.show{
  opacity: 1;
  transform: scale(1) translateY(0);
}

.telegram-chat-bubble.collapsed{
  opacity: 0;
  transform: scale(0.85) translateY(6px);
  pointer-events: none;
}

@keyframes telegramPulse{
  0%, 100%{
    box-shadow:
      0 6px 20px rgba(0,0,0,0.25),
      0 0 0 0 rgba(34,158,217,0.30);
  }
  50%{
    box-shadow:
      0 10px 24px rgba(0,0,0,0.28),
      0 0 0 10px rgba(34,158,217,0.00);
  }
}

@keyframes chatBubbleFloat{
  0%, 100%{
    transform: scale(1) translateY(0);
  }
  50%{
    transform: scale(1) translateY(-2px);
  }
}

@media (max-width: 575.98px){
  .telegram-chat-bubble{
    left: 10px;
    bottom: calc(100% + 8px);
    padding: 5px 9px;
    min-height: 28px;
    font-size: 11px;
  }

  .telegram-chat-bubble::before{
    left: 12px;
    bottom: -5px;
    width: 9px;
    height: 9px;
  }
}

.back-to-top-btn{
  width: 46px;
  height: 46px;
  min-width: 46px;
  min-height: 46px;
  border: none;
  border-radius: 50%;
  background: #0058a8;
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  display: none;
  align-items: center;
  justify-content: center;
  box-shadow: 0 6px 20px rgba(0,0,0,0.25);
  cursor: pointer;
  transition: all 0.2s ease;
}

.back-to-top-btn:hover{
  background: #fc9a1d;
  transform: translateY(-2px);
}