/* ========================================
   Product CSS - 产品相关页面样式
   ======================================== */

/* === Product List Page === */
.product-page {
    padding: 80px 0;
    background: var(--color-white);
}

.product-categories {
    display: flex;
    justify-content: center;
    gap: 16px;
    margin-bottom: 50px;
    flex-wrap: wrap;
}

.product-categories .cat-btn {
    padding: 12px 30px;
    font-size: 1.4rem;
    color: var(--color-text-light);
    border: 1px solid var(--color-border);
    border-radius: 2px;
    cursor: pointer;
    transition: var(--transition);
    letter-spacing: 1px;
}

.product-categories .cat-btn:hover,
.product-categories .cat-btn.active {
    background: var(--color-accent);
    color: var(--color-white);
    border-color: var(--color-accent);
}

/* === Product Detail Page === */
.product-detail {
    padding: 80px 0;
}

.product-detail-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 60px;
    align-items: start;
}

.product-gallery {
    position: relative;
}

.product-gallery .main-image {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border-radius: 4px;
    margin-bottom: 16px;
    box-shadow: var(--shadow-sm);
}

.product-gallery .thumbnails {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
}

.product-gallery .thumbnails .thumb {
    aspect-ratio: 1;
    object-fit: cover;
    cursor: pointer;
    border-radius: 4px;
    border: 2px solid transparent;
    transition: var(--transition);
}

.product-gallery .thumbnails .thumb:hover,
.product-gallery .thumbnails .thumb.active {
    border-color: var(--color-accent);
}

.product-info-detail h1 {
    font-size: 3rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 8px;
}

.product-info-detail .product-sku {
    font-size: 1.3rem;
    color: var(--color-text-lighter);
    margin-bottom: 24px;
}

.product-info-detail .product-desc {
    font-size: 1.5rem;
    color: var(--color-text-light);
    line-height: 2;
    margin-bottom: 30px;
}

.product-specs {
    margin-bottom: 30px;
}

.product-specs .spec-row {
    display: flex;
    padding: 14px 0;
    border-bottom: 1px solid var(--color-border);
    font-size: 1.4rem;
}

.product-specs .spec-row .spec-label {
    width: 100px;
    color: var(--color-text-lighter);
    flex-shrink: 0;
}

.product-specs .spec-row .spec-value {
    color: var(--color-text);
    font-weight: 500;
}

.product-actions {
    display: flex;
    gap: 16px;
    margin-top: 30px;
}

/* Related Products */
.related-products {
    padding: 80px 0;
    background: var(--color-gray);
}

.related-products .section-title {
    margin-bottom: 40px;
}

/* === Product Grid & Cards (shared) === */
.product-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 24px;
}

.product-card {
    background: var(--color-white);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    transition: var(--transition);
    box-shadow: var(--shadow-sm);
}

.product-card:hover {
    transform: translateY(-8px);
    box-shadow: var(--shadow-lg);
}

.product-card .card-image {
    position: relative;
    overflow: hidden;
    aspect-ratio: 1;
}

.product-card .card-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s ease;
}

.product-card:hover .card-image img {
    transform: scale(1.05);
}

.product-card .card-image .overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.2);
    opacity: 0;
    transition: var(--transition);
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-card:hover .card-image .overlay {
    opacity: 1;
}

.product-card .card-image .overlay .view-btn {
    width: 44px;
    height: 44px;
    background: transparent;
    border: 1.5px solid rgba(255, 255, 255, 0.8);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 1.4rem;
    transition: var(--transition);
}

.product-card .card-image .overlay .view-btn:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: #fff;
}

.product-card .card-info {
    padding: 20px;
    text-align: center;
}

.product-card .card-info h4 {
    font-size: 1.7rem;
    font-weight: 600;
    color: var(--color-primary);
    margin-bottom: 6px;
}

.product-card .card-info .product-spec {
    font-size: 1.3rem;
    color: var(--color-text-lighter);
}

/* === Lightbox === */
.lightbox {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.92);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.3s ease;
}

.lightbox.active {
    opacity: 1;
    visibility: visible;
}

.lightbox img {
    max-width: 90%;
    max-height: 85vh;
    object-fit: contain;
    border-radius: 2px;
}

.lightbox-close {
    position: absolute;
    top: 24px;
    right: 40px;
    color: var(--color-white);
    font-size: 3.6rem;
    cursor: pointer;
    transition: var(--transition);
    z-index: 1;
}

.lightbox-close:hover {
    color: var(--color-accent);
}

.lightbox-prev,
.lightbox-next {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 52px;
    height: 52px;
    border: 2px solid rgba(255, 255, 255, 0.5);
    border-radius: 50%;
    color: var(--color-white);
    font-size: 2rem;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: var(--transition);
}

.lightbox-prev { left: 30px; }
.lightbox-next { right: 30px; }

.lightbox-prev:hover,
.lightbox-next:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: var(--color-white);
}

.lightbox-counter {
    position: absolute;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.4rem;
    letter-spacing: 2px;
}
