/* ============================================================
   Sticky WhatsApp Button — Industrial Portfolio Theme
   ============================================================ */

/* ── Wrapper ─────────────────────────────────────────────── */
.indpf-wa-wrap {
    position: fixed;
    bottom: 28px;
    right: 28px;
    z-index: 99999; /* raised above everything including mobile nav (10000) */
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: end;
        -ms-flex-pack: end;
            justify-content: flex-end;
    gap: 10px;
    /* Respect iOS safe-area (notch / home-bar) */
    bottom: calc(28px + env(safe-area-inset-bottom, 0px));
}

/* ── Tooltip ─────────────────────────────────────────────── */
.indpf-wa-tooltip {
    background: #1a1a1a;
    color: #fff;
    font-size: 13px;
    font-weight: 600;
    font-family: var(--ff-head, 'Inter', sans-serif);
    line-height: 1.3;
    padding: 8px 14px;
    white-space: nowrap;
    pointer-events: none;
    opacity: 0;
    -webkit-transform: translateX(8px);
            transform: translateX(8px);
    -webkit-transition: opacity 0.22s ease, -webkit-transform 0.22s ease;
    transition: opacity 0.22s ease, transform 0.22s ease;
    position: relative;
    border-radius: 4px;
}

/* Tooltip arrow */
.indpf-wa-tooltip::after {
    content: '';
    position: absolute;
    top: 50%;
    right: -7px;
    -webkit-transform: translateY(-50%);
            transform: translateY(-50%);
    border: 4px solid transparent;
    border-left-color: #1a1a1a;
}

/* Show tooltip on wrap hover / focus */
.indpf-wa-wrap:hover .indpf-wa-tooltip,
.indpf-wa-btn:focus ~ .indpf-wa-tooltip,
.indpf-wa-wrap:focus-within .indpf-wa-tooltip {
    opacity: 1;
    -webkit-transform: translateX(0);
            transform: translateX(0);
}

/* Hide tooltip on touch/mobile — no hover on touch devices */
@media (hover: none) {
    .indpf-wa-tooltip {
        display: none;
    }
}

/* ── Button ──────────────────────────────────────────────── */
.indpf-wa-btn {
    display: -webkit-box !important;
    display: -ms-flexbox !important;
    display: flex !important;
    -webkit-box-align: center;
        -ms-flex-align: center;
            align-items: center;
    -webkit-box-pack: center;
        -ms-flex-pack: center;
            justify-content: center;
    width: 60px;
    height: 60px;
    background: #25D366;
    border-radius: 50%;
    text-decoration: none;
    position: relative;
    -webkit-transition: -webkit-transform 0.2s ease, background 0.2s ease;
    transition: transform 0.2s ease, background 0.2s ease;
    -ms-flex-negative: 0;
        flex-shrink: 0;
    /* Shadow so button pops against any background */
    -webkit-box-shadow: 0 4px 18px rgba(37, 211, 102, 0.45), 0 2px 8px rgba(0,0,0,0.18);
            box-shadow: 0 4px 18px rgba(37, 211, 102, 0.45), 0 2px 8px rgba(0,0,0,0.18);
    /* Tap highlight off on iOS */
    -webkit-tap-highlight-color: transparent;
}

.indpf-wa-btn:hover {
    background: #1ebe5d;
    -webkit-transform: scale(1.08);
            transform: scale(1.08);
}

.indpf-wa-btn:active {
    -webkit-transform: scale(0.96);
            transform: scale(0.96);
}

.indpf-wa-btn:focus-visible {
    outline: 3px solid #25D366;
    outline-offset: 4px;
}

/* ── Icon ────────────────────────────────────────────────── */
.indpf-wa-icon {
    width: 32px;
    height: 32px;
    display: block;
    -ms-flex-negative: 0;
        flex-shrink: 0;
}

/* ── Pulse Ring ──────────────────────────────────────────── */
.indpf-wa-btn--pulse::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #25D366;
    opacity: 0;
    -webkit-animation: indpf-wa-pulse 2.4s ease-out infinite;
            animation: indpf-wa-pulse 2.4s ease-out infinite;
}

.indpf-wa-btn--pulse::after {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    border: 2px solid #25D366;
    opacity: 0;
    -webkit-animation: indpf-wa-pulse 2.4s ease-out 1.2s infinite;
            animation: indpf-wa-pulse 2.4s ease-out 1.2s infinite;
}

@-webkit-keyframes indpf-wa-pulse {
    0%   { -webkit-transform: scale(1);    transform: scale(1);    opacity: 0.7; }
    100% { -webkit-transform: scale(1.55); transform: scale(1.55); opacity: 0; }
}
@keyframes indpf-wa-pulse {
    0%   { -webkit-transform: scale(1);    transform: scale(1);    opacity: 0.7; }
    100% { -webkit-transform: scale(1.55); transform: scale(1.55); opacity: 0; }
}

/* Pause pulse on hover */
.indpf-wa-btn--pulse:hover::before,
.indpf-wa-btn--pulse:hover::after {
    -webkit-animation-play-state: paused;
            animation-play-state: paused;
}

/* ── Entrance animation ──────────────────────────────────── */
.indpf-wa-wrap {
    -webkit-animation: indpf-wa-enter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s both;
            animation: indpf-wa-enter 0.4s cubic-bezier(0.34, 1.56, 0.64, 1) 1.2s both;
}

@-webkit-keyframes indpf-wa-enter {
    from { -webkit-transform: translateY(20px); transform: translateY(20px); opacity: 0; }
    to   { -webkit-transform: translateY(0);    transform: translateY(0);    opacity: 1; }
}
@keyframes indpf-wa-enter {
    from { -webkit-transform: translateY(20px); transform: translateY(20px); opacity: 0; }
    to   { -webkit-transform: translateY(0);    transform: translateY(0);    opacity: 1; }
}

/* ── Mobile (≤ 768px) ────────────────────────────────────── */
/*
 * Force the sticky WhatsApp button visible on ALL mobile screens.
 * z-index 99999 keeps it above the mobile bottom nav (z-index 10000)
 * and any other overlapping elements.
 */
@media screen and (max-width: 768px) {
    .indpf-wa-wrap {
        display: -webkit-box !important;
        display: -ms-flexbox !important;
        display: flex !important;
        visibility: visible !important;
        opacity: 1;
        bottom: 20px;
        bottom: calc(20px + env(safe-area-inset-bottom, 0px));
        right: 16px;
        z-index: 99999;
    }

    .indpf-wa-btn {
        display: -webkit-box !important;
        display: -ms-flexbox !important;
        display: flex !important;
        visibility: visible !important;
        width: 56px;
        height: 56px;
    }

    .indpf-wa-icon {
        width: 28px;
        height: 28px;
    }
}

/* ── Extra small phones (≤ 360px) ───────────────────────── */
@media screen and (max-width: 360px) {
    .indpf-wa-wrap {
        bottom: 16px;
        bottom: calc(16px + env(safe-area-inset-bottom, 0px));
        right: 12px;
    }

    .indpf-wa-btn {
        width: 52px;
        height: 52px;
    }

    .indpf-wa-icon {
        width: 26px;
        height: 26px;
    }
}
