/* ============================================
   ABPack.vn — Floating Contact Buttons
   Premium sticky CTA buttons with animations
   ============================================ */

/* --- Floating Button Container --- */
.btn-call-to-action {
    position: fixed;
    left: 0;
    bottom: 30%;
    z-index: var(--z-fixed);
    display: flex;
    flex-direction: column;
    gap: var(--space-2);
}

.btn-call-to-action a {
    display: flex;
    align-items: center;
    padding: var(--space-2) var(--space-4) var(--space-2) var(--space-3);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    color: var(--color-text-inverse);
    font-weight: 500;
    font-size: var(--text-sm);
    text-decoration: none;
    min-width: 140px;
    box-shadow: var(--shadow-lg);
    transition: all var(--transition-base);
    transform: translateX(-2px);
}

.btn-call-to-action a:hover {
    transform: translateX(4px);
    box-shadow: var(--shadow-xl);
}

/* Zalo */
.btn-call-to-action a.btn-zalo {
    background: linear-gradient(135deg, #E8851E, #C96E10);
}

.btn-call-to-action a.btn-zalo:hover {
    background: linear-gradient(135deg, #F5A54D, #E8851E);
}

/* Facebook */
.btn-call-to-action a.btn-fb {
    background: linear-gradient(135deg, #2B5EA7, #1B3E6F);
}

.btn-call-to-action a.btn-fb:hover {
    background: linear-gradient(135deg, #3D7DC4, #2B5EA7);
}

/* Hotline */
.btn-call-to-action a.btn-hotline {
    background: linear-gradient(135deg, #D93A3A, #B52828);
    position: relative;
}

.btn-call-to-action a.btn-hotline:hover {
    background: linear-gradient(135deg, #E75555, #D93A3A);
}

/* Pulse animation for hotline */
.btn-call-to-action a.btn-hotline::before {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    animation: pulse-ring 2s ease-out infinite;
    background: rgba(217, 58, 58, 0.3);
    z-index: -1;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(1.15);
        opacity: 0;
    }
}

/* --- Scroll-triggered fade-in animations --- */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInLeft {
    from {
        opacity: 0;
        transform: translateX(-20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes fadeInRight {
    from {
        opacity: 0;
        transform: translateX(20px);
    }
    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@keyframes scaleIn {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* Animation classes (applied via IntersectionObserver or on load) */
.animate-fade-in-up {
    animation: fadeInUp 0.6s ease-out both;
}

.animate-fade-in-left {
    animation: fadeInLeft 0.6s ease-out both;
}

.animate-fade-in-right {
    animation: fadeInRight 0.6s ease-out both;
}

.animate-scale-in {
    animation: scaleIn 0.5s ease-out both;
}

/* Stagger delays for grid items */
.animate-delay-1 { animation-delay: 0.1s; }
.animate-delay-2 { animation-delay: 0.2s; }
.animate-delay-3 { animation-delay: 0.3s; }
.animate-delay-4 { animation-delay: 0.4s; }

/* --- Smooth appearance for back-to-top button --- */
a.back-to-top {
    opacity: 0;
    transition: opacity var(--transition-base), transform var(--transition-base) !important;
}

a.back-to-top.active,
a.back-to-top:not([style*="display: none"]) {
    opacity: 1;
}

/* --- Loading skeleton shimmer (for lazy images) --- */
@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

.skeleton {
    background: linear-gradient(90deg, var(--color-bg-secondary) 25%, var(--color-bg-tertiary) 50%, var(--color-bg-secondary) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.5s ease-in-out infinite;
    border-radius: var(--radius-md);
}

/* --- Reduced Motion: respect user preferences --- */
@media (prefers-reduced-motion: reduce) {
    .animate-fade-in-up,
    .animate-fade-in-left,
    .animate-fade-in-right,
    .animate-scale-in {
        animation: none !important;
        opacity: 1 !important;
        transform: none !important;
    }

    .btn-call-to-action a.btn-hotline::before {
        animation: none !important;
    }
}
