/* 產品頁面專用 CSS */

/* 麵包屑導航 */
.breadcrumb {
    padding: 15px 0;
    font-size: 14px;
    color: #666;
    border-bottom: 1px solid #eee;
    margin-bottom: 20px;
}

.breadcrumb a {
    color: #3498db;
    text-decoration: none;
}

.breadcrumb a:hover {
    text-decoration: underline;
}

/* 分類篩選 */
.category-filter {
    background: #f8f9fa;
    padding: 20px;
    margin-bottom: 30px;
    border-radius: 8px;
}

.category-filter h3 {
    margin: 0 0 15px 0;
    font-size: 18px;
    color: #333;
}

.category-list {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.category-list li {
    margin: 0;
}

.category-list li a {
    display: block;
    padding: 8px 16px;
    background: #fff;
    color: #666;
    text-decoration: none;
    border-radius: 20px;
    border: 1px solid #ddd;
    transition: all 0.3s ease;
}

.category-list li a:hover,
.category-list li.active a {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

/* 產品區域 */
.products-section {
    margin-bottom: 40px;
}

.section-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 25px;
    padding-bottom: 15px;
    border-bottom: 2px solid #3498db;
}

.section-header h2 {
    margin: 0;
    font-size: 24px;
    color: #333;
}

.product-count {
    color: #666;
    font-size: 14px;
}

/* 產品網格 */
.products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
    gap: 25px;
    margin-bottom: 30px;
}

/* 產品項目 */
.product-item {
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.product-item:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 20px rgba(0,0,0,0.15);
}

.product-image {
    position: relative;
    overflow: hidden;
    height: 250px;
}

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

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

.product-badges {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
}

.badge {
    display: inline-block;
    padding: 4px 8px;
    font-size: 12px;
    font-weight: bold;
    border-radius: 4px;
    margin-right: 5px;
    margin-bottom: 5px;
}

.badge.featured {
    background: #e74c3c;
    color: #fff;
}

.badge.new {
    background: #27ae60;
    color: #fff;
}

.badge.bestseller {
    background: #f39c12;
    color: #fff;
}

.product-info {
    padding: 20px;
}

.product-name {
    margin: 0 0 10px 0;
    font-size: 16px;
    font-weight: bold;
}

.product-name a {
    color: #333;
    text-decoration: none;
}

.product-name a:hover {
    color: #3498db;
}

.product-category {
    font-size: 12px;
    color: #666;
    margin-bottom: 10px;
}

.product-description {
    font-size: 14px;
    color: #666;
    line-height: 1.4;
    margin-bottom: 15px;
}

.product-price {
    margin-bottom: 15px;
}

.original-price {
    text-decoration: line-through;
    color: #999;
    font-size: 14px;
    margin-right: 10px;
}

.current-price {
    font-size: 18px;
    font-weight: bold;
    color: #e74c3c;
}

.product-actions {
    display: flex;
    gap: 10px;
}

.btn {
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    text-decoration: none;
    display: inline-block;
    text-align: center;
    transition: background-color 0.3s ease;
}

.btn-primary {
    background: #3498db;
    color: #fff;
}

.btn-primary:hover {
    background: #2980b9;
}

.btn-cart {
    background: #27ae60;
    color: #fff;
}

.btn-cart:hover {
    background: #229954;
}

.btn-buy {
    background: #e74c3c;
    color: #fff;
}

.btn-buy:hover {
    background: #c0392b;
}

.btn-disabled {
    background: #bdc3c7;
    color: #7f8c8d;
    cursor: not-allowed;
}

/* 無產品提示 */
.no-products {
    text-align: center;
    padding: 60px 20px;
    color: #666;
}

.no-products p {
    font-size: 18px;
    margin: 0;
}

/* 分頁導航 */
.pagination {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 10px;
    margin-top: 30px;
}

.page-link {
    padding: 8px 12px;
    background: #fff;
    color: #666;
    text-decoration: none;
    border: 1px solid #ddd;
    border-radius: 4px;
    transition: all 0.3s ease;
}

