/* ============================================
   Product Detail Page Styles
   ============================================ */

/* ============================================
   Skeleton Loading Styles
   ============================================ */
.skeleton {
    background: linear-gradient(90deg, #f0f0f0 25%, #e0e0e0 50%, #f0f0f0 75%);
    background-size: 200% 100%;
    animation: skeleton-loading 1.5s ease-in-out infinite;
    border-radius: 4px;
}

@keyframes skeleton-loading {
    0% {
        background-position: 200% 0;
    }
    100% {
        background-position: -200% 0;
    }
}

.skeleton-text {
    height: 1em;
    margin-bottom: 0.5em;
}

.skeleton-title {
    height: 2em;
    width: 60%;
    margin-bottom: 1em;
}

.skeleton-price {
    height: 2.5em;
    width: 40%;
    margin-bottom: 1em;
}

.skeleton-image {
    width: 100%;
    height: 400px;
    border-radius: 8px;
}

.skeleton-thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    margin-right: 10px;
}

.skeleton-button {
    height: 48px;
    width: 100%;
    border-radius: 8px;
    margin-top: 1em;
}

.product-content-loading {
    display: contents;
}

.product-content-loaded {
    display: none;
}

.product-content-loaded.show {
    display: contents;
}

.product-content-loading.hide {
    display: none;
}

.product-detail-section {
    /* padding: 80px 20px; */
    background-color: #ffffff;
}

.product-detail-container {
    max-width: 1200px;
    margin: 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 80px;
    align-items: start;
    overflow: hidden;
    position: relative;
}

/* Product Images Panel */
.product-images-panel {
    position: sticky;
    top: 20px;
}

.product-image-card {
    position: relative;
    background-color: #f9f9f9;
    border: none;
    /* border-radius: 12px; */
    padding: 0;
    margin-bottom: 20px;
    overflow: hidden;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    min-height: 400px;
}

/* 主图 + 视频共用舞台：横向轨道轮播，拖动时可看到相邻张 */
.pd-main-media-stage {
    width: 100%;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    will-change: auto;
}

.pd-main-media-clip {
    overflow: hidden;
    width: 100%;
    position: relative;
}

.pd-main-media-track {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    align-items: stretch;
}

