/*
 * Floating WhatsApp and Messenger buttons (Settings > Social Chat Integration).
 * Every rule is scoped to .gcp-chat so template styles are not affected.
 * z-index 1035: above page content and fixed headers, below Bootstrap offcanvas and modals.
 */
.gcp-chat {
    --gcp-chat-size: 56px;
    --gcp-chat-gap: 12px;
    --gcp-chat-edge: 22px;
    --gcp-chat-lift: 0px;
    position: fixed;
    z-index: 1035;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--gcp-chat-gap);
    box-sizing: border-box;
    max-width: calc(100vw - 2 * var(--gcp-chat-edge));
    margin: 0;
    padding: 0;
    color: #111827;
    font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans Devanagari", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.3;
    pointer-events: none;
    transition: opacity .15s ease;
}

.gcp-chat *, .gcp-chat *::before, .gcp-chat *::after { box-sizing: border-box; }
.gcp-chat > * { pointer-events: auto; }

.gcp-chat--bottom-right {
    right: max(var(--gcp-chat-edge), env(safe-area-inset-right, 0px));
    bottom: calc(max(var(--gcp-chat-edge), env(safe-area-inset-bottom, 0px)) + var(--gcp-chat-lift));
}

.gcp-chat--middle-right {
    top: 50%;
    right: max(var(--gcp-chat-edge), env(safe-area-inset-right, 0px));
    transform: translateY(-50%);
}

.gcp-chat--bottom-left {
    bottom: calc(max(var(--gcp-chat-edge), env(safe-area-inset-bottom, 0px)) + var(--gcp-chat-lift));
    left: max(var(--gcp-chat-edge), env(safe-area-inset-left, 0px));
    align-items: flex-start;
}

.gcp-chat--contained { position: absolute; }
.gcp-chat--yield { opacity: 0; visibility: hidden; }

.gcp-chat__welcome {
    display: flex;
    align-items: center;
    gap: 4px;
    max-width: 230px;
    margin: 0;
    padding: 7px 6px 7px 13px;
    border: 1px solid rgba(17, 24, 39, .1);
    border-radius: 14px;
    background: #fff;
    color: #111827;
    font-weight: 600;
    box-shadow: 0 8px 24px rgba(17, 24, 39, .18);
    animation: gcp-chat-in .35s ease both;
}

.gcp-chat__welcome[hidden] { display: none; }

.gcp-chat__close {
    display: inline-grid;
    flex: 0 0 auto;
    place-items: center;
    width: 28px;
    height: 28px;
    margin: 0;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: transparent;
    color: #4b5563;
    font: inherit;
    font-size: 18px;
    line-height: 1;
    cursor: pointer;
}

