/**
 * YS Taiwan Address Customizer
 * 台灣縣市鄉鎮市區下拉選單樣式
 *
 * @version 1.3.2
 */

/* 下拉選單基本樣式 */
.ys-tw-select {
    width: 100% !important;
    padding: 5px 40px 5px 16px !important;
    font-size: 16px !important;
    line-height: 1em !important;
    height: auto !important;
    min-height: 40px !important;
    border: 1px solid #6160bc !important;
    border-radius: 15px !important;
    background-color: #fff !important;
    appearance: none !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath fill='%236160bc' d='M6 8L1 3h10z'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right 16px center !important;
    cursor: pointer;
    transition: border-color 0.2s, box-shadow 0.2s;
    box-sizing: border-box !important;
}

.ys-tw-select:focus {
    outline: none !important;
    border-color: #4a49a3 !important;
    box-shadow: 0 0 0 3px rgba(97, 96, 188, 0.2) !important;
}

.ys-tw-select:hover {
    border-color: #4a49a3 !important;
}

/* =====================================================
   我的帳號頁面 - 欄位佈局
   ===================================================== */

/* 所有欄位預設 100% 寬度 */
.woocommerce-address-fields .form-row {
    width: 100% !important;
    float: none !important;
    display: block !important;
    margin-bottom: 20px !important;
    clear: both !important;
}

/* 姓名欄位 50% 並排 */
.woocommerce-address-fields #billing_first_name_field,
.woocommerce-address-fields #shipping_first_name_field {
    width: 48% !important;
    display: inline-block !important;
    vertical-align: top !important;
    margin-right: 4% !important;
    clear: none !important;
}

.woocommerce-address-fields #billing_last_name_field,
.woocommerce-address-fields #shipping_last_name_field {
    width: 48% !important;
    display: inline-block !important;
    vertical-align: top !important;
    margin-right: 0 !important;
    clear: none !important;
}

/* 郵遞區號、縣市、鄉鎮市區 - 全部 100% 獨立一行 */
.woocommerce-address-fields #billing_postcode_field,
.woocommerce-address-fields #shipping_postcode_field,
.woocommerce-address-fields #billing_state_field,
.woocommerce-address-fields #shipping_state_field,
.woocommerce-address-fields #billing_city_field,
.woocommerce-address-fields #shipping_city_field {
    width: 100% !important;
    display: block !important;
    float: none !important;
    clear: both !important;
}

/* 地址、電話、電子郵件 - 100% */
.woocommerce-address-fields #billing_address_1_field,
.woocommerce-address-fields #billing_address_2_field,
.woocommerce-address-fields #billing_phone_field,
.woocommerce-address-fields #billing_email_field,
.woocommerce-address-fields #shipping_address_1_field,
.woocommerce-address-fields #shipping_address_2_field,
.woocommerce-address-fields #shipping_phone_field {
    width: 100% !important;
    display: block !important;
    clear: both !important;
}

/* 隱藏國家欄位 */
.woocommerce-address-fields #billing_country_field,
.woocommerce-address-fields #shipping_country_field {
    display: none !important;
}

/* 確保原始 input 隱藏 */
#billing_state,
#billing_city,
#shipping_state,
#shipping_city {
    display: none !important;
}

/* =====================================================
   結帳頁面相容性
   ===================================================== */
.woocommerce-checkout .ys-tw-select {
    height: auto !important;
    min-height: 40px !important;
}

/* =====================================================
   響應式
   ===================================================== */
@media (max-width: 768px) {
    .woocommerce-address-fields #billing_first_name_field,
    .woocommerce-address-fields #billing_last_name_field,
    .woocommerce-address-fields #shipping_first_name_field,
    .woocommerce-address-fields #shipping_last_name_field {
        width: 100% !important;
        margin-right: 0 !important;
        display: block !important;
    }
}
