/* AnyPopMart 商品详情页样式 */

/* ========== 页面布局 ========== */
.product-page {
    padding: 50px 0 80px;
    background: linear-gradient(180deg, #FFF5F8 0%, #FFFFFF 100%);
}

.product-detail {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 48px;
    background: white;
    border-radius: var(--radius-lg);
    padding: 48px;
    box-shadow: var(--shadow-lg);
    margin-bottom: 50px;
    border: 2px solid rgba(255, 107, 157, 0.08);
    max-width: 100%;
    overflow: hidden;
}

/* ========== 左侧图片区 ========== */
.detail-gallery {
    position: sticky;
    top: 100px;
    height: fit-content;
    min-width: 0;
    max-width: 100%;
}

.main-image-wrapper {
    position: relative;
    width: 100%;
    max-width: 100%;
    background: linear-gradient(135deg, #FFF5F8 0%, #FFE4EC 100%);
    border-radius: var(--radius);
    overflow: hidden;
    margin-bottom: 24px;
    box-shadow: inset 0 4px 20px rgba(0,0,0,0.05);
    border: 2px solid rgba(255, 107, 157, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    /* 设置宽高比,保持1:1 */
    aspect-ratio: 1 / 1;
}

.main-image {
    width: 100%;
    height: 100%;
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.4s ease;
    display: block;
}

.main-image:hover {
    transform: scale(1.02);
}

.main-image-placeholder {
    width: 100%;
    padding: 100px 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #FFB3D1;
    text-align: center;
}

.placeholder-icon {
    font-size: 88px;
    margin-bottom: 20px;
}

/* ========== 缩略图 ========== */
.thumbnails {
    display: flex;
    gap: 14px;
    overflow-x: auto;
    padding: 10px;
    margin: -10px;
    scroll-behavior: smooth;
}

.thumbnails::-webkit-scrollbar {
    height: 8px;
}

.thumbnails::-webkit-scrollbar-track {
    background: #FFF5F8;
    border-radius: 10px;
}

.thumbnails::-webkit-scrollbar-thumb {
    background: var(--gradient-primary);
    border-radius: 10px;
}

.thumb-img {
    width: 80px;
    height: 80px;
    object-fit: cover;
    border-radius: 12px;
    cursor: pointer;
    border: 3px solid transparent;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    position: relative;
    background: #FFF5F8;
}

/* 缩略图悬停发光效果 */
.thumb-img::before {
    content: '';
    position: absolute;
    inset: -4px;
    background: var(--gradient-primary);
    border-radius: 14px;
    opacity: 0;
    transition: opacity 0.3s ease;
    z-index: -1;
    filter: blur(8px);
}

.thumb-img:hover {
    border-color: rgba(255, 107, 157, 0.5);
    transform: translateY(-4px) scale(1.05);
    box-shadow: 0 8px 20px rgba(255, 107, 157, 0.3);
}

.thumb-img:hover::before {
    opacity: 0.6;
}

.thumb-img.active {
    border-color: var(--primary);
    box-shadow: 0 6px 25px rgba(255, 107, 157, 0.5);
    transform: scale(1.1);
}

.thumb-img.active::before {
    opacity: 1;
}

/* ========== 右侧信息区 ========== */
.detail-info {
    padding: 10px 0;
    min-width: 0;
    max-width: 100%;
    overflow-wrap: break-word;
}

.product-title {
    font-size: 36px;
    font-weight: 900;
    color: var(--dark);
    margin-bottom: 20px;
    line-height: 1.3;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.product-meta {
    margin-bottom: 28px;
}

.category-tag {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 24px;
    background: var(--gradient-secondary);
    color: white;
    border-radius: 30px;
    font-size: 14px;
    font-weight: 700;
    box-shadow: 0 4px 15px rgba(168, 230, 207, 0.3);
}

.category-tag .separator {
    color: rgba(255,255,255,0.7);
}

/* ========== 价格显示 ========== */
.product-price-display {
    padding: 28px 0;
    border-top: 2px solid #FFE4EC;
    border-bottom: 2px solid #FFE4EC;
    margin-bottom: 32px;
}

.current-price {
    font-size: 48px;
    font-weight: 900;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.price-contact {
    font-size: 22px;
    color: var(--gray);
    font-weight: 600;
}

/* ========== 详情区块 ========== */
.detail-section {
    margin-bottom: 32px;
}

.detail-section h4 {
    font-size: 18px;
    font-weight: 800;
    color: var(--dark);
    margin-bottom: 16px;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.size-info {
    color: var(--gray);
    line-height: 1.9;
    background: #FFF5F8;
    padding: 20px 24px;
    border-radius: var(--radius-sm);
    border: 2px solid rgba(255, 107, 157, 0.1);
}

/* ========== 规格列表 ========== */
.variants-list {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
}

.variant-item {
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 80px;
    padding: 12px 20px;
    border: 2px solid #FFE4EC;
    border-radius: 12px;
    cursor: pointer;
    transition: var(--transition);
    background: white;
    position: relative;
    overflow: hidden;
}

.variant-item::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: var(--gradient-primary);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.variant-item:hover {
    border-color: var(--primary);
    background: rgba(255, 107, 157, 0.05);
    transform: translateY(-4px);
    box-shadow: 0 8px 25px rgba(255, 107, 157, 0.2);
}

.variant-item.active {
    border-color: var(--primary);
    background: var(--gradient-primary);
    color: white;
    transform: translateY(-4px);
    box-shadow: 0 10px 30px rgba(255, 107, 157, 0.4);
}

.variant-item.active::before {
    opacity: 1;
}

.variant-item.soldout {
    opacity: 0.5;
    cursor: not-allowed;
    background: #F0F0F0;
    border-color: #E0E0E0;
}

.variant-name {
    font-weight: 700;
    font-size: 16px;
    position: relative;
    z-index: 1;
}

.variant-soldout {
    background: var(--gray);
    color: white;
    padding: 6px 14px;
    border-radius: 10px;
    font-size: 12px;
    font-weight: 700;
}

/* ========== 操作按钮 ========== */
.action-buttons {
    display: flex;
    gap: 20px;
    margin-bottom: 40px;
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 18px 48px;
    border: none;
    border-radius: 16px;
    font-size: 17px;
    font-weight: 800;
    cursor: pointer;
    text-align: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    text-decoration: none;
    flex: 1;
    position: relative;
    overflow: hidden;
}

/* 按钮波纹效果 */
.btn::after {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: rgba(255,255,255,0.4);
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
}

.btn:active::after {
    width: 400px;
    height: 400px;
}

/* 主要按钮 */
.btn-primary {
    background: var(--gradient-primary);
    color: white;
    box-shadow: 0 8px 30px rgba(255, 107, 157, 0.4);
}

.btn-primary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-primary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 45px rgba(255, 107, 157, 0.6);
}

.btn-primary:hover::before {
    opacity: 1;
}

/* 次要按钮 */
.btn-secondary {
    background: var(--gradient-secondary);
    color: white;
    box-shadow: 0 8px 30px rgba(168, 230, 207, 0.4);
}

.btn-secondary::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, rgba(255,255,255,0.2) 0%, transparent 50%);
    opacity: 0;
    transition: opacity 0.3s ease;
}

.btn-secondary:hover {
    transform: translateY(-4px) scale(1.02);
    box-shadow: 0 15px 45px rgba(168, 230, 207, 0.5);
}

.btn-secondary:hover::before {
    opacity: 1;
}

.btn-large {
    padding: 22px 60px;
    font-size: 18px;
    letter-spacing: 0.5px;
}

/* ========== 介绍框 ========== */
.description-box {
    background: #FFF5F8;
    padding: 28px;
    border-radius: var(--radius);
    line-height: 1.9;
    color: var(--gray);
    font-size: 15px;
    white-space: pre-wrap;
    border: 2px solid rgba(255, 107, 157, 0.1);
}

/* ========== 推荐商品 ========== */
.related-products {
    background: white;
    border-radius: var(--radius-lg);
    padding: 40px;
    box-shadow: var(--shadow-lg);
    border: 2px solid rgba(255, 107, 157, 0.08);
}

.related-products .section-title {
    font-size: 28px;
    font-weight: 800;
    margin-bottom: 10px;
    padding-bottom: 20px;
    border-bottom: 3px solid;
    border-image: var(--gradient-primary) 1;
    background: var(--gradient-primary);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.related-products .product-grid {
    gap: 24px;
}

/* ========== 图片放大镜效果 ========== */
.main-image-wrapper:hover .main-image {
    cursor: zoom-in;
}

/* ========== 响应式 ========== */
@media (max-width: 900px) {
    .product-detail {
        grid-template-columns: 1fr;
        gap: 40px;
        padding: 32px;
        border-radius: var(--radius);
    }

    .detail-gallery {
        position: static;
    }

    .product-title {
        font-size: 28px;
    }

    .current-price {
        font-size: 38px;
    }

    .action-buttons {
        flex-direction: column;
    }

    .action-buttons .btn {
        width: 100%;
    }

    .thumb-img {
        width: 45px;
        height: 45px;
        border-radius: 8px;
    }
}

@media (max-width: 600px) {
    .product-page {
        padding: 30px 0 50px;
    }

    .product-detail {
        padding: 24px;
        border-radius: var(--radius-sm);
    }

    .product-title {
        font-size: 24px;
    }

    .current-price {
        font-size: 32px;
    }

    .variant-item {
        padding: 14px 20px;
        font-size: 14px;
    }

    .thumbnails {
        gap: 10px;
    }

    .thumb-img {
        width: 40px;
        height: 40px;
        border-radius: 8px;
    }

    .related-products {
        padding: 24px;
        border-radius: var(--radius);
    }

    .related-products .section-title {
        font-size: 22px;
    }

    .action-buttons {
        gap: 14px;
    }

    .btn {
        padding: 16px 32px;
        font-size: 16px;
    }
}

/* ========== 加载动画 ========== */
@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.7; }
}

.loading {
    animation: pulse 1.5s ease-in-out infinite;
}

/* ========== 按钮点击效果 ========== */
.btn:active {
    transform: scale(0.96);
}

/* ========== 入场动画 ========== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.detail-gallery,
.detail-info {
    animation: fadeInUp 0.6s ease;
}

.detail-info {
    animation-delay: 0.2s;
}
