/* =========================================
   메인 팝업 (inc/popup.php) - index.php 전용
   PC: 화면 가운데 또는 지정 위치 / 모바일(640px 이하): 바텀시트
   ========================================= */
.site-popup {
    position: fixed;
    inset: 0;
    z-index: 9000;
    pointer-events: none;
}

.site-popup__dim {
    position: absolute;
    inset: 0;
    background: rgba(60, 64, 72, 0.35);
    pointer-events: auto;
}

.site-popup__item {
    position: absolute;
    display: flex;
    flex-direction: column;
    width: var(--popup-width, auto);
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    background: var(--color-white, #fff);
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    pointer-events: auto;
}

.site-popup__item.is-centered {
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
}

.site-popup__item.is-positioned {
    top: var(--popup-top, 0);
    left: var(--popup-left, 0);
}

.site-popup__body {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
}

.site-popup__body a {
    display: block;
}

.site-popup__img {
    display: block;
    max-width: 100%;
    height: auto;
}

.site-popup__item.has-width .site-popup__img {
    width: 100%;
}

.site-popup__content {
    padding: 24px 22px;
    font-size: 15px;
    line-height: 1.6;
    color: var(--color-text, #222);
    word-break: keep-all;
    overflow-wrap: anywhere;
}

.site-popup__content img {
    max-width: 100%;
    height: auto;
}

.site-popup__content p {
    margin: 0 0 8px;
}

.site-popup__foot {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    padding: 0 6px;
    background: var(--color-dark, #1a1a2e);
}

.site-popup__btn {
    padding: 12px 10px;
    border: 0;
    background: none;
    color: #fff;
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
}

.site-popup__btn--hide {
    margin-right: auto;
    color: rgba(255, 255, 255, 0.75);
}

.site-popup__btn:hover,
.site-popup__btn:focus-visible {
    text-decoration: underline;
}

/* ---------- 모바일: 바텀시트 ---------- */
@media (max-width: 640px) {
    .site-popup__item,
    .site-popup__item.is-centered,
    .site-popup__item.is-positioned {
        top: auto;
        right: 0;
        bottom: 0;
        left: 0;
        width: 100%;
        max-width: none;
        max-height: 85vh;
        transform: none;
        border-radius: 16px 16px 0 0;
        animation: site-popup-up 0.3s ease-out;
    }

    .site-popup__img {
        width: 100%;
    }

    .site-popup__foot {
        padding: 0 10px env(safe-area-inset-bottom, 0);
    }

    .site-popup__btn {
        padding: 15px 10px;
        font-size: 14px;
    }
}

@keyframes site-popup-up {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
    .site-popup__item {
        animation: none !important;
    }
}