.pd-main-media-slide {
    flex: 0 0 100%;
    width: 100%;
    min-width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-like-btn {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 32px;
    height: 32px;
    background-color: #ffffff;
    border: none;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: transform 0.2s;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.product-like-btn:hover {
    transform: scale(1.1);
}

.product-like-btn::before {
    content: '♡';
    font-size: 16px;
    color: #000000;
    transition: color 0.2s;
}

.product-like-btn.liked::before {
    content: '♥';
    color: #ff0000;
}

.product-main-image {
    width: 100%;
    max-width: 100%;
    max-height: 600px;
    height: auto;
    display: block;
    object-fit: contain;
    margin: 0 auto;
}

.product-main-video-frame {
    position: relative;
    width: 100%;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.product-main-video-frame .product-main-video {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 100%;
    max-height: 600px;
    height: auto;
    display: block;
    object-fit: contain;
    margin: 0 auto;
    background-color: transparent;
}

.product-video-loading {
    position: absolute;
    inset: 0;
    z-index: 2;
    background: linear-gradient(
        110deg,
        #f0f0f0 0%,
        #f9f9f9 40%,
        #f3f3f3 60%,
        #f9f9f9 100%
    );
    background-size: 200% 100%;
    animation: product-video-loading-shimmer 1.4s ease-in-out infinite;
    pointer-events: none;
    transition: opacity 0.4s ease, visibility 0.4s ease;
}

.product-main-video-frame.is-playing .product-video-loading {
    opacity: 0;
    visibility: hidden;
}

@keyframes product-video-loading-shimmer {
    0% {
        background-position: 100% 0;
    }
    100% {
        background-position: -100% 0;
    }
}

@media (prefers-reduced-motion: reduce) {
    .product-video-loading {
        animation: none;
        background: #f9f9f9;
    }
}

#mainProductImage.hidden,
#mainVideoFrame.hidden {
    display: none !important;
}

.product-thumbnails {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 0px 10px;
    flex-wrap: nowrap;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE and Edge */
}

.product-thumbnails::-webkit-scrollbar {
    display: none; /* Chrome, Safari, Opera */
}

.product-thumbnail {
    min-width: 60px;
    width: 60px;
    height: 60px;
    border: 4px solid #999999;
    border-radius: 10px;
    cursor: pointer;
    transition: all 0.3s;
    flex-shrink: 0;
    overflow: hidden;
    box-sizing: border-box;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0;
    background: #111;
}

.product-thumbnail-media {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}

.product-thumbnail:hover {
    border-color: #000000;
}

.product-thumbnail.active {
    border-color: #000000;
}

/* Product Info Panel */
.product-info-panel {
    padding: 20px 10px;
}

.product-title {
    font-size: 30px;
    font-weight: 800;
    color: #000000;
    /* margin-bottom: 20px; */
    line-height: 1.2;
    letter-spacing: -0.5px;
}

.product-rating {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
}

.rating-stars {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    background-color: #f5f5f5;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 600;
    color: #000000;
}

.rating-stars:not(.rating-stars-composite)::before {
    content: '★★★★★';
    color: #ffd700;
    font-size: 16px;
    margin-right: 4px;
}

.rating-stars.rating-stars-composite {
    gap: 8px;
}

.rating-stars.rating-stars-composite::before {
    content: none;
    display: none;
}

.rating-stars-stack {
    position: relative;
    display: inline-block;
    line-height: 1;
    letter-spacing: 0.06em;
    font-size: 16px;
}

.rating-stars-bg {
    color: #d8d8d8;
}

.rating-stars-fg {
    position: absolute;
    left: 0;
    top: 0;
    overflow: hidden;
    white-space: nowrap;
    color: #ffd700;
    width: 0;
    height: 100%;
    pointer-events: none;
}

.rating-stars-num {
    font-size: 14px;
    font-weight: 600;
    color: #000000;
}

.rating-text {
    background-color: #f5f5f5;
    padding: 6px 12px;
    border-radius: 6px;
    font-size: 14px;
    color: #000000;
}

.pd-short-description {
    margin: 14px 0 16px;
    font-size: 15px;
    line-height: 1.55;
    color: #555555;
}

.pd-short-description:empty {
    display: none;
}

.product-price-section {
    margin-bottom: 20px;
}

.discount-badge {
    display: inline-block;
    background-color: #fd0536;
    color: #ffffff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 600;
    margin-bottom: 10px;
}

.price-container {
    display: flex;
    align-items: baseline;
    gap: 15px;
}

.current-price {
    font-size: 30px;
    font-weight: 800;
    color: #000000;
    letter-spacing: -1px;
}

.original-price {
    font-size: 15px;
    color: #999999;
    text-decoration: line-through;
}

/* Color Selector */
.product-color-selector {
    padding-top: 14px;
    margin-bottom: 30px;
}

.selector-label {
    display: block;
    font-size: 16px;
    font-weight: 600;
    color: #000000;
    margin-bottom: 15px;
}

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

.color-thumbnail {
    width: 100%;
    aspect-ratio: 1;
    object-fit: cover;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
}

.color-thumbnail:hover {
    border-color: #999999;
    transform: scale(1.05);
}

.color-thumbnail.selected {
    border-color: #000000;
    border-width: 3px;
    box-shadow: 0 0 0 2px rgba(0, 0, 0, 0.1);
}

/* Size Selector */
.product-size-selector {
    margin-bottom: 30px;
}

.size-grid {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 10px;
}

.size-option {
    padding: 14px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    text-align: center;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s;
    background-color: #ffffff;
    color: #000000;
}

.size-option:hover {
    border-color: #999999;
    transform: translateY(-2px);
}

.size-option.selected {
    background-color: #000000;
    color: #ffffff;
    border-color: #000000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.product-add-to-cart-btn {
    width: 100%;
    padding: 12px 20px;
    background-color: #000000;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 12px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin-bottom: 20px;
    letter-spacing: 0.5px;
}

.product-add-to-cart-btn:hover {
    background-color: #333333;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

.cart-icon-btn {
    display: flex;
    align-items: center;
    flex-shrink: 0;
}

.cart-icon-btn svg {
    display: block;
}

/* Product Description Section */
.product-description-section {
    padding: 0px 20px;
    background-color: #ffffff;
}



.description-container {
    max-width: 1200px;
    margin: 0 auto;
}

.description-wrapper {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
    overflow: hidden;
}

.description-title {
    font-size: 18px;
    font-weight: 700;
    color: #000000;
    margin: 0;
    padding: 16px 20px;
    background-color: #F9FAFB;
    display: flex;
    justify-content: space-between;
    align-items: center;
    cursor: pointer;
    user-select: none;
    transition: background-color 0.2s;
}

.description-title:hover {
    background-color: #f3f4f6;
}

.description-toggle-icon {
    display: flex;
    align-items: center;
    transition: transform 0.3s ease;
}

.description-title.collapsed .description-toggle-icon {
    transform: rotate(180deg);
}

.description-toggle-icon svg {
    display: block;
}

.description-content {
    overflow: hidden;
    transition: max-height 0.35s ease, opacity 0.3s ease;
    /* 需足够大以容纳长图文；过小会裁切描述中的大图 */
    max-height: 50000px;
    opacity: 1;
}

.description-wrapper.collapsed .description-content {
    max-height: 0;
    opacity: 0;
}

.description-text {
    font-size: 14px;
    color: #666666;
    line-height: 1.8;
    white-space: pre-line;
    margin: 0;
    padding: 20px;
    overflow-x: auto;
    box-sizing: border-box;
}

/* 描述区 HTML 内嵌图片/视频：不超出容器宽度，高度随比例缩放 */
.description-text img,
.description-text video {
    max-width: 100%;
    width: auto;
    height: auto;
    display: block;
    margin: 12px 0;
}

body.pd-page .product-description-section.product-spec-extra-section {
    margin-top: 28px;
    margin-bottom: 32px;
}

.description-spec-table-wrap {
    padding: 0 20px 20px;
    overflow-x: auto;
}

.product-spec-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
    color: #666666;
    margin-top: 12px;
}

.product-spec-table td {
    border: 1px solid #e5e7eb;
    padding: 12px 14px;
    text-align: left;
    vertical-align: top;
}

.product-spec-table tbody tr:nth-child(even) {
    background: #fafafa;
}

.product-spec-empty {
    color: #9ca3af;
    text-align: center;
}

/* Responsive Design */
@media (max-width: 768px) {

    hr {
        border: none;           /* 先清除默认边框 */
    border-top: 1px solid #eff0f0;  /* 设置顶部边框颜色 */
    }

    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 40px;
    }

    .product-images-panel {
        position: static;
        max-width: 100%;
        overflow: hidden;
    }

    .product-image-card {
        min-height: 300px;
        max-height: 350px;
    }

    .product-main-image {
        max-height: 500px;
        width: 100%;
        height: auto;
        object-fit: contain;
    }

    .color-thumbnails {
        grid-template-columns: repeat(4, 1fr);
    }

    .size-grid {
        grid-template-columns: repeat(4, 1fr);
    }
}

/* Floating Cart Bar */
.floating-cart-bar {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 9999;
    background-color: #ffffff;
    border-top: 1px solid #e0e0e0;
    box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.1);
    transform: translateY(100%);
    transition: transform 0.3s ease-in-out;
}

