:root {
    --mal-contact-navy: #0c2a36;
    --mal-contact-green: #20d86a;
    --mal-contact-teal: #10859b;
    --mal-contact-size: 64px;
    --mal-contact-radius: 20px;
    --mal-contact-ease: cubic-bezier(.22, 1, .36, 1);
}

/* Make the actual header number clickable without changing its current design. */
.top .top-contact .mal-header-phone-link {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: inherit !important;
    text-decoration: none !important;
}

.top .top-contact .mal-header-phone-link span,
.top .top-contact .mal-header-phone-link i {
    margin: 0 !important;
}

.mal-contact-widget,
.mal-contact-widget *,
.mal-contact-widget *::before,
.mal-contact-widget *::after {
    box-sizing: border-box;
}

.mal-contact-widget {
    position: fixed;
    right: 0;
    top: 50%;
    width: var(--mal-contact-size);
    transform: translateY(-50%);
    z-index: 9998;
    direction: rtl;
    filter: drop-shadow(0 18px 28px rgba(11, 34, 45, .18));
    margin: 0;
    padding: 0;
    line-height: 1;
}

.mal-contact-widget__stack,
.mal-contact-widget__actions {
    display: block;
    width: var(--mal-contact-size);
    margin: 0;
    padding: 0;
    line-height: 1;
}

.mal-contact-widget__row {
    position: relative;
    display: block;
    width: var(--mal-contact-size);
    height: var(--mal-contact-size);
    margin: 0;
    padding: 0;
    line-height: 1;
}

.mal-contact-widget__toggle,
.mal-contact-widget__action {
    position: absolute;
    inset-block: 0;
    right: 0;
    width: var(--mal-contact-size);
    height: var(--mal-contact-size);
    border: 0;
    outline: 0;
    color: #fff;
    text-decoration: none !important;
}

.mal-contact-widget__toggle {
    display: grid;
    place-items: center;
    background: var(--mal-contact-navy);
    border-radius: var(--mal-contact-radius) 0 0 0;
    cursor: pointer;
    z-index: 10;
    transition: transform .25s ease, box-shadow .25s ease, border-radius .35s var(--mal-contact-ease);
}

.mal-contact-widget__toggle:hover,
.mal-contact-widget__toggle:focus-visible {
    transform: translateY(-2px);
    box-shadow: 0 12px 26px rgba(12, 42, 54, .25);
}

.mal-contact-widget__toggle svg {
    width: 25px;
    height: 25px;
    transition: transform .38s var(--mal-contact-ease);
}

.mal-contact-widget__action {
    display: block;
    overflow: visible;
}

.mal-contact-widget__action--whatsapp {
    background: var(--mal-contact-green);
}

.mal-contact-widget__action--phone {
    background: var(--mal-contact-teal);
    border-radius: 0;
}

.mal-contact-widget__icon {
    position: absolute;
    top: 0;
    right: 0;
    width: var(--mal-contact-size);
    height: var(--mal-contact-size);
    display: grid;
    place-items: center;
    color: #fff;
    z-index: 3;
    pointer-events: none;
    background: inherit;
}

.mal-contact-widget__icon svg {
    display: block;
    width: 27px;
    height: 27px;
    transition: transform .28s ease;
}

.mal-contact-widget__label {
    position: absolute;
    top: 0;
    right: calc(var(--mal-contact-size) - 2px);
    height: var(--mal-contact-size);
    min-width: 118px;
    padding: 0 22px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-family: "Cairo", Tahoma, Arial, sans-serif;
    font-size: 18px;
    font-weight: 800;
    white-space: nowrap;
    opacity: 0;
    transform: translateX(24px) scaleX(.86);
    transform-origin: right center;
    pointer-events: none;
    z-index: 2;
    transition: opacity .22s ease, transform .42s var(--mal-contact-ease), box-shadow .3s ease;
}

.mal-contact-widget__action--whatsapp .mal-contact-widget__label {
    background: var(--mal-contact-green);
}

.mal-contact-widget__action--phone .mal-contact-widget__label {
    background: var(--mal-contact-teal);
    border-radius: 0 0 0 var(--mal-contact-radius);
}

/* Keep a single rounded outer corner. The old radius on the 64px phone tile
   created a transparent wedge below the label when it expanded on hover. */
.mal-contact-widget__action--phone .mal-contact-widget__icon {
    background: var(--mal-contact-teal);
    border-radius: 0 0 0 var(--mal-contact-radius);
    transition: border-radius .2s ease;
}

