/*
 * 마사지엠 반응형 팝업레이어
 */
.msgm-popup-root {
    position: fixed;
    inset: 0;
    z-index: 2147482000;
    width: 100%;
    height: 100%;
    pointer-events: none;
    font-family:
        'Noto Sans KR',
        'Pretendard',
        -apple-system,
        BlinkMacSystemFont,
        'Segoe UI',
        sans-serif;
}

.msgm-popup-root.is-empty {
    display: none !important;
}

.msgm-popup-overlay {
    position: absolute;
    inset: 0;
    display: none;
    background: rgba(19, 21, 27, .88);
    -webkit-backdrop-filter: blur(7px);
    backdrop-filter: blur(7px);
    pointer-events: auto;
    cursor: default;
    -webkit-tap-highlight-color: transparent;
}

.msgm-popup-root.has-visible-overlay .msgm-popup-overlay {
    display: block;
}

.msgm-popup-card {
    position: fixed;
    z-index: 2;
    display: none;
    width: min(
        var(--msgm-popup-width),
        calc(100vw - 24px)
    );
    max-width: calc(100vw - 24px);
    overflow: hidden;
    border: 1px solid rgba(15, 23, 42, .10);
    border-radius: 18px;
    background: #fff;
    box-shadow:
        0 28px 80px rgba(15, 23, 42, .28),
        0 4px 16px rgba(15, 23, 42, .10);
    pointer-events: auto;
    isolation: isolate;
}

.msgm-popup-card.is-visible {
    display: block;
    animation: msgmPopupOpen .22s ease-out both;
}

.msgm-popup-header {
    position: relative;
    z-index: 4;
    display: flex;
    min-height: 70px;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    padding: 12px 14px 12px 16px;
    border-bottom: 1px solid rgba(120, 78, 30, .13);
    background:
        radial-gradient(
            circle at 88% 0%,
            rgba(179, 27, 31, .09),
            transparent 35%
        ),
        linear-gradient(
            135deg,
            #fffdf8 0%,
            #ffffff 48%,
            #fbf7f0 100%
        );
}

.msgm-popup-header::after {
    content: '';
    position: absolute;
    right: 16px;
    bottom: 0;
    left: 16px;
    height: 1px;
    background: linear-gradient(
        90deg,
        transparent,
        rgba(145, 96, 42, .28),
        transparent
    );
}

.msgm-popup-header__brand {
    display: flex;
    min-width: 0;
    align-items: center;
    gap: 11px;
}

.msgm-popup-header__mark {
    display: grid;
    flex: 0 0 36px;
    width: 36px;
    height: 36px;
    place-items: center;
    border: 1px solid rgba(143, 25, 30, .18);
    border-radius: 50%;
    background:
        linear-gradient(
            145deg,
            #fff 0%,
            #f8eee8 100%
        );
    color: #8f191e;
    font-family: Georgia, 'Times New Roman', serif;
    font-size: 20px;
    font-weight: 700;
    font-style: italic;
    box-shadow:
        inset 0 0 0 3px rgba(255, 255, 255, .72),
        0 5px 14px rgba(82, 42, 25, .09);
}

.msgm-popup-header__copy {
    min-width: 0;
}

.msgm-popup-header__eyebrow {
    display: block;
    margin-bottom: 2px;
    color: #a17451;
    font-size: 8px;
    font-weight: 900;
    line-height: 1.2;
    letter-spacing: .16em;
}

