/* =========================================================
   HOMEDEN FLOATING CONTACT WIDGET
========================================================= */

.floating-contact-widget {
    --contact-primary: #ed7a3d;
    --contact-primary-dark: #d9632f;
    --contact-teal: #0f6f58;
    --contact-teal-dark: #0b2922;
    --contact-teal-soft: #e9f3ef;

    --contact-surface: #ffffff;
    --contact-surface-soft: #f7f9f8;

    --contact-heading: #17372e;
    --contact-text: #344941;
    --contact-muted: #718078;

    --contact-border:
        rgba(15, 111, 88, 0.16);

    --contact-shadow:
        rgba(11, 41, 34, 0.22);

    position: fixed;
    right: 24px;
    bottom: 24px;

    z-index: 1060;

    display: flex;
    flex-direction: column;
    align-items: flex-end;

    pointer-events: none;
}


/* =========================================================
   FLOATING BUTTONS
========================================================= */

.floating-contact-buttons {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 12px;

    pointer-events: auto;
}

.floating-contact-button {
    position: relative;

    width: 50px;
    height: 50px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border:
        2px solid
        rgba(255, 255, 255, 0.92);

    border-radius: 50%;

    color: #ffffff;

    cursor: pointer;

    box-shadow:
        0 12px 28px
        var(--contact-shadow);

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}


/* Call button */

.floating-contact-call {
    width: 50px;
    height: 50px;

    background: var(--contact-primary);

    font-size: 18px;
}

.floating-contact-call:hover,
.floating-contact-call:focus-visible {
    background: var(--contact-primary-dark);

    transform:
        translateY(-2px)
        scale(1.03);

    box-shadow:
        0 15px 32px
        rgba(237, 122, 61, 0.28);
}


/* WhatsApp button */

.floating-contact-whatsapp {
    background: var(--contact-teal);

    font-size: 25px;
}

.floating-contact-whatsapp:hover,
.floating-contact-whatsapp:focus-visible {
    background: var(--contact-teal-dark);

    transform:
        translateY(-2px)
        scale(1.03);

    box-shadow:
        0 15px 32px
        rgba(15, 111, 88, 0.30);
}


/* Active state */

.floating-contact-button.is-active {
    background: var(--contact-teal-dark);

    border-color:
        rgba(237, 122, 61, 0.92);
}


/* =========================================================
   TOOLTIP
========================================================= */

.floating-contact-tooltip {
    position: absolute;
    top: 50%;
    right: calc(100% + 11px);

    padding: 8px 11px;

    border-radius: 7px;

    background: var(--contact-teal-dark);
    color: #ffffff;

    font-size: 10px;
    font-weight: 750;
    line-height: 1;
    white-space: nowrap;

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(-50%)
        translateX(5px);

    box-shadow:
        0 8px 20px
        rgba(11, 41, 34, 0.18);

    transition:
        opacity 0.2s ease,
        visibility 0.2s ease,
        transform 0.2s ease;

    pointer-events: none;
}

.floating-contact-tooltip::after {
    content: "";

    position: absolute;
    top: 50%;
    left: 100%;

    width: 0;
    height: 0;

    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;

    border-left:
        5px solid
        var(--contact-teal-dark);

    transform: translateY(-50%);
}

.floating-contact-button:hover
.floating-contact-tooltip,

.floating-contact-button:focus-visible
.floating-contact-tooltip {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(-50%)
        translateX(0);
}


/* =========================================================
   POPUP
========================================================= */

.floating-contact-popup {
    position: absolute;
    right: 0;
    bottom: 128px;

    width:
        min(
            380px,
            calc(100vw - 48px)
        );

    padding: 27px;

    overflow: visible;

    border:
        1px solid
        var(--contact-border);

    border-radius: 22px;

    background: var(--contact-surface);
    color: var(--contact-text);

    box-shadow:
        0 25px 65px
        rgba(11, 41, 34, 0.20);

    opacity: 0;
    visibility: hidden;

    transform:
        translateY(14px)
        scale(0.97);

    transform-origin: bottom right;

    transition:
        opacity 0.25s ease,
        visibility 0.25s ease,
        transform 0.25s ease;

    pointer-events: none;
}


/* Popup arrow */

.floating-contact-popup::before {
    content: "";

    position: absolute;
    right: 22px;
    bottom: -15px;

    width: 29px;
    height: 29px;

    border-right:
        1px solid
        var(--contact-border);

    border-bottom:
        1px solid
        var(--contact-border);

    background: var(--contact-surface);

    transform: rotate(45deg);
}


/* HomeDen orange accent */

.floating-contact-popup::after {
    content: "";

    position: absolute;
    top: 21px;
    right: -4px;
    bottom: -4px;

    width: 4px;

    border-radius:
        0 20px 20px 0;

    background: var(--contact-primary);

    z-index: -1;
}

.floating-contact-popup.is-open {
    opacity: 1;
    visibility: visible;

    transform:
        translateY(0)
        scale(1);

    pointer-events: auto;
}


/* =========================================================
   CLOSE BUTTON
========================================================= */

.floating-contact-close {
    position: absolute;
    top: 16px;
    right: 16px;

    width: 32px;
    height: 32px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    padding: 0;

    border:
        1px solid
        rgba(15, 111, 88, 0.09);

    border-radius: 50%;

    background: var(--contact-teal-soft);
    color: var(--contact-teal-dark);

    font-size: 12px;

    cursor: pointer;

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease;
}

