/* Custom tweaks (Tailwind used for main UI) */

html,
body {
  scroll-behavior: smooth;
}

.tieudedautrang {
  font-size: 2.5rem;
  line-height: 1.4;
}

span.tieudephu {
  font-size: 2rem;
}

/* Đảm bảo sticky CTA ẩn trên màn hình lớn (fallback nếu class Tailwind không áp dụng) */
@media (min-width: 768px) {
  #sticky-cta {
    display: none !important;
  }
}

/* Sticky CTA (mobile) – show on scroll down with slide-up */
#sticky-cta.sticky-cta-anim {
  opacity: 0;
  transform: translate3d(0, 110%, 0);
  pointer-events: none;
  transition: transform 260ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 200ms ease;
  will-change: transform, opacity;
}

#sticky-cta.sticky-cta-anim.is-visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
  pointer-events: auto;
}

@media (prefers-reduced-motion: reduce) {
  #sticky-cta.sticky-cta-anim {
    transition: none !important;
  }
}

/* Hiệu ứng background chuyển động nhẹ cho CTA chính */
@keyframes cta-gold-glow {
  0% {
    background-position: 0% 50%;
  }
  50% {
    background-position: 100% 50%;
  }
  100% {
    background-position: 0% 50%;
  }
}

.cta-animated {
  background-image: linear-gradient(
    120deg,
    #cfaf6e,
    #e3c78a,
    #cfaf6e
  );
  background-size: 200% 200%;
  animation: cta-gold-glow 4s ease-in-out infinite;
}

/* Checkmark animation (popup thanks) */
.checkmark {
  width: 56px;
  height: 56px;
  border-radius: 9999px;
  border: 3px solid rgba(34, 197, 94, 0.35);
  position: relative;
  animation: checkmark-pop 420ms ease-out both;
}

.checkmark::after {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 16px;
  height: 30px;
  border-right: 5px solid #22c55e;
  border-bottom: 5px solid #22c55e;
  /* Center the check visually */
  transform: translate(-50%, -62%) rotate(45deg) scale(0.2);
  transform-origin: center;
  animation: checkmark-draw 520ms 160ms ease-out both;
}

@keyframes checkmark-pop {
  0% {
    transform: scale(0.92);
    opacity: 0;
  }
  100% {
    transform: scale(1);
    opacity: 1;
  }
}

@keyframes checkmark-draw {
  0% {
    opacity: 0;
    transform: translate(-50%, -62%) rotate(45deg) scale(0.2);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, -62%) rotate(45deg) scale(1);
  }
}

/* Floating CTA (desktop) – rung rinh nhẹ để nổi bật */
@keyframes float-cta-wiggle {
  0%,
  100% {
    transform: translate3d(0, 0, 0);
  }
  35% {
    transform: translate3d(0, -3px, 0);
  }
  60% {
    transform: translate3d(0, 0, 0);
  }
  75% {
    transform: translate3d(0, -1px, 0);
  }
}

.floating-cta-attn {
  transform: translate3d(0, 0, 0);
  animation: float-cta-wiggle 2.9s ease-in-out infinite;
  will-change: transform;
}

.floating-cta-attn:nth-child(2) {
  animation-delay: 180ms;
}
.floating-cta-attn:nth-child(3) {
  animation-delay: 360ms;
}

@media (prefers-reduced-motion: reduce) {
  .floating-cta-attn {
    animation: none !important;
  }
}

/* Popup animation */
.popup-overlay {
  opacity: 0;
  transition: opacity 220ms ease;
}
.popup-overlay.is-open {
  opacity: 1;
}

.popup-panel {
  opacity: 0;
  transform: translate3d(0, 18px, 0) scale(0.985);
  transition: opacity 240ms cubic-bezier(0.2, 0.8, 0.2, 1),
    transform 280ms cubic-bezier(0.2, 0.8, 0.2, 1);
  will-change: transform, opacity;
}
.popup-overlay.is-open .popup-panel {
  opacity: 1;
  transform: translate3d(0, 0, 0) scale(1);
}

.popup-panel[data-anim="top"] {
  transform: translate3d(0, -36px, 0);
}
.popup-panel[data-anim="bottom"] {
  transform: translate3d(0, 36px, 0);
}

@media (prefers-reduced-motion: reduce) {
  .popup-overlay,
  .popup-panel {
    transition: none !important;
    animation: none !important;
  }
}

/* Location map animated path */
.animated-path {
  stroke-dasharray: 10 10;
  animation: location-dash 1400ms linear infinite;
}

@keyframes location-dash {
  to {
    stroke-dashoffset: -20;
  }
}

@media (prefers-reduced-motion: reduce) {
  .animated-path {
    animation: none !important;
  }
}

/* Location icon subtle zoom */
@keyframes location-icon-zoom {
  0%,
  100% {
    transform: translateZ(0) scale(1);
  }
  50% {
    transform: translateZ(0) scale(1.06);
  }
}

.location-icon-zoom {
  animation: location-icon-zoom 1400ms ease-in-out infinite;
  transform-origin: center;
  will-change: transform;
}

@media (prefers-reduced-motion: reduce) {
  .location-icon-zoom {
    animation: none !important;
  }
}