.msgm-popup-header h3 {
    margin: 0;
    overflow: hidden;
    color: #23201e;
    font-size: 16px;
    font-weight: 900;
    line-height: 1.35;
    letter-spacing: -.035em;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.msgm-popup-x {
    position: relative;
    z-index: 5;
    display: grid;
    flex: 0 0 34px;
    width: 34px;
    height: 34px;
    place-items: center;
    padding: 0;
    border: 1px solid rgba(37, 32, 29, .10);
    border-radius: 50%;
    background:
        linear-gradient(
            145deg,
            #3b3836 0%,
            #1f1d1c 100%
        );
    color: #fff;
    font-size: 13px;
    cursor: pointer;
    box-shadow: 0 6px 15px rgba(18, 16, 15, .18);
    transition:
        transform .18s ease,
        box-shadow .18s ease,
        background .18s ease;
}

.msgm-popup-x:hover,
.msgm-popup-x:focus-visible {
    background:
        linear-gradient(
            145deg,
            #a21f24 0%,
            #7f1519 100%
        );
    transform: translateY(-1px);
    box-shadow: 0 8px 18px rgba(120, 20, 24, .22);
    outline: 0;
}

.msgm-popup-content {
    width: 100%;
    height: min(
        var(--msgm-popup-height),
        calc(100dvh - 105px)
    );
    min-height: 120px;
    overflow: auto;
    background: #fff;
    color: #1b1f27;
    line-height: 1.65;
    overscroll-behavior: contain;
    -webkit-overflow-scrolling: touch;
}

.msgm-popup-content img,
.msgm-popup-content video,
.msgm-popup-content iframe {
    max-width: 100% !important;
}

.msgm-popup-content img {
    height: auto !important;
    vertical-align: top;
}


.msgm-popup-image-link {
    display: block;
    width: 100%;
    min-height: 100%;
    color: inherit;
    text-decoration: none;
}

.msgm-popup-direct-image {
    display: block !important;
    width: 100% !important;
    max-width: none !important;
    height: auto !important;
    min-height: 0 !important;
    object-fit: contain;
    border: 0;
}

.msgm-popup-content > :first-child {
    margin-top: 0;
}

.msgm-popup-content > :last-child {
    margin-bottom: 0;
}

.msgm-popup-footer {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    min-height: 48px;
    border-top: 1px solid #eceef2;
    background: #fff;
}

.msgm-popup-footer button {
    min-width: 0;
    padding: 0 15px;
    border: 0;
    background: transparent;
    color: #616975;
    font: inherit;
    font-size: 11px;
    font-weight: 800;
    cursor: pointer;
}

.msgm-popup-footer button:hover {
    background: #f6f7f9;
}

.msgm-popup-footer .msgm-popup-close {
    min-width: 72px;
    border-left: 1px solid #eceef2;
    color: #171b22;
}

body.msgm-popup-lock {
    overflow: hidden !important;
}

@keyframes msgmPopupOpen {
    from {
        opacity: 0;
        transform: translateY(10px) scale(.985);
    }

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

@media (max-width: 640px) {
    .msgm-popup-card {
        width: calc(100vw - 20px);
        max-width: calc(100vw - 20px);
        border-radius: 15px;
    }

    .msgm-popup-content {
        height: min(
            var(--msgm-popup-height),
            calc(100dvh - 96px)
        );
    }

    .msgm-popup-footer {
        min-height: 46px;
    }

    .msgm-popup-footer button {
        padding: 0 12px;
        font-size: 10px;
    }

    .msgm-popup-header {
        min-height: 64px;
        padding: 10px 12px 10px 13px;
    }

    .msgm-popup-header__brand {
        gap: 9px;
    }

    .msgm-popup-header__mark {
        flex-basis: 32px;
        width: 32px;
        height: 32px;
        font-size: 18px;
    }

    .msgm-popup-header__eyebrow {
        font-size: 7px;
    }

    .msgm-popup-header h3 {
        font-size: 15px;
    }

    .msgm-popup-x {
        width: 32px;
        height: 32px;
        flex-basis: 32px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .msgm-popup-card.is-visible {
        animation: none;
    }
}


/* =========================================================
   전용 이미지 팝업 높이 자동 맞춤
   - 관리자 높이값으로 빈 공간이 생기지 않도록 이미지 실제 높이 사용
   - HTML 내용형 팝업은 기존 고정 높이 유지
========================================================= */
.msgm-popup-content.is-image-only {
    height: auto !important;
    min-height: 0 !important;
    max-height: calc(100dvh - 105px);
    overflow: auto;
    line-height: 0;
}

.msgm-popup-content.is-image-only .msgm-popup-image-link {
    min-height: 0;
    line-height: 0;
}

.msgm-popup-content.is-image-only .msgm-popup-direct-image {
    display: block !important;
    width: 100% !important;
    height: auto !important;
    max-height: calc(100dvh - 105px);
    object-fit: contain;
}

@media (max-width: 640px) {
    .msgm-popup-content.is-image-only {
        max-height: calc(100dvh - 94px);
    }

    .msgm-popup-content.is-image-only .msgm-popup-direct-image {
        max-height: calc(100dvh - 94px);
    }
}


/* 팝업 내부 접근성 전용 문구가 시각적으로 노출되지 않도록 강제 */
.msgm-popup-root .sound_only {
    position: absolute !important;
    width: 1px !important;
    height: 1px !important;
    margin: -1px !important;
    padding: 0 !important;
    overflow: hidden !important;
    clip: rect(0, 0, 0, 0) !important;
    white-space: nowrap !important;
    border: 0 !important;
}
