body:has(.modal-open) {
    overflow: hidden;
}

/* Modal Background */
.modal-background {
    position: fixed;
    top: 0;
    left: 0;
    display: none;
    width: 100%;
    height: 100%;
    background-color: rgba(66, 66, 66, 0.62);
    overflow-x: hidden;
    overflow-y: auto;
    z-index: 100;
}

.modal-background:has(.modal-open) {
    display: block;
}

/* Modal Container */
.modal-container {
    display: flex;
    align-items: center;
    min-height: 100%;
    width: auto;
    max-width: 50rem;
    padding: 2rem 0rem;
    margin: 0rem auto;
}
.modal-container.large {
    max-width: 65rem;
}

/* Modal */
.modal {
    display: flex;
    flex-direction: column;
    height: fit-content;
    width: 100%;
    padding: 4rem;
    background-color: #fff;
    border-radius: 1.5rem;
    box-shadow: rgba(0, 0, 0, 0.1) 0 0.4rem 1.2rem;
}
.modal-container.large .modal {
    padding: 4rem 6rem;
}

/* Modal Head */
.modal-head {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0rem 0rem 2rem;
}
.modal-container.large .modal-head {
    padding: 0rem 0rem 4rem;
}

/* Modal title */
.modal-title {
    font-size: 2rem;
    font-weight: bold;
}
.modal-container.large .modal-title {
    font-size: 2.2rem;
}

/* Modal 닫기 버튼 */
.modal-close-btn {
    color: var(--grey);
    font-size: 2.2rem;
}

.modal-footer {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    padding: 2rem 0rem 0rem;
}

.modal-footer-btn-container {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.modal-footer-btn {
    padding: 0.5rem 1rem;
    color: var(--grey-dark);
    background-color: var(--grey-btn-background);
    font-size: 1.4rem;
    font-weight: 700;
    border-radius: 0.6rem;
}

.modal-footer-btn.negative {
    color: #fff;
    background-color: var(--negative);
}

/* Hover */
@media (hover: hover) {

}

@media screen and (max-width: 1080px) {

}

/* Mobile breakpoint (768px) */
@media screen and (max-width: 768px) {
    /* Modal Background */
    .modal-background:not(.popup-modal-background) {
        background-color: #fff;
        overflow-y: hidden;
    }
    
    .popup-modal-background {
        padding: 0 2rem;
    }
    
    /* Modal Container */
    .modal-container:not(.popup-modal-container) {
        height: 100%;
        max-width: 100% !important;
        margin: 0rem;
        padding: 0rem;
    }

    /* Modal */
    .modal:not(.popup-modal) {
        height: 100%;
        padding: 2rem !important;
        border-radius: 0rem;
        box-shadow: none;
        overflow-y: auto;
    }

    .popup-modal {
        padding: 2rem 3rem !important;
    }
}