/* ===== css/checkout.css - 結帳頁面專用樣式 ===== */

.checkout-section {
    padding: 50px 0;
}

.checkout-progress {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 40px;
}

.progress-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    position: relative;
}

.step-number {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background-color: #eee;
    color: #999;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    margin-bottom: 10px;
}

.progress-step.active .step-number {
    background-color: #4caf50;
    color: white;
}

.step-text {
    font-size: 0.9rem;
    color: #666;
}

.progress-step.active .step-text {
    color: #333;
    font-weight: 500;
}

.progress-line {
    flex-grow: 1;
    height: 2px;
    background-color: #eee;
    margin: 0 15px;
    margin-bottom: 20px;
}

.checkout-container {
    display: flex;
    gap: 30px;
    margin-top: 30px;
}

.checkout-form-container {
    flex: 3;
}

.checkout-summary {
    flex: 2;
    background-color: #f9f9f9;
    padding: 25px;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.05);
    align-self: flex-start;
    position: sticky;
    top: 20px;
}

.form-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #eee;
}

.form-section h2 {
    font-size: 1.3rem;
    margin-bottom: 20px;
    color: #333;
}

.form-row {
    display: flex;
    gap: 15px;
}

.form-row .form-group {
    flex: 1;
}

.form-group {
    margin-bottom: 15px;
}

label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #333;
}

