/* Modal de suporte estilo chat (abre ao clicar em Contato / ion-button.cust-btn) */
#support-chat-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    flex-direction: column;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: #e8eef5;
    color: #1a1a1a;
    -webkit-font-smoothing: antialiased;
}

#support-chat-overlay.support-chat--open {
    display: flex;
    height: 100%;
    max-height: 100vh;
    overflow: hidden;
}

.support-chat__header {
    flex-shrink: 0;
    background: #1a1a1a;
    color: #fff;
    padding: 0.65rem 0.75rem;
    padding-top: calc(0.65rem + env(safe-area-inset-top, 0px));
    display: flex;
    align-items: center;
    gap: 0.6rem;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06);
}

.support-chat__header-logo {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    object-fit: cover;
    background: #333;
    flex-shrink: 0;
}

.support-chat__header-text {
    flex: 1;
    min-width: 0;
}

.support-chat__header-title {
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.02em;
    line-height: 1.2;
}

.support-chat__header-sub {
    font-size: 0.7rem;
    opacity: 0.85;
    margin-top: 0.15rem;
    line-height: 1.25;
}

.support-chat__close {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border: none;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.12);
    color: #fff;
    font-size: 1.5rem;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
}

.support-chat__close:active {
    background: rgba(255, 255, 255, 0.22);
}

.support-chat__banner {
    flex-shrink: 0;
    background: #f56c6c;
    color: #fff;
    font-size: 0.75rem;
    padding: 0.45rem 0.6rem;
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.support-chat__banner[hidden] {
    display: none !important;
}

.support-chat__banner-dismiss {
    margin-left: auto;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 1.1rem;
    line-height: 1;
    cursor: pointer;
    padding: 0.15rem 0.25rem;
    opacity: 0.9;
}

.support-chat__scroll {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 0.65rem 0.6rem 5.5rem;
    -webkit-overflow-scrolling: touch;
}

.support-chat__row {
    display: flex;
    gap: 0.45rem;
    align-items: flex-start;
    margin-bottom: 0.75rem;
}

.support-chat__avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    flex-shrink: 0;
    background: #ccc;
}

.support-chat__bubble {
    flex: 1;
    min-width: 0;
    background: #d6e8ff;
    border-radius: 12px;
    padding: 0.65rem 0.75rem;
    font-size: 0.8125rem;
    line-height: 1.45;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.support-chat__bubble p {
    margin: 0 0 0.5rem;
}

.support-chat__bubble p:last-child {
    margin-bottom: 0;
}

.support-chat__bubble a.site-link {
    color: #1565c0;
    text-decoration: underline;
    font-weight: 600;
}

.support-chat__actions {
    display: flex;
    flex-direction: column;
    gap: 0.45rem;
    margin-top: 0.65rem;
}

.support-chat__btn {
    display: block;
    width: 100%;
    text-align: center;
    padding: 0.55rem 0.75rem;
    border-radius: 10px;
    border: 1px solid rgba(0, 0, 0, 0.08);
    background: #fff;
    color: #1a1a1a;
    font-size: 0.8125rem;
    font-weight: 600;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
}

.support-chat__btn:active {
    transform: scale(0.99);
    background: #f8fafc;
}

.support-chat__list {
    margin: 0.35rem 0 0;
    padding-left: 1.1rem;
}

.support-chat__list li {
    margin-bottom: 0.35rem;
}

.support-chat__footer {
    flex-shrink: 0;
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: #fff;
    border-top: 1px solid #e5e7eb;
    padding: 0.45rem 0.5rem;
    padding-bottom: calc(0.45rem + env(safe-area-inset-bottom, 0px));
    display: flex;
    align-items: center;
    gap: 0.35rem;
}

.support-chat__footer-icons {
    display: flex;
    gap: 0.15rem;
    color: #9ca3af;
    font-size: 1.15rem;
    padding: 0 0.15rem;
}

.support-chat__input {
    flex: 1;
    border: 1px solid #e5e7eb;
    border-radius: 20px;
    padding: 0.45rem 0.75rem;
    font-size: 0.8125rem;
    outline: none;
    background: #f9fafb;
}

.support-chat__input::placeholder {
    color: #9ca3af;
}

.support-chat__send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #1a1a1a;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.support-chat__send svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

.support-chat__dynamic {
    margin-top: 0.5rem;
    padding-top: 0.5rem;
    border-top: 1px dashed rgba(0, 0, 0, 0.12);
}

.support-chat__avatar--placeholder {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 0.55rem;
    font-weight: 700;
    background: #cbd5e1;
    color: #334155;
}

.support-chat__row--user {
    flex-direction: row-reverse;
}

.support-chat__bubble--user {
    background: #c8e6c9;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.06);
}

.support-chat__row--user .support-chat__bubble--user {
    margin-right: 0;
}

/* Desktop: coluna central tipo “celular”, sem esticar na largura toda */
@media (min-width: 769px) {
    #support-chat-overlay.support-chat--open {
        align-items: center;
        background: rgba(15, 23, 42, 0.42);
        padding-left: max(12px, env(safe-area-inset-left, 0px));
        padding-right: max(12px, env(safe-area-inset-right, 0px));
        box-sizing: border-box;
    }

    #support-chat-overlay.support-chat--open > .support-chat__header,
    #support-chat-overlay.support-chat--open > .support-chat__banner,
    #support-chat-overlay.support-chat--open > .support-chat__scroll {
        width: 100%;
        max-width: 440px;
        box-sizing: border-box;
    }

    #support-chat-overlay.support-chat--open > .support-chat__header {
        border-radius: 16px 16px 0 0;
        box-shadow: 0 4px 24px rgba(0, 0, 0, 0.12);
    }

    #support-chat-overlay.support-chat--open > .support-chat__scroll {
        background: #e8eef5;
        padding-bottom: 5.25rem;
        box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.04);
    }

    #support-chat-overlay.support-chat--open > .support-chat__footer {
        left: 50%;
        right: auto;
        transform: translateX(-50%);
        width: min(100%, 440px);
        max-width: 440px;
        box-sizing: border-box;
        border-radius: 0 0 16px 16px;
        box-shadow: 0 12px 40px rgba(0, 0, 0, 0.2);
    }
}