.page-link:hover {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.page-link.current {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

/* 產品詳細頁面 */
.product-detail-container {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    margin-bottom: 40px;
}

.product-images {
    position: sticky;
    top: 20px;
}

.image-carousel-container {
    position: relative;
    margin-bottom: 15px;
    border-radius: 8px;
    overflow: hidden;
}

.main-image {
    position: relative;
    width: 100%;
    height: auto;
    min-height: 300px;
    overflow: hidden;
    background: #f8f9fa;
}

.main-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.carousel-image {
    position: relative;
    width: 100%;
    height: auto;
    display: none;
}

.carousel-image.active {
    display: block;
}

.carousel-image img {
    width: 100%;
    height: auto;
    object-fit: contain;
    transition: opacity 0.3s ease;
}

.carousel-controls {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    width: 100%;
    display: flex;
    justify-content: space-between;
    padding: 0 15px;
    pointer-events: none;
}

.carousel-btn {
    width: 40px;
    height: 40px;
    background: rgba(255, 255, 255, 0.9);
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
    color: #333;
    transition: all 0.3s ease;
    pointer-events: auto;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.carousel-btn:hover {
    background: #fff;
    transform: scale(1.1);
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
}

.carousel-btn:disabled {
    opacity: 0.3;
    cursor: not-allowed;
    transform: none;
}

.carousel-indicators {
    position: absolute;
    bottom: 15px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 2;
}

.carousel-indicator {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.5);
    cursor: pointer;
    transition: background-color 0.3s ease;
}

.carousel-indicator.active {
    background: #3498db;
}

.thumbnail-carousel {
    position: relative;
    overflow: hidden;
}

.thumbnail-images {
    display: flex;
    gap: 10px;
    transition: transform 0.3s ease;
    overflow-x: auto;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

.thumbnail-images::-webkit-scrollbar {
    display: none;
}

.thumbnail {
    width: 80px;
    height: 80px;
    border-radius: 4px;
    overflow: hidden;
    border: 2px solid transparent;
    transition: border-color 0.3s ease;
    flex-shrink: 0;
    cursor: pointer;
}

.thumbnail.active {
    border-color: #3498db;
}

.thumbnail:hover {
    border-color: #3498db;
    opacity: 0.8;
}

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

.product-info {
    padding: 0;
}

.product-title {
    font-size: 28px;
    font-weight: bold;
    margin: 0 0 20px 0;
    color: #333;
}

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

.product-meta > div {
    margin-bottom: 8px;
    font-size: 14px;
}

.label {
    font-weight: bold;
    color: #666;
}

.product-price {
    margin-bottom: 25px;
    padding: 15px;
    background: #f8f9fa;
    border-radius: 8px;
}

.discount {
    display: block;
    color: #27ae60;
    font-size: 14px;
    margin-top: 5px;
}

.product-description {
    margin-bottom: 25px;
}

.product-description h3 {
    font-size: 18px;
    margin: 0 0 10px 0;
    color: #333;
}

.product-attributes {
    margin-bottom: 25px;
}

.attribute-group {
    margin-bottom: 15px;
}

.attribute-label {
    display: block;
    font-weight: bold;
    margin-bottom: 8px;
    color: #333;
}

.attribute-values {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.attribute-value {
    display: flex;
    align-items: center;
    cursor: pointer;
}

.attribute-value input[type="radio"] {
    margin-right: 5px;
}

.attribute-value span {
    padding: 6px 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    background: #fff;
    transition: all 0.3s ease;
}

.attribute-value input[type="radio"]:checked + span {
    background: #3498db;
    color: #fff;
    border-color: #3498db;
}

.product-stock {
    margin-bottom: 25px;
    padding: 10px;
    background: #f8f9fa;
    border-radius: 4px;
}

.stock-status.in-stock {
    color: #27ae60;
    font-weight: bold;
}

.stock-status.out-of-stock {
    color: #e74c3c;
    font-weight: bold;
}

.product-actions {
    margin-bottom: 25px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.quantity-selector label {
    margin-right: 10px;
    font-weight: bold;
}

.quantity-selector button {
    width: 30px;
    height: 30px;
    border: 1px solid #ddd;
    background: #fff;
    cursor: pointer;
    font-size: 16px;
}

.quantity-selector input {
    width: 60px;
    height: 30px;
    text-align: center;
    border: 1px solid #ddd;
    border-left: none;
    border-right: none;
}

.action-buttons {
    display: flex;
    gap: 15px;
}

.action-buttons .btn {
    flex: 1;
    padding: 12px 20px;
    font-size: 16px;
}

/* 商品詳細說明 */
.product-details {
    margin-bottom: 40px;
    padding: 25px;
    background: #f8f9fa;
    border-radius: 8px;
}

.product-details h3 {
    font-size: 20px;
    margin: 0 0 15px 0;
    color: #333;
}

.detail-content {
    line-height: 1.6;
    color: #666;
}

/* 商品規格 */
.product-specifications {
    margin-bottom: 40px;
}

.product-specifications h3 {
    font-size: 20px;
    margin: 0 0 15px 0;
    color: #333;
}

.spec-table {
    width: 100%;
    border-collapse: collapse;
    background: #fff;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

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

.spec-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #eee;
}

.spec-table td:first-child {
    font-weight: bold;
    color: #333;
    width: 120px;
}

/* 相關商品 */
.related-products {
    margin-bottom: 40px;
}

.related-products h3 {
    font-size: 20px;
    margin: 0 0 20px 0;
    color: #333;
}

.related-products .products-grid {
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
}

.related-products .product-item {
    box-shadow: 0 1px 5px rgba(0,0,0,0.1);
}

.related-products .product-image {
    height: 180px;
}

.related-products .product-info {
    padding: 15px;
}

.related-products .product-name {
    font-size: 14px;
    margin-bottom: 8px;
}

.related-products .product-price {
    margin-bottom: 0;
}

.related-products .current-price {
    font-size: 16px;
}

/* 響應式設計 */
@media (max-width: 768px) {
    .product-detail-container {
        grid-template-columns: 1fr;
        gap: 20px;
    }
    
    .product-images {
        position: static;
    }
    
    .main-image {
        min-height: 250px;
    }
    
    .carousel-btn {
        width: 35px;
        height: 35px;
        font-size: 14px;
    }
    
    .carousel-controls {
        padding: 0 10px;
    }
    
    .carousel-indicators {
        bottom: 10px;
    }
    
    .carousel-indicator {
        width: 6px;
        height: 6px;
    }
    
    .thumbnail {
        width: 60px;
        height: 60px;
    }
    
    .products-grid {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        gap: 15px;
        padding: 0 10px;
    }
    
    .category-list {
        flex-direction: column;
        padding: 0 10px;
    }
    
    .category-list li a {
        text-align: center;
    }
    
    .action-buttons {
        flex-direction: column;
    }
    
    .thumbnail-images {
        justify-content: center;
    }
    
    .section-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 10px;
        padding: 0 10px;
    }
    
    .products-section {
        padding: 0 10px;
    }
    
    .category-filter {
        margin: 0 10px 30px 10px;
    }
}

@media (max-width: 480px) {
    .products-grid {
        grid-template-columns: 1fr;
        gap: 10px;
        padding: 0 5px;
    }
    
    .main-image {
        min-height: 200px;
    }
    
    .carousel-btn {
        width: 30px;
        height: 30px;
        font-size: 12px;
    }
    
    .carousel-controls {
        padding: 0 5px;
    }
    
    .thumbnail {
        width: 50px;
        height: 50px;
    }
    
    .product-title {
        font-size: 24px;
    }
    
    .product-price {
        padding: 10px;
    }
    
    .current-price {
        font-size: 20px;
    }
    
    .products-section {
        padding: 0 5px;
    }
    
    .category-filter {
        margin: 0 5px 30px 5px;
        padding: 15px;
    }
    
    .section-header {
        padding: 0 5px;
    }
    
    .category-list {
        padding: 0 5px;
    }
}