.floating-cart-bar.show {
    transform: translateY(0);
}

.floating-cart-bar.hidden {
    transform: translateY(100%);
}

.floating-cart-content {
    max-width: 1200px;
    margin: 0 auto;
    display: flex;
    align-items: center;
    gap: 16px;
    padding: 12px 20px;
}

.floating-product-thumbnail {
    width: 60px;
    height: 60px;
    flex-shrink: 0;
    border: 1px solid #000000;
    border-radius: 4px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.floating-product-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.floating-product-info {
    flex: 1;
    min-width: 0;
}

.floating-product-name {
    font-size: 16px;
    font-weight: 700;
    color: #000000;
    margin-bottom: 4px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.floating-product-price {
    display: flex;
    align-items: center;
    gap: 12px;
}

.floating-current-price {
    font-size: 20px;
    font-weight: 700;
    color: #000000;
}

.floating-original-price {
    font-size: 14px;
    color: #999999;
    text-decoration: line-through;
}

.floating-add-to-cart-btn {
    padding: 12px 24px;
    background-color: black;
    color: #ffffff;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 700;
    cursor: pointer;
    transition: all 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    white-space: nowrap;
    flex-shrink: 0;
}

.floating-add-to-cart-btn:hover {
    background-color: #1e40af;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
}

@media (max-width: 768px) {
    .floating-cart-content {
        padding: 10px 16px;
        gap: 12px;
    }
    
    .floating-product-thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .floating-product-name {
        font-size: 14px;
    }
    
    .floating-current-price {
        font-size: 18px;
    }
    
    .floating-add-to-cart-btn {
        padding: 10px 16px;
        font-size: 12px;
    }
}
