/**
 * Floating Quick Help and WhatsApp support controls.
 */

.thayu-floating-support {
    --thayu-floating-obstruction: 0px;
    --thayu-floating-size: 56px;
    --thayu-floating-gap: 10px;
    position: fixed;
    z-index: 900;
    inset-inline-end: max(20px, env(safe-area-inset-right));
    inset-block-end: calc(max(20px, env(safe-area-inset-bottom)) + var(--thayu-floating-obstruction));
    color: #06214a;
    font-family: inherit;
}

.thayu-floating-support,
.thayu-floating-support * {
    box-sizing: border-box;
}

.thayu-floating-support button,
.thayu-floating-support a {
    font: inherit;
}

.thayu-floating-support .screen-reader-text {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    padding: 0 !important;
    margin: -1px !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}

.thayu-floating-support__launchers {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: var(--thayu-floating-gap);
}

/* Keep the helper clear of the publication form's bottom-right submit action. */
body[class*="page-template-page-submit-post"] .thayu-floating-support,
body[class*="page-template-page-submit-listing"] .thayu-floating-support {
    inset-inline-start: max(20px, env(safe-area-inset-left));
    inset-inline-end: auto;
}

body[class*="page-template-page-submit-post"] .thayu-floating-support__launchers,
body[class*="page-template-page-submit-listing"] .thayu-floating-support__launchers {
    align-items: flex-start;
}

body[class*="page-template-page-submit-post"] .thayu-guided-helper,
body[class*="page-template-page-submit-listing"] .thayu-guided-helper {
    inset-inline-start: 0;
    inset-inline-end: auto;
    transform-origin: bottom left;
}

.thayu-helper-launcher,
.thayu-whatsapp-launcher {
    min-width: var(--thayu-floating-size);
    height: var(--thayu-floating-size);
    border-radius: 999px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 0;
    cursor: pointer;
    box-shadow: 0 12px 28px rgba(4, 31, 74, 0.24), 0 3px 8px rgba(4, 31, 74, 0.16);
    transition: transform 160ms ease, box-shadow 160ms ease, background-color 160ms ease;
    text-decoration: none !important;
}

.thayu-helper-launcher {
    gap: 9px;
    min-width: 132px;
    padding: 0 18px;
    background: linear-gradient(135deg, #0a397a 0%, #041f4a 100%);
    color: #fff;
    border: 1px solid rgba(229, 184, 62, 0.88);
    font-size: 15px;
    font-weight: 800;
    letter-spacing: 0.01em;
}

.thayu-helper-launcher svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 1.9;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.thayu-whatsapp-launcher {
    width: var(--thayu-floating-size);
    background: #19b95b;
    color: #fff !important;
    border: 2px solid #fff;
}

.thayu-whatsapp-launcher svg,
.thayu-guided-helper__whatsapp svg {
    fill: currentColor;
}

.thayu-helper-launcher:hover,
.thayu-whatsapp-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 16px 34px rgba(4, 31, 74, 0.28), 0 4px 10px rgba(4, 31, 74, 0.18);
}

.thayu-whatsapp-launcher:hover {
    background: #129d4b;
}

.thayu-helper-launcher:focus-visible,
.thayu-whatsapp-launcher:focus-visible,
.thayu-guided-helper button:focus-visible,
.thayu-guided-helper a:focus-visible {
    outline: 3px solid #e5b83e;
    outline-offset: 3px;
}

.thayu-guided-helper[hidden] {
    display: none !important;
}

.thayu-guided-helper {
    position: absolute;
    inset-inline-end: 0;
    inset-block-end: calc((var(--thayu-floating-size) * 2) + var(--thayu-floating-gap) + 14px);
    width: min(370px, calc(100vw - 40px));
    max-height: min(70vh, 590px);
    max-height: min(70dvh, calc(100dvh - 180px - var(--thayu-floating-obstruction)), 590px);
    overflow: auto;
    overscroll-behavior: contain;
    padding: 18px;
    border: 1px solid #d5dfed;
    border-top: 4px solid #e5b83e;
    border-radius: 22px;
    background: #fff;
    box-shadow: 0 24px 60px rgba(4, 31, 74, 0.24), 0 6px 18px rgba(4, 31, 74, 0.12);
    transform-origin: bottom right;
    animation: thayu-helper-in 170ms ease-out both;
}

.thayu-guided-helper__header {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 14px;
    margin-bottom: 14px;
}

