/* Popup de anúncio do cardápio: cartão central com a arte, o X e o botão "Eu quero". */

/*
 * Cartão no centro em qualquer tela. O tema dá 560px aos modais no computador e vira gaveta no
 * celular; aqui a largura segue a altura da tela para a arte (até 4:5) caber inteira, sem faixas.
 * Altura: 16px de respiro em cima e embaixo + 76px do botão = 100dvh - 108px (arredondado para 120).
 */
body.rd-app .modal.anuncio-modal.fade .modal-dialog.anuncio-modal__dialog {
    width: 100%;
    max-width: min(400px, calc((100dvh - 120px) * .8 + 32px));
    min-height: 100%;
    margin: 0 auto;
    padding: 16px;
    align-items: center;
}

.anuncio-modal .modal-content {
    position: relative;
    border: 0;
    border-radius: var(--rd-radius-lg, 16px);
    overflow: hidden;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}

.anuncio-modal__imagem {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    background: var(--rd-surface-subtle, #f3f4f6);
    cursor: pointer;
}

.anuncio-modal__imagem img {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(100dvh - 120px);
    object-fit: contain;
}

/* Área de toque de 56px num círculo de 36px: tocar perto do X fecha, não compra. */
.anuncio-modal__fechar {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: 56px;
    height: 56px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1rem;
}

.anuncio-modal__fechar i {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: rgba(0, 0, 0, .6);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background-color .15s ease;
}

.anuncio-modal__fechar:hover i,
.anuncio-modal__imagem--so-arte,
.anuncio-modal__imagem:disabled {
    cursor: default;
    opacity: 1;
}

.anuncio-modal__rodape[hidden] {
    display: none;
}

.anuncio-modal__fechar:focus-visible i {
    background: rgba(0, 0, 0, .85);
}

.anuncio-modal__fechar:focus-visible i {
    outline: 3px solid #fff;
}

.anuncio-modal__imagem:focus-visible {
    outline: 3px solid #fff;
    outline-offset: -3px;
}

.anuncio-modal__rodape {
    padding: 12px;
    background: var(--rd-surface, #fff);
}

/* Com o aviso de loja fechada o rodapé cresce: a arte encolhe para o botão continuar na tela. */
.anuncio-modal .modal-content:has(.anuncio-modal__aviso:not([hidden])) .anuncio-modal__imagem img {
    max-height: calc(100dvh - 190px);
}

.anuncio-modal__aviso {
    margin: 0 0 10px;
    padding: 8px 10px;
    border-radius: var(--rd-radius-sm, 8px);
    background: #fff4e5;
    color: #7a4100;
    font-size: .875rem;
    line-height: 1.35;
}

.anuncio-modal__quero {
    font-weight: 700;
    min-height: 52px;
}

/* No celular o tema arredonda só os cantos de cima (gaveta). */
@media (max-width: 575.98px) {
    body.rd-app .modal.anuncio-modal.fade .modal-content {
        max-height: calc(100dvh - 32px);
        border-radius: var(--rd-radius-lg, 16px);
    }
}

@media (prefers-reduced-motion: reduce) {
    .anuncio-modal.fade .modal-dialog {
        transition: none;
    }
}
