
:root {
    --primary-color: #2c3e50;
    --secondary-color: #3498db;
    --accent-color: #1abc9c;
    --light-color: #ecf0f1;
    --dark-color: #34495e;
    --text-color: #2c3e50;
}

/* ================= 全域設定 ================= */
body {
    background-color: #f8f9fa;
    color: var(--text-color);
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
}

a {
    text-decoration: none !important;
    color: inherit;
}

.hero-section {
    background: linear-gradient(135deg, var(--primary-color) 0%, var(--secondary-color) 100%);
    color: white;
    padding: 60px 0;
    border-radius: 10px;
    margin-bottom: 30px;
    text-align: center;
}

.section-title {
    color: var(--primary-color);
    border-left: 5px solid var(--secondary-color);
    padding-left: 15px;
    margin: 30px 0 20px;
    font-weight: 600;
}

/* ================= 產品卡片 ================= */
.product-card { 
    transition: transform 0.3s; 
    margin-bottom: 20px;
    border: 1px solid #ddd;
    border-radius: 10px;
    overflow: hidden;
    background: white;
    height: 100%;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
}
.product-card:hover { 
    transform: translateY(-5px); 
    box-shadow: 0 10px 25px rgba(0,0,0,0.15);
}

.product-img { 
    height: 200px; 
    object-fit: cover; 
    width: 100%;
    transition: transform 0.5s;
}
.product-card:hover .product-img {
    transform: scale(1.05);
}

.product-category {
    color: var(--secondary-color);
    font-size: 0.8rem;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 5px;
}

.product-price { 
    color: var(--accent-color); 
    font-weight: 700;
    font-size: 1.2rem;
}
.original-price {
    color: #6c757d;
    font-size: 0.9em;
    text-decoration: line-through;
}

.discount-badge,
.sale-badge,
.new-badge,
.out-of-stock-badge,
.unavailable-badge {
    position: absolute;
    top: 10px;
    padding: 5px 10px;
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 600;
    z-index: 1;
}
.discount-badge { background-color: #e74c3c; color: white; left: 10px; }
.sale-badge { background-color: #28a745; color: white; right: 10px; }
.new-badge { background-color: var(--secondary-color); color: white; right: 10px; }
.out-of-stock-badge,
.unavailable-badge { background-color: #6c757d; color: white; left: 10px; }

.contact-service {
    color: #dc3545;
    font-weight: bold;
    font-size: 0.9em;
    text-align: center;
    padding: 5px;
    background-color: #fff3cd;
    border-radius: 4px;
    margin-top: 10px;
}

/* ================= 側邊分類 ================= */
.category-sidebar {
    background: white;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 4px 15px rgba(44, 62, 80, 0.1);
    margin-bottom: 20px;
}
.category-sidebar h5 {
    color: var(--text-color);
    border-bottom: 2px solid var(--secondary-color);
    padding-bottom: 10px;
    margin-bottom: 15px;
    font-weight: 600;
}
.category-list a {
    display: block;
    padding: 10px 15px;
    color: var(--dark-color);
    border-left: 3px solid transparent;
    transition: all 0.3s ease;
}
.category-list a:hover {
    background-color: var(--light-color);
    color: var(--secondary-color);
    border-left: 3px solid var(--secondary-color);
    transform: translateX(5px);
}
.active-category {
    background-color: var(--primary-color) !important;
    color: white !important;
}

/* ================= 搜尋與分頁 ================= */
.search-box {
    background: rgba(255,255,255,0.2);
    padding: 20px;
    border-radius: 10px;
    backdrop-filter: blur(10px);
    margin-bottom: 20px;
}
.search-type-select {
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-right: none;
}
.search-input {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
}

.pagination .page-link {
    color: var(--primary-color);
}
.pagination .page-item.active .page-link {
    background-color: var(--light-color);
    border-color: var(--primary-color);
}

.results-info {
    background-color: #f8f9fa;
    padding: 10px 15px;
    border-radius: 5px;
    margin-bottom: 20px;
}

/* ================= 商品詳情頁 ================= */
.product-image {
    max-height: 500px;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
}

.product-info-card {
    border: 1px solid #ddd;
    border-radius: 10px;
    padding: 20px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.thumbnail-container {
    display: flex;
    gap: 10px;
    margin-top: 15px;
    flex-wrap: wrap;
}
.thumbnail {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border: 2px solid transparent;
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
}
.thumbnail:hover,
.thumbnail.active {
    border-color: var(--primary-color);
    transform: scale(1.05);
}

.nav-tabs .nav-link {
    color: var(--dark-color);
    font-weight: 500;
}
.nav-tabs .nav-link.active {
    color: var(--primary-color);
    border-bottom: 3px solid var(--primary-color);
    font-weight: bold;
}
.tab-content {
    background: #f8f9fa;
    border-radius: 0 0 8px 8px;
    padding: 25px;
    min-height: 200px;
}

.breadcrumb {
    background-color: var(--light-color);
    border-radius: 5px;
    padding: 10px 15px;
}
.breadcrumb-item a {
    color: var(--primary-color);
    text-decoration: none;
}

.action-buttons .btn {
    padding: 12px 30px;
    font-size: 1.1rem;
    font-weight: bold;
    border-radius: 8px;
    transition: all 0.3s ease;
}
.action-buttons .btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.spec-item {
    display: flex;
    margin-bottom: 10px;
    padding-bottom: 10px;
    border-bottom: 1px solid #eee;
}
.spec-label {
    font-weight: bold;
    color: var(--dark-color);
    min-width: 120px;
}
.spec-value {
    color: #555;
    flex: 1;
}

.youtube-btn {
    background: linear-gradient(45deg, #FF0000, #CC0000);
    border: none;
    color: white;
    padding: 10px 20px;
    border-radius: 6px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    transition: all 0.3s ease;
}
.youtube-btn:hover {
    background: linear-gradient(45deg, #CC0000, #990000);
    transform: translateY(-2px);
}

.stock-info {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 15px;
    border-radius: 20px;
    font-weight: bold;
}
.stock-in { background: #d4edda; color: #155724; }
.stock-out { background: #f8d7da; color: #721c24; }

/* ================= 相關產品 ================= */
.related-products { margin-top: 50px; }
.related-product-card {
    border: 1px solid #ddd;
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s ease;
    height: 100%;
}
.related-product-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.1);
}
.related-product-img {
    height: 150px;
    object-fit: cover;
    width: 100%;
}

/* ================= 其他通用 ================= */
.btn-success {
    background-color: var(--accent-color);
    border-color: var(--accent-color);
}
.btn-success:hover {
    background-color: #16a085;
    border-color: #16a085;
}
.btn-outline-success {
    color: var(--accent-color);
    border-color: var(--accent-color);
}
.btn-outline-success:hover {
    background-color: var(--accent-color);
    color: white;
}

.btn-out-of-stock {
    background-color: #6c757d;
    color: white;
    cursor: not-allowed;
}

.btn-loading {
    position: relative;
    color: transparent !important;
}
.btn-loading::after {
    content: '';
    position: absolute;
    width: 16px;
    height: 16px;
    top: 50%;
    left: 50%;
    margin-left: -8px;
    margin-top: -8px;
    border: 2px solid #ffffff;
    border-radius: 50%;
    border-right-color: transparent;
    animation: spin 1s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

footer {
    background: linear-gradient(135deg, var(--dark-color) 0%, var(--primary-color) 100%);
}

