/*
 * Floating support launchers (Feedback button + Dialogflow chat).
 * The only place these are positioned. The chat launcher itself lives in the
 * Dialogflow Shadow DOM; feedback_chat_popup.tpl injects a rule there that reads
 * --eo-support-right / --eo-support-bottom / --eo-support-size from here.
 *
 * Body classes (set in main.tpl from $req_file_name):
 *   eo-has-mobile-action-bar  page has the fixed mobile "Se kurv" bar
 *   eo-support-hide-mobile    checkout: no floating launchers below 992px
 *   eo-support-hide           payment pages: no floating launchers at all
 */
:root {
    --eo-support-right: 16px;
    --eo-support-bottom: max(16px, env(safe-area-inset-bottom));
    --eo-support-size: 48px;
    --eo-support-gap: 12px;
}

.eo-support-dock {
    position: fixed;
    right: var(--eo-support-right);
    bottom: calc(var(--eo-support-bottom) + var(--eo-support-size) + var(--eo-support-gap));
    z-index: 1040;
}

.eo-support-button {
    width: var(--eo-support-size);
    height: var(--eo-support-size);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #c71818;
    color: #fff;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.22);
    cursor: pointer;
}

.eo-support-button:focus-visible {
    outline: 3px solid #ff8100;
    outline-offset: 2px;
}

.eo-support-button svg {
    width: 22px;
    height: 22px;
}

/* Inline feedback link, shown where the floating button is hidden.
   !important: the footer list styles set display on every li. */
.eo-feedback-link {
    display: none !important;
}

@media (max-width: 991.98px) {
    /* Sticky "Se kurv" bar is 88px tall; keep the chat clear of it. */
    body.eo-has-mobile-action-bar {
        --eo-support-bottom: calc(88px + 12px + env(safe-area-inset-bottom));
    }

    body.eo-support-hide-mobile .eo-support-dock,
    body.eo-support-hide-mobile df-messenger {
        display: none !important;
    }
}

@media (max-width: 767px) {
    :root {
        --eo-support-right: 12px;
    }

    /* Only one floating launcher on mobile; Feedback moves to an inline link. */
    .eo-feedback-button {
        display: none;
    }

    .eo-feedback-link {
        display: list-item !important;
    }
}

body.eo-support-hide .eo-support-dock,
body.eo-support-hide df-messenger {
    display: none !important;
}

/* Floating launchers must not cover overlays. */
body.modal-open .eo-support-dock,
body.modal-open df-messenger,
body:has(#eo-consent-banner:not([hidden])) .eo-support-dock,
body:has(#eo-consent-banner:not([hidden])) df-messenger,
body:has(#eo-consent-dialog:not([hidden])) .eo-support-dock,
body:has(#eo-consent-dialog:not([hidden])) df-messenger {
    visibility: hidden;
}
