.order-form-wrapper h2 {
	margin-top: 0.5rem !important;
	margin-bottom: 0.5rem !important;
}

.moriforms-required-star {
  color: #ff0000; /* 紅色 */
  font-weight: bold;
}

/* =========================================
   1. 容器與區塊卡片樣式 (Product Summary & Customer Info)
   ========================================= */
.order-form-wrapper {
    max-width: 1200px; /* 限制最大寬度，避免在大螢幕太寬 */
    margin: 0 auto;
}

/* 讓兩個主要區塊看起來像卡片 */
.order-summary-wrapper,
.customer-info-wrapper {
    padding: 2em;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    margin-bottom: 2em; /* 區塊之間的距離 */
    background-color: #fff;
}

/* 標題樣式 */
.order-summary-wrapper h2,
.customer-info-wrapper h2 {
    font-size: 1.5em;
    font-weight: bold;
    margin-top: 0;
    margin-bottom: 1em;
    padding-bottom: 0.5em;
    border-bottom: 1px solid #eee; /* 標題下方的分隔線 */
    color: #333;
}

/* =========================================
   2. 產品摘要區塊 (Product Summary Specific)
   ========================================= */
.summary-item {
    padding: 0.5em 0;
    font-size: 1.1em;
    display: flex;
    align-items: center;
}

.summary-item strong {
    min-width: 100px;
    color: #555;
}

/* 數量輸入框微調 */
#quantity-input {
    padding: 5px;
    border: 1px solid #ccc;
    border-radius: 4px;
    font-size: 1em;
}

/* =========================================
   3. 表單欄位排版 (Grid Layout)
   ========================================= */
.form-fields-container {
    display: grid;
    grid-template-columns: repeat(3, 1fr); /* 預設三欄 */
    gap: 1.5em; /* 欄位間距 */
    align-items: start;
}

/* --- 跨欄位設定 (關鍵佈局) --- */

/* 1. 產品需求類型 (Checkbox) -> 跨滿整行 */
#field-wrapper-inquiry_types {
    grid-column: 1 / -1;
    border: none; /* 移除 fieldset 預設邊框 */
    padding: 0;
    margin-bottom: -1em;
}

/* 2. 產品洽詢內容 (Textarea) -> 跨滿整行 */
#field-wrapper-inquiry_content {
    grid-column: 1 / -1;
}

/* 3. 電子郵件 -> 跨兩欄 (為了補齊最後一行) */
/* 排列邏輯：手機(1) + Email(2) = 3欄 */
#field-wrapper-customer_email {
    grid-column: span 2;
}

/* =========================================
   4. 輸入框與標籤通用樣式
   ========================================= */
.moriforms-field-wrapper,
.form-field-wrapper {
    display: flex;
    flex-direction: column;
}

.moriforms-field-label,
.form-field-wrapper label {
    font-weight: bold;
    margin-bottom: 0.5em;
    color: #333;
    display: block;
}

/* 輸入框樣式 */
.form-field-wrapper input[type="text"],
.form-field-wrapper input[type="tel"],
.form-field-wrapper input[type="email"],
.form-field-wrapper textarea {
    width: 100%;
    padding: 0.8em;
    border: 1px solid #ccc;
    border-radius: 4px;
    box-sizing: border-box; /* 確保 padding 不會撐大寬度 */
    font-size: 1em;
    transition: border-color 0.3s;
}

.form-field-wrapper input:focus,
.form-field-wrapper textarea:focus {
    border-color: #007bff;
    outline: none;
}

.form-field-wrapper textarea {
    min-height: 120px;
    resize: vertical;
}

/* 錯誤訊息 */
.moriforms-field-error {
    color: #d9534f;
    font-size: 0.9em;
    margin-top: 5px;
    min-height: 1.2em; /* 預留高度避免跳動 */
}

/* =========================================
   5. Checkbox 特殊樣式 (水平排列)
   ========================================= */
.moriforms-checkbox-wrapper legend {
    font-size: 1.1em;
    font-weight: bold;
    margin-bottom: 0.8em;
}

.moriforms-checkbox-item {
    display: inline-flex; /* 讓 Checkbox 橫排 */
    align-items: center;
    margin-right: 1.5em;
    margin-bottom: 0.5em;
    cursor: pointer;
}

.moriforms-checkbox-item input {
    margin-right: 0.5em;
    width: 16px;
    height: 16px;
    cursor: pointer;
}

.moriforms-checkbox-item label {
    font-weight: normal;
    margin-bottom: 0;
    cursor: pointer;
}

/* =========================================
   6. 按鈕樣式 (Form Footer)
   ========================================= */
.form-footer {
    text-align: center;
    margin-top: 2em;
}

.form-footer button[type="submit"] {
    background-color: #007bff;
    color: white;
    font-size: 1.1em;
    padding: 10px 40px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.2s;
}

.form-footer button[type="submit"]:hover {
    background-color: #0056b3;
}

/* =========================================
   7. RWD 響應式設定 (手機版)
   ========================================= */
@media (max-width: 768px) {
    .order-summary-wrapper,
    .customer-info-wrapper {
        padding: 1.5em; /* 手機版內距縮小 */
    }

    .form-fields-container {
        grid-template-columns: 1fr; /* 改為單欄 */
        gap: 1em;
    }

    /* 手機版取消跨欄設定，全部佔滿一行 */
    #field-wrapper-inquiry_types,
    #field-wrapper-inquiry_content,
    #field-wrapper-customer_email {
        grid-column: 1;
    }
    
    /* Checkbox 在極小螢幕變成垂直堆疊比較好點 */
    .moriforms-checkbox-item {
        display: flex;
        margin-right: 0;
    }
}

/* =========================================
   修正：產品需求類型 (複選) 橫向排列
   ========================================= */

/* 1. 確保父容器允許內容流動 */
#field-wrapper-inquiry_types {
    display: block; /* 確保 fieldset 是區塊，讓內容自然排列 */
    width: 100%;
}

/* 2. 針對每一個選項強制改為橫向 (Inline-Flex) */
#field-wrapper-inquiry_types .moriforms-checkbox-item {
    display: inline-flex !important; /* 強制並排顯示 */
    align-items: center;             /* 讓框框跟文字垂直置中 */
    width: auto !important;          /* 避免被其他樣式撐開成 100% */
    margin-right: 1.5em;             /* 選項之間的右側間距 */
    margin-bottom: 0.8em;            /* 下方間距 (以防視窗縮小換行時太擠) */
    vertical-align: middle;
}

/* 微調 input 與 label 的間距 */
#field-wrapper-inquiry_types .moriforms-checkbox-item input {
    margin-right: 6px;
    margin-top: 0; /* 修正有些表單 input 會跑版 */
}

/* =========================================
   RWD 手機版設定 (手機上還是直排比較好點擊)
   ========================================= */
@media (max-width: 768px) {
    #field-wrapper-inquiry_types .moriforms-checkbox-item {
        display: flex !important; /* 手機版改回 Flex 佔滿一行 */
        width: 100% !important;
        margin-right: 0;
        margin-bottom: 0.8em;
    }
}