/* css/payment.css */

#payment-page-content {
    background-color: #EAE4DD; /* Figma: fill_WGEWU9 */
    color: #000000;
    font-family: 'Inter', sans-serif; /* Figma uses Inter extensively here */
    padding: 20px 0; /* Adjusted padding, no horizontal here, handle in children */
    min-height: calc(100vh - 80px); /* Assuming navbar height */
    box-sizing: border-box;
    /* display: none; */ /* Controlled by JS, but for dev set to flex */
    display: flex; /* Make it a flex container */
    flex-direction: column; /* Stack header, main, footer vertically */
    align-items: center; /* Center direct children like .payment-header, .payment-main-content, .payment-footer */
}

.payment-header {
    width: 100%;
    max-width: 860px; /* Match main content */
    margin: 0 auto 20px auto; /* Centered, with bottom margin */
    padding: 0 25px; /* Match horizontal padding of main content */
    box-sizing: border-box;
}

.payment-top-bar {
    padding: 10px 0;
    text-align: left; /* Align back button to left */
    border-bottom: 1px solid #ddd; /* Add a separator line like in Figma */
    margin-bottom: 20px; /* Space below the top bar */
}

.payment-back-btn {
    /* width: auto; */ /* cause common-back-button-img control */
    /* height: 24px; */ /* cause common-back-button-img control */
    /* cursor: pointer; */ /* cause common-back-button-img control */
    /* These styles are now created by global.css hit the target .common-back-button-img control */
    display: inline-block; /* ensure img Apply dimensions correctly as a block level element */
}

.payment-header h2 { /* Page Title e.g., "Confirm Order" */
    font-family: 'Inter', sans-serif; 
    font-weight: 600; 
    font-size: 24px;  
    text-align: center;
    margin: 0;
    padding-top: 10px; 
}

.payment-header-placeholder { 
   display: none;
}

.payment-main-content {
    max-width: 860px; /* Constrain width of payment details - Increased from 700px */
    margin: 0 auto;
    background-color: #FFFFFF; /* White background for content sections */
    padding: 25px;
    border-radius: 10px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.1);
    width: 100%; /* Allow it to take the max-width */
    display: flex;
    flex-direction: column; /* Sections inside stack vertically */
    box-sizing: border-box;
}

.payment-section {
    margin-bottom: 30px;
}
.payment-section:last-of-type {
    margin-bottom: 0;
}

.payment-section h3 {
    font-size: 18px; /* Figma: 16px or 20px, adjusted for web */
    font-weight: 600; /* Figma: Medium or SemiBold */
    margin-bottom: 15px;
    color: #333;
    border-bottom: 1px solid #EFEFEF;
    padding-bottom: 10px;
}

/* Delivery Address - Type Selector */
.address-type-selector {
    display: flex;
    gap: 20px;
    margin-bottom: 20px; /* Increased margin */
    padding: 0; /* Remove padding if labels have enough */
    /* background-color: #f9f9f9; */ /* Removed background for cleaner look */
    border-radius: 8px;
}

.radio-option {
    display: flex;
    align-items: center;
    cursor: pointer;
    font-size: 16px; /* Figma looks around 14-16px */
    color: #333;
}

.radio-option input[type="radio"] {
    margin-right: 8px;
    accent-color: #51393A; /* Match button color for consistency */
    width: 18px; /* Larger radio */
    height: 18px;
}

.radio-option .radio-label {
    font-weight: 400; /* Figma Regular for options */
}

.address-details p{
    font-size: 14px; /* Figma: 14px for address lines */
    line-height: 1.6;
    margin-bottom: 5px;
    color: #555;
}

.address-details p strong {
    font-weight: 600; /* Figma: Name is usually bolder */
    color: #000;
    font-size: 16px; /* Figma: Name is slightly larger */
}

/* Payment Method Options */
.payment-options-container {
    display: flex;
    flex-direction: column; 
    gap: 15px; 
}

.payment-option {
    display: flex;
    align-items: center;
    padding: 15px 20px; 
    border: 1px solid #E0E0E0; 
    border-radius: 10px; 
    cursor: pointer;
    transition: all 0.3s ease;
    background-color: #F8F8F8; 
    color: #333333; 
}

/* Default selected state (like Apple Pay in Figma) */
.payment-option.selected {
    background-color: #333333; /* Dark background like Figma Apple Pay */
    color: #FFFFFF; 
    border-color: #333333; 
}

.payment-option:not(.selected):hover {
    border-color: #AAAAAA;
    background-color: #EFEFEF;
}

.payment-option-icon-placeholder {
    font-size: 22px; 
    margin-right: 15px;
    min-width: 25px; 
    text-align: center;
}

.payment-option.selected .payment-option-icon-placeholder {
    color: #FFFFFF; 
}

