:root {
    --bg-color: #ffffff;
    --text-primary: #333333;
    --text-secondary: #666666;
    --border-color: #e5e7eb;
    --border-focus: #10b981;
    --success-green: #10b981;
    --success-light: #ecfdf5;
    --primary-color: #22c55e;
    --primary-hover: #16a34a;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-primary);
    line-height: 1.5;
}

/* Header */
.checkout-header {
    display: flex;
    justify-content: center;
    padding: 15px 20px;
    border-bottom: 1px solid var(--border-color);
    margin-bottom: 30px;
}
.checkout-header .main-logo {
    height: 35px;
    width: auto;
    display: block;
}

/* Layout */
.checkout-container {
    display: flex;
    flex-direction: column-reverse; /* Mobile default: Summary at bottom or top depending on preference, actually typical is summary at top or right. In mobile let's put summary below form */
    max-width: 1000px;
    margin: 0 auto;
    padding: 0 20px 60px;
    gap: 40px;
}

@media (min-width: 768px) {
    .checkout-container {
        flex-direction: row;
        align-items: flex-start;
    }
    .checkout-form-section {
        flex: 1.2;
    }
    .order-summary-section {
        flex: 1;
        position: sticky;
        top: 20px;
    }
}

/* Reserved Banner */
.reserved-banner {
    background-color: var(--success-light);
    color: #065f46;
    padding: 12px 16px;
    border-radius: 6px;
    border: 1px solid #a7f3d0;
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 0.9rem;
    margin-bottom: 30px;
}
.reserved-banner i {
    font-size: 1.1rem;
}

/* Form Sections */
.form-section {
    margin-bottom: 35px;
}
.section-title {
    font-size: 1.2rem;
    font-weight: 700;
    margin-bottom: 15px;
}

/* Inputs */
.input-group {
    margin-bottom: 12px;
    position: relative;
    width: 100%;
}
.input-row {
    display: flex;
    gap: 12px;
}
.input-row .input-group {
    flex: 1;
}

input[type="text"],
input[type="email"],
input[type="tel"],
.standard-select {
    width: 100%;
    height: 50px;
    padding: 0 14px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    font-size: 1rem;
    color: var(--text-primary);
    transition: all 0.2s ease;
    background-color: #fff;
    font-family: inherit;
    appearance: none;
}
.standard-select {
    padding-right: 35px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
}
input:focus, .standard-select:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 1px var(--border-focus);
}
input::placeholder {
    color: #999;
}

.input-icon, .select-icon {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    color: var(--text-secondary);
    pointer-events: none;
    font-size: 0.9rem;
}

/* Phone Group */
.phone-group {
    display: flex;
}
.country-code {
    width: 115px;
    height: 50px;
    padding: 0 35px 0 12px;
    border: 1px solid var(--border-color);
    border-right: none;
    border-top-right-radius: 0;
    border-bottom-right-radius: 0;
    border-top-left-radius: 6px;
    border-bottom-left-radius: 6px;
    background-color: #f9fafb;
    font-size: 0.95rem;
    font-family: inherit;
    appearance: none;
    color: var(--text-primary);
}
.country-code:focus {
    outline: none;
    border-color: var(--border-focus);
    box-shadow: 0 0 0 1px var(--border-focus);
    z-index: 2;
}
.phone-group input {
    border-top-left-radius: 0;
    border-bottom-left-radius: 0;
    flex: 1;
}
.phone-select-icon {
    left: 85px;
    right: auto;
}

/* Shipping Methods */
.shipping-methods {
    border: 1px solid var(--border-color);
    border-radius: 6px;
    overflow: hidden;
}
.shipping-option {
    display: flex;
    align-items: center;
    padding: 16px;
    cursor: pointer;
    border-bottom: 1px solid var(--border-color);
    transition: background 0.2s;
}
.shipping-option:last-child {
    border-bottom: none;
}
.shipping-option.selected {
    background-color: var(--success-light);
    border-color: var(--success-green);
}
.shipping-option input {
    display: none;
}
.radio-custom {
    width: 18px;
    height: 18px;
    border: 1px solid #ccc;
    border-radius: 50%;
    margin-right: 15px;
    position: relative;
    flex-shrink: 0;
}
.shipping-option.selected .radio-custom {
    border-color: var(--success-green);
    border-width: 5px;
}
.shipping-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}
.shipping-name {
    font-size: 0.95rem;
    color: var(--text-primary);
}
.shipping-time {
    font-size: 0.8rem;
    color: var(--text-secondary);
    margin-top: 2px;
}
.shipping-price {
    font-size: 0.95rem;
    font-weight: 500;
}
.fw-bold {
    font-weight: 700;
}

