/**
 * WooGoPro One Page Checkout Styles
 * 
 * Responsive design for desktop and mobile
 * Taiwan specific styles
 */

/* 全局樣式 */
.woogopro-1pc-wrapper {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans, Ubuntu, Cantarell, "Helvetica Neue", "Noto Sans TC", "微軟正黑體", "Microsoft JhengHei", "蘋方-繁", sans-serif;
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    color: #333;
}

/* 區塊樣式 */
.woogopro-1pc-section {
    background-color: #fff;
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
    padding: 20px;
    margin-bottom: 30px;
}

/* 標題樣式 */
.woogopro-1pc-wrapper h2, 
.woogopro-1pc-wrapper h3 {
    color: #333;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 12px;
    margin-bottom: 20px;
    font-weight: 500;
}

/* 購物車表格樣式 */
.woogopro-1pc-cart-section table {
    width: 100%;
    border-collapse: collapse;
}

.woogopro-1pc-cart-section table th {
    background-color: #f7f7f7;
    padding: 12px 10px;
    font-weight: 500;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.woogopro-1pc-cart-section table td {
    padding: 15px 10px;
    border-bottom: 1px solid #f0f0f0;
    vertical-align: middle;
}

/* 產品圖片樣式 */
.woogopro-1pc-cart-section .product-thumbnail img {
    width: 60px;
    height: auto;
    border-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

/* 產品名稱樣式 */
.woogopro-1pc-cart-section .product-name a {
    color: #333;
    font-weight: 500;
    text-decoration: none;
    transition: color 0.2s;
}

.woogopro-1pc-cart-section .product-name a:hover {
    color: #0073aa;
}

/* 數量控制樣式 */
.woogopro-quantity-controls {
    display: flex;
    align-items: center;
    justify-content: flex-start;
}

.woogopro-qty-btn {
    width: 30px;
    height: 30px;
    background-color: #f5f5f5;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 16px;
    line-height: 1;
    font-weight: bold;
    color: #555;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.woogopro-qty-btn:hover {
    background-color: #e9e9e9;
}

.woogopro-qty-input {
    text-align: center;
    min-width: 40px;
    height: 30px;
    border: 1px solid #ddd;
    border-radius: 4px;
    margin: 0 8px !important;
    padding: 2px 5px !important;
    font-size: 14px !important;
}

/* 移除按鈕樣式 */
.woogopro-remove-item {
    color: #b22!important;
    font-size: 18px;
    font-weight: 700;
    text-decoration: none !important;
    display: inline-block;
    width: 24px;
    height: 24px;
    line-height: 22px;
    text-align: center;
    border-radius: 50%;
    transition: all 0.2s;
}

.woogopro-remove-item:hover {
    background-color: #f2dede;
    color: #a00 !important;
}

/* 表單樣式 */
.woogopro-1pc-checkout-fields-section label {
    font-weight: 500;
    margin-bottom: 5px;
    display: block;
}

.woogopro-1pc-checkout-fields-section .required {
    color: #e25c4a;
    font-weight: 700;
    border: 0 !important;
    text-decoration: none;
}

.woogopro-1pc-checkout-fields-section input[type="text"],
.woogopro-1pc-checkout-fields-section input[type="tel"],
.woogopro-1pc-checkout-fields-section input[type="email"],
.woogopro-1pc-checkout-fields-section select {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    background-color: #f9f9f9;
    font-size: 16px;
    transition: all 0.3s;
}

.woogopro-1pc-checkout-fields-section input[type="text"]:focus,
.woogopro-1pc-checkout-fields-section input[type="tel"]:focus,
.woogopro-1pc-checkout-fields-section input[type="email"]:focus,
.woogopro-1pc-checkout-fields-section select:focus {
    border-color: #0073aa;
    outline: none;
    box-shadow: 0 0 0 1px rgba(0, 115, 170, 0.3);
    background-color: #fff;
}

.woogopro-1pc-checkout-fields-section .form-row {
    margin-bottom: 20px;
}

/* 表單欄位排版 */
@media (min-width: 768px) {
    .woocommerce-billing-fields__field-wrapper {
        display: flex;
        flex-wrap: wrap;
        margin-left: -15px;
        margin-right: -15px;
    }
    
    .woocommerce-billing-fields__field-wrapper .form-row {
        padding: 0 15px;
        margin-bottom: 25px;
    }
    
    .form-row-first,
    .form-row-last {
        width: 50%;
    }
    
    #wg1pc_billing_name_field,
    #wg1pc_billing_phone_field {
        width: 50%;
    }
    
    #wg1pc_billing_city_field,
    #wg1pc_billing_district_field {
        width: 50%;
    }
}

/* 訂單摘要樣式 */
.woogopro-1pc-order-review-section .shop_table {
    width: 100%;
    border-collapse: collapse;
}

.woogopro-1pc-order-review-section .shop_table th,
.woogopro-1pc-order-review-section .shop_table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #eee;
}

.woogopro-1pc-order-review-section .shop_table tr.order-total {
    font-size: 18px;
    background-color: #f9f9f9;
}

