/* 
 * WooCommerce 快速下單插件 - 完整樣式表
 * 版本: 7.1.0 
 */

/* --- 1. 容器基礎樣式 --- */
#wqo-modal {
    max-width: 600px;
    margin: 30px auto;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
    padding: 25px;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    box-sizing: border-box;
    overflow: visible !important; /* 確保內容不會被截斷 */
}

#wqo-modal h2 {
    color: #333;
    font-size: 1.4rem;
    font-weight: 700;
    text-align: center;
    margin-top: 0;
    margin-bottom: 25px !important;
    line-height: 1.4;
}

/* --- 2. 欄位群組修正 --- */
.wqo-field-group {
    margin-bottom: 20px !important;
    position: relative;
    height: auto !important; /* 修正遮擋關鍵：高度自適應 */
    display: block;
    width: 100%;
}

.wqo-field-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 15px;
}

/* --- 3. 核心修正：解決文字遮擋與顯示不全 --- */
.wqo-attr-select,
#wqo-store-list,
#wqo-city,
#wqo-dist,
.wqo-field-group input[type="text"],
.wqo-field-group input[type="tel"],
.wqo-field-group textarea {
    width: 100% !important;
    display: block !important;
    
    /* 高度與行高：這是解決文字截斷一半的核心 */
    height: auto !important; 
    min-height: 48px !important; 
    line-height: 1.6 !important;
    
    /* 內邊距：給予文字足夠的呼吸空間 */
    padding: 10px 15px !important;
    
    /* 字體大小：16px 在手機端不會觸發自動放大，最適合閱讀 */
    font-size: 16px !important;
    
    /* 樣式外觀 */
    border: 1.5px solid #ddd !important;
    border-radius: 10px !important;
    background-color: #fafafa !important;
    color: #333 !important;
    box-sizing: border-box !important;
    transition: border-color 0.2s, box-shadow 0.2s;
}

/* 焦點狀態 */
.wqo-attr-select:focus,
#wqo-store-list:focus,
.wqo-field-group input:focus {
    border-color: #ff4757 !important;
    background-color: #fff !important;
    box-shadow: 0 0 0 3px rgba(255, 71, 87, 0.1) !important;
    outline: none !important;
}

/* --- 4. 新增：超商品牌按鈕樣式 --- */
.wqo-brand-buttons { 
    display: flex; 
    gap: 10px; 
    margin-bottom: 12px; 
}
.wqo-b-btn { 
    flex: 1; 
    height: 46px; 
    border: 1px solid #ddd; 
    border-radius: 12px; 
    background: #fff; 
    cursor: pointer; 
    font-weight: 600; 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    transition: all 0.2s;
    font-size: 14px; 
    color: #333;
    padding: 0;
}
.wqo-b-btn img { 
    width: 22px !important; 
    height: 22px !important; 
    margin-right: 8px !important; 
    object-fit: contain !important; /* 確保圖標比例不變形 */
    vertical-align: middle !important; /* 確保與文字對齊 */
}
/* 按鈕內的圖示 */
.wqo-icon {
    width: 18px;
    height: 18px;
    margin-right: 5px;
    object-fit: contain;
}

/* 手機端特別優化 (螢幕小於 480px 時) */
@media screen and (max-width: 480px) {
    .wqo-brand-buttons {
        gap: 6px;
    }
    
    .wqo-b-btn {
        font-size: 13px;
        padding: 12px 2px; /* 增加高度更方便手指點擊 */
    }
    .wqo-b-btn img { 
    display: block;
   }
}
/* 按鈕選中狀態 */
.wqo-b-btn.active { 
    border-color: #2e7d32; 
    background: #f1f8f1; 
    color: #2e7d32; 
    box-shadow: 0 0 8px rgba(46,125,50,0.15); 
    border-width: 2px; 
}

/* --- 5. 搜尋與排版優化 --- */
#wqo-store-search {
    border: 1.5px dashed #ffb300 !important; /* 搜尋框用虛線區分 */
    background-color: #fffde7 !important;
}

/* 縣市與區域並排 */
div[style*="display:flex"] {
    gap: 10px !important;
}

/* --- 6. 按鈕樣式 --- */
#wqo-open-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #ff6b81, #ff4757);
    color: white;
    border: none;
    border-radius: 30px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    box-shadow: 0 4px 15px rgba(255, 71, 87, 0.3);
    margin: 15px 0;
}

#wqo-submit {
    width: 100%;
    padding: 16px;
    background: #bf0a2c;
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 18px;
    font-weight: bold;
    cursor: pointer;
    margin-top: 20px;
    transition: background 0.3s;
}

#wqo-submit:hover {
    background: #94094b;
}

#wqo-submit:disabled {
    background: #ccc;
}

/* --- 7. 響應式微調 (手機端) --- */
@media (max-width: 480px) {
    #wqo-modal {
        margin: 15px 10px;
        padding: 20px 15px;
    }
    
    .wqo-attr-select,
    #wqo-store-list {
        font-size: 15px !important; /* 手機端字體稍微縮小一點點 */
        padding: 12px 10px !important;
    }

    #wqo-open-btn {
        font-size: 16px;
    }
}

/* 禁用按鈕的通用樣式 */
#wqo-submit:disabled, #wqo-open-btn:disabled {
    background-color: #cccccc !important;
    color: #666666 !important;
    cursor: not-allowed !important;
    box-shadow: none !important;
    transform: none !important; /* 取消 hover 縮放效果 */
}

/* --- 2. 產品資訊：圖片與標題一行顯示 --- */
.wqo-product-info { 
    display: flex; 
    align-items: center; 
    gap: 15px; 
    margin-bottom: 15px; 
    padding-bottom: 15px; 
    border-bottom: 1px dashed #eee; 
}
.wqo-p-img-box img { 
    width: 65px !important; 
    height: 65px !important; 
    border-radius: 12px; 
    object-fit: cover; 
    border: 1px solid #f0f0f0;
}
.wqo-p-details { 
    flex: 1; 
    min-width: 0; 
}
.wqo-p-title { 
    margin: 0 0 4px 0 !important; 
    font-size: 15px !important; 
    font-weight: 700 !important; 
    color: #333; 
    line-height: 1.3 !important;
    display: -webkit-box;
    -webkit-line-clamp: 2; 
    -webkit-box-orient: vertical;
    overflow: hidden;
}
#wqo-display-price { color: #d32f2f; font-weight: 800; font-size: 17px; }