.gcp-chat__close:hover { background: #f3f4f6; color: #111827; }

.gcp-chat__list {
    display: flex;
    flex-direction: column;
    gap: var(--gcp-chat-gap);
    margin: 0;
    padding: 0;
    list-style: none;
}

.gcp-chat__item { position: relative; margin: 0; padding: 0; list-style: none; }
.gcp-chat__item::before, .gcp-chat__item::after { content: none; }
.gcp-chat__item[hidden] { display: none; }

.gcp-chat__button {
    position: relative;
    display: grid;
    place-items: center;
    width: var(--gcp-chat-size);
    height: var(--gcp-chat-size);
    border-radius: 50%;
    color: #fff;
    text-decoration: none;
    box-shadow: 0 8px 22px rgba(17, 24, 39, .3);
    transition: transform .2s ease, box-shadow .2s ease;
    animation: gcp-chat-in .35s ease backwards;
}

.gcp-chat__button:hover, .gcp-chat__button:focus-visible {
    color: #fff;
    text-decoration: none;
    box-shadow: 0 12px 28px rgba(17, 24, 39, .38);
    transform: translateY(-2px) scale(1.06);
}

.gcp-chat__button:focus-visible, .gcp-chat__close:focus-visible {
    outline: 3px solid #111827;
    outline-offset: 2px;
    box-shadow: 0 0 0 2px #fff;
}

.gcp-chat__button--whatsapp { background: #25d366; }
.gcp-chat__button--messenger { background: #0084ff; }
.gcp-chat__icon { display: block; width: 30px; height: 30px; fill: currentColor; }

.gcp-chat__tooltip {
    position: absolute;
    top: 50%;
    right: calc(100% + 10px);
    padding: 6px 10px;
    border-radius: 8px;
    background: #111827;
    color: #fff;
    font-size: 13px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(4px, -50%);
    transition: opacity .15s ease, transform .15s ease, visibility .15s;
}

.gcp-chat--bottom-left .gcp-chat__tooltip { right: auto; left: calc(100% + 10px); transform: translate(-4px, -50%); }

.gcp-chat__button:focus-visible .gcp-chat__tooltip { opacity: 1; visibility: visible; transform: translate(0, -50%); }

@media (hover: hover) {
    .gcp-chat__button:hover .gcp-chat__tooltip { opacity: 1; visibility: visible; transform: translate(0, -50%); }
}

/* An open mobile menu, drawer or dialog always comes first. */
@media (max-width: 1100px) {
    body:has(.nav-toggle:checked) .gcp-chat:not(.gcp-chat--contained),
    body:has(.navbar-collapse.show) .gcp-chat:not(.gcp-chat--contained),
    body:has(.navbar-collapse.collapsing) .gcp-chat:not(.gcp-chat--contained) { opacity: 0; visibility: hidden; }
}

body:has(.offcanvas.show) .gcp-chat:not(.gcp-chat--contained),
body:has(.modal.show) .gcp-chat:not(.gcp-chat--contained),
body:has(.demo-drawer:not([hidden])) .gcp-chat:not(.gcp-chat--contained) { opacity: 0; visibility: hidden; }

@media (max-width: 767.98px) {
    .gcp-chat { --gcp-chat-size: 50px; --gcp-chat-gap: 10px; --gcp-chat-edge: 14px; }
    .gcp-chat__icon { width: 27px; height: 27px; }
    .gcp-chat__welcome { max-width: 190px; font-size: 13px; }
}

/* Preview on the settings screen. */
.gcp-chat[hidden] { display: none; }
.gcp-chat-preview-card { flex: 1 1 0; min-width: 0; }

@media (min-width: 1200px) {
    .gcp-chat-preview-card { position: sticky; top: 1rem; }
}

.gcp-chat-frame {
    position: relative;
    width: 100%;
    max-width: 100%;
    height: 420px;
    margin-inline: auto;
    overflow: hidden;
    border: 1px solid var(--bs-border-color, #d1d5db);
    border-radius: 10px;
    background: var(--bs-tertiary-bg, #f3f4f6);
    transition: width .2s ease;
}

.gcp-chat-frame[data-device="tablet"] { width: 480px; }
.gcp-chat-frame[data-device="mobile"] { width: 320px; }
.gcp-chat-frame[data-device="mobile"] .gcp-chat { --gcp-chat-size: 50px; --gcp-chat-gap: 10px; --gcp-chat-edge: 14px; }
.gcp-chat-frame__page { display: grid; gap: 12px; padding: 20px; }
.gcp-chat-frame__page span { display: block; height: 14px; border-radius: 6px; background: var(--bs-secondary-bg, #e5e7eb); }
.gcp-chat-frame__page span:first-child { width: 45%; height: 22px; }
.gcp-chat-frame__page span:last-child { width: 70%; }

@keyframes gcp-chat-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    .gcp-chat, .gcp-chat *, .gcp-chat *::before, .gcp-chat *::after { animation: none !important; transition: none !important; }
    .gcp-chat__button:hover, .gcp-chat__button:focus-visible { transform: none; }
}

@media print {
    .gcp-chat { display: none !important; }
}
