/**
 * Sticky Phone Button - Mobile First
 *
 * Persistent call button optimized for mobile conversions
 * Focus: Phone calls (user's priority goal)
 *
 * @package GeneratePress Child
 * @since 1.0.0
 */

/* ============================================
   STICKY PHONE BUTTON
   ============================================ */

.sticky-phone-button {
    position: fixed;
    bottom: var(--space-5); /* 20px */
    right: var(--space-4); /* 16px */
    z-index: var(--z-sticky);

    /* Hidden by default, shown after scroll */
    opacity: 0;
    transform: translateY(100px);
    transition: all 0.3s var(--ease-out);
    pointer-events: none;
}

/* Show after scrolling */
.sticky-phone-button.visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: all;
}

/* Button Link */
.sticky-phone-button a {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--space-2);

    /* Size */
    min-width: 160px;
    height: var(--btn-height-lg); /* 52px */
    padding: var(--space-3) var(--space-5);

    /* Style */
    background: linear-gradient(135deg, var(--color-primary-600) 0%, var(--color-primary-700) 100%);
    color: white;
    font-size: var(--fs-base);
    font-weight: var(--fw-semibold);
    text-decoration: none;
    border-radius: var(--radius-full);
    box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4),
                0 2px 8px rgba(0, 0, 0, 0.2);

    /* Animation */
    transition: all 0.2s var(--ease-out);
}

/* Hover effect - only on devices with hover capability (mouse/trackpad) */
@media (hover: hover) and (pointer: fine) {
    .sticky-phone-button a:hover {
        background: linear-gradient(135deg, var(--color-primary-700) 0%, var(--color-primary-800) 100%);
        box-shadow: 0 6px 24px rgba(37, 99, 235, 0.5),
                    0 4px 12px rgba(0, 0, 0, 0.3);
        transform: translateY(-2px);
        text-decoration: none;
    }
}

/* Touch devices: Enhanced active state feedback */
@media (hover: none) and (pointer: coarse) {
    .sticky-phone-button a:active {
        background: linear-gradient(135deg, var(--color-primary-700) 0%, var(--color-primary-800) 100%);
        box-shadow: 0 4px 16px rgba(37, 99, 235, 0.4),
                    0 2px 8px rgba(0, 0, 0, 0.25);
        transform: scale(0.96);
    }
}

/* Active state for all devices (fallback) */
.sticky-phone-button a:active {
    transform: translateY(0);
}

/* Phone Icon */
.sticky-phone-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
}

/* Phone Text */
.sticky-phone-text {
    white-space: nowrap;
    line-height: 1;
}

/* Pulse Animation */
@keyframes pulse {
    0%, 100% {
        box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4),
                    0 2px 8px rgba(0, 0, 0, 0.2),
                    0 0 0 0 rgba(37, 99, 235, 0.7);
    }
    50% {
        box-shadow: 0 4px 20px rgba(37, 99, 235, 0.4),
                    0 2px 8px rgba(0, 0, 0, 0.2),
                    0 0 0 8px rgba(37, 99, 235, 0);
    }
}

.sticky-phone-button.pulse a {
    animation: pulse 2s infinite;
}

/* ============================================
   TABLET & DESKTOP
   ============================================ */

/* Tablet: Slightly larger */
@media (min-width: 768px) {
    .sticky-phone-button {
        bottom: var(--space-6); /* 24px */
        right: var(--space-6); /* 24px */
    }

    .sticky-phone-button a {
        min-width: 180px;
        padding: var(--space-4) var(--space-6);
        font-size: var(--fs-lg);
    }

    .sticky-phone-icon {
        width: 22px;
        height: 22px;
    }
}

/* Desktop: Larger and more prominent */
@media (min-width: 1024px) {
    .sticky-phone-button {
        bottom: var(--space-8); /* 32px */
        right: var(--space-8); /* 32px */
    }

    .sticky-phone-button a {
        min-width: 200px;
        height: var(--btn-height-xl); /* 60px */
        padding: var(--space-4) var(--space-8);
        font-size: var(--fs-xl);
    }

    .sticky-phone-icon {
        width: 24px;
        height: 24px;
    }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

/* Focus state for keyboard navigation */
.sticky-phone-button a:focus-visible {
    outline: 3px solid white;
    outline-offset: 2px;
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .sticky-phone-button a {
        border: 2px solid white;
    }
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    .sticky-phone-button {
        transition: opacity 0.1s;
    }

    .sticky-phone-button a {
        transition: none;
    }

    .sticky-phone-button.pulse a {
        animation: none;
    }
}

/* ============================================
   PRINT
   ============================================ */

@media print {
    .sticky-phone-button {
        display: none;
    }
}
