/* Xolvin Installment Engine - Premium Design System */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&family=Outfit:wght@500;600;700&display=swap');

.xie-installment-container {
    margin: 40px 0;
    padding: 25px;
    background: #ffffff;
    border-radius: 16px;
    border: 1px solid #eef2f1;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.04);
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.xie-title {
    font-family: 'Outfit', sans-serif;
    font-size: 20px;
    font-weight: 600;
    color: #1a202c;
    margin-bottom: 20px;
    margin-top: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.xie-table {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    border: 1px solid #f0f4f3;
}

.xie-table thead {
    background: #f8fafc;
}

.xie-table th {
    padding: 12px 15px;
    text-align: left;
    font-weight: 600;
    color: #64748b;
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 0.05em;
    border-bottom: 1px solid #f1f5f9;
}

.xie-table td {
    padding: 12px 15px;
    border-bottom: 1px solid #f1f5f9;
    font-size: 13px;
    color: #334155;
    vertical-align: middle;
}

.xie-table tbody tr {
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
}

.xie-table tbody tr:hover {
    background-color: #f8fafc;
    transform: scale(1.002);
}

.xie-table tbody tr:last-child td {
    border-bottom: none;
}

.xie-table td strong {
    color: #1e293b;
    font-weight: 600;
    font-family: 'Outfit', sans-serif;
    font-size: 13px;
}

/* Advance & Monthly amounts */
.xie-table td bdi {
    color: #10b981;
    font-weight: 700;
    font-size: 13px;
    white-space: nowrap;
}

/* Markup Badge */
.xie-markup-badge {
    display: inline-block;
    background-color: #e74c3c;
    color: #fff;
    padding: 3px 8px;
    border-radius: 3px;
    font-size: 11px;
    font-weight: 600;
    margin-right: 5px;
}

.xie-markup-amount {
    display: block;
    font-size: 12px;
    color: #e74c3c;
    margin-top: 2px;
    font-weight: 600;
}

/* Select Plan → now an anchor link */
.xie-select-plan {
    background: linear-gradient(135deg, #10b981 0%, #059669 100%);
    color: #fff !important;
    text-decoration: none !important;
    border: none;
    padding: 8px 16px;
    border-radius: 8px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 12px;
    box-shadow: 0 4px 12px rgba(16, 185, 129, 0.2);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
}

.xie-select-plan:hover {
    background: linear-gradient(135deg, #059669 0%, #047857 100%);
    transform: translateY(-2px);
    box-shadow: 0 6px 15px rgba(16, 185, 129, 0.3);
    color: #fff !important;
}

.xie-select-plan:active {
    transform: translateY(0);
}


/* Info text */
.xie-info-text {
    margin-top: 20px;
    padding: 12px 16px;
    background-color: #f0f9ff;
    border-radius: 10px;
    color: #0369a1;
    font-size: 13px;
    display: flex;
    align-items: center;
    gap: 8px;
    border: 1px solid #e0f2fe;
}

/* Modal Styling */
.xie-modal {
    display: none;
    position: fixed;
    z-index: 99999;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    animation: xie-fade-in 0.3s ease;
}

@keyframes xie-fade-in {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes xie-slide-down {
    from {
        transform: translateY(-30px);
        opacity: 0;
    }

    to {
        transform: translateY(1);
    }
}

.xie-modal-content {
    background: #ffffff;
    margin: 40px auto;
    padding: 0;
    border: none;
    border-radius: 12px;
    width: 95%;
    max-width: 550px;
    max-height: 90vh;
    overflow-y: auto;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
    position: relative;
    animation: xie-slide-down 0.4s cubic-bezier(0.165, 0.84, 0.44, 1);
}

.xie-modal-header {
    background: linear-gradient(135deg, #27ae60 0%, #2ecc71 100%);
    padding: 25px 30px;
    border-radius: 12px 12px 0 0;
    position: relative;
    color: #fff;
}

.xie-modal-header-top {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 12px;
}

.xie-product-tag {
    background: rgba(255, 255, 255, 0.15);
    padding: 4px 12px;
    border-radius: 20px;
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    border: 1px solid rgba(255, 255, 255, 0.2);
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.05);
}

.xie-modal-close {
    color: rgba(255, 255, 255, 0.8);
    font-size: 24px;
    line-height: 1;
    font-weight: 300;
    cursor: pointer;
    transition: all 0.2s ease;
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.1);
    border-radius: 50%;
}

.xie-modal-close:hover {
    color: #fff;
    background: rgba(0, 0, 0, 0.2);
    transform: rotate(90deg);
}

.xie-modal-title {
    margin: 0;
    font-size: 20px;
    font-weight: 600;
    color: #fff !important;
    border-bottom: none;
    padding-bottom: 0;
    display: flex;
    align-items: center;
    gap: 10px;
}

.xie-modal-body {
    padding: 30px;
}

/* Modal Info Section */
.xie-modal-info {
    background-color: #f8faf9;
    padding: 18px;
    border-radius: 10px;
    margin-bottom: 25px;
    border: 1px solid #eef2f0;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.xie-info-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    border-bottom: 1px dashed #e0e6e3;
    padding-bottom: 8px;
}

.xie-info-item:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.xie-info-label {
    font-weight: 600;
    color: #666;
    font-size: 12px;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 4px;
}

.xie-info-value {
    color: #27ae60;
    font-weight: 700;
    font-size: 14px;
}

/* Plan Details Section */
.xie-plan-details {
    background: #fff;
    border: 1px solid #ff980033;
    border-radius: 10px;
    padding: 20px;
    margin-bottom: 30px;
    box-shadow: 0 4px 12px rgba(255, 152, 0, 0.08);
}

.xie-plan-details-title {
    margin: 0 0 15px 0;
    font-size: 13px;
    font-weight: 700;
    color: #ff9800;
    text-transform: uppercase;
    letter-spacing: 1px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.xie-plan-details-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 15px;
}

.xie-plan-detail-item {
    display: flex;
    flex-direction: column;
    padding: 12px 15px;
    background: #fffbf2;
    border-radius: 8px;
    border: 1px solid #fff3e0;
}

.xie-detail-label {
    font-size: 11px;
    font-weight: 600;
    color: #666;
    text-transform: uppercase;
    letter-spacing: 0.3px;
    margin-bottom: 5px;
}

.xie-detail-value {
    font-size: 14px;
    font-weight: 700;
    color: #ff6f00;
    word-break: break-word;
}

/* Form Group Styling */
.xie-form-group {
    margin-bottom: 20px;
}

.xie-form-group label {
    display: block;
    margin-bottom: 8px;
    font-weight: 600;
    color: #444;
    font-size: 13px;
}

.xie-form-group input,
.xie-form-group textarea {
    width: 100%;
    padding: 12px 15px;
    border: 1.5px solid #e1e8e5;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: all 0.2s ease;
    background: #fafcfb;
}

.xie-form-group input:hover,
.xie-form-group textarea:hover {
    border-color: #bdc7c3;
}

.xie-form-group input:focus,
.xie-form-group textarea:focus {
    outline: none;
    border-color: #27ae60;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(39, 174, 96, 0.1);
}

.xie-form-group textarea {
    resize: vertical;
    min-height: 80px;
}

/* Form Actions */
.xie-form-actions {
    display: flex;
    gap: 12px;
    margin-top: 30px;
    justify-content: flex-end;
}

.xie-btn-cancel,
.xie-btn-submit {
    padding: 10px 20px;
    border: none;
    border-radius: 4px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.xie-btn-cancel {
    background-color: #95a5a6;
    color: #fff;
}

.xie-btn-cancel:hover {
    background-color: #7f8c8d;
}

.xie-btn-submit {
    background-color: #27ae60;
    color: #fff;
}

.xie-btn-submit:hover {
    background-color: #229954;
}

.xie-btn-submit:disabled {
    background-color: #95a5a6;
    cursor: not-allowed;
}

/* Toggle Button for Mobile */
.xie-mobile-toggle-btn {
    display: none;
    width: 100%;
    padding: 15px;
    background: #fff;
    border: 1px solid #eef2f1;
    border-radius: 12px;
    font-weight: 600;
    color: #1a202c;
    cursor: pointer;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.04);
    margin-bottom: 20px;
    font-family: 'Outfit', sans-serif;
    transition: all 0.2s ease;
}

.xie-mobile-toggle-btn:hover {
    background: #f8fafc;
}

.xie-mobile-toggle-btn .xie-toggle-icon {
    font-size: 12px;
    color: #64748b;
}

/* Responsive Design */
@media (max-width: 1024px) {
    .xie-mobile-toggle-btn {
        display: flex !important;
    }

    .xie-plans-wrapper {
        display: none;
        margin-top: 10px;
    }

    .xie-installment-container .xie-title {
        display: none !important;
        /* Title already inside toggle or redundant */
    }

    .xie-installment-container {
        padding: 10px !important;
        background: transparent !important;
        border: none !important;
        box-shadow: none !important;
    }

    /* Stack the table on mobile / tablet */
    .xie-installment-container .xie-table,
    .xie-installment-container .xie-table thead,
    .xie-installment-container .xie-table tbody,
    .xie-installment-container .xie-table th,
    .xie-installment-container .xie-table td,
    .xie-installment-container .xie-table tr {
        display: block !important;
        width: 100% !important;
        box-sizing: border-box !important;
    }

    .xie-installment-container .xie-table thead tr {
        position: absolute !important;
        top: -9999px !important;
        left: -9999px !important;
    }

    .xie-installment-container .xie-table {
        border: none !important;
        background: transparent !important;
    }

    .xie-installment-container .xie-table tbody tr {
        background: #ffffff !important;
        border: 1px solid #f1f5f9 !important;
        border-radius: 12px !important;
        margin-bottom: 20px !important;
        padding: 15px !important;
        box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03) !important;
        transform: none !important;
    }

    .xie-installment-container .xie-table td {
        border: none !important;
        padding: 10px 0 !important;
        text-align: right !important;
        position: relative !important;
        padding-left: 50% !important;
        display: flex !important;
        justify-content: space-between !important;
        align-items: center !important;
        font-size: 13px !important;
        border-bottom: 1px dashed #f1f5f9 !important;
        white-space: normal !important;
        min-height: 40px !important;
    }

    .xie-installment-container .xie-table td:last-child {
        border-bottom: none !important;
        padding-bottom: 5px !important;
        padding-top: 15px !important;
        justify-content: center !important;
        padding-left: 0 !important;
    }

    .xie-installment-container .xie-table td::before {
        content: attr(data-label) !important;
        position: absolute !important;
        left: 0 !important;
        width: 45% !important;
        padding-right: 10px !important;
        white-space: nowrap !important;
        text-align: left !important;
        font-weight: 600 !important;
        color: #64748b !important;
        text-transform: uppercase !important;
        font-size: 10px !important;
        letter-spacing: 0.05em !important;
    }

    /* Hide label for the action button row if it's too much */
    .xie-installment-container .xie-table td[data-label="Action"]::before {
        display: none !important;
    }

    .xie-installment-container .xie-table td strong {
        font-size: 14px !important;
    }

    .xie-installment-container .xie-table td bdi {
        font-size: 15px !important;
    }

    .xie-installment-container .xie-select-plan {
        width: 100% !important;
        padding: 12px !important;
        font-size: 14px !important;
    }

    .xie-installment-container .xie-info-text {
        font-size: 12px !important;
    }

    /* Modal Adjustments */
    .xie-modal-content {
        width: 95%;
        margin: 20px auto;
        max-height: 95vh;
    }

    .xie-modal-header {
        padding: 20px;
    }

    .xie-modal-body {
        padding: 20px;
    }

    .xie-plan-details-grid {
        grid-template-columns: 1fr;
        gap: 10px;
    }

    .xie-modal-info {
        padding: 15px;
        margin-bottom: 20px;
    }

    .xie-form-group input,
    .xie-form-group textarea {
        font-size: 16px;
        /* Prevents iOS zoom on focus */
    }

    .xie-form-actions {
        flex-direction: column;
        gap: 10px;
    }

    .xie-btn-cancel,
    .xie-btn-submit {
        width: 100%;
        padding: 14px;
        font-size: 15px;
    }
}

@media (max-width: 480px) {
    .xie-installment-container {
        padding: 15px 12px;
    }

    .xie-table tbody tr {
        padding: 12px;
        margin-bottom: 15px;
    }

    .xie-title {
        font-size: 16px;
    }

    .xie-table td::before {
        font-size: 10px;
    }

    .xie-table td bdi {
        font-size: 16px;
    }
}

/* ============================================================
   CUSTOM CHECKOUT PAGE STYLES
   ============================================================ */
.xie-co-wrap {
    font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 16px 60px;
}

/* Header */
.xie-co-header {
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 60%, #0f3460 100%);
    border-radius: 16px;
    padding: 36px 40px;
    margin-bottom: 30px;
    text-align: center;
    color: #fff;
}
.xie-co-back {
    display: inline-block;
    color: rgba(255,255,255,.65);
    text-decoration: none;
    font-size: 13px;
    margin-bottom: 14px;
    transition: color .2s;
}
.xie-co-back:hover { color: #fff; }
.xie-co-title {
    margin: 0 0 6px;
    font-family: 'Outfit', sans-serif;
    font-size: 28px;
    font-weight: 700;
    color: #fff;
}
.xie-co-subtitle {
    margin: 0;
    color: rgba(255,255,255,.6);
    font-size: 14px;
}

/* Alert */
.xie-co-alert {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 20px;
    border-radius: 10px;
    margin-bottom: 24px;
    font-size: 14px;
    line-height: 1.6;
}
.xie-co-alert-error {
    background: #fff2f2;
    border: 1.5px solid #e74c3c;
    color: #c0392b;
}

/* Error page */
.xie-co-error {
    background: #fff2f2;
    border: 2px solid #e74c3c;
    border-radius: 12px;
    padding: 30px;
    text-align: center;
    color: #c0392b;
}

/* Main grid */
.xie-co-grid {
    display: grid;
    grid-template-columns: 1fr 1.4fr;
    gap: 28px;
    align-items: start;
}

/* Card base */
.xie-co-card {
    background: #fff;
    border-radius: 16px;
    padding: 28px;
    box-shadow: 0 4px 24px rgba(0,0,0,.07);
    border: 1px solid #f1f5f9;
}
.xie-co-card-title {
    font-family: 'Outfit', sans-serif;
    font-size: 18px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 22px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e94560;
}

/* Product image */
.xie-co-product-img {
    border-radius: 12px;
    overflow: hidden;
    margin-bottom: 18px;
}
.xie-co-product-img img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 12px;
}

.xie-co-product-name {
    font-family: 'Outfit', sans-serif;
    font-size: 17px;
    font-weight: 600;
    color: #1e293b;
    margin: 0 0 16px;
}

/* Plan badge */
.xie-co-plan-badge {
    display: inline-flex;
    gap: 0;
    border-radius: 8px;
    overflow: hidden;
    margin-bottom: 22px;
    box-shadow: 0 2px 8px rgba(233,69,96,.2);
}
.xie-co-plan-num {
    background: #e94560;
    color: #fff;
    padding: 6px 14px;
    font-weight: 700;
    font-size: 13px;
}
.xie-co-plan-dur {
    background: #1a1a2e;
    color: #fff;
    padding: 6px 14px;
    font-size: 13px;
}

/* Breakdown */
.xie-co-breakdown {
    background: #f8fafc;
    border-radius: 10px;
    padding: 16px;
    margin-bottom: 22px;
}
.xie-co-breakdown-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 14px;
    color: #475569;
    border-bottom: 1px dashed #e2e8f0;
}
.xie-co-breakdown-row:last-child { border-bottom: none; }
.xie-co-markup-row { color: #e94560; }
.xie-co-breakdown-divider {
    height: 1px;
    background: #cbd5e1;
    margin: 8px 0;
}
.xie-co-total-row {
    font-weight: 700;
    font-size: 16px;
    color: #1e293b;
}

/* Payment schedule */
.xie-co-schedule { margin-top: 4px; }
.xie-co-schedule-title {
    font-size: 14px;
    font-weight: 700;
    color: #475569;
    margin: 0 0 12px;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-size: 12px;
}
.xie-co-schedule-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
}
.xie-co-sched-item {
    border-radius: 10px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.xie-co-sched-advance {
    background: #e8f5e9;
    border: 1px solid #c8e6c9;
}
.xie-co-sched-monthly {
    background: #e3f2fd;
    border: 1px solid #bbdefb;
}
.xie-co-sched-label {
    font-size: 11px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: .5px;
    color: #64748b;
}
.xie-co-sched-amount {
    font-size: 18px;
    font-weight: 700;
}
.xie-co-sched-advance .xie-co-sched-amount { color: #27ae60; }
.xie-co-sched-monthly .xie-co-sched-amount { color: #2196f3; }
.xie-co-sched-note {
    font-size: 11px;
    color: #94a3b8;
}

/* Form */
.xie-co-form-desc {
    color: #64748b;
    font-size: 14px;
    margin: -14px 0 22px;
}
.xie-co-fields { display: flex; flex-direction: column; gap: 18px; }
.xie-co-field-group { display: flex; flex-direction: column; gap: 6px; }
.xie-co-label {
    font-size: 13px;
    font-weight: 600;
    color: #374151;
}
.xie-co-star { color: #e94560; margin-left: 2px; }
.xie-co-input {
    width: 100%;
    padding: 12px 14px;
    border: 1.5px solid #e2e8f0;
    border-radius: 8px;
    font-size: 14px;
    font-family: inherit;
    box-sizing: border-box;
    transition: all .2s ease;
    background: #fafbfc;
    color: #1e293b;
}
.xie-co-input:hover { border-color: #94a3b8; }
.xie-co-input:focus {
    outline: none;
    border-color: #e94560;
    background: #fff;
    box-shadow: 0 0 0 4px rgba(233,69,96,.1);
}
.xie-co-textarea { resize: vertical; min-height: 80px; }

/* Submit */
.xie-co-submit-wrap {
    margin-top: 28px;
    text-align: center;
}
.xie-co-submit-btn {
    width: 100%;
    padding: 15px 28px;
    background: linear-gradient(135deg, #e94560, #c0392b);
    color: #fff;
    border: none;
    border-radius: 10px;
    font-size: 16px;
    font-weight: 700;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    transition: all .3s ease;
    box-shadow: 0 6px 20px rgba(233,69,96,.3);
    font-family: 'Outfit', sans-serif;
}
.xie-co-submit-btn:hover {
    background: linear-gradient(135deg, #c0392b, #922b21);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(233,69,96,.4);
}
.xie-co-submit-btn:disabled {
    background: #94a3b8;
    box-shadow: none;
    transform: none;
    cursor: not-allowed;
}
.xie-co-submit-note {
    color: #94a3b8;
    font-size: 12px;
    margin: 12px 0 0;
}

/* Success Screen */
.xie-co-success {
    background: #fff;
    border-radius: 20px;
    padding: 60px 40px;
    text-align: center;
    box-shadow: 0 8px 40px rgba(0,0,0,.08);
    max-width: 560px;
    margin: 0 auto;
}
.xie-co-success-icon { font-size: 64px; margin-bottom: 20px; }
.xie-co-success-title {
    font-family: 'Outfit', sans-serif;
    font-size: 30px;
    font-weight: 700;
    color: #1a1a2e;
    margin: 0 0 14px;
}
.xie-co-success-msg {
    color: #64748b;
    font-size: 15px;
    line-height: 1.7;
    margin: 0 0 28px;
}
.xie-co-order-ref {
    background: linear-gradient(135deg, #e94560, #c0392b);
    border-radius: 12px;
    padding: 20px;
    margin-bottom: 24px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}
.xie-co-ref-label {
    color: rgba(255,255,255,.75);
    font-size: 11px;
    text-transform: uppercase;
    letter-spacing: 2px;
}
.xie-co-ref-number {
    color: #fff;
    font-size: 26px;
    font-weight: 700;
    letter-spacing: 3px;
    font-family: 'Outfit', sans-serif;
}
.xie-co-success-note {
    color: #94a3b8;
    font-size: 13px;
    line-height: 1.8;
    margin: 0 0 28px;
}
.xie-co-home-btn {
    display: inline-block;
    background: linear-gradient(135deg, #1a1a2e, #0f3460);
    color: #fff !important;
    text-decoration: none !important;
    padding: 14px 32px;
    border-radius: 10px;
    font-weight: 700;
    font-size: 15px;
    transition: all .3s ease;
    box-shadow: 0 4px 16px rgba(26,26,46,.2);
}
.xie-co-home-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(26,26,46,.3);
}

/* Responsive checkout */
@media (max-width: 768px) {
    .xie-co-header { padding: 28px 22px; }
    .xie-co-title { font-size: 22px; }
    .xie-co-grid { grid-template-columns: 1fr; gap: 20px; }
    .xie-co-card { padding: 20px; }
    .xie-co-schedule-grid { grid-template-columns: 1fr 1fr; }
    .xie-co-success { padding: 40px 22px; }
    .xie-co-success-title { font-size: 24px; }
}
@media (max-width: 480px) {
    .xie-co-schedule-grid { grid-template-columns: 1fr; }
    .xie-co-ref-number { font-size: 20px; }
}