.wpipc-overlay {
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 16px;
    background: rgba(0, 0, 0, 0.72);
    backdrop-filter: blur(4px);
}

.wpipc-overlay.wpipc-open {
    display: flex;
}

.wpipc-modal {
    position: relative;
    display: inline-block;
    width: auto;
    max-width: min(var(--wpipc-width, 720px), var(--wpipc-mobile-width, 92vw));
    max-height: calc(100vh - 32px);
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
    line-height: 0;
    animation: wpipcFadeUp .22s ease-out;
}

.wpipc-image {
    display: block;
    width: min(var(--wpipc-width, 720px), var(--wpipc-mobile-width, 92vw));
    max-width: calc(100vw - 32px);
    max-height: calc(100vh - 32px);
    height: auto;
    object-fit: contain;
    border: 0 !important;
    border-radius: 0 !important;
    outline: 0 !important;
    background: transparent !important;
    box-shadow: none !important;
}

.wpipc-link {
    display: inline-block;
    line-height: 0;
    padding: 0 !important;
    margin: 0 !important;
    background: transparent !important;
    border: 0 !important;
    box-shadow: none !important;
}

.wpipc-close {
    -webkit-appearance: none;
    appearance: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 34px;
    height: 34px;
    min-width: 34px;
    min-height: 34px;
    padding: 0 !important;
    margin: 0 !important;
    border: 0 !important;
    border-radius: 999px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.68) !important;
    color: #ffffff !important;
    font-family: Arial, Helvetica, sans-serif;
    font-size: 24px;
    font-weight: 400;
    line-height: 1;
    cursor: pointer;
    box-shadow: none !important;
    z-index: 3;
}

.wpipc-close:hover,
.wpipc-close:focus {
    background: rgba(0, 0, 0, 0.86) !important;
    color: #ffffff !important;
    outline: 2px solid rgba(255, 255, 255, 0.75);
    outline-offset: 2px;
}

@keyframes wpipcFadeUp {
    from { opacity: 0; transform: translateY(18px) scale(.98); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

@media (max-width: 600px) {
    .wpipc-overlay { padding: 12px; }
    .wpipc-image {
        width: min(var(--wpipc-width, 720px), var(--wpipc-mobile-width, 94vw));
        max-width: calc(100vw - 24px);
        max-height: calc(100vh - 24px);
    }
    .wpipc-close {
        top: 8px;
        right: 8px;
        width: 32px;
        height: 32px;
        min-width: 32px;
        min-height: 32px;
        font-size: 22px;
    }
}
