html,
body {
    width: 100%;
    min-height: 100%;
    margin: 0;
}

body {
    overflow-x: hidden;
    background: #ffffff;
}

.publico-layout,
.publico-layout-conteudo {
    width: 100%;
    min-width: 0;
    min-height: 100vh;
}

.publico-layout {
    overflow-x: hidden;
    background: #ffffff;
}

.publico-layout-conteudo {
    display: block;
    padding: 0;
}

.publico-layout__voltar-area {
    position: relative;
    z-index: 40;
    width: min(1180px, calc(100% - 48px));
    margin: 28px auto 0;
}

.publico-layout__voltar {
    display: inline-flex;
    min-height: 44px;
    align-items: center;
    justify-content: center;
    padding: 0 18px;
    border: 1px solid #d7e2f7;
    border-radius: 9px;
    background: #ffffff;
    color: #1761e8;
    font-size: 13px;
    font-weight: 800;
    line-height: 1;
    text-decoration: none;
    transition:
        border-color .2s ease,
        background-color .2s ease,
        color .2s ease,
        transform .2s ease;
}

.publico-layout__voltar:hover {
    border-color: #1761e8;
    background: #1761e8;
    color: #ffffff;
    transform: translateY(-1px);
}

.publico-layout__voltar:focus-visible {
    outline: 3px solid rgba(23, 97, 232, .22);
    outline-offset: 3px;
}

/*
   O detalhe de Eventos ainda possui o botão antigo dentro do componente.
   Quando o layout público fornece o botão padrão para a raiz, escondemos
   somente esse botão legado para não aparecerem dois controles.
*/
.publico-layout--rota-interna .evento-detalhe__voltar,
.publico-layout--rota-interna
.evento-detalhe-nao-encontrado a[href="/eventos"] {
    display: none !important;
}

.publico-whatsapp {
    position: fixed;
    right: 24px;
    bottom: max(24px, calc(env(safe-area-inset-bottom) + 14px));
    z-index: 950;
    display: grid;
    width: 58px;
    height: 58px;
    place-items: center;
    border-radius: 50%;
    background: #25d366;
    color: #ffffff;
    text-decoration: none;
    transition:
        transform .2s ease,
        background-color .2s ease;
}

.publico-whatsapp:hover {
    background: #1ebe5d;
    color: #ffffff;
    transform: translateY(-3px) scale(1.035);
}

.publico-whatsapp:focus-visible {
    outline: 4px solid rgba(37, 211, 102, .25);
    outline-offset: 3px;
}