.mal-contact-widget__action--phone:hover .mal-contact-widget__icon,
.mal-contact-widget__action--phone:focus-visible .mal-contact-widget__icon {
    border-radius: 0;
}

.mal-contact-widget__action:hover .mal-contact-widget__label,
.mal-contact-widget__action:focus-visible .mal-contact-widget__label {
    opacity: 1;
    transform: translateX(0) scaleX(1);
    box-shadow: -14px 14px 28px rgba(10, 35, 47, .18);
}

.mal-contact-widget__action:hover .mal-contact-widget__icon svg,
.mal-contact-widget__action:focus-visible .mal-contact-widget__icon svg {
    transform: scale(1.06);
}

.mal-contact-widget__action-row {
    transition: height .35s var(--mal-contact-ease), opacity .22s ease .08s;
}

.mal-contact-widget.is-hidden .mal-contact-widget__actions {
    height: 0;
    overflow: hidden;
    pointer-events: none;
}

.mal-contact-widget.is-hidden .mal-contact-widget__action-row {
    height: 0;
    opacity: 0;
    pointer-events: none;
    transition: height .35s var(--mal-contact-ease), opacity .16s ease;
}

.mal-contact-widget.is-hidden .mal-contact-widget__toggle {
    border-radius: var(--mal-contact-radius) 0 0 var(--mal-contact-radius);
}

.mal-contact-widget.is-hidden .mal-contact-widget__toggle svg {
    transform: rotate(180deg);
}

@media (max-width: 767px) {
    :root {
        --mal-contact-size: 60px;
    }

    body {
        padding-bottom: calc(var(--mal-contact-size) + env(safe-area-inset-bottom, 0px));
    }

    .mal-contact-widget {
        right: 0;
        left: 0;
        top: auto;
        bottom: 0;
        width: 100%;
        transform: none;
        filter: drop-shadow(0 -10px 24px rgba(11, 34, 45, .15));
    }

    .mal-contact-widget__stack,
    .mal-contact-widget__actions {
        width: 100%;
    }

    .mal-contact-widget__toggle-row {
        display: none;
    }

    .mal-contact-widget__actions,
    .mal-contact-widget.is-hidden .mal-contact-widget__actions {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        direction: rtl;
        height: auto !important;
        overflow: visible !important;
        pointer-events: auto !important;
    }

    .mal-contact-widget__action-row,
    .mal-contact-widget.is-hidden .mal-contact-widget__action-row {
        width: 100%;
        height: var(--mal-contact-size);
        min-width: 0;
        overflow: hidden;
        opacity: 1;
        pointer-events: auto;
    }

    .mal-contact-widget__action {
        position: relative;
        width: 100%;
        height: var(--mal-contact-size);
        border-radius: 0 !important;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 10px;
        overflow: hidden;
        transition: filter .22s ease;
    }

    .mal-contact-widget__action:hover,
    .mal-contact-widget__action:focus-visible {
        filter: brightness(.96);
    }

    .mal-contact-widget__icon {
        position: static;
        width: 27px;
        min-width: 27px;
        height: 27px;
    }

    .mal-contact-widget__icon svg {
        width: 23px;
        height: 23px;
    }

    .mal-contact-widget__label {
        position: static;
        min-width: 0;
        height: auto;
        padding: 0;
        background: transparent !important;
        border-radius: 0 !important;
        box-shadow: none !important;
        opacity: 1;
        transform: none;
        font-size: 16px;
        line-height: 1;
        order: -1;
    }

    .mal-contact-widget,
    .mal-contact-widget__stack,
    .mal-contact-widget__actions,
    .mal-contact-widget__row,
    .mal-contact-widget__action {
        margin: 0 !important;
        padding: 0 !important;
        line-height: 1 !important;
    }

    .mal-contact-widget__action--phone .mal-contact-widget__icon,
    .mal-contact-widget__action--phone:hover .mal-contact-widget__icon,
    .mal-contact-widget__action--phone:focus-visible .mal-contact-widget__icon {
        background: transparent;
        border-radius: 0;
    }

    .floating-profile-download {
        bottom: calc(var(--mal-contact-size) + 12px + env(safe-area-inset-bottom, 0px)) !important;
    }

    .scroll-top {
        bottom: calc(var(--mal-contact-size) + 15px + env(safe-area-inset-bottom, 0px)) !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .mal-contact-widget *,
    .mal-contact-widget *::before,
    .mal-contact-widget *::after {
        transition: none !important;
        animation: none !important;
        scroll-behavior: auto !important;
    }
}
