* {
    margin: 0;
    padding: 0;
    box-sizing: border-box
}

body {
    font-family: Segoe UI, Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background-color: #f5f5f5;
    min-height: 100vh
}

.checkout-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 40px 20px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    min-height: 100vh
}

.product-section {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px #0000001a;
    height: fit-content
}

.price-box {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 25px;
    text-align: center
}

.price {
    font-size: 1.5rem;
    font-weight: 600;
    color: #2c3e50
}

.product-info {
    margin-bottom: 25px
}

.product-item {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-bottom: 20px
}

.product-icon {
    font-size: 2rem;
    width: 50px;
    height: 50px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #f8f9fa;
    border-radius: 8px
}

.product-details h3 {
    font-size: 1.2rem;
    color: #2c3e50;
    margin-bottom: 5px
}

.product-details p {
    color: #666;
    font-size: .9rem;
    margin-bottom: 5px
}

.price-detail {
    font-weight: 600;
    color: #2c3e50
}

.quantity-selector {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px
}

.qty-btn {
    width: 35px;
    height: 35px;
    border: 2px solid #e1e8ed;
    background: #fff;
    border-radius: 6px;
    cursor: pointer;
    font-size: 1.2rem;
    font-weight: 600;
    color: #666;
    transition: all .3s ease
}

.qty-btn:hover {
    border-color: #3498db;
    color: #3498db
}

.quantity {
    font-size: 1.1rem;
    font-weight: 600;
    min-width: 30px;
    text-align: center
}

.order-summary {
    background: #f8f9fa;
    border-radius: 8px;
    padding: 20px
}

.summary-item {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-size: .95rem
}

.summary-item.total {
    font-weight: 600;
    font-size: 1.1rem;
    color: #2c3e50;
    border-top: 1px solid #e1e8ed;
    padding-top: 10px;
    margin-top: 10px
}

.payment-section {
    background: #fff;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 4px 20px #0000001a;
    height: fit-content
}

.payment-methods {
    display: flex;
    gap: 15px;
    margin-bottom: 25px
}

.payment-option {
    flex: 1
}

.payment-option input[type=radio] {
    display: none
}

.payment-option label {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 15px 20px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    cursor: pointer;
    transition: all .3s ease;
    font-weight: 500;
    background: #fff;
    color: #666
}

.payment-option input[type=radio]:checked+label {
    border-color: #0070ba;
    background-color: #0070ba;
    color: #fff
}

.payment-option input[type=radio]:checked+label svg {
    fill: #fff;
    stroke: #fff
}

.payment-option label:hover {
    border-color: #0070ba;
    background-color: #f0f8ff;
    color: #0070ba
}

.payment-option label:hover svg {
    fill: #0070ba;
    stroke: #0070ba
}

.email-input {
    margin-bottom: 20px
}

.email-input label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555
}

.email-input input {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    transition: border-color .3s ease
}

.email-input input:focus {
    outline: none;
    border-color: #0070ba;
    box-shadow: 0 0 0 3px #0070ba1a
}

.country-selector {
    margin-bottom: 20px
}

.country-selector label {
    display: block;
    margin-bottom: 8px;
    font-weight: 500;
    color: #555
}

.country-selector select {
    width: 100%;
    padding: 12px 15px;
    border: 2px solid #e1e8ed;
    border-radius: 8px;
    font-size: 16px;
    background: #fff;
    cursor: pointer;
    transition: border-color .3s ease
}

.country-selector select:focus {
    outline: none;
    border-color: #0070ba
}

.security-notice {
    font-size: .85rem;
    color: #666;
    margin-bottom: 25px;
    line-height: 1.4
}

.paypal-button-container {
    margin-bottom: 30px;
    text-align: center
}

.paypal-button-container .paypal-button {
    width: 100%;
    max-width: 300px;
    margin: 0 auto
}

/* 成功訊息樣式和寬度限制 */
.success-message-box {
    /* 核心樣式 - 複製您原來的成功內聯樣式 */
    background: #d4edda;
    border: 1px solid #c3e6cb;
    color: #155724;
    padding: 20px;
    border-radius: 8px;
    
    /* 關鍵：限制寬度並居中 */
    max-width: 400px; 
    margin: 20px auto; /* 垂直邊距 20px，水平 auto 實現居中 */
    width: 100%; /* 確保 max-width 能正確運作 */
    box-sizing: border-box;
    word-break: break-all;
}

.paypal-marks,
.paypal-messages {
    margin-bottom: 20px;
    text-align: center
}

.paypal-button-container .paypal-button-row {
    display: flex;
    justify-content: center
}

.paypal-button-container .paypal-button-layout-vertical {
    width: 100%
}

@media (max-width: 480px) {
    .paypal-button-container .paypal-button {
        max-width: 100%
    }
}

.legal-info {
    font-size: .8rem;
    color: #666;
    line-height: 1.4
}

.legal-info p {
    margin-bottom: 10px
}

.legal-links {
    margin-top: 15px
}

.legal-links a {
    color: #0070ba;
    text-decoration: none
}

.legal-links a:hover {
    text-decoration: underline
}

.loading {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: #ffffffe6;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 1000
}

.spinner {
    width: 50px;
    height: 50px;
    border: 5px solid #f3f3f3;
    border-top: 5px solid #0070ba;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px
}

@keyframes spin {
    0% {
        transform: rotate(0)
    }

    to {
        transform: rotate(360deg)
    }
}

@media (max-width: 768px) {
    .checkout-container {
        grid-template-columns: 1fr;
        gap: 20px;
        padding: 20px 10px
    }

    .product-section,
    .payment-section {
        padding: 20px
    }

    .payment-methods {
        flex-direction: column;
        gap: 10px
    }

    .product-item {
        flex-direction: column;
        text-align: center;
        gap: 10px
    }

    .quantity-selector {
        justify-content: center
    }
}

.fade-in {
    animation: fadeIn .5s ease-in
}

@keyframes fadeIn {
    0% {
        opacity: 0;
        transform: translateY(20px)
    }

    to {
        opacity: 1;
        transform: translateY(0)
    }
}

.slide-in {
    animation: slideIn .3s ease-out
}

@keyframes slideIn {
    0% {
        transform: translate(-100%)
    }

    to {
        transform: translate(0)
    }
}