* {
    padding: 0px;
    /*內邊距 */
    margin: 0px;
    /*外邊距*/
    border: 0px;
    /*邊框*/
}

.product {
    position: relative;
    min-height: 100vh;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: left;
    background: #ffffff;
    margin-top: 0;
}

.product .sidebar {
    position: absolute;
    background-color: #ffffff;
    width: 80px;
    height: 480px;
    top: 80px;
    margin-top: 80px;
    transition: 0.5s;
    overflow: hidden;
    overflow-y: auto;
    border-radius: 8px;
    transition: width .5s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .25);
    flex: 0 0 250px;
}

.product .sidebar.active {
    width: 250px;
}

.product .sidebar ul {
    width: 100%;
    position: absolute;
    top: 0;
    left: 0;
    list-style: none;
}

.product .sidebar ul li {
    position: relative;
    width: 100%;
}

.product .sidebar ul li:hover {
    background: #d3d3d3;
    color: #000;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.product .sidebar ul li a {
    display: flex;
    position: relative;
    width: 100%;
    text-decoration: none;
    color: #535353;
    font-size: 15px;
    font-weight: 500;
}

.product .sidebar ul li a .icon {
    position: relative;
    display: block;
    min-width: 80px;
    height: 60px;
    line-height: 60px;
    min-width: 80px;
    text-align: center;
}

.product .sidebar ul li a .icon .fa {
    font-size: 24px;
}

.product .sidebar ul li a .title {
    position: relative;
    display: block;
    height: 60px;
    line-height: 60px;
    white-space: nowrap;
    opacity: 1;
    transition: opacity 0.3s;
}

.toggle {
    position: absolute;
    top: 400px;
    left: 65px;
    transform: translateY(-50%);
    width: 35px;
    height: 35px;
    background: #ffffff;
    cursor: pointer;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: left 0.5s, transform 0.5s;
    box-shadow: 0 5px 15px rgba(0, 0, 0, .25);

}

.product .sidebar.active+.toggle {
    left: 235px;
    top: 400px;
}

.toggle::before {
    position: absolute;
    width: 100%;
    height: 100%;
    line-height: 30px;
    text-align: center;
    font-size: 16px;
    color: #000000;
}

.toggle i {
    font-size: 16px;
    color: #000000;
}

.toggle:hover {
    background: #d3d3d3;
    color: #000;
    box-shadow: inset 0 0 5px rgba(0, 0, 0, 0.2);
}

.product_detail {
    display: flex;
    flex-direction: column;
    align-items: center;
    flex-wrap: wrap;
    margin-top: 80px;
    margin-left: 80px;
    transition: margin-left 0.5s;
    width: calc(100% - 20px);
    padding: 20px;
}

.product-images {
    flex: 1;
    height: 450px;
    width: 450px;
    padding: 20px;
}

.main-image {
    width: 350px;
    /* 固定主圖寬度 */
    height: 350px;
    /* 固定主圖高度 */
    object-fit: contain;
    /* 讓圖片完整顯示且不變形 */
    border-radius: 8px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.1);
    margin-bottom: 15px;
    display: block;
    background: #fff;
    /* 可選，讓留白更明顯 */
}

.thumbnail-container {
    display: flex;
    gap: 10px;
    /* 縮圖間距 */
    justify-content: flex-start;
}

.thumbnail {
    width: 70px;
    /* 固定縮圖寬度 */
    height: 70px;
    /* 固定縮圖高度 */
    object-fit: contain;
    /* 讓縮圖完整顯示且不變形 */
    border-radius: 5px;
    cursor: pointer;
    transition: all 0.3s ease;
    display: block;
    background: #fff;
    /* 可選，讓留白更明顯 */
}

.thumbnail:hover {
    transform: translateY(-5px);
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.1);
}

.product-info {
    flex: 1;
    min-width: 300px;
    padding: 20px;
}

.product-title {
    font-size: 28px;
    font-weight: 700;
    margin-bottom: 10px;
    color: #333;
}

.product-rating {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
}

.stars {
    color: #f8d32b;
    margin-right: 10px;
}

.review-count {
    color: #666;
    font-size: 14px;
}

.product-price {
    font-size: 32px;
    font-weight: 700;
    color: #e23e3e;
    margin-bottom: 20px;
}

.price-original {
    text-decoration: line-through;
    color: #999;
    font-size: 18px;
    margin-left: 10px;
}

.product-availability {
    display: flex;
    align-items: center;
    margin-bottom: 15px;
    color: #28a745;
    font-weight: 500;
}

.product-availability i {
    margin-right: 5px;
}

.purchase-options {
    margin-bottom: 25px;
}

.quantity-selector {
    display: flex;
    align-items: center;
    margin-bottom: 20px;
}

.quantity-selector label {
    margin-right: 15px;
    font-weight: 500;
}

.quantity-input {
    width: 60px;
    height: 40px;
    text-align: center;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 10px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    background: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
}

