/**
 * 產品詳情頁樣式
 */

.wine-shop-product-detail {
    margin: 0 auto;
}

/* 產品詳情主區域 */
.product-detail-wrapper {
    margin: 30px auto 0;
    max-width: 1280px;
    padding-left: 20px;
    padding-right: 20px;
}

.product-details-container {
    display: flex;
    flex-wrap: wrap;
    gap: 100px;
    margin: 0 auto;

}

/* 產品圖片區域 */
.product-image-section {
    flex: 0 0 350px;
    width: 350px;
}

.product-main-image {
    width: 100%;
    background-color: var(--light-gray);
    border: 1px solid var(--border-color);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 20px;
    min-height: 400px;
    position: relative; /* anchor for magnifier icon */
}

.product-main-image img {
    max-width: 100%;
    max-height: 360px;
    object-fit: contain;
}

.wine-image-placeholder {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    height: 360px;
    background-color: var(--light-gray);
    text-align: center;
    font-size: 18px;
    color: var(--text-gray);
    line-height: 1.5;
}

.image-disclaimer {
    margin-top: 10px;
    font-size: 12px;
    color: var(--text-gray);
    text-align: center;
    line-height: 1.5;
}

/* 產品信息區域 */
.product-info-section {
    flex: 1;
    min-width: 300px;
}

.product-title {
    font-size: 24px;
    font-weight: bold;
    margin: 0 0 15px 0;
    color: #000;
    line-height: 1.3;
    font-family: var(--heading-font);
}

.product-code {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 10px;
}

.product-producer {
    font-size: 14px;
    color: var(--text-gray);
    margin-bottom: 15px;
}

.producer-value {
    font-weight: 500;
}

.product-separator {
    height: 1px;
    background-color: var(--border-color);
    margin: 15px 0;
    width: 100%;
}

/* 酒類型標籤 */
.wine-type-tags {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin: 15px 0;
}

.wine-type-label {
    font-size: 14px;
    color: var(--text-gray);
    margin-right: 10px;
}

.type-tag {
    display: inline-block;
    padding: 5px 10px;
    border-radius: 4px;
    font-size: 13px;
    font-weight: bold;
    color: white;
}

.red-tag {
    background-color: #a83240;
}

.blue-tag {
    background-color: #003366;
}

.certification-icons {
    display: flex;
    gap: 10px;
    margin-left: auto;
}

.certification-icon, 
.cert-icon {
    width: 30px;
    height: 30px;
    object-fit: contain;
}

/* 評分標籤樣式 */
.rating-label {
    display: inline-block;
    padding: 2px 6px;
    margin: 0 2px;
    border-radius: 3px;
    font-size: 12px;
    font-weight: bold;
    color: white;
}

.purple-tag {
    background-color: #8a2be2; /* 紫色背景 */
}

.green-tag {
    background-color: #2e8b57; /* 綠色背景 */
}

.orange-tag {
    background-color: #ff8c00; /* 橙色背景 */
}

.blue-tag {
    background-color: #4169e1; /* 藍色背景 */
}

/* 庫存狀態 */
.product-availability {
    margin: 15px 0;
    font-size: 14px;
}

.availability-label {
    font-weight: bold;
    color: var(--text-gray);
    margin-right: 8px;
}

.availability-value {
    color: var(--text-dark);
}

/* 數量選擇器和購物車按鈕水平排列 */
.product-action-row {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin: 15px 0;
}

.product-action-row .quantity-selector {
    flex: 0 0 auto;
    border: 1px solid var(--border-color, #ddd);
    height: 40px;
    overflow: hidden;
}

.product-action-row .add-to-cart-button {
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 180px;
    flex: 0 0 auto;
}

.product-action-row .stock-info {
    margin-top: 0;
    margin-right: 10px;
}

/* 預購狀態樣式 */
.stock-info.pre-order {
    color: #ff9900;
    font-weight: bold;
}

/* 價格區域 */
.product-price-section {
    margin: 20px 0;
}

.price-amount {
    font-size: 24px;
    font-weight: bold;
    color: #a83240;
    margin: 0 0 15px 0;
}

/* 數量選擇和購買按鈕 */
.quantity-purchase-area {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
    margin-top: 15px;
}

.quantity-selector {
    display: flex;
    align-items: center;
}

.quantity-label {
    font-size: 20px;
    margin-right: 10px;
    color: var(--text-gray);
}

.quantity-control {
    display: flex;
    align-items: center;
    border: 1px solid var(--border-color);
    border-radius: 4px;
    overflow: hidden;
    height: 40px;
}

.quantity-btn {
    width: 40px;
    height: 40px;
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: #f5f5f5;
    border: none;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    transition: background-color 0.2s;
}

.quantity-btn:hover {
    background-color: #e5e5e5;
}

.quantity-input {
    width: 40px;
    height: 100%;
    border: none;
    text-align: center;
    font-size: 16px;
    -moz-appearance: textfield;
    appearance: textfield;
}

.quantity-input::-webkit-outer-spin-button,
.quantity-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    appearance: none;
    margin: 0;
}

