/* ==========================================================================
   SHREEJA FOOD SOLUTIONS — FLOATING CONTACT CHATBOX WIDGET
   Phone, WhatsApp & Email Direct Channels with Smooth Micro-Animations
   ========================================================================== */

.floating-chat-widget {
  position: fixed;
  bottom: 28px;
  right: 28px;
  z-index: calc(var(--z-modal, 1000) - 10);
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  font-family: var(--font-body, -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif);
}

/* --------------------------------------------------------------------------
   1. Animated Greeting / Teaser Tooltip
   -------------------------------------------------------------------------- */
.chat-teaser-bubble {
  display: none !important;
  position: absolute;
  bottom: 74px;
  right: 0;
  background: #FFFFFF;
  color: var(--color-black, #17130F);
  padding: 0.75rem 1.15rem;
  border-radius: 16px;
  box-shadow: 0 12px 32px rgba(23, 19, 15, 0.16), 0 2px 6px rgba(23, 19, 15, 0.06);
  border: 1px solid var(--color-cream-border, #E8E2D8);
  display: flex;
  align-items: center;
  gap: 0.75rem;
  white-space: nowrap;
  cursor: pointer;
  transform-origin: bottom right;
  animation: bubbleFloat 4s ease-in-out infinite, bubbleEnter 0.5s cubic-bezier(0.16, 1, 0.3, 1) forwards;
  transition: opacity 0.3s ease, transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), visibility 0.3s ease;
}

.chat-teaser-bubble::after {
  content: '';
  position: absolute;
  bottom: -7px;
  right: 24px;
  width: 14px;
  height: 14px;
  background: #FFFFFF;
  border-right: 1px solid var(--color-cream-border, #E8E2D8);
  border-bottom: 1px solid var(--color-cream-border, #E8E2D8);
  transform: rotate(45deg);
}

.chat-teaser-bubble.hidden {
  opacity: 0;
  visibility: hidden;
  transform: translateY(10px) scale(0.9);
  pointer-events: none;
}

.teaser-avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background-color: var(--color-orange, #F15A24);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #FFFFFF;
  font-size: 0.75rem;
  flex-shrink: 0;
}

.teaser-text {
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--color-black, #17130F);
  line-height: 1.2;
}

.teaser-text span {
  display: block;
  font-size: 0.72rem;
  color: var(--color-orange, #F15A24);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  margin-top: 2px;
}

.teaser-close-btn {
  background: transparent;
  border: none;
  color: var(--text-dark-muted, #7A7369);
  font-size: 1.1rem;
  line-height: 1;
  padding: 0 0 0 0.35rem;
  cursor: pointer;
  transition: color 0.2s ease;
}

.teaser-close-btn:hover {
  color: var(--color-orange, #F15A24);
}

/* --------------------------------------------------------------------------
   2. Floating Launcher Trigger Button
   -------------------------------------------------------------------------- */
.chat-launcher-btn {
  width: 60px;
  height: 60px;
  border-radius: 50%;
  background: linear-gradient(135deg, #F15A24 0%, #D94612 100%);
  color: #FFFFFF;
  border: none;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  box-shadow: 0 8px 26px rgba(241, 90, 36, 0.42), 0 2px 8px rgba(23, 19, 15, 0.15);
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.35s ease;
  z-index: 2;
}

.chat-launcher-btn:hover {
  transform: scale(1.08) translateY(-2px);
  box-shadow: 0 12px 32px rgba(241, 90, 36, 0.55), 0 4px 12px rgba(23, 19, 15, 0.2);
}

.chat-launcher-btn:active {
  transform: scale(0.95);
}

/* Continuous Pulse Ripple behind Launcher */
.chat-launcher-pulse {
  position: absolute;
  top: -4px;
  left: -4px;
  right: -4px;
  bottom: -4px;
  border-radius: 50%;
  border: 2px solid var(--color-orange, #F15A24);
  animation: pulseRipple 2.4s cubic-bezier(0.25, 0.8, 0.25, 1) infinite;
  pointer-events: none;
}

/* Online Badge Dot */
.chat-online-badge {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 14px;
  height: 14px;
  background-color: #22C55E;
  border: 2.5px solid #FFFFFF;
  border-radius: 50%;
}

.chat-launcher-btn .chat-icon-msg,
.chat-launcher-btn .chat-icon-close {
  position: absolute;
  transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.3s ease;
}

.chat-launcher-btn .chat-icon-msg {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.chat-launcher-btn .chat-icon-close {
  opacity: 0;
  transform: rotate(-90deg) scale(0.5);
}

.floating-chat-widget.active .chat-launcher-btn .chat-icon-msg {
  opacity: 0;
  transform: rotate(90deg) scale(0.5);
}

.floating-chat-widget.active .chat-launcher-btn .chat-icon-close {
  opacity: 1;
  transform: rotate(0) scale(1);
}

.floating-chat-widget.active .chat-launcher-pulse {
  animation: none;
  opacity: 0;
}

/* --------------------------------------------------------------------------
   3. Chatbox Popup Window Card
   -------------------------------------------------------------------------- */
.chatbox-card {
  position: absolute;
  bottom: 76px;
  right: 0;
  width: 335px;
  max-width: calc(100vw - 32px);
  background: #FFFFFF;
  border-radius: 20px;
  box-shadow: 0 24px 64px rgba(23, 19, 15, 0.22), 0 4px 16px rgba(23, 19, 15, 0.08);
  border: 1px solid rgba(23, 19, 15, 0.08);
  overflow: hidden;
  opacity: 0;
  visibility: hidden;
  transform: translateY(20px) scale(0.92);
  transform-origin: bottom right;
  transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              transform 0.4s cubic-bezier(0.16, 1, 0.3, 1),
              visibility 0.4s ease;
  pointer-events: none;
  z-index: 3;
}

.floating-chat-widget.active .chatbox-card {
  opacity: 1;
  visibility: visible;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

/* Header */
.chatbox-header {
  background: linear-gradient(135deg, #17130F 0%, #2A231C 100%);
  color: #FFFFFF;
  padding: 1.4rem 1.4rem 1.25rem;
  position: relative;
}

.chatbox-header::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--color-orange, #F15A24) 0%, #FFA07A 100%);
}

.chatbox-header-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 0.65rem;
}

.chatbox-brand {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.chatbox-avatar {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: #FFFFFF;
  padding: 3px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.25);
  position: relative;
}

.chatbox-avatar img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.chatbox-avatar-dot {
  position: absolute;
  bottom: -1px;
  right: -1px;
  width: 10px;
  height: 10px;
  background-color: #22C55E;
  border: 2px solid #17130F;
  border-radius: 50%;
  animation: pulseDot 1.8s infinite;
}

.chatbox-title-wrap h4 {
  font-family: var(--font-display, inherit);
  font-size: 0.98rem;
  font-weight: 700;
  color: #FFFFFF;
  margin: 0;
  line-height: 1.2;
}

.chatbox-title-wrap p {
  font-size: 0.72rem;
  color: rgba(255, 255, 255, 0.65);
  margin: 2px 0 0;
  text-transform: uppercase;
  letter-spacing: 0.04em;
}

.chatbox-close-btn {
  background: rgba(255, 255, 255, 0.12);
  border: none;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  color: #FFFFFF;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 1.1rem;
  line-height: 1;
  transition: background 0.2s ease, transform 0.2s ease;
}

.chatbox-close-btn:hover {
  background: rgba(241, 90, 36, 0.85);
  transform: rotate(90deg);
}

.chatbox-status-line {
  font-size: 0.78rem;
  color: rgba(255, 255, 255, 0.85);
  display: flex;
  align-items: center;
  gap: 0.4rem;
  margin-top: 0.35rem;
}

.chatbox-status-line .dot-live {
  width: 7px;
  height: 7px;
  background-color: #22C55E;
  border-radius: 50%;
}

/* Body Options */
.chatbox-body {
  padding: 1.15rem 1.15rem 0.95rem;
  background-color: #FAFAFA;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.chat-channel-btn {
  display: flex;
  align-items: center;
  gap: 0.95rem;
  padding: 0.85rem 1rem;
  background: #FFFFFF;
  border-radius: 14px;
  border: 1px solid var(--color-cream-border, #EAE5DC);
  text-decoration: none;
  color: var(--color-black, #17130F);
  box-shadow: 0 2px 6px rgba(23, 19, 15, 0.03);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
  position: relative;
  overflow: hidden;
}

.chat-channel-btn:hover {
  transform: translateY(-2px);
  border-color: var(--color-orange, #F15A24);
  box-shadow: 0 8px 20px rgba(241, 90, 36, 0.15);
}

.channel-icon-wrap {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  transition: transform 0.25s ease;
}

.chat-channel-btn:hover .channel-icon-wrap {
  transform: scale(1.1);
}

/* WhatsApp Channel Style */
.channel-whatsapp .channel-icon-wrap {
  background: linear-gradient(135deg, #25D366 0%, #128C7E 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(37, 211, 102, 0.3);
}

.channel-whatsapp:hover {
  border-color: #25D366;
  box-shadow: 0 8px 20px rgba(37, 211, 102, 0.2);
}

/* Phone Channel Style */
.channel-phone .channel-icon-wrap {
  background: linear-gradient(135deg, #F15A24 0%, #D94612 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(241, 90, 36, 0.3);
}

/* Email Channel Style */
.channel-email .channel-icon-wrap {
  background: linear-gradient(135deg, #17130F 0%, #3B332A 100%);
  color: #FFFFFF;
  box-shadow: 0 4px 12px rgba(23, 19, 15, 0.2);
}

.channel-info {
  flex: 1;
  min-width: 0;
}

.channel-name {
  font-family: var(--font-display, inherit);
  font-size: 0.88rem;
  font-weight: 700;
  color: var(--color-black, #17130F);
  margin-bottom: 2px;
  line-height: 1.2;
}

.channel-sub {
  font-size: 0.74rem;
  color: var(--text-dark-muted, #7A7369);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
}

.channel-arrow {
  color: var(--text-dark-muted, #7A7369);
  font-size: 0.95rem;
  transition: transform 0.2s ease, color 0.2s ease;
  flex-shrink: 0;
}

.chat-channel-btn:hover .channel-arrow {
  transform: translateX(3px);
  color: var(--color-orange, #F15A24);
}

.channel-whatsapp:hover .channel-arrow {
  color: #25D366;
}

/* Footer note */
.chatbox-footer {
  padding: 0.75rem 1.15rem;
  background-color: #FFFFFF;
  border-top: 1px solid var(--color-cream-border, #EAE5DC);
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.chatbox-footer-note {
  font-size: 0.72rem;
  color: var(--text-dark-muted, #7A7369);
  display: flex;
  align-items: center;
  gap: 0.35rem;
}

.chatbox-footer-link {
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--color-orange, #F15A24);
  text-decoration: none;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  cursor: pointer;
}

.chatbox-footer-link:hover {
  text-decoration: underline;
}

/* --------------------------------------------------------------------------
   4. Keyframe Animations
   -------------------------------------------------------------------------- */
@keyframes pulseRipple {
  0% {
    transform: scale(0.95);
    opacity: 0.8;
  }
  50% {
    transform: scale(1.22);
    opacity: 0;
  }
  100% {
    transform: scale(0.95);
    opacity: 0;
  }
}

@keyframes pulseDot {
  0%, 100% {
    transform: scale(1);
    opacity: 1;
  }
  50% {
    transform: scale(1.3);
    opacity: 0.8;
  }
}

@keyframes bubbleEnter {
  0% {
    opacity: 0;
    transform: translateY(12px) scale(0.9);
  }
  100% {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes bubbleFloat {
  0%, 100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-5px);
  }
}

/* --------------------------------------------------------------------------
   5. Mobile Responsiveness
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  .floating-chat-widget {
    bottom: 20px;
    right: 18px;
  }

  .chat-launcher-btn {
    width: 54px;
    height: 54px;
  }

  .chatbox-card {
    width: calc(100vw - 36px);
    right: 0;
    bottom: 68px;
  }

  .chat-teaser-bubble {
    bottom: 68px;
    padding: 0.6rem 0.95rem;
  }
}