.publico-whatsapp svg {
    width: 31px;
    height: 31px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.home-publica-estado {
    display: grid;
    min-height: 320px;
    place-items: center;
    padding: 32px;
    color: #64748b;
    font-size: 15px;
    text-align: center;
}

.home-publica-estado.erro {
    color: #b91c1c;
}

@media (max-width: 700px) {
    .publico-layout__voltar-area {
        width: min(100% - 32px, 560px);
        margin-top: 18px;
    }

    .publico-layout__voltar {
        min-height: 42px;
        padding-inline: 16px;
        border-radius: 8px;
        font-size: 12px;
    }

    .publico-whatsapp {
        right: 16px;
        bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
        width: 54px;
        height: 54px;
    }

    .publico-whatsapp svg {
        width: 28px;
        height: 28px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .publico-layout__voltar,
    .publico-whatsapp {
        transition: none;
    }
}

/* WHATSAPP-CHAT-POPUP-V1 */
.publico-whatsapp-widget {
    position: fixed;
    right: 24px;
    bottom: max(24px, calc(env(safe-area-inset-bottom) + 14px));
    z-index: 950;
}

.publico-whatsapp-widget > summary {
    list-style: none;
}

.publico-whatsapp-widget > summary::-webkit-details-marker {
    display: none;
}

.publico-whatsapp-widget__toggle {
    display: grid;
    width: 58px;
    height: 58px;
    margin-left: auto;
    place-items: center;
    border: 0;
    border-radius: 50%;
    background: #25d366;
    color: #ffffff;
    cursor: pointer;
    box-shadow: 0 10px 30px rgba(15, 23, 42, .18);
    transition: transform .2s ease, background-color .2s ease, box-shadow .2s ease;
}

.publico-whatsapp-widget__toggle:hover {
    background: #1ebe5d;
    transform: translateY(-3px) scale(1.035);
    box-shadow: 0 14px 34px rgba(15, 23, 42, .22);
}

.publico-whatsapp-widget__toggle:focus-visible {
    outline: 4px solid rgba(37, 211, 102, .25);
    outline-offset: 3px;
}

.publico-whatsapp-widget__icon {
    display: grid;
    place-items: center;
}

.publico-whatsapp-widget__icon svg {
    width: 31px;
    height: 31px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.publico-whatsapp-widget__icon--close {
    display: none;
}

.publico-whatsapp-widget[open] .publico-whatsapp-widget__icon--whatsapp {
    display: none;
}

.publico-whatsapp-widget[open] .publico-whatsapp-widget__icon--close {
    display: grid;
}

.publico-whatsapp-chat {
    position: absolute;
    right: 0;
    bottom: 74px;
    width: min(348px, calc(100vw - 32px));
    overflow: hidden;
    border: 1px solid #e4e8ef;
    border-radius: 20px;
    background: #ffffff;
    box-shadow: 0 24px 70px rgba(15, 23, 42, .22);
    transform-origin: bottom right;
    animation: publico-whatsapp-chat-in .22s ease both;
}

.publico-whatsapp-chat__header {
    display: flex;
    align-items: center;
    gap: 12px;
    min-height: 78px;
    padding: 14px 16px;
    background: #1761e8;
    color: #ffffff;
}

.publico-whatsapp-chat__avatar {
    display: grid;
    width: 44px;
    height: 44px;
    flex: 0 0 44px;
    place-items: center;
    border: 2px solid rgba(255, 255, 255, .72);
    border-radius: 50%;
    background: #ffffff;
    color: #1761e8;
    font-size: 18px;
    font-weight: 900;
}

.publico-whatsapp-chat__header-copy {
    display: grid;
    gap: 5px;
}

.publico-whatsapp-chat__header-copy strong {
    font-size: 15px;
    font-weight: 900;
}

.publico-whatsapp-chat__header-copy span {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, .88);
    font-size: 11px;
    font-weight: 600;
}

.publico-whatsapp-chat__header-copy i {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #41e178;
}

.publico-whatsapp-chat__body {
    min-height: 190px;
    padding: 22px 16px;
    background: linear-gradient(180deg, #f4f7fb 0%, #eef3f8 100%);
}

.publico-whatsapp-chat__message {
    max-width: 88%;
    padding: 14px 15px 12px;
    border-radius: 4px 16px 16px 16px;
    background: #ffffff;
    color: #263244;
    box-shadow: 0 8px 22px rgba(15, 23, 42, .07);
}

.publico-whatsapp-chat__message strong {
    display: block;
    margin-bottom: 8px;
    color: #1761e8;
    font-size: 13px;
}

.publico-whatsapp-chat__message p {
    margin: 0 0 7px;
    font-size: 12px;
    line-height: 1.55;
}

.publico-whatsapp-chat__message time {
    display: block;
    color: #98a2b2;
    font-size: 9px;
    text-align: right;
}

.publico-whatsapp-chat__footer {
    display: grid;
    gap: 9px;
    padding: 14px 16px 16px;
    background: #ffffff;
}

.publico-whatsapp-chat__action {
    display: flex;
    min-height: 46px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    border-radius: 12px;
    background: #25d366;
    color: #ffffff;
    font-size: 12px;
    font-weight: 900;
    text-decoration: none;
    transition: transform .18s ease, background-color .18s ease;
}

.publico-whatsapp-chat__action:hover {
    background: #1ebe5d;
    color: #ffffff;
    transform: translateY(-1px);
}

.publico-whatsapp-chat__action svg {
    width: 20px;
    height: 20px;
    fill: none;
    stroke: currentColor;
    stroke-width: 1.8;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.publico-whatsapp-chat__footer small {
    color: #98a2b2;
    font-size: 9px;
    text-align: center;
}

@keyframes publico-whatsapp-chat-in {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.96);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@media (max-width: 700px) {
    .publico-whatsapp-widget {
        right: 16px;
        bottom: max(16px, calc(env(safe-area-inset-bottom) + 10px));
    }

    .publico-whatsapp-widget__toggle {
        width: 54px;
        height: 54px;
    }

    .publico-whatsapp-widget__icon svg {
        width: 28px;
        height: 28px;
    }

    .publico-whatsapp-chat {
        bottom: 68px;
        width: min(336px, calc(100vw - 24px));
        border-radius: 18px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .publico-whatsapp-widget__toggle,
    .publico-whatsapp-chat,
    .publico-whatsapp-chat__action {
        animation: none;
        transition: none;
    }
}