input[type="text"],
input[type="email"],
input[type="tel"],
select,
textarea {
    width: 100%;
    padding: 12px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 1rem;
    transition: border-color 0.3s;
    box-sizing: border-box;
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
select:focus,
textarea:focus {
    border-color: #4caf50;
    outline: none;
}

.required {
    color: #e74c3c;
}

.radio-group {
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.radio-label {
    display: flex;
    align-items: center;
    padding: 15px;
    border: 1px solid #ddd;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.3s;
    position: relative;
}

.radio-label:hover {
    border-color: #4caf50;
}

input[type="radio"] {
    position: absolute;
    opacity: 0;
}

.custom-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #ddd;
    border-radius: 50%;
    margin-right: 15px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s;
}

.custom-radio::after {
    content: '';
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: #4caf50;
    opacity: 0;
    transition: opacity 0.3s;
}

input[type="radio"]:checked + .custom-radio {
    border-color: #4caf50;
}

input[type="radio"]:checked + .custom-radio::after {
    opacity: 1;
}

.radio-info {
    flex-grow: 1;
}

.radio-title {
    display: block;
    font-weight: 500;
    color: #333;
}

.radio-desc {
    display: block;
    font-size: 0.9rem;
    color: #777;
    margin-top: 3px;
}

.radio-price {
    font-weight: 500;
    color: #333;
}

.payment-info {
    margin-top: 15px;
    margin-bottom: 15px;
    padding: 15px;
    background-color: #f5f5f5;
    border-radius: 8px;
    margin-left: 35px;
}

.bank-card {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
    margin-bottom: 15px;
}

.bank-details {
    text-align: center;
}

.bank-name {
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
    margin-bottom: 10px;
}

.bank-account-title {
    font-weight: 500;
    margin-bottom: 5px;
    color: #555;
}

.bank-account-number {
    font-size: 1.1rem;
    margin: 5px 0;
    color: #333;
    font-weight: 500;
}

.bank-notice {
    color: #e74c3c;
    font-weight: 500;
    margin-top: 10px;
}

.payment-note {
    color: #777;
    font-size: 0.9rem;
    margin-top: 10px;
    font-style: italic;
}

.credit-cards {
    display: flex;
    gap: 10px;
    margin-bottom: 15px;
}

.card-logo {
    height: 30px;
    width: auto;
}

.order-items {
    margin-bottom: 20px;
    max-height: 300px;
    overflow-y: auto;
    padding-right: 10px;
}

.order-item {
    display: flex;
    align-items: center;
    padding: 15px 0;
    border-bottom: 1px solid #eee;
}

.item-image {
    position: relative;
    margin-right: 15px;
}

.item-image img {
    width: 60px;
    height: 60px;
    object-fit: cover;
    border-radius: 4px;
}

.item-quantity {
    position: absolute;
    top: -8px;
    right: -8px;
    background-color: #4caf50;
    color: white;
    font-size: 0.8rem;
    width: 22px;
    height: 22px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.item-info {
    flex-grow: 1;
}

.item-info h3 {
    margin: 0;
    font-size: 1rem;
}

.item-info p {
    margin: 5px 0 0 0;
    color: #777;
    font-size: 0.9rem;
}

.item-total {
    font-weight: 500;
}

.summary-row {
    display: flex;
    justify-content: space-between;
    padding: 12px 0;
    border-bottom: 1px solid #eee;
}

.summary-row.total {
    border-bottom: none;
    margin-top: 10px;
    padding-top: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    color: #333;
}

.checkout-actions {
    margin-top: 25px;
    display: flex;
    gap: 10px;
}

.checkout-actions .btn-outline:hover {
    background-color: #4caf50;
    color: white;
}

.checkout-actions .btn-primary:hover {
    background-color: #3d8b40;
    border-color: #3d8b40;
}

/* 手機版底部按鈕 */
.mobile-checkout-actions {
    display: none;
    margin-top: 30px;
    background-color: #fff;
    padding: 15px;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    position: fixed;
    bottom: 0;
    left: 0;
    width: 100%;
    z-index: 100;
    box-sizing: border-box;
}

/* 手機版樣式 */
@media (max-width: 992px) {
    .checkout-container {
        flex-direction: column;
    }
    
    .checkout-summary {
        position: static;
        order: -1;
        margin-bottom: 30px;
    }
    
    /* 在手機版隱藏桌面版按鈕，顯示底部固定按鈕 */
    .checkout-summary .checkout-actions {
        display: none;
    }
    
    .mobile-checkout-actions {
        display: flex;
        gap: 10px;
    }
    
    /* 為底部按鈕區添加底部空間 */
    .checkout-section {
        padding-bottom: 90px; /* 為底部固定按鈕留出空間 */
    }
}

@media (max-width: 768px) {
    .form-row {
        flex-direction: column;
        gap: 0;
    }
    
    .checkout-progress {
        display: none;
    }
    
    /* 優化手機版按鈕區域 - 修復按鈕大小不一致問題 */
    .mobile-checkout-actions {
        padding: 15px 20px;
        display: flex;
        gap: 1rem;
    }
    
    /* 統一按鈕樣式 - 確保 a 標籤和 button 標籤樣式一致 */
    .mobile-checkout-actions .btn {
        /* 統一尺寸 */
        flex: 1;
        height: 48px; /* 固定高度 */
        
        /* 統一布局 */
        display: flex;
        align-items: center;
        justify-content: center;
        
        /* 統一字體 */
        font-size: 1rem;
        font-weight: 600;
        font-family: inherit;
        
        /* 統一邊框和樣式 */
        border: 2px solid transparent;
        border-radius: 8px;
        text-decoration: none;
        cursor: pointer;
        
        /* 過渡效果 */
        transition: all 0.3s ease;
        
        /* 確保文字不換行 */
        white-space: nowrap;
        text-align: center;
        
        /* 防止內容溢出 */
        overflow: hidden;
        text-overflow: ellipsis;
        
        /* 重置默認樣式 */
        outline: none;
        box-sizing: border-box;
    }
    
    /* 返回購物車按鈕樣式 */
    .mobile-checkout-actions .btn-outline {
        background: white;
        color: #666;
        border-color: #ddd;
        margin-right: 0.5rem;
    }
    
    .mobile-checkout-actions .btn-outline:hover {
        background: #f8f9fa;
        border-color: #aaa;
        color: #333;
        transform: translateY(-1px);
    }
    
    /* 提交訂單按鈕樣式 */
    .mobile-checkout-actions .btn-primary {
        background: linear-gradient(135deg, #66bb6a, #4caf50);
        color: white;
        border-color: transparent;
        margin-left: 0.5rem;
    }
    
    .mobile-checkout-actions .btn-primary:hover {
        background: linear-gradient(135deg, #5cb85c, #449d48);
        transform: translateY(-1px);
        box-shadow: 0 4px 12px rgba(102, 187, 106, 0.3);
    }
    
    /* 禁用狀態 */
    .mobile-checkout-actions .btn:disabled {
        opacity: 0.6;
        cursor: not-allowed;
        transform: none !important;
    }
    
    .mobile-checkout-actions .btn:disabled:hover {
        transform: none !important;
        box-shadow: none !important;
    }
}

/* 更小螢幕的優化 */
@media (max-width: 480px) {
    .mobile-checkout-actions {
        padding: 0.8rem;
    }
    
    .mobile-checkout-actions .btn {
        height: 44px;
        font-size: 0.9rem;
    }
    
    .checkout-section {
        padding-bottom: 76px;
    }
}

/* 極小螢幕的優化 */
@media (max-width: 360px) {
    .mobile-checkout-actions .btn {
        height: 40px;
        font-size: 0.85rem;
        padding: 0 0.5rem;
    }
    
    .mobile-checkout-actions {
        gap: 0.5rem;
    }
    
    .mobile-checkout-actions .btn-outline {
        margin-right: 0.25rem;
    }
    
    .mobile-checkout-actions .btn-primary {
        margin-left: 0.25rem;
    }
}