.woogopro-1pc-order-review-section .shop_table tr.order-total th,
.woogopro-1pc-order-review-section .shop_table tr.order-total td {
    padding-top: 15px;
    padding-bottom: 15px;
    border-bottom: none;
}

.woogopro-1pc-order-review-section .shop_table tr.order-total td strong {
    color: #e25c4a;
}

/* 前往付款按鈕樣式 */
#place_order {
    background-color: #0073aa;
    border-color: #0073aa;
    color: white;
    font-weight: 500;
    padding: 14px 28px;
    font-size: 17px;
    border-radius: 6px;
    margin-top: 20px;
    transition: all 0.3s;
    width: 100%;
    text-transform: none;
}

#place_order:hover {
    background-color: #005b88;
    border-color: #005b88;
}

/* 訊息樣式 */
.woocommerce-info {
    padding: 15px 20px;
    margin-bottom: 20px;
    background-color: #f0f8ff;
    border-left: 4px solid #0073aa;
    border-radius: 4px;
    color: #333;
}

.woocommerce-info a.button {
    background-color: #0073aa;
    color: white;
    border: none;
    padding: 8px 15px;
    border-radius: 4px;
    margin-left: 10px;
    font-weight: normal;
    transition: background-color 0.2s;
}

.woocommerce-info a.button:hover {
    background-color: #005b88;
}

/* 支付部分樣式 */
.woogopro-1pc-payment-section {
    background-color: #f9f9f9;
    border-radius: 6px;
    padding: 15px;
    margin-bottom: 20px;
}

.woogopro-1pc-payment-section p {
    margin: 0;
    color: #666;
}

/* 響應式移動設備樣式 */
@media (max-width: 767px) {
    /* 隱藏表頭 */
    .woogopro-1pc-cart-section table thead {
        display: none;
    }
    
    /* 將表格轉為卡片設計 */
    .woogopro-1pc-cart-section table, 
    .woogopro-1pc-cart-section tbody, 
    .woogopro-1pc-cart-section tr, 
    .woogopro-1pc-cart-section td {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }
    
    .woogopro-1pc-cart-section tr {
        margin-bottom: 20px;
        border: 1px solid #eee;
        border-radius: 8px;
        overflow: hidden;
        position: relative;
        padding-top: 35px; /* 為移除按鈕留出空間 */
    }
    
    /* 設置標題前的偽元素 */
    .woogopro-1pc-cart-section td::before {
        content: attr(data-title);
        font-weight: 600;
        display: block;
        color: #666;
        margin-bottom: 5px;
    }
    
    /* 移除按鈕定位 */
    .woogopro-1pc-cart-section td.product-remove {
        position: absolute;
        top: 10px;
        right: 10px;
        border: none;
        padding: 0;
    }
    
    /* 調整縮圖和產品名稱 */
    .woogopro-1pc-cart-section td.product-thumbnail {
        text-align: center;
        border-bottom: none;
        padding-bottom: 0;
    }
    
    .woogopro-1pc-cart-section td.product-name {
        text-align: center;
        padding-top: 10px;
    }
    
    /* 數量控制對齊 */
    .woogopro-1pc-cart-section .woogopro-quantity-controls {
        justify-content: center;
    }
    
    /* 小計加粗並居中 */
    .woogopro-1pc-cart-section td.product-subtotal {
        font-weight: bold;
        text-align: center;
        background-color: #f9f9f9;
    }
    
    /* 訂單摘要在手機上調整 */
    .woogopro-1pc-order-review-section .shop_table th,
    .woogopro-1pc-order-review-section .shop_table td {
        padding: 12px 10px;
    }
    
    /* 調整按鈕大小 */
    #place_order {
        padding: 15px 20px;
        font-size: 16px;
    }
}

/* iOS 設備樣式優化 */
@supports (-webkit-touch-callout: none) {
    /* 修復 iOS 設備上的圓角輸入問題 */
    input[type="text"],
    input[type="tel"],
    input[type="email"],
    select {
        -webkit-appearance: none;
        border-radius: 6px !important;
    }
    
    /* 修復 iOS 設備上的按鈕樣式 */
    button, 
    input[type="submit"] {
        -webkit-appearance: none;
        border-radius: 6px !important;
    }
}

/* 購物車為空時的樣式 */
.woocommerce-info {
    font-size: 16px;
    line-height: 1.6;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
}

@media (max-width: 576px) {
    .woocommerce-info {
        flex-direction: column;
        text-align: center;
    }
    
    .woocommerce-info a.button {
        margin-top: 10px;
        margin-left: 0;
    }
}

/* 消息通知樣式 */
#woogopro-1pc-notices-wrapper {
    margin-bottom: 20px;
}

/* 轉場動畫 */
.woogopro-1pc-section {
    transition: opacity 0.3s, transform 0.3s;
}

@keyframes fadeIn {
    from {opacity: 0; transform: translateY(10px);}
    to {opacity: 1; transform: translateY(0);}
}

.woogopro-1pc-wrapper {
    animation: fadeIn 0.5s ease-out;
}