:root {
    --vulci-popup-admin-offset: 0px;
}

.vulciPopupInstance {
    text-align: center;
}

.vulciPopupOverlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.8);
    backdrop-filter: blur(10px);
    display: none;
    justify-content: center;
    align-items: center;
    padding: calc(24px + var(--vulci-popup-admin-offset)) 24px 24px;
    z-index: 1000;
    opacity: 0;
    transition: opacity .25s ease-in-out;
    overflow-y: auto;
}

.vulciPopupOverlay.is-active {
    display: flex;
}

.vulciPopupOverlay.is-visible {
    opacity: 1;
}

.vulciPopupModal {
    background: #fff;
    width: min(960px, 100%);
    max-height: min(820px, calc(100dvh - var(--vulci-popup-admin-offset) - 48px));
    position: relative;
    display: flex;
    flex-direction: column;
    opacity: 0;
    visibility: hidden;
    transform: translateY(20px);
    transition: opacity .25s ease-in-out, transform .25s ease-in-out, visibility .25s ease-in-out;
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.3);
    padding: 30px;
    overflow: hidden;
}

.vulciPopupModal.show {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.vulciPopupHeader {
    padding: 0;
    flex-shrink: 0;
    line-height: 1;
    margin-bottom: 24px;
    padding-right: 56px;
}

.vulciPopupTitle {
    color: #000;
    font-weight: 600;
    margin: 0;
    font-size: 32px;
    text-transform: uppercase;
}

.vulciPopupClose {
    position: absolute;
    background: #222;
    box-shadow: none;
    top: 16px;
    right: 16px;
    width: 32px;
    height: 32px;
    line-height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 0;
    transition: background 0.3s ease;
    border-radius: 50%;
}

.vulciPopupClose:hover,
.vulciPopupClose:active,
.vulciPopupClose:focus {
    background: #000;
    padding: 0;
}

.vulciPopupBody {
    display: grid;
    grid-template-columns: minmax(0, 42%) minmax(0, 1fr);
    gap: 24px;
    overflow: auto;
    align-items: start;
    min-height: 0;
}

.vulciPopupBody.is-text-only {
    grid-template-columns: minmax(0, 1fr);
}

.vulciPopupMedia img {
    width: 100%;
    height: auto;
    max-height: 520px;
    display: block;
    object-fit: cover;
}

.vulciPopupContent {
    text-align: left;
    color: #000;
    line-height: 1.6;
}

.vulciPopupContent > *:first-child {
    margin-top: 0;
}

.vulciPopupContent > *:last-child {
    margin-bottom: 0;
}

.vulciPopupMeta {
    margin-top: 24px;
    border-top: 1px solid #e6e6e6;
    padding-top: 20px;
}

.vulciPopupMetaItem {
    display: flex;
    align-items: flex-start;
    gap: 14px;
}

.vulciPopupMetaItem + .vulciPopupMetaItem {
    margin-top: 16px;
}

.vulciPopupMetaIcon {
    width: 74px;
    min-width: 74px;
    display: block;
}

.vulciPopupMetaIcon img {
    width: 100%;
    height: auto;
    display: block;
    object-fit: contain;
}

.vulciPopupMetaText {
    min-width: 0;
}

.vulciPopupMetaLine {
    margin: 0;
    line-height: 1.4;
}

.vulciPopupMetaLabel {
    margin: 0;
    color: #000;
    font-size: 15px;
    font-weight: 700;
}

h4.vulciPopupMetaLabel {
    margin-bottom: 10px;
}

.vulciPopupMetaValue {
    margin: 0;
    font-size: 15px;
}

.vulciPopupMetaNote {
    margin-bottom: 10px;
}

.vulciPopupMetaValue.is-rich > *:first-child {
    margin-top: 0;
}

.vulciPopupMetaValue.is-rich > *:last-child {
    margin-bottom: 0;
}

.vulciPopupMetaOptions {
    display: flex;
    flex-direction: column;
    flex-wrap: wrap;
    gap: 10px 14px;
}

.vulciPopupMetaOption {
    display: inline-flex;
    align-items: center;
    gap: 8px;
}

.vulciPopupMetaOptionIcon {
    width: 38px;
    height: 38px;
    object-fit: contain;
    flex: 0 0 38px;
}

.vulciPopupTrigger {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: none;
    background: #beab93;
    color: #fff;
    padding: 12px 20px;
    font-weight: 700;
    letter-spacing: 0.03em;
    cursor: pointer;
    transition: background .2s ease-in-out;
}

.vulciPopupTrigger:hover,
.vulciPopupTrigger:focus {
    background: #8b7355;
}

body.vulci-popup-open {
    overflow: hidden;
}

@media (max-width: 768px) {
    .vulciPopupOverlay {
        align-items: flex-start;
        padding: calc(12px + var(--vulci-popup-admin-offset)) 12px 12px;
    }

    .vulciPopupModal {
        width: 100%;
        max-height: calc(100dvh - var(--vulci-popup-admin-offset) - 24px);
        padding: 16px;
    }

    .vulciPopupTitle {
        font-size: 22px;
    }

    .vulciPopupHeader {
        margin-bottom: 18px;
        padding-right: 44px;
    }

    .vulciPopupBody {
        grid-template-columns: minmax(0, 1fr);
        gap: 16px;
    }

    .vulciPopupMedia img {
        max-height: 240px;
    }

    .vulciPopupClose {
        top: 12px;
        right: 12px;
        width: 30px;
        height: 30px;
    }

    .vulciPopupMetaIcon {
        width: 56px;
        min-width: 56px;
    }

    .vulciPopupMetaOptionIcon {
        width: 30px;
        height: 30px;
        flex-basis: 30px;
    }
}