.quantity-btn:hover {
    background: #e9e9e9;
}

.action-buttons {
    display: flex;
    gap: 20px;
    margin: 30px 0;
    justify-content: flex-start;
    /* 改為靠左對齊 */
}

.btn {
    padding: 15px 30px;
    border-radius: 25px;
    font-weight: 600;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s ease;
    text-transform: uppercase;
    letter-spacing: 1px;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.btn-primary {
    background: #1a1a1a;
    color: white;
    border: none;
}

.btn-primary:hover {
    background: #333;
}

.btn-outline {
    background: transparent;
    border: 2px solid #1a1a1a;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-outline:hover {
    background: #1a1a1a;
    color: white;
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

.btn-outline i {
    font-size: 18px;
}

/* 新增購物車按鈕動畫效果 */
.btn-outline::before {
    content: '';
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    background: #1a1a1a;
    border-radius: 50%;
    transform: translate(-50%, -50%);
    transition: width 0.6s, height 0.6s;
    z-index: -1;
}

.btn-outline:hover::before {
    width: 300px;
    height: 300px;
}

.product-description {
    margin-bottom: 30px;
}

.product-description h3 {
    font-size: 18px;
    margin-bottom: 10px;
    color: #333;
}

.product-description p {
    color: #666;
    line-height: 1.6;
    margin-bottom: 15px;
}

.product-specs {
    margin-bottom: 30px;
}

.product-specs h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.specs-table {
    width: 100%;
    border-collapse: collapse;
}

.specs-table th {
    background: #f7f7f7;
    font-size: 1.3em;
    font-weight: bold;
    color: #222;
    letter-spacing: 1px;
    text-align: left;
    padding: 12px 8px;
    border-bottom: 2px solid #e0e0e0;
}

.spec-section th {
    border-top: 18px solid transparent;
}

.specs-table td {
    padding: 8px 8px;
    border-bottom: 1px solid #f0f0f0;
}

.product-features {
    margin-bottom: 30px;
}

.product-features h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
}

.feature-list {
    list-style-type: none;
}

.feature-list li {
    padding: 8px 0;
    color: #666;
    display: flex;
    align-items: center;
}

.feature-list li i {
    color: #28a745;
    margin-right: 10px;
}

.full-specs {
    width: 100%;
    padding: 30px 20px;
    margin-top: 20px;
    background: #f9f9f9;
    border-radius: 8px;
}

.full-specs h2 {
    font-size: 24px;
    margin-bottom: 20px;
    color: #333;
    text-align: center;
}

.specs-section {
    margin-bottom: 30px;
}

.specs-section h3 {
    font-size: 18px;
    margin-bottom: 15px;
    color: #333;
    border-bottom: 2px solid #eee;
    padding-bottom: 8px;
}

.spec-subsection th {
    background: #f0f4fa;
    font-size: 1.1em;
    font-weight: normal;
    color: #020202;
    letter-spacing: 1px;
    text-align: left;
    padding: 10px 8px;
    border-bottom: 1px solid #e0e0e0;
}

footer {
    background-color: #000000;
    color: rgb(153, 147, 147);
    height: 60px;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 14px;
}

/* 加在 detail_style.css */
.color-selector {
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.color-selector label {
    font-weight: bold;
    color: #333;
    margin-right: 4px;
}

#color {
    padding: 6px 28px 6px 12px;
    border: 1.5px solid #bbb;
    border-radius: 6px;
    background: #fafbfc url('data:image/svg+xml;utf8,<svg fill="gray" height="20" viewBox="0 0 20 20" width="20" xmlns="http://www.w3.org/2000/svg"><path d="M7 7l3-3 3 3m0 6l-3 3-3-3" stroke="gray" stroke-width="1.5" stroke-linecap="round" stroke-linejoin="round" fill="none"/></svg>') no-repeat right 10px center/18px 18px;
    font-size: 1em;
    color: #222;
    appearance: none;
    -webkit-appearance: none;
    -moz-appearance: none;
    transition: border-color 0.2s;
    min-width: 90px;
}

#color:focus {
    border-color: #336699;
    outline: none;
    background-color: #f0f4fa;
}

/* 顏色選擇器樣式 */
.color-options {
    display: flex;
    gap: 12px;
    align-items: center;
}

.color-radio {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 1em;
    margin-right: 8px;
    user-select: none;
}

.color-radio input[type="radio"] {
    display: none;
}

.color-dot {
    display: inline-block;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    border: 2px solid #ccc;
    margin-right: 6px;
    vertical-align: middle;
    transition: border-color 0.2s;
}

.color-radio input[type="radio"]:checked+.color-dot {
    border-color: #336699;
    box-shadow: 0 0 0 2px #b3d1f3;
}

/* 評論區樣式 */
.product-comments {
    margin: 30px auto;
    padding: 30px;
    background: #fff;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    max-width: 800px;
    width: 90%;
}

