/**
 * 前台樣式：加價購區塊（卡片式設計）
 * 參考風格：深色背景、獨立區塊
 */

/* 主區塊 - 在產品內容後 */
.wbt-buy-together-section {
    width: 100%;
    max-width: 100%;
    margin: 0 0 40px 0;
    padding: 30px;
    box-sizing: border-box;
    border-radius: 12px;
    background: linear-gradient(135deg, #4a3737 0%, #2d2020 100%);
    color: #fff;
    clear: both;
    overflow: hidden;
}

.wbt-title {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 20px;
    color: #fff;
    text-align: left;
    padding-bottom: 15px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.2);
}

/* 產品網格佈局 */
.wbt-products-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
    gap: 20px;
    margin-bottom: 25px;
    width: 100%;
    box-sizing: border-box;
}

/* 產品卡片 */
.wbt-product-card {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.15);
    border-radius: 10px;
    padding: 15px;
    transition: all 0.3s ease;
    position: relative;
    min-height: 280px;
    display: flex;
    flex-direction: column;
    box-sizing: border-box;
}

.wbt-product-card:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-2px);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.3);
}

/* 產品圖片 */
.wbt-card-image {
    margin-bottom: 12px;
    border-radius: 8px;
    overflow: hidden;
    background: #fff;
    padding: 10px;
    flex-shrink: 0;
}

.wbt-card-image img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    display: block;
}

/* 產品資訊 */
.wbt-card-info {
    margin-bottom: 15px;
    flex-grow: 1;
}

.wbt-product-name {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: #fff;
    margin-bottom: 5px;
    line-height: 1.4;
    min-height: 40px;
}

.wbt-add-on-price {
    display: block;
    font-size: 16px;
    font-weight: 700;
    color: #ffeb3b;
}

.wbt-add-on-price .woocommerce-Price-amount {
    color: #ffeb3b;
}

.wbt-add-on-price del {
    color: rgba(255, 255, 255, 0.5);
    font-size: 12px;
}

.wbt-add-on-price ins {
    color: #ffeb3b;
    text-decoration: none;
}

/* 數量控制 */
.wbt-product-card .wbt-quantity {
    margin: 0 auto 12px;
    display: flex;
    justify-content: center;
}

.wbt-product-card .wbt-quantity.buttons_added {
    display: inline-flex;
    align-items: center;
    background: transparent;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    overflow: hidden;
}

.wbt-product-card .wbt-quantity.buttons_added .minus,
.wbt-product-card .wbt-quantity.buttons_added .plus {
    background: transparent;
    border: none;
    color: #fff;
    width: 32px;
    height: 32px;
    font-size: 18px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.wbt-product-card .wbt-quantity.buttons_added .minus:hover,
.wbt-product-card .wbt-quantity.buttons_added .plus:hover {
    background: rgba(255, 255, 255, 0.2);
}

.wbt-product-card .wbt-quantity.buttons_added .qty,
.wbt-product-card .wbt-qty-input {
    width: 50px;
    text-align: center;
    background: transparent;
    border: none;
    border-left: 1px solid rgba(255, 255, 255, 0.3);
    border-right: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    padding: 5px;
    height: 32px;
    -moz-appearance: textfield;
}

.wbt-product-card .wbt-quantity.buttons_added .qty::-webkit-outer-spin-button,
.wbt-product-card .wbt-quantity.buttons_added .qty::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 變體選擇器 */
.wbt-variation-selector {
    margin-bottom: 12px;
}

.wbt-variation-select {
    width: 100%;
    padding: 8px 12px;
    font-size: 13px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 6px;
    background: rgba(255, 255, 255, 0.9);
    color: #333;
    cursor: pointer;
}

.wbt-variation-select:disabled {
    background: rgba(255, 255, 255, 0.5);
    cursor: not-allowed;
    opacity: 0.6;
}

/* 加入購物車按鈕 - 使用主題預設樣式 */
.wbt-product-card .wbt-add-to-cart-btn {
    width: 100%;
    margin-top: auto;
}

.wbt-product-card .wbt-add-to-cart-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.wbt-product-card .wbt-add-to-cart-btn.loading {
    pointer-events: none;
    opacity: 0.8;
}

/* 底部區域 - 隱藏總價，只保留按鈕（已移除） */
.wbt-footer {
    display: none;
}

/* 訊息 */
.wbt-message {
    margin-top: 15px;
    padding: 12px 20px;
    border-radius: 6px;
    font-weight: 500;
    text-align: center;
}

.wbt-message-success {
    background: rgba(76, 175, 80, 0.9);
    color: #fff;
}

.wbt-message-error {
    background: rgba(244, 67, 54, 0.9);
    color: #fff;
}

/* 載入動畫 */
.wbt-add-to-cart.loading {
    position: relative;
    pointer-events: none;
    opacity: 0.8;
}

.wbt-add-to-cart.loading::after {
    content: '';
    position: absolute;
    width: 20px;
    height: 20px;
    top: 50%;
    left: 50%;
    margin-left: -10px;
    margin-top: -10px;
    border: 3px solid rgba(102, 126, 234, 0.3);
    border-top-color: #667eea;
    border-radius: 50%;
    animation: wbt-spin 0.8s linear infinite;
}

@keyframes wbt-spin {
    to {
        transform: rotate(360deg);
    }
}

/* 響應式設計 */
@media (max-width: 768px) {
    .wbt-products-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .wbt-product-card {
        padding: 10px;
        min-height: 240px;
    }
    
    .wbt-card-image img {
        height: 80px;
    }
    
    .wbt-product-name {
        font-size: 12px;
        min-height: 34px;
    }
    
    .wbt-add-on-price {
        font-size: 14px;
    }
}

@media (max-width: 480px) {
    .wbt-products-grid {
        grid-template-columns: 1fr;
    }
}

/* 產品名稱連結 */
a.wbt-product-name {
    text-decoration: none;
    color: #fff;
    transition: color 0.2s ease;
}

a.wbt-product-name:hover {
    color: #ffeb3b;
}
