/* ==========================================================================
   Product Image Zoom — Desktop hover-zoom + Mobile pinch-zoom modal
   استفاده از همان تصویر اصلی، بدون نیاز به تصویر جداگانه‌ی high-res
   ========================================================================== */

/* تصویر داخل کانتینر زوم */
.shop-details-img {
    position: relative;
    overflow: hidden;
    cursor: zoom-in;
    background: #fafafa;
    border-radius: 4px;
}

.shop-details-img img {
    display: block;
    width: 100%;
    transition: transform 0.25s ease;
    transform-origin: center center;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
}

/* وقتی روی تصویر هاور می‌شه (دسکتاپ) */
@media (hover: hover) and (pointer: fine) {
    .shop-details-img.zooming {
        cursor: zoom-out;
    }
    .shop-details-img.zooming img {
        transform: scale(2.2);
        transition: transform 0.1s linear;
    }
}

/* hint کوچک گوشه‌ی تصویر */
.shop-details-img::after {
    content: '';
    position: absolute;
    bottom: 8px;
    left: 8px;
    width: 32px;
    height: 32px;
    background: rgba(0, 0, 0, 0.55);
    border-radius: 50%;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='white'%3E%3Cpath d='M15.5 14h-.79l-.28-.27A6.471 6.471 0 0 0 16 9.5 6.5 6.5 0 1 0 9.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 4.99L20.49 19l-4.99-5zm-6 0C7.01 14 5 11.99 5 9.5S7.01 5 9.5 5 14 7.01 14 9.5 11.99 14 9.5 14zm-.5-4h-1v1.5H7V10H5.5V9H7V7.5h1V9h1.5v1z'/%3E%3C/svg%3E");
    background-size: 18px;
    background-repeat: no-repeat;
    background-position: center;
    pointer-events: none;
    opacity: 0.85;
    transition: opacity 0.2s;
}

.shop-details-img:hover::after { opacity: 0; }
.shop-details-img.zooming::after { display: none; }

/* ============================================================
   Mobile fullscreen modal with pinch-zoom
   ============================================================ */

.zoom-modal {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.92);
    z-index: 99999;
    /* display is toggled in JS (none ↔ flex) so it never blocks touches when closed */
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.25s ease;
    overscroll-behavior: contain;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
}

.zoom-modal.open { opacity: 1; }

.zoom-modal__image-wrap {
    position: relative;
    width: 100%;
    height: 100%;
    overflow: hidden;
    touch-action: none;
}

.zoom-modal__image {
    position: absolute;
    top: 50%;
    left: 50%;
    max-width: 100vw;
    max-height: 100vh;
    transform: translate(-50%, -50%) scale(1);
    transform-origin: center center;
    transition: transform 0.15s ease-out;
    will-change: transform;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-touch-callout: none;
    -webkit-user-drag: none;
    pointer-events: auto;
}

.zoom-modal__image.dragging {
    transition: none;
}

/* دکمه بستن */
.zoom-modal__close {
    position: absolute;
    top: 12px;
    right: 12px;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.18);
    color: #fff;
    border: none;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2;
    transition: background 0.2s;
}
.zoom-modal__close:hover { background: rgba(255, 255, 255, 0.32); }
.zoom-modal__close:active { transform: scale(0.94); }

/* راهنمای کوچک پایین صفحه */
.zoom-modal__hint {
    position: absolute;
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.85);
    font-size: 12px;
    text-align: center;
    pointer-events: none;
    background: rgba(0, 0, 0, 0.55);
    padding: 7px 14px;
    border-radius: 18px;
    white-space: nowrap;
    transition: opacity 0.4s ease;
    max-width: 92%;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* جلوگیری از اسکرول background وقتی modal بازه */
body.zoom-modal-open {
    overflow: hidden;
}
