/* ============================================
   MODAL BASE — Delícias da Jó
   Visual padrão reutilizável
   ============================================ */

.jo-modal {
    position: fixed;
    inset: 0;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: var(--container-pad);
}

.jo-modal__overlay {
    position: absolute;
    inset: 0;
    background: rgba(72, 24, 8, 0.45);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    animation: jo-modal-fade 0.25s ease;
}

.jo-modal__box {
    position: relative;
    width: 100%;
    max-width: 520px;
    max-height: calc(100dvh - 2 * var(--container-pad));
    display: flex;
    flex-direction: column;
    background: var(--cor-fundo-alt);
    border-radius: var(--raio-m);
    box-shadow: 0 30px 80px rgba(72, 24, 8, 0.30);
    overflow: hidden;
    animation: jo-modal-in 0.3s cubic-bezier(0.22, 1, 0.36, 1);
}

@keyframes jo-modal-fade {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes jo-modal-in {
    from {
        opacity: 0;
        transform: translateY(16px) scale(0.97);
    }

    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

.jo-modal__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 20px 22px;
    border-bottom: 1px solid var(--cor-borda);
}

.jo-modal__title {
    font-family: var(--fonte-titulo);
    font-size: 1.25rem;
    font-weight: 600;
    color: var(--marrom);
}

.jo-modal__close {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--cor-texto-suave);
    background: rgba(72, 24, 8, 0.05);
    transition: background var(--transicao), color var(--transicao), transform var(--transicao);
}

.jo-modal__close:hover {
    background: var(--rosa-principal);
    color: #fff;
    transform: rotate(90deg);
}

.jo-modal__body {
    padding: 22px;
    overflow-y: auto;
    overscroll-behavior: contain;
}

@media (max-width: 600px) {
    .jo-modal {
        align-items: flex-end;
        padding: 0;
    }

    .jo-modal__box {
        max-width: 100%;
        max-height: 90dvh;
        border-radius: var(--raio-m) var(--raio-m) 0 0;
        animation: jo-modal-up 0.3s cubic-bezier(0.22, 1, 0.36, 1);
    }

    @keyframes jo-modal-up {
        from {
            opacity: 0;
            transform: translateY(100%);
        }

        to {
            opacity: 1;
            transform: translateY(0);
        }
    }
}