/* ============================================
   STICKY FREE CONSULTATION BUTTON
   ============================================ */

/* Main sticky button container */
.sticky-consultation-btn {
    position: fixed;
    bottom: 30px;
    right: 20px;
    z-index: 9999;
    opacity: 0;
    visibility: hidden;
    transform: translateY(100px) scale(0.8);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
    max-width: calc(100vw - 40px); /* Prevent overflow */
}

/* Show state */
.sticky-consultation-btn.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
    pointer-events: all;
}

/* Button styling */
.sticky-consultation-btn .consultation-btn {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 16px 24px;
    padding-left: 28px; /* Extra padding for badge space */
    background: linear-gradient(135deg, #b3ff00 0%, #8fcc00 100%);
    color: #1a1a2e;
    text-decoration: none;
    border-radius: 60px;
    font-weight: 700;
    font-size: 16px;
    box-shadow:
        0 10px 30px rgba(179, 255, 0, 0.3),
        0 5px 15px rgba(0, 0, 0, 0.2);
    position: relative;
    overflow: visible; /* Allow badge to show outside button */
    white-space: nowrap;
}

/* Hover effect */
.sticky-consultation-btn .consultation-btn:hover {
    transform: translateY(-3px);
    box-shadow:
        0 15px 40px rgba(179, 255, 0, 0.4),
        0 8px 20px rgba(0, 0, 0, 0.25);
    background: linear-gradient(135deg, #c4ff33 0%, #9fdd00 100%);
}

/* Active/Click effect */
.sticky-consultation-btn .consultation-btn:active {
    transform: translateY(-1px);
    box-shadow:
        0 8px 20px rgba(179, 255, 0, 0.3),
        0 4px 10px rgba(0, 0, 0, 0.2);
}

/* Subtle pulse animation */
.sticky-consultation-btn .consultation-btn::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 100%;
    height: 100%;
    background: inherit;
    border-radius: inherit;
    transform: translate(-50%, -50%);
    z-index: -1;
    animation: pulse-ring 3s cubic-bezier(0.4, 0, 0.6, 1) infinite;
    opacity: 0.3;
}

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

/* Icon styling */
.sticky-consultation-btn .btn-icon {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 24px;
    height: 24px;
}

.sticky-consultation-btn .btn-icon svg {
    width: 20px;
    height: 20px;
    fill: currentColor;
}

/* Badge for "FREE" */
.sticky-consultation-btn .free-badge {
    position: absolute;
    top: -8px;
    left: -5px; /* Moved to left side to prevent right-edge cutoff */
    background: #1a1a2e; /* Dark theme color matching site */
    color: #b3ff00; /* Bright green text */
    font-size: 10px;
    font-weight: 800;
    padding: 4px 8px;
    border-radius: 12px;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    border: 1px solid #b3ff00;
    box-shadow: 0 2px 8px rgba(179, 255, 0, 0.3);
    animation: badge-bounce 3s ease-in-out infinite;
    z-index: 10;
    white-space: nowrap;
}

@keyframes badge-bounce {
    0%, 100% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-2px);
    }
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .sticky-consultation-btn {
        bottom: 20px;
        right: 15px;
        left: 15px;
        max-width: calc(100vw - 30px);
    }

    .sticky-consultation-btn .consultation-btn {
        width: 100%;
        justify-content: center;
        padding: 14px 20px;
        font-size: 14px;
    }

    /* Simplified mobile version */
    .sticky-consultation-btn .btn-text-full {
        display: none;
    }

    .sticky-consultation-btn .btn-text-mobile {
        display: block;
    }

    .sticky-consultation-btn .free-badge {
        top: -6px;
        left: 10px; /* Keep on left side for mobile too */
    }
}

/* Desktop only */
@media (min-width: 769px) {
    .sticky-consultation-btn .btn-text-mobile {
        display: none;
    }

    .sticky-consultation-btn .btn-text-full {
        display: block;
    }

    /* Subtle entrance animation */
    .sticky-consultation-btn.show {
        animation: slideInBounce 0.6s cubic-bezier(0.68, -0.55, 0.265, 1.55);
    }
}

@keyframes slideInBounce {
    0% {
        transform: translateX(100px) translateY(100px) scale(0.5);
        opacity: 0;
    }
    60% {
        transform: translateX(-10px) translateY(-5px) scale(1.05);
        opacity: 1;
    }
    100% {
        transform: translateX(0) translateY(0) scale(1);
        opacity: 1;
    }
}

/* Hide button when near footer to avoid overlap */
.sticky-consultation-btn.near-footer {
    transform: translateY(100px) scale(0.8);
    opacity: 0;
    visibility: hidden;
}

/* Loading state */
.sticky-consultation-btn.loading .consultation-btn {
    pointer-events: none;
    opacity: 0.7;
}

.sticky-consultation-btn.loading .consultation-btn::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin: -10px 0 0 -10px;
    border: 2px solid #1a1a2e;
    border-radius: 50%;
    border-top-color: transparent;
    animation: spinner 0.6s linear infinite;
}

@keyframes spinner {
    to {
        transform: rotate(360deg);
    }
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    .sticky-consultation-btn,
    .sticky-consultation-btn .consultation-btn {
        transition: none;
        animation: none;
    }

    .sticky-consultation-btn .consultation-btn::before,
    .sticky-consultation-btn .free-badge {
        animation: none;
    }
}