/**
 * Product Magnifier Styles
 */

/* 图片容器相对定位 */
.image-container {
    position: relative;
    width: 100%;
    display: flex;
    justify-content: center;
}

/* 放大镜图标样式 */
.magnifier-icon {
    position: absolute;
    bottom: 10px;
    right: 10px;
    background: rgba(255, 255, 255, 0.7);
    border-radius: 50%;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: default;
    pointer-events: none; /* prevent cursor from leaving the image and causing flicker/shift */
    transition: background-color 0.2s ease; /* avoid animating positional properties */
    z-index: 5;
    border: 1px solid #ddd;
}

.magnifier-icon i {
    color: #333;
    font-size: 18px;
}

/* 放大模态框样式 */
.image-zoom-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    display: none;
    justify-content: center;
    align-items: center;
    z-index: 9999;
    overflow: hidden;
}

.image-zoom-modal.active {
    display: flex;
}

.image-zoom-modal .zoomed-image {
    z-index: 99999999999 !important;
    max-width: 90%;
    max-height: 80vh;
    object-fit: contain;
    margin: 0 auto;
    display: block;
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.3);
    border: 1px solid #f1f1f1;
    background-color: #ffffff; /* Ensure transparent images appear on white */
    position: relative;
    transform-origin: center center;
}

.image-zoom-modal .close-zoom {
    position: absolute;
    top: 15px;
    right: 25px;
    color: #fff;
    font-size: 40px;
    font-weight: bold;
    cursor: pointer;
    transition: color 0.3s;
    z-index: 99999 !important;
    pointer-events: auto;
}

.close-zoom:hover {
    color: #ccc;
}

/* Zoom Controls */
.zoom-controls {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    background: rgba(0, 0, 0, 0.6);
    border-radius: 30px;
    padding: 10px;
    z-index: 10;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.3);
}

.zoom-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: white;
    margin: 0 5px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
    color: #333;
}

.zoom-btn:hover {
    background: #f1f1f1;
    transform: scale(1.1);
}

.zoom-btn:active {
    transform: scale(0.95);
}

.zoom-btn i {
    font-size: 16px;
}

/* Make zoomed image draggable */
.image-zoom-modal .zoomed-image {
    cursor: grab;
    transition: transform 0.1s ease-out;
    transform-origin: center;
    will-change: transform;
}

.image-zoom-modal .zoomed-image:active {
    cursor: grabbing;
}

/* Container for the zoomed image */
.zoom-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

/* 响应式调整 */
@media (max-width: 768px) {
    .magnifier-icon {
        width: 35px;
        height: 35px;
    }
    
    .magnifier-icon i {
        font-size: 16px;
    }
}
