/**
 * 商品图片放大插件样式
 * Product Image Zoom Plugin Styles
 */

/* 灯箱容器 */
.piz-lightbox {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
}

/* 背景遮罩 */
.piz-lightbox-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.9);
    cursor: pointer;
}

/* 内容容器 */
.piz-lightbox-container {
    position: relative;
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 图片包装器 */
.piz-image-wrapper {
    max-width: 90%;
    max-height: 90%;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

/* 图片 */
.piz-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    transition: transform 0.1s ease;
    user-select: none;
    -webkit-user-select: none;
    -moz-user-select: none;
}

/* 关闭按钮 */
.piz-close {
    position: absolute;
    top: 20px;
    right: 30px;
    background: transparent;
    border: none;
    color: #fff;
    font-size: 48px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    width: 50px;
    height: 50px;
    line-height: 50px;
    padding: 0;
    transition: all 0.3s ease;
}

.piz-close:hover {
    color: #ff4444;
    transform: rotate(90deg);
}

/* 导航按钮通用样式 */
.piz-prev,
.piz-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #fff;
    color: #fff;
    font-size: 48px;
    font-weight: 300;
    cursor: pointer;
    z-index: 10001;
    width: 60px;
    height: 60px;
    line-height: 50px;
    padding: 0;
    transition: all 0.3s ease;
    border-radius: 50%;
}

.piz-prev:hover,
.piz-next:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

/* 上一张按钮 */
.piz-prev {
    left: 30px;
}

/* 下一张按钮 */
.piz-next {
    right: 30px;
}

/* 禁用状态 */
.piz-prev.piz-disabled,
.piz-next.piz-disabled {
    opacity: 0.3;
    cursor: not-allowed;
}

.piz-prev.piz-disabled:hover,
.piz-next.piz-disabled:hover {
    background: rgba(0, 0, 0, 0.5);
}

/* 计数器 */
.piz-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 16px;
    z-index: 10001;
}

/* 响应式设计 - 平板和手机 */
@media (max-width: 768px) {
    .piz-close {
        top: 10px;
        right: 10px;
        font-size: 36px;
        width: 40px;
        height: 40px;
        line-height: 40px;
    }

    .piz-prev,
    .piz-next {
        width: 50px;
        height: 50px;
        line-height: 42px;
        font-size: 36px;
    }

    .piz-prev {
        left: 10px;
    }

    .piz-next {
        right: 10px;
    }

    .piz-counter {
        bottom: 20px;
        font-size: 14px;
        padding: 8px 16px;
    }

    .piz-image-wrapper {
        max-width: 95%;
        max-height: 85%;
    }
}

/* 移动设备 */
@media (max-width: 480px) {
    .piz-close {
        font-size: 30px;
        width: 35px;
        height: 35px;
        line-height: 35px;
        top: 5px;
        right: 5px;
    }

    .piz-prev,
    .piz-next {
        width: 40px;
        height: 40px;
        line-height: 32px;
        font-size: 30px;
        border-width: 1px;
    }

    .piz-prev {
        left: 5px;
    }

    .piz-next {
        right: 5px;
    }

    .piz-counter {
        bottom: 15px;
        font-size: 12px;
        padding: 6px 12px;
    }
}

/* 加载动画 */
@keyframes piz-spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 焦点可访问性 */
.piz-close:focus,
.piz-prev:focus,
.piz-next:focus {
    outline: 2px solid #fff;
    outline-offset: 4px;
}

/* 禁止文本选择 */
.piz-lightbox * {
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

/* 图片加载状态 */
.piz-image {
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.1s ease;
}

.piz-image.loaded {
    opacity: 1;
}

/* 缩放提示 */
.piz-zoom-hint {
    position: absolute;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 0, 0, 0.7);
    color: #fff;
    padding: 8px 16px;
    border-radius: 15px;
    font-size: 12px;
    z-index: 10001;
    animation: fadeInOut 3s ease-in-out;
}

@keyframes fadeInOut {
    0%, 100% { opacity: 0; }
    20%, 80% { opacity: 1; }
}

/* 打印时隐藏 */
@media print {
    .piz-lightbox {
        display: none !important;
    }
}

/* ========================================
   主图导航箭头样式
   ======================================== */

/* 主图容器相对定位 */
.item_visual {
    position: relative;
}

/* 主图箭头通用样式 */
.piz-main-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(0, 0, 0, 0.5);
    border: 2px solid #fff;
    color: #fff;
    font-size: 36px;
    font-weight: 300;
    cursor: pointer;
    z-index: 100;
    width: 50px;
    height: 50px;
    line-height: 42px;
    padding: 0;
    transition: all 0.3s ease;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.piz-main-arrow:hover {
    background: rgba(255, 255, 255, 0.3);
    border-color: #fff;
    transform: translateY(-50%) scale(1.1);
}

.piz-main-arrow:active {
    transform: translateY(-50%) scale(0.95);
}

/* 上一张按钮 */
.piz-main-prev {
    left: 10px;
}

/* 下一张按钮 */
.piz-main-next {
    right: 10px;
}

/* 响应式设计 - 平板 */
@media (max-width: 768px) {
    .piz-main-arrow {
        width: 40px;
        height: 40px;
        font-size: 28px;
        line-height: 32px;
    }

    .piz-main-prev {
        left: 5px;
    }

    .piz-main-next {
        right: 5px;
    }
}

/* 响应式设计 - 手机 */
@media (max-width: 480px) {
    .piz-main-arrow {
        width: 35px;
        height: 35px;
        font-size: 24px;
        line-height: 28px;
        border-width: 1px;
    }

    .piz-main-prev {
        left: 3px;
    }

    .piz-main-next {
        right: 3px;
    }
}

/* 焦点可访问性 */
.piz-main-arrow:focus {
    outline: 2px solid #fff;
    outline-offset: 2px;
}
