/* Direction-aware hover effect for buttons */
.btn-dir {
    position: relative;
    overflow: hidden;
    transition: color .35s ease;
}

.btn-dir::before {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--btn-contrast, #fff);
    transform: translateY(100%);
    transition: transform .35s ease;
}

.btn-dir:hover::before,
.btn-dir:active::before {
    transform: translate(0, 0);
    background: var(--btn-contrast, #fff) !important;
}

.btn-dir:hover,
.btn-dir:active {
    color: var(--btn-bg, #198754) !important;
    background: var(--btn-contrast, #fff) !important;
    border-color: var(--btn-bg, #198754) !important;
}

.btn-dir > * {
    position: relative;
    z-index: 1;
    color: inherit !important;
    transition: color .35s ease;
}

.btn-dir:hover > *,
.btn-dir:active > * {
    color: var(--btn-bg, #198754) !important;
}

/* Specific styles for the shared consultation CTA */
.consult-float {
    position: fixed !important;
    right: auto !important;
    left: 24px !important;
    bottom: 24px !important;
    isolation: isolate;
    border: 2px solid rgba(255, 255, 255, .92) !important;
    border-radius: 999px !important;
    padding: .9rem 1.2rem !important;
    z-index: 9999 !important;
    box-shadow: 0 10px 28px rgba(30, 64, 175, .34), 0 0 0 5px rgba(56, 189, 248, .2), 0 0 28px rgba(6, 182, 212, .3) !important;
    background: linear-gradient(115deg, #2563eb 0%, #0ea5e9 56%, #06b6d4 100%) !important;
    color: #fff !important;
    transition: background-position .3s ease, box-shadow .25s ease, transform .2s ease;
    background-size: 160% 160% !important;
    background-position: 0% 50% !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    gap: .6rem;
    visibility: visible !important;
    opacity: 1 !important;
    width: auto !important;
    height: auto !important;
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif !important;
    will-change: transform, box-shadow;
    animation: consultFloatSoftBounce 2.2s ease-in-out infinite !important;
}

.consult-float:hover,
.consult-float:focus-visible,
.consult-float:active {
    animation-play-state: paused;
    background-position: 100% 50% !important;
    color: #fff !important;
    box-shadow: 0 14px 32px rgba(30, 64, 175, .38), 0 0 0 6px rgba(56, 189, 248, .24), 0 0 34px rgba(6, 182, 212, .38) !important;
    transform: translateY(-3px);
}

.consult-float > i,
.consult-float > .consult-float-label {
    position: relative;
    z-index: 1;
    color: #fff !important;
}

.consult-float > i {
    font-size: 1.05rem;
    filter: drop-shadow(0 2px 4px rgba(9, 55, 138, .3));
}

.consult-float-label {
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif !important;
    font-size: .92rem;
    font-weight: 850;
    white-space: nowrap;
}

/* Public floating controls: offer left, scroll-to-top center, contact right. */
.hero-contact-float,
.hero-contact-float:hover,
.hero-contact-float:focus-visible,
.hero-back-to-top,
.hero-back-to-top:hover,
.hero-back-to-top:focus-visible {
    position: fixed !important;
    bottom: 24px !important;
    z-index: 9998 !important;
    display: inline-flex !important;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(255, 255, 255, .92) !important;
    color: #fff !important;
    text-decoration: none;
    box-shadow: 0 10px 28px rgba(30, 64, 175, .3), 0 0 0 5px rgba(56, 189, 248, .18), 0 0 24px rgba(6, 182, 212, .24) !important;
    transition: background-color .2s ease, box-shadow .2s ease, transform .2s ease, opacity .2s ease, visibility .2s ease;
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif !important;
}

.hero-contact-float,
.hero-contact-float:hover,
.hero-contact-float:focus-visible {
    right: 24px !important;
    gap: .55rem;
    min-width: 152px;
    min-height: 50px;
    padding: .62rem 1rem;
    border-radius: 999px;
    background: linear-gradient(115deg, #2563eb 0%, #0ea5e9 56%, #06b6d4 100%) !important;
    background-size: 160% 160% !important;
    background-position: 0% 50% !important;
    font-size: .82rem;
    font-weight: 800;
}

.hero-contact-float:hover,
.hero-contact-float:focus-visible {
    background: linear-gradient(115deg, #2563eb 0%, #0ea5e9 56%, #06b6d4 100%) !important;
    background-size: 160% 160% !important;
    background-position: 100% 50% !important;
    color: #fff !important;
    box-shadow: 0 14px 32px rgba(30, 64, 175, .36), 0 0 0 6px rgba(56, 189, 248, .24), 0 0 30px rgba(6, 182, 212, .34) !important;
    transform: translateY(-3px);
}

.hero-contact-float i,
.hero-contact-float-copy,
.hero-contact-float-copy strong,
.hero-contact-float-copy small,
.hero-contact-float:hover i,
.hero-contact-float:hover .hero-contact-float-copy,
.hero-contact-float:hover .hero-contact-float-copy strong,
.hero-contact-float:hover .hero-contact-float-copy small,
.hero-contact-float:focus-visible i,
.hero-contact-float:focus-visible .hero-contact-float-copy,
.hero-contact-float:focus-visible .hero-contact-float-copy strong,
.hero-contact-float:focus-visible .hero-contact-float-copy small {
    color: #fff !important;
}

.hero-contact-float > i {
    font-size: 1.12rem;
    filter: drop-shadow(0 2px 4px rgba(8, 47, 73, .26));
}

.hero-contact-float-copy {
    display: grid;
    gap: 1px;
    min-width: 0;
    text-align: left;
}

.hero-contact-float-copy strong {
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif !important;
    font-size: .82rem;
    font-weight: 900;
    line-height: 1.1;
}

.hero-contact-float-copy small {
    font-family: "Plus Jakarta Sans", ui-sans-serif, system-ui, sans-serif !important;
    font-size: .7rem;
    font-weight: 700;
    line-height: 1.1;
    opacity: .92;
    white-space: nowrap;
}

.hero-contact-float-status {
    position: absolute;
    top: 6px;
    right: 8px;
    width: 8px;
    height: 8px;
    border: 2px solid rgba(255, 255, 255, .9);
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 0 rgba(34, 197, 94, .72);
    animation: contactOnlinePulse 1.8s ease-out infinite;
}

.hero-back-to-top {
    left: 50% !important;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .95) !important;
    background: rgba(255, 255, 255, .95) !important;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #2563eb !important;
    box-shadow: 0 10px 28px rgba(15, 23, 42, .22), 0 0 0 5px rgba(255, 255, 255, .3), 0 0 24px rgba(56, 189, 248, .3) !important;
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
    transform: translateX(-50%);
}

.hero-back-to-top.is-visible {
    visibility: visible;
    opacity: 1;
    pointer-events: auto;
}

.hero-back-to-top:hover,
.hero-back-to-top:focus-visible {
    border-color: #fff !important;
    background: rgba(255, 255, 255, .99) !important;
    color: #1d4ed8 !important;
    box-shadow: 0 14px 32px rgba(15, 23, 42, .26), 0 0 0 6px rgba(56, 189, 248, .36), 0 0 30px rgba(6, 182, 212, .36) !important;
    transform: translate(-50%, -3px);
}

.hero-back-to-top i,
.hero-back-to-top:hover i,
.hero-back-to-top:focus-visible i {
    color: inherit !important;
}

@media (max-width: 767.98px) {
    .consult-float {
        left: 12px !important;
        right: auto !important;
        bottom: 16px !important;
        max-width: 190px;
        padding: .75rem .9rem !important;
        border-radius: 999px !important;
        font-size: .72rem;
    }

    .consult-float > .consult-float-label {
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }

    .hero-contact-float,
    .hero-contact-float:hover,
    .hero-contact-float:focus-visible {
        right: 12px !important;
        bottom: 16px !important;
        width: 46px;
        min-width: 46px;
        height: 46px;
        min-height: 46px;
        padding: 0;
        border-radius: 50%;
    }

    .hero-contact-float-copy {
        display: none;
    }

    .hero-back-to-top {
        bottom: 16px !important;
        width: 44px;
        height: 44px;
    }
}

@keyframes consultFloatSoftBounce {
    0%, 28%, 72%, 100% {
        transform: translateY(0);
        box-shadow: 0 10px 28px rgba(30, 64, 175, .34), 0 0 0 5px rgba(56, 189, 248, .2), 0 0 28px rgba(6, 182, 212, .3);
    }
    50% {
        transform: translate3d(0, -4px, 0);
        box-shadow: 0 12px 30px rgba(30, 64, 175, .4), 0 0 0 7px rgba(56, 189, 248, .28), 0 0 38px rgba(6, 182, 212, .46);
    }
}

@keyframes contactOnlinePulse {
    0% { box-shadow: 0 0 0 0 rgba(34, 197, 94, .72); }
    70% { box-shadow: 0 0 0 7px rgba(34, 197, 94, 0); }
    100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0); }
}

@media (prefers-reduced-motion: reduce) {
    .hero-contact-float-status {
        animation: none;
    }
}