/* Payment Box */
.payment-box {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    background-color: #fafafa;
}
.spei-logo {
    display: inline-block;
    padding: 5px 15px;
    border: 1px solid #ccc;
    border-radius: 6px;
    background: #fff;
    margin-bottom: 15px;
}
.payment-box h3 {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 8px;
}
.payment-box p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

/* Submit Button */
.btn-submit {
    width: 100%;
    padding: 18px;
    background-color: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 1.1rem;
    font-weight: 700;
    cursor: pointer;
    transition: background 0.2s;
    margin-top: 10px;
}
.btn-submit:hover {
    background-color: var(--primary-hover);
}

/* Summary Card */
.summary-card {
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 20px;
    background: #fff;
}
.product-summary {
    display: flex;
    align-items: center;
    gap: 15px;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--border-color);
}
.product-image-wrapper {
    width: 65px;
    height: 65px;
    background: #f1f1f1;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}
.product-image-wrapper img {
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
}
.product-details {
    flex: 1;
}
.product-details h4 {
    font-size: 0.95rem;
    font-weight: 600;
    margin-bottom: 4px;
}
.product-meta {
    font-size: 0.75rem;
    color: var(--text-secondary);
    margin-bottom: 4px;
}
.product-price {
    font-size: 0.95rem;
    font-weight: 700;
}
.summary-totals {
    padding: 20px 0;
    border-bottom: 1px solid var(--border-color);
}
.total-row {
    display: flex;
    justify-content: space-between;
    font-size: 0.9rem;
    margin-bottom: 10px;
}
.total-row:last-child {
    margin-bottom: 0;
}
.final-total {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: 20px;
    font-size: 1.2rem;
    font-weight: 800;
}

/* Loading Overlay */
.loading-overlay {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 80vh;
    padding: 20px;
    text-align: center;
    animation: fadeIn 0.3s ease;
}
.spinner {
    width: 50px;
    height: 50px;
    border: 4px solid var(--border-color);
    border-top: 4px solid var(--primary-color);
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-bottom: 20px;
}
@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}
.loading-overlay h3 {
    font-size: 1.4rem;
    color: var(--text-primary);
    margin-bottom: 5px;
}
.loading-overlay p {
    font-size: 0.95rem;
    color: var(--text-secondary);
}

/* SPEI Success View */
.spei-success-view {
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 80vh;
    padding: 20px;
}
.spei-card {
    background: #fff;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    width: 100%;
    max-width: 500px;
    overflow: hidden;
    box-shadow: 0 10px 25px rgba(0,0,0,0.05);
}
.spei-header {
    background: var(--success-light);
    border-bottom: 1px solid #a7f3d0;
    padding: 40px 20px 30px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
}
.modal-icon-wrap {
    width: 80px; height: 80px; background: #fff; color: var(--success-green); border-radius: 50%;
    display: flex; align-items: center; justify-content: center; font-size: 36px; margin: 0 auto 20px;
    position: relative;
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.2);
}
.modal-icon-ring {
    position: absolute; width: 100%; height: 100%; border-radius: 50%; border: 3px solid var(--success-green);
    animation: pulse-ring 2s cubic-bezier(0.4, 0, 0.6, 1) infinite;
}
@keyframes pulse-ring {
    0% { transform: scale(1); opacity: 0.8; }
    100% { transform: scale(1.6); opacity: 0; }
}
.spei-header h2 {
    font-size: 1.6rem;
    color: #064e3b;
    margin-bottom: 8px;
    font-weight: 800;
}
.spei-header p {
    font-size: 0.95rem;
    color: #065f46;
}
.spei-details {
    padding: 30px 20px;
}
.spei-row {
    margin-bottom: 20px;
}
.spei-row:last-child {
    margin-bottom: 0;
}
.spei-row span {
    display: block;
    font-size: 0.9rem;
    color: var(--text-secondary);
    margin-bottom: 5px;
}
.spei-row strong {
    font-size: 1.2rem;
    color: var(--text-primary);
    display: block;
}
.copy-box {
    display: flex;
    justify-content: space-between;
    align-items: center;
    background: #f9fafb;
    border: 1px solid var(--border-color);
    padding: 12px 15px;
    border-radius: 6px;
    margin-top: 5px;
}
.copy-box strong {
    font-size: 1.1rem;
    letter-spacing: 1px;
}
.btn-copy {
    background: #e5e7eb;
    border: none;
    padding: 8px 12px;
    border-radius: 4px;
    font-size: 0.85rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
    color: var(--text-primary);
}
.btn-copy:hover {
    background: #d1d5db;
}
.spei-footer {
    background: #f9fafb;
    padding: 15px 20px;
    text-align: center;
    border-top: 1px solid var(--border-color);
}
.spei-footer p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}