.thayu-guided-helper__eyebrow {
    display: block;
    margin-bottom: 3px;
    color: #9a6d00;
    font-size: 11px;
    font-weight: 900;
    letter-spacing: 0.11em;
    line-height: 1.2;
    text-transform: uppercase;
}

.thayu-guided-helper h2 {
    margin: 0;
    color: #041f4a;
    font-size: clamp(21px, 4vw, 25px);
    line-height: 1.18;
}

.thayu-guided-helper__close {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: -7px -7px 0 0;
    border: 0;
    border-radius: 50%;
    background: #eef3f9;
    color: #041f4a;
    cursor: pointer;
}

.thayu-guided-helper__close:hover {
    background: #dfe9f5;
}

.thayu-guided-helper__close svg {
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
}

.thayu-guided-helper__message {
    position: relative;
    margin: 0 0 14px 8px;
    padding: 12px 14px;
    border-radius: 4px 15px 15px 15px;
    background: #eef5ff;
    color: #17375f;
    font-size: 14px;
    font-weight: 600;
    line-height: 1.45;
}

.thayu-guided-helper__choices {
    display: grid;
    gap: 8px;
}

.thayu-guided-helper__choices > a {
    min-height: 58px;
    display: grid;
    grid-template-columns: 38px minmax(0, 1fr) auto;
    align-items: center;
    gap: 10px;
    padding: 9px 11px;
    border: 1px solid #dce5f0;
    border-radius: 14px;
    background: #fff;
    color: #082d64 !important;
    text-decoration: none !important;
    transition: border-color 150ms ease, background-color 150ms ease, transform 150ms ease;
}

.thayu-guided-helper__choices > a:hover {
    border-color: #a8c2e3;
    background: #f5f9ff;
    transform: translateX(-2px);
}

.thayu-guided-helper__choice-icon {
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #eaf1fb;
    color: #0a397a;
    font-size: 21px;
    font-weight: 900;
    line-height: 1;
}

.thayu-guided-helper__choices strong,
.thayu-guided-helper__choices small {
    display: block;
}

.thayu-guided-helper__choices strong {
    color: #041f4a;
    font-size: 14px;
    line-height: 1.25;
}

.thayu-guided-helper__choices small {
    margin-top: 2px;
    color: #5c6f86;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.25;
}

.thayu-guided-helper__arrow {
    color: #8aa1bd;
    font-size: 24px;
    line-height: 1;
}

.thayu-guided-helper__whatsapp {
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    margin-top: 14px;
    padding: 10px 14px;
    border-radius: 13px;
    background: #19a957;
    color: #fff !important;
    font-size: 14px;
    font-weight: 850;
    line-height: 1.25;
    text-align: center;
    text-decoration: none !important;
}

.thayu-guided-helper__whatsapp:hover {
    background: #118847;
}

@keyframes thayu-helper-in {
    from {
        opacity: 0;
        transform: translateY(8px) scale(0.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 720px) {
    .thayu-floating-support {
        inset-inline-end: max(12px, env(safe-area-inset-right));
        inset-block-end: calc(max(12px, env(safe-area-inset-bottom)) + var(--thayu-floating-obstruction));
    }

    .thayu-guided-helper {
        width: min(370px, calc(100vw - 24px));
        max-height: min(68vh, 560px);
        max-height: min(68dvh, calc(100dvh - 172px - var(--thayu-floating-obstruction)), 560px);
        padding: 16px;
        border-radius: 19px;
    }

    body[class*="page-template-page-submit-post"] .thayu-floating-support,
    body[class*="page-template-page-submit-listing"] .thayu-floating-support {
        inset-inline-start: max(12px, env(safe-area-inset-left));
    }
}

@media (max-width: 420px) {
    .thayu-helper-launcher {
        min-width: var(--thayu-floating-size);
        width: var(--thayu-floating-size);
        padding: 0;
    }

    .thayu-helper-launcher > span {
        position: absolute !important;
        width: 1px !important;
        height: 1px !important;
        padding: 0 !important;
        margin: -1px !important;
        overflow: hidden !important;
        clip: rect(0, 0, 0, 0) !important;
        white-space: nowrap !important;
        border: 0 !important;
    }
}

@media (prefers-reduced-motion: reduce) {
    .thayu-guided-helper {
        animation: none;
    }

    .thayu-helper-launcher,
    .thayu-whatsapp-launcher,
    .thayu-guided-helper__choices > a {
        transition: none;
    }
}

@media print {
    .thayu-floating-support {
        display: none !important;
    }
}