.floating-contact-close:hover,
.floating-contact-close:focus-visible {
    background: var(--contact-primary);

    border-color: var(--contact-primary);

    color: #ffffff;

    transform: rotate(5deg);
}


/* =========================================================
   BRAND
========================================================= */

.floating-contact-brand {
    display: flex;
    align-items: center;
    gap: 11px;

    padding-right: 38px;
}

.floating-contact-logo {
    width: 47px;
    height: 47px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    flex: 0 0 47px;

    border:
        1px solid
        var(--contact-border);

    border-radius: 50%;

    background: var(--contact-surface);

    box-shadow:
        0 6px 16px
        rgba(11, 41, 34, 0.08);
}

.floating-contact-logo img {
    width: 32px;
    height: 32px;

    object-fit: contain;
}

.floating-contact-brand-copy {
    display: grid;
    gap: 3px;
}

.floating-contact-brand-copy strong {
    color: var(--contact-heading);

    font-size: 12px;
    font-weight: 850;
    line-height: 1.4;
}

.floating-contact-brand-copy small {
    color: var(--contact-muted);

    font-size: 9px;
    font-weight: 550;
    line-height: 1.4;
}


/* =========================================================
   CONTENT
========================================================= */

.floating-contact-content {
    margin-top: 28px;
}

.floating-contact-greeting {
    display: block;

    margin-bottom: 10px;

    color: var(--contact-teal);

    font-size: 14px;
    font-weight: 800;
}

.floating-contact-content h2 {
    margin: 0;

    color: var(--contact-heading);

    font-size: 22px;
    font-weight: 850;
    line-height: 1.25;
    letter-spacing: -0.025em;
}

.floating-contact-content p {
    margin: 9px 0 0;

    color: var(--contact-muted);

    font-size: 11.5px;
    line-height: 1.7;
}


/* =========================================================
   PRIMARY ACTION
========================================================= */

.floating-contact-primary-action {
    min-height: 57px;

    display: grid;

    grid-template-columns:
        auto
        minmax(0, 1fr)
        auto;

    align-items: center;
    gap: 11px;

    margin-top: 23px;
    padding: 12px 16px;

    border:
        1px solid
        var(--contact-teal-dark);

    border-radius: 10px;

    background: var(--contact-teal-dark);
    color: #ffffff;

    font-size: 12px;
    font-weight: 800;
    line-height: 1.4;

    text-decoration: none;

    box-shadow:
        0 4px 0
        var(--contact-primary);

    transition:
        background-color 0.2s ease,
        border-color 0.2s ease,
        color 0.2s ease,
        transform 0.2s ease,
        box-shadow 0.2s ease;
}

.floating-contact-primary-action:hover,
.floating-contact-primary-action:focus-visible {
    background: var(--contact-teal);
    border-color: var(--contact-teal);

    color: #ffffff;

    transform: translateY(-1px);

    box-shadow:
        0 5px 0
        var(--contact-primary-dark);
}

.floating-contact-action-icon {
    width: 28px;
    height: 28px;

    display: inline-flex;
    align-items: center;
    justify-content: center;

    color: var(--contact-primary);

    font-size: 19px;
}

.floating-contact-primary-action
.bi-arrow-right {
    color:
        rgba(255, 255, 255, 0.82);

    font-size: 16px;
}

.floating-contact-note {
    display: block;

    margin-top: 21px;

    color: #99a59f;

    font-size: 8.5px;
    font-weight: 650;
    line-height: 1.4;
    text-align: center;
}


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

.floating-contact-button:focus-visible,
.floating-contact-close:focus-visible,
.floating-contact-primary-action:focus-visible {
    outline:
        3px solid
        rgba(237, 122, 61, 0.28);

    outline-offset: 3px;
}


/* =========================================================
   TABLET
========================================================= */

@media (max-width: 767.98px) {

    .floating-contact-widget {
        right: 17px;
        bottom: 18px;
    }

    .floating-contact-button {
        width: 51px;
        height: 51px;
    }

    .floating-contact-call {
        width: 47px;
        height: 47px;
    }

    .floating-contact-popup {
        bottom: 121px;

        width:
            min(
                355px,
                calc(100vw - 34px)
            );

        padding: 24px;
    }

}


/* =========================================================
   SMALL MOBILE
========================================================= */

@media (max-width: 479.98px) {

    .floating-contact-widget {
        right: 14px;
        bottom: 210px;
    }

    .floating-contact-popup {
        position: fixed;
        right: 15px;
        bottom: 230px;
        left: 15px;

        width: auto;

        padding: 22px;

        border-radius: 19px;

        transform-origin: bottom center;
    }

    .floating-contact-popup::before {
        right: 20px;
    }

    .floating-contact-content {
        margin-top: 24px;
    }

    .floating-contact-content h2 {
        font-size: 20px;
    }

    .floating-contact-tooltip {
        display: none;
    }

}


/* =========================================================
   REDUCED MOTION
========================================================= */

@media (prefers-reduced-motion: reduce) {

    .floating-contact-button,
    .floating-contact-popup,
    .floating-contact-close,
    .floating-contact-primary-action,
    .floating-contact-tooltip {
        transition: none;
    }

}