/* WooCommerce Single Product Page Styles */

/* 主要區域佈局 */
.product-main-section {
    margin-bottom: 60px;
    display: flex;
    align-items: stretch;
}

.product-main-section .col-lg-6 {
    display: flex;
    flex-direction: column;
}

/* 圖片區域樣式 */
.product-images-container {
    background: #fff;
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 主圖片顯示 */
.product-main-image-wrapper {
    margin-bottom: 20px;
}

.main-image-display {
    position: relative;
    width: 100%;
    height: 500px;
    overflow: hidden;
    border-radius: 8px;
    background: #f8f9fa;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image-display img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    transition: transform 0.3s ease;
}

.main-image-display:hover img {
    transform: scale(1.05);
}

.no-image-placeholder {
    text-align: center;
    color: #6c757d;
    padding: 60px 20px;
}

.no-image-placeholder i {
    font-size: 64px;
    margin-bottom: 15px;
    opacity: 0.5;
}

.no-image-placeholder p {
    font-size: 16px;
    margin: 0;
}

/* 縮略圖區域 */
.product-thumbnails-wrapper {
    position: relative;
}

.thumbnails-container {
    position: relative;
    display: flex;
    align-items: center;
    padding: 0 40px;
}

.thumbnails-slider {
    display: flex;
    gap: 12px;
    overflow-x: auto;
    scroll-behavior: smooth;
    padding: 10px 0;
    scrollbar-width: thin;
    scrollbar-color: #dee2e6 #f8f9fa;
}

.thumbnails-slider::-webkit-scrollbar {
    height: 6px;
}

.thumbnails-slider::-webkit-scrollbar-track {
    background: #f8f9fa;
    border-radius: 3px;
}

.thumbnails-slider::-webkit-scrollbar-thumb {
    background: #dee2e6;
    border-radius: 3px;
}

.thumbnails-slider::-webkit-scrollbar-thumb:hover {
    background: #adb5bd;
}

.thumbnail-item {
    flex: 0 0 80px;
    height: 80px;
    border: 2px solid transparent;
    border-radius: 6px;
    overflow: hidden;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #fff;
}

.thumbnail-item:hover {
    border-color: #007bff;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.15);
}

.thumbnail-item.active {
    border-color: #007bff;
    box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.25);
}

.thumbnail-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