.comment-form {
    margin: 0 auto 30px;
    text-align: center;
    max-width: 600px;
}

.rating-input {
    margin-bottom: 20px;
    text-align: center;
}

.rating-input label {
    font-size: 18px;
    color: #333;
    margin-right: 10px;
}

.stars-input {
    display: inline-block;
    direction: rtl;
    margin: 10px 0;
}

.stars-input input[type="radio"] {
    display: none;
}

.stars-input label {
    float: right;
    cursor: pointer;
    color: #ddd;
    font-size: 24px;
    padding: 0 5px;
    transition: all 0.2s ease;
}

.stars-input input[type="radio"]:checked~label,
.stars-input label:hover,
.stars-input label:hover~label {
    color: #ffb400;
    transform: scale(1.2);
}

.form-group {
    margin-bottom: 20px;
}

.form-group input,
.form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #eee;
    border-radius: 8px;
    font-size: 16px;
    transition: all 0.3s ease;
}

.form-group input:focus,
.form-group textarea:focus {
    border-color: #000;
    outline: none;
    box-shadow: 0 0 0 3px rgba(0, 0, 0, 0.1);
}

.form-group textarea {
    height: 120px;
    resize: vertical;
}

.btn-submit {
    background: #000;
    color: white;
    padding: 12px 30px;
    border: none;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
}

.btn-submit:hover {
    background: #333;
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
}

.comments-list {
    margin-top: 30px;
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.comment {
    background: #f8f9fa;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 20px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.05);
}

.comment-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 15px;
    flex-wrap: wrap;
}

.user-name {
    font-weight: 600;
    color: #333;
    font-size: 16px;
}

.rating {
    color: #ffb400;
    margin: 0 15px;
}

.comment-date {
    color: #888;
    font-size: 14px;
}

.comment-text {
    line-height: 1.6;
    color: #444;
    font-size: 15px;
    padding: 10px 0;
}

/* 新增無評論時的樣式 */
.no-comments {
    text-align: center;
    padding: 30px;
    color: #666;
    font-size: 16px;
    background: #f8f9fa;
    border-radius: 8px;
}

/* 新增錯誤訊息樣式 */
.error {
    text-align: center;
    padding: 20px;
    color: #dc3545;
    background: #fff8f8;
    border-radius: 8px;
    border: 1px solid #ffd7d7;
    margin: 20px 0;
}

.toast-notification {
            position: fixed;
            top: 20px;
            right: -300px;
            background-color: #333;
            color: white;
            padding: 16px 24px;
            border-radius: 8px;
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
            display: flex;
            align-items: center;
            gap: 10px;
            z-index: 1000;
            transition: all 0.3s ease-in-out;
        }

        .toast-notification.show {
            right: 20px;
        }

        .toast-notification i {
            font-size: 20px;
            color: #4CAF50;
        }

/* 響應式設計與法 */
@media screen and (max-width: 768px) {

    .welcome h2 {
        font-size: 30px;
    }

    .welcome p {
        font-size: 18px;
    }

    .welcome a {
        font-size: 13px;
        padding: 8px 10px;
    }

    .shop {
        flex-direction: column-reverse;
    }

    .shop img {
        width: 100%;
    }

    .info {
        width: 100%;
        padding: 50px 0;
    }

    .info h2 {
        font-size: 30px;
        color: #cacaca;
    }

    .info p {
        font-size: 18px;
        color: #afafaf;
    }

    .product-detail {
        margin-left: 10px;
        width: calc(100% - 20px);
    }

    .product-images,
    .product-info {
        flex: 100%;
    }

    .action-buttons {
        flex-direction: row;
        /* 保持水平排列 */
        justify-content: flex-start;
        /* 保持靠左對齊 */
    }

    .btn {
        width: auto;
        /* 改回自動寬度 */
    }

    .product-info h3 {
        font-size: 14px;
    }

    .product-price {
        font-size: 16px;
    }

    .toggle {
        top: 400px;
    }

    .add-to-cart {
        padding: 6px 10px;
        font-size: 12px;
    }

}

/* 在寬度小於1400px的螢幕上每行顯示5個 */
@media (max-width: 1400px) {
    .product-grid {
        grid-template-columns: repeat(5, 1fr);
    }

    .toggle {
        top: 370px;
    }
}

/* 在寬度小於1200px的螢幕上每行顯示4個 */
@media (max-width: 1200px) {
    .product-grid {
        grid-template-columns: repeat(4, 1fr);
    }

    .toggle {
        top: 370px;
    }
}

/* 在寬度小於900px的螢幕上每行顯示3個 */
@media (max-width: 900px) {
    .product-grid {
        grid-template-columns: repeat(3, 1fr);
    }

    .toggle {
        top: 370px;
    }
}

/* 在寬度小於600px的螢幕上每行顯示2個 */
@media (max-width: 600px) {
    .product-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .toggle {
        top: 370px;
    }
}