/**
 * Star Suites - Floating Action Buttons & Dock Styles
 * WhatsApp, Phone, Email & Smooth Back to Top
 */

:root {
  --star-brand-red: #950a0a;
  --star-ink: #091e24;
  --star-ink-2: #0e1824;
  --star-whatsapp: #25D366;
  --star-ring: 0 10px 24px rgba(0, 0, 0, 0.22), 0 6px 12px rgba(0, 0, 0, 0.18);
  --star-radius: 999px;

  /* Mobile layout tokens */
  --star-btn: 50px;
  --star-gap: 18px;
  --star-gutter: 12px;
  --star-top-size: 50px;
}

/* =========================================================================
   Desktop & Tablet (>= 768px): Vertical Floating Stack on Right
   ========================================================================= */
a.floating-button {
  position: fixed;
  right: 24px;
  width: 52px;
  height: 52px;
  line-height: 52px;
  font-size: 20px;
  color: #ffffff !important;
  border-radius: var(--star-radius);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  text-decoration: none;
  box-shadow: var(--star-ring);
  transition: transform 0.15s ease, box-shadow 0.15s ease, background-color 0.2s ease, opacity 0.2s ease;
  outline: none;
}

#whatsapp-float {
  bottom: 232px;
  background: var(--star-whatsapp);
}

#tel-float {
  bottom: 160px;
  background: var(--star-brand-red);
}

#email-float {
  bottom: 88px;
  background: linear-gradient(180deg, var(--star-ink) 0%, var(--star-ink-2) 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
}

a.floating-button:hover,
a.floating-button:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(0, 0, 0, 0.28), 0 8px 14px rgba(0, 0, 0, 0.18);
}

#whatsapp-float:hover,
#whatsapp-float:focus-visible {
  background: #21c55d;
}

#tel-float:hover,
#tel-float:focus-visible {
  background: #7f0808;
}

#email-float:hover,
#email-float:focus-visible {
  filter: brightness(1.08);
}

/* Back-to-Top: Desktop Standalone Floating */
#scrollToTopIcon {
  position: fixed;
  bottom: 24px;
  right: 24px;
  z-index: 1100;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: var(--star-radius);
  background: var(--star-brand-red);
  color: #ffffff;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  box-shadow: var(--star-ring);
  transition: opacity 0.25s ease, transform 0.15s ease, background-color 0.2s ease;
}

#scrollToTopIcon.show {
  opacity: 1;
  pointer-events: auto;
}

#scrollToTopIcon:hover,
#scrollToTopIcon:focus-visible {
  background: #7f0808;
  transform: translateY(-2px);
}

/* =========================================================================
   Mobile (<= 767px): Centered Glassmorphic Bottom Dock
   ========================================================================= */
@media (max-width: 767px) {
  #side-contact {
    position: fixed;
    bottom: 10px;
    left: 50%;
    transform: translateX(-50%);
    display: inline-flex;
    align-items: center;
    gap: var(--star-gap);
    z-index: 1090;

    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    background: linear-gradient(180deg, rgba(9, 30, 36, 0.65), rgba(14, 24, 36, 0.65));
    border-radius: 16px;
    padding: 10px var(--star-gutter);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
    transition: padding 0.35s ease;
  }

  a.floating-button {
    position: static;
    width: var(--star-btn);
    height: var(--star-btn);
    line-height: var(--star-btn);
    flex: 0 0 auto;
    box-shadow: none;
  }

  #scrollToTopIcon {
    position: absolute;
    right: var(--star-gutter);
    top: 50%;
    transform: translateY(-50%) scale(0.9);
    width: var(--star-top-size);
    height: var(--star-top-size);
    border-radius: var(--star-radius);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    box-shadow: var(--star-ring);
  }

  /* When scrolled down, dock expands right padding to reveal back-to-top */
  #side-contact.is-scrolled {
    padding-right: calc(var(--star-gutter) + var(--star-top-size) + var(--star-gap));
  }

  #side-contact.is-scrolled #scrollToTopIcon {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translateY(-50%) scale(1);
    transition: opacity 0.25s ease, transform 0.25s ease;
  }

  #scrollToTopIcon.show {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
  }
}

@media (prefers-reduced-motion: reduce) {
  #side-contact,
  #scrollToTopIcon,
  a.floating-button {
    transition: none !important;
  }
}

