/* static/css/product_detail.css */

.row {
    margin-right: 0 !important;
    margin-left: 0 !important;
}

.col-12 {
    padding-left: 0;
    padding-right: 0;
}

/* 包住整體內容，限制桌機寬度為 60vw */
.product-page-wrapper {
    max-width: 60vw;
    margin: 0 auto;
}

/* 左側圖片區 */
.product-image-gallery {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.gallery-item {
    height: auto;
}

.gallery-image.img-fluid {
    min-height: 400px;
    max-height: 600px;
}

.main-image-wrapper {
    width: 100%;
    height: 400px;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

.main-image-wrapper img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.thumbnail-container {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    margin-top: 30px;
}

.thumbnail-container img {
    width: 70px;
    height: 70px;
    object-fit: cover;
    border: 1px solid #ccc;
    cursor: pointer;
    transition: border 0.3s;
}

.thumbnail-container img.active,
.thumbnail-container img:hover {
    border: 2px solid #8fae85;
}

/* 商品資訊區 */
.product-info .price {
    font-size: 20px;
    font-weight: 600;
    margin-top: 10px;
    margin-bottom: 20px;
}

.btn-buy {
    background-color: #a8bfa1;
    color: white;
    border: none;
}

.btn-buy:hover {
    background-color: #8fae85;
}

/* 移除數字 input 箭頭 */
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
input[type="number"] {
    -moz-appearance: textfield;
}

/* 價格容器 */
.price-container {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 0.75rem;
    margin: 20px 0;
}

/* 售價 - 深紅色 */
.sale-price {
    color: #c41e3a !important;
    font-weight: bold;
    font-size: 1.1rem;
}

/* 比較價格 - 灰色 + 刪除線 */
.comparison-price {
    color: #aaa !important;
    text-decoration: line-through;
    font-size: 1.1rem;
}

/* 商品描述圖片 */
.product-description img {
    max-width: 100%;
    height: auto;
    margin-top: 1rem;
}

.product-description {
    white-space: normal;
    word-break: break-word;
    font-size: 16px;
    line-height: 1.6;
    overflow-x: hidden;
}

.product-description-image {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    overflow-x: hidden;
}

/* 限制商品介紹區圖片寬度 */
.product-description-image img {
    max-width: 100% !important;
    width: auto !important;
    height: auto !important;
    display: block;
    object-fit: contain;
    margin: 1rem auto;
}

.product-description ul {
    padding-left: 1.2rem;
    margin-bottom: 1rem;
}

.product-description li {
    margin-bottom: 0.4rem;
}

.product-description p {
    margin-bottom: 0.8rem;
}

.product-description h6 {
    margin-top: 1.5rem;
    margin-bottom: 0.6rem;
    font-size: 16px;
    font-weight: bold;
}

/* 訊息彈出框 */
.message-popup {
    position: fixed;
    top: 65%;
    left: 50%;
    transform: translate(-50%, -50%);
    opacity: 0.85;
    z-index: 9999;
    max-width: 300px;
    text-align: center;
    display: none;
    font-weight: bold;
}

/* RWD 響應式設計 */
@media (max-width: 768px) {
    .product-page-wrapper {
        max-width: 100%;
        padding: 0 16px;
    }

    .main-image-wrapper {
        width: 100%;
        min-height: 300px;
        max-height: 500px;
    }

    .thumbnail-container img {
        width: 60px;
        height: 60px;
    }

    .product-info {
        margin-top: 28px;
    }

    .product-info .price {
        font-size: 18px;
    }

    .btn-buy,
    .btn-outline-dark {
        font-size: 1rem;
    }

    .product-description-image {
        width: 100%;
        overflow: hidden;
    }

    .product-description-image img {
        width: 100% !important;
        max-width: 100% !important;
        height: auto !important;
        object-fit: contain;
    }
}