.add-to-cart-button {
    background-color: var(--primary-color);
    color: white;
    border: none;
    padding: 12px 24px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.add-to-cart-button:hover {
    background-color: var(--accent-color);
}

.add-to-cart-button.adding {
    pointer-events: none;
    opacity: 0.8;
}

.add-to-cart-button.added {
    background-color: #28a745;
}

.quantity-dropdown {
    display: none;
}

/* 圓形購物車按鈕樣式 */
.circle-cart-btn {
    width: 50px !important;
    height: 50px !important;
    border-radius: 50% !important;
    padding: 0 !important;
    display: flex !important;
    justify-content: center !important;
    align-items: center !important;
    min-width: unset !important;
    transition: all 0.3s ease !important;
}

.circle-cart-btn i {
    font-size: 20px;
    margin: 0;
}

.circle-cart-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
}

.circle-cart-btn:disabled {
    background: #ccc;
    color: #888;
    cursor: not-allowed;
}

/* 促銷橫幅樣式 */
.promotion-banner {
    overflow: visible;
    border-radius: 0;
    box-shadow: none;
    transition: transform 0.3s ease;
    width: 100vw;
    max-width: 100vw;
    position: relative;
    left: 50%;
    right: 50%;
    margin-left: -50vw;
    margin-right: -50vw;
    margin-top: 40px;
    margin-bottom: 40px;
    padding: 0;
}

.promotion-banner:hover {
    transform: translateY(-5px);
}

.promotion-banner a {
    display: block;
    width: 100%;
}

.promotion-banner img {
    width: 100%;
    height: auto;
    display: block;
}

/* 響應式調整 */
@media (max-width: 768px) {
    .promotion-banner {
        margin-top: 20px;
        margin-bottom: 20px;
    }

    .product-details-container {
        gap: 24px;
    }
}

/* 產品介紹 */
.product-introduction {
    margin: 25px 0;
}

.product-introduction h3 {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 15px 0;
    color: #333;
}

.introduction-content {
    font-size: 14px;
    line-height: 1.6;
    color: #444;
}

/* 生產信息 */
.production-information {
    margin: 25px 0;
}

.production-information h3 {
    font-size: 18px;
    font-weight: bold;
    margin: 0 0 15px 0;
    color: #333;
}

.production-info-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.production-info-column {
    display: flex;
    flex-direction: column;
}

.info-item {
    margin-bottom: 10px;
    display: flex;
    align-items: flex-start;
}

.info-label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
    width: 120px;
    flex-shrink: 0;
}

.info-value {
    font-size: 14px;
    color: #333;
    display: flex;
    align-items: center;
}

.country-flag {
    margin-right: 8px;
}

.production-details {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 10px;
}

.detail-row {
    display: flex;
    margin-bottom: 8px;
}

.detail-label {
    font-size: 14px;
    color: #555;
    font-weight: 500;
    width: 120px;
}

.detail-value {
    font-size: 14px;
    color: #333;
}

/* 相似產品區域樣式 */
.similar-products-section {
    margin: 60px auto;
    overflow: hidden;
    width: 1280px;
    max-width: 100%;
    padding: 0 20px;
}

.similar-products-section h2 {
    margin-bottom: 30px;
    text-align: center;
    font-size: 28px;
    font-weight: 700;
    color: var(--text-dark);
}

/* 確保產品滑塊在產品詳情頁正常顯示 */
.product-detail-page .product-slider {
    margin-bottom: 40px;
}

/* 確保產品詳情頁的產品卡片內部元素高度一致 */
.product-detail-page .wineshop_product-card__inner {
    height: calc(100% - 60px);
}

/* 響應式設計 */
@media (max-width: 768px) {
    .product-image-section {
        flex: 0 0 100%;
        width: 100%;
    }
    
    .product-title {
        font-size: 20px;
    }
}

@media (max-width: 640px) {
    .production-info-grid {
        display: block;
    }
}