.bamch-event-popup[hidden] {
    display: none !important;
}

.bamch-event-popup {
    position: fixed;
    inset: 0;
    z-index: 2147483000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(2, 28, 16, 0.86);
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
    opacity: 0;
    visibility: hidden;
    transition: opacity 220ms ease, visibility 220ms ease;
}

.bamch-event-popup.is-visible {
    opacity: 1;
    visibility: visible;
}

.bamch-event-popup__panel {
    position: relative;
    width: min(1120px, 96vw);
    max-height: 92vh;
    border: 3px solid rgba(255, 255, 255, 0.95);
    border-radius: 5px;
    background: #dff7c8;
    box-shadow: 0 24px 80px rgba(0, 0, 0, 0.48);
    overflow: visible;
    transform: scale(0.96) translateY(12px);
    transition: transform 260ms ease;
}

.bamch-event-popup.is-visible .bamch-event-popup__panel {
    transform: scale(1) translateY(0);
}

.bamch-event-popup__image {
    display: block;
    width: 100%;
    height: auto;
    max-height: calc(92vh - 6px);
    object-fit: contain;
    border-radius: 2px;
}

.bamch-event-popup__close {
    position: absolute;
    top: -18px;
    right: -18px;
    z-index: 2;
    width: 42px;
    height: 42px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    border: 2px solid #ffffff;
    border-radius: 50%;
    background: #b30000;
    color: #ffffff;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.35);
    font-family: Arial, sans-serif;
    font-size: 30px;
    font-weight: 700;
    line-height: 1;
    cursor: pointer;
    transition: background 160ms ease, transform 160ms ease;
}

.bamch-event-popup__close:hover,
.bamch-event-popup__close:focus-visible {
    background: #df0000;
    transform: scale(1.06);
    outline: none;
}

body.bamch-popup-open {
    overflow: hidden !important;
}

@media (max-width: 600px) {
    .bamch-event-popup {
        padding: 12px;
    }

    .bamch-event-popup__panel {
        width: 100%;
        max-height: 88vh;
        border-width: 2px;
    }

    .bamch-event-popup__image {
        max-height: calc(88vh - 4px);
    }

    .bamch-event-popup__close {
        top: -14px;
        right: -8px;
        width: 38px;
        height: 38px;
        font-size: 27px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .bamch-event-popup,
    .bamch-event-popup__panel {
        transition: none;
    }
}