.payment-option-text {
    font-weight: 500; 
    font-size: 16px; 
    flex-grow: 1; 
}

.payment-option-detail {
    font-size: 14px;
    color: #777777; 
}

.edit-card-btn {
    background-color: transparent;
    border: 1px solid #ccc;
    border-radius: 4px;
    padding: 5px 10px;
    font-size: 12px;
    color: #555;
    cursor: pointer;
    margin-left: 10px;
    transition: all 0.2s ease;
}

.edit-card-btn:hover {
    background-color: #f5f5f5;
    border-color: #aaa;
}

.payment-option.selected .edit-card-btn {
    color: #51393A;
    border-color: #51393A;
}

.payment-option.selected .payment-option-detail {
    color: #E0E0E0; 
}

/* Specific override for Credit Card when selected (Figma style) */
.payment-option[data-method="creditcard"].selected {
     background-color: #FFFFFF; 
     color: #333333; 
     border: 2px solid #51393A; 
}
.payment-option[data-method="creditcard"].selected .payment-option-icon-placeholder,
.payment-option[data-method="creditcard"].selected .payment-option-text {
    color: #333333; 
}
.payment-option[data-method="creditcard"].selected .payment-option-detail {
    color: #555555;
}


/* Order Summary section - reuse styles from wishlist summary where possible */
.order-summary-section .summary-line {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
    font-size: 14px; /* Figma: 14px for subtotal/shipping labels & values */
}

.order-summary-section .summary-label {
    font-weight: 400;
    color: #333;
}

.order-summary-section .summary-value {
    font-weight: 600; /* Values are usually bolder */
    color: #000000;
}

.order-summary-section .summary-label-total {
    font-weight: 600;
    font-size: 18px; /* Figma: Total is larger, 18-20px */
}

.order-summary-section .summary-value-total {
    font-weight: 700; /* Total value is boldest */
    font-size: 18px;
}

.order-summary-section .summary-divider {
    border: none;
    border-top: 1px solid #E0E0E0;
    margin: 10px 0 15px 0;
}

.payment-footer {
    width: 100%;
    max-width: 860px; 
    margin: 30px auto 0 auto; 
    padding: 0 25px 20px 25px; 
    box-sizing: border-box;
    text-align: center;
}

.place-order-btn {
    display: block;
    width: 100%;
    background-color: #51393A; 
    color: #FFFFFF;
    font-family: 'Inter', sans-serif;
    font-weight: 600; /* Figma: Place to order SemiBold */
    font-size: 18px;  /* Figma: 16-18px approx */
    border: none;
    padding: 15px 20px;
    border-radius: 10px; 
    cursor: pointer;
    text-align: center;
    transition: background-color 0.3s ease;
}

.place-order-btn:hover {
    background-color: #3e2d2d;
} 

/* Modal styles are removed from here */ 

/* Mobile style optimization */
@media (max-width: 768px) {
    #payment-page-content {
        position: fixed !important;
        top: 0 !important;
        left: 0 !important;
        width: 100% !important;
        height: 100vh !important;
        min-height: 100% !important;
        margin: 0 !important;
        padding: 0 !important;
        z-index: 500 !important;
        overflow-y: auto;
    }
    
    .payment-header {
        padding-top: 15px;
    }
    
    .payment-main-content {
        margin-top: 10px;
        width: calc(100% - 30px);
        border-radius: 8px;
    }
    
    .payment-footer {
        width: calc(100% - 30px);
        padding: 15px;
        margin-bottom: 80px; /* Increase bottom margin，Avoid being obscured by the bottom navigation bar */
    }
    
    .place-order-btn {
        margin-bottom: 20px; /* Add bottom spacing for buttons */
    }
} 

/* Credit Card Form Style */
.credit-card-form {
    display: none;
    flex-direction: column;
    margin-top: 15px;
    border: 1px solid #E0E0E0;
    border-radius: 10px;
    padding: 15px;
    background-color: #F8F8F8;
}

.credit-card-form.active {
    display: flex;
}

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

.form-group {
    flex: 1;
    min-width: 200px;
}

.form-group label {
    display: block;
    font-size: 14px;
    color: #555;
    margin-bottom: 5px;
}

.form-group input {
    width: 100%;
    padding: 10px;
    border: 1px solid #ddd;
    border-radius: 5px;
    font-size: 16px;
    outline: none;
}

.form-group input:focus {
    border-color: #51393A;
}

/* Mobile form style */
@media (max-width: 768px) {
    .form-group {
        min-width: 100%;
    }
    
    .form-row {
        flex-direction: column;
        gap: 10px;
    }
    
    .form-group input {
        font-size: 14px;
        padding: 8px;
    }
} 