/* 縮略圖導航按鈕 */
.thumbnail-nav {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: #fff;
    border: 1px solid #dee2e6;
    border-radius: 50%;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    z-index: 2;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.thumbnail-nav:hover {
    background: #007bff;
    color: #fff;
    border-color: #007bff;
}

.prev-thumbnail {
    left: 0;
}

.next-thumbnail {
    right: 0;
}

/* 產品信息區域 */
.product-info-container {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* 產品標題 */
.product-header-section {
    margin-bottom: 20px;
    padding-bottom: 20px;
    border-bottom: 1px solid #e9ecef;
}

.product-title {
    font-size: 28px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 12px;
    line-height: 1.3;
}

.product-categories {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.product-category-tag {
    background: #e9ecef;
    color: #495057;
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
}

/* 價格區域 */
.product-price-section {
    margin-bottom: 25px;
}

.price-wrapper {
    display: flex;
    align-items: center;
    gap: 15px;
    flex-wrap: wrap;
}

.current-price {
    font-size: 32px;
    font-weight: 700;
    color: #dc3545;
}

.original-price {
    font-size: 20px;
    color: #6c757d;
    text-decoration: line-through;
}

.discount-badge {
    background: #dc3545;
    color: #fff;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 600;
}

/* 產品簡短說明 */
.product-short-description {
    margin-bottom: 25px;
    padding: 20px;
    background: #f8f9fa;
    border-radius: 8px;
    border-left: 4px solid #007bff;
}

.product-short-description h3 {
    font-size: 18px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 12px;
}

.short-description-content {
    color: #495057;
    line-height: 1.6;
}

.short-description-content p {
    margin-bottom: 10px;
}

.short-description-content ul {
    padding-left: 20px;
}

.short-description-content li {
    margin-bottom: 5px;
}

/* 產品屬性 */
.product-attributes {
    margin-bottom: 25px;
    padding: 20px;
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
}

.attribute-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    border-bottom: 1px solid #f8f9fa;
}

.attribute-item:last-child {
    border-bottom: none;
}

.attribute-label {
    font-weight: 500;
    color: #495057;
    min-width: 80px;
}

.attribute-value {
    color: #212529;
    font-weight: 500;
}

.stock-instock {
    color: #28a745;
}

.stock-outofstock {
    color: #dc3545;
}

/* 購買操作 */
.product-purchase-section {
    padding-top: 20px;
    border-top: 1px solid #e9ecef;
}

.purchase-actions {
    display: flex;
    gap: 15px;
    flex-wrap: wrap;
}

.add-to-cart-btn {
    flex: 1;
    min-width: 200px;
    padding: 12px 24px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.add-to-cart-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 123, 255, 0.3);
}

.add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.add-to-wishlist {
    padding: 12px 20px;
    border-radius: 8px;
    transition: all 0.3s ease;
}

.add-to-wishlist:hover {
    background: #dc3545 !important;
    border-color: #dc3545 !important;
    color: #fff !important;
}

/* 產品詳細說明區域 */
.product-details-section {
    margin-top: 40px;
}

.product-full-description {
    background: #fff;
    border-radius: 12px;
    padding: 40px;
    box-shadow: 0 2px 20px rgba(0, 0, 0, 0.1);
}

.product-full-description h2 {
    font-size: 24px;
    font-weight: 600;
    color: #212529;
    margin-bottom: 20px;
    padding-bottom: 15px;
    border-bottom: 2px solid #007bff;
}

.description-content {
    color: #495057;
    line-height: 1.8;
    font-size: 16px;
}

.description-content h1,
.description-content h2,
.description-content h3,
.description-content h4,
.description-content h5,
.description-content h6 {
    color: #212529;
    margin-top: 25px;
    margin-bottom: 15px;
}

.description-content p {
    margin-bottom: 15px;
}

.description-content ul,
.description-content ol {
    padding-left: 25px;
    margin-bottom: 15px;
}

.description-content li {
    margin-bottom: 8px;
}

.description-content img {
    max-width: 100%;
    height: auto;
    border-radius: 8px;
    margin: 15px 0;
}

.description-content table {
    width: 100%;
    border-collapse: collapse;
    margin: 20px 0;
}

.description-content th,
.description-content td {
    padding: 12px;
    border: 1px solid #dee2e6;
    text-align: left;
}

.description-content th {
    background: #f8f9fa;
    font-weight: 600;
}

/* 響應式設計 */
@media (max-width: 991px) {
    .product-main-section {
        margin-bottom: 40px;
        flex-direction: column;
        align-items: normal;
    }
    
    .main-image-display {
        height: 400px;
    }
    
    .product-info-container {
        margin-top: 30px;
    }
    
    .product-title {
        font-size: 24px;
    }
    
    .current-price {
        font-size: 28px;
    }
    
    .purchase-actions {
        flex-direction: column;
    }
    
    .add-to-cart-btn {
        min-width: auto;
    }
}

@media (max-width: 767px) {
    .main-image-display {
        height: 300px;
    }
    
    .thumbnail-item {
        flex: 0 0 60px;
        height: 60px;
    }
    
    .product-info-container {
        padding: 20px;
    }
    
    .product-title {
        font-size: 20px;
    }
    
    .current-price {
        font-size: 24px;
    }
    
    .product-full-description {
        padding: 20px;
    }
    
    .thumbnails-container {
        padding: 0 30px;
    }
    
    .thumbnail-nav {
        width: 28px;
        height: 28px;
    }
}

@media (max-width: 575px) {
    .main-image-display {
        height: 250px;
    }
    
    .product-images-container,
    .product-info-container {
        padding: 15px;
    }
    
    .price-wrapper {
        flex-direction: column;
        align-items: flex-start;
        gap: 8px;
    }
    
    .attribute-item {
        flex-direction: column;
        align-items: flex-start;
        gap: 5px;
    }
}

/* 動畫效果 */
@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.product-images-container,
.product-info-container,
.product-full-description {
    animation: fadeIn 0.6s ease-out;
}

/* 加載動畫 */
.thumbnail-item.loading {
    position: relative;
    overflow: hidden;
}

.thumbnail-item.loading::after {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    animation: loading 1.5s infinite;
}

@keyframes loading {
    0% {
        left: -100%;
    }
    100% {
        left: 100%;
    }
}