#productImageModal {
    z-index: 1000000;
}

.modal-backdrop {
    z-index: 999999;
}

.pim-dialog {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    max-width: 100%;
    height: 100%;
    min-height: 100%;
    margin: 0;
}

.pim-box {
    position: relative;
    width: min(720px, 92vw);
    height: min(720px, 85vh);
    background: #14161a;
    border: 1px solid rgba(255, 255, 255, 0.08);
    border-radius: 14px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
    overflow: hidden;
}

.pim-viewport {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    touch-action: none;
}

.pim-img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
    cursor: zoom-in;
    transform-origin: center center;
    transition: transform 0.08s ease-out;
}

.pim-img.is-zoomed {
    cursor: grab;
}

.pim-img.is-dragging {
    cursor: grabbing;
    transition: none;
}

.pim-close {
    position: absolute;
    top: 10px;
    right: 10px;
    z-index: 5;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: none;
    border-radius: 50%;
    background: #e5484d;
    color: #fff;
    font-size: 0.95rem;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
    transition: background 0.15s ease, transform 0.15s ease;
}

.pim-close:hover {
    background: #c53030;
    transform: scale(1.08);
}

@media (max-width: 767.98px) {
    .pim-box {
        width: 100vw;
        height: 100vh;
        height: 100dvh;
        border: none;
        border-radius: 0;
    }

    .pim-close {
        top: calc(12px + env(safe-area-inset-top));
        right: 12px;
        width: 38px;
        height: 38px;
    }
}
