﻿/* =====================================================
   ألوان صفحة الدفع الأساسية
   ===================================================== */

:root {
    --pay-navy: #102f4c;
    --pay-navy-dark: #081f35;
    --pay-blue: #126b8a;
    --pay-orange: #ed8b16;
    --pay-orange-dark: #cf6f05;
    --pay-green: #178653;
    --pay-bg: #eef2f5;
    --pay-white: #ffffff;
    --pay-border: #d6dfe5;
    --pay-text: #172f42;
    --pay-muted: #6c7c87;
}

/* =====================================================
   الإعدادات العامة للصفحة
   ===================================================== */

body {
    background: var(--pay-bg);
}

.payment-checkout-page {
    width: 100%;
    max-width: 1260px;
    margin: 0 auto;
    padding: 12px 0 60px;
    color: var(--pay-text);
}

/* =====================================================
   رأس الصفحة
   ===================================================== */

.payment-page-header {
    position: relative;
    overflow: hidden;
    background: var(--pay-navy);
    border-radius: 17px;
    padding: 20px 24px 24px;
    margin-bottom: 17px;
    color: #ffffff;
    box-shadow: 0 14px 32px rgba(8, 31, 53, 0.2);
}

    .payment-page-header::before {
        content: "";
        position: absolute;
        width: 210px;
        height: 210px;
        border-radius: 50%;
        border: 38px solid rgba(255, 255, 255, 0.035);
        left: -80px;
        top: -100px;
    }

.header-top-row,
.header-main-content {
    position: relative;
    z-index: 1;
}

.header-top-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 21px;
}

.back-to-centers,
.secure-payment-badge {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 12px;
}

.back-to-centers {
    color: rgba(255, 255, 255, 0.88);
    text-decoration: none;
    font-weight: 700;
}

    .back-to-centers:hover {
        color: #ffffff;
    }

.secure-payment-badge {
    padding: 6px 10px;
    border-radius: 20px;
    background: rgba(27, 181, 109, 0.16);
    border: 1px solid rgba(92, 225, 162, 0.25);
    color: #baf6d7;
    font-weight: 700;
}

.header-main-content {
    display: flex;
    align-items: center;
    gap: 14px;
}

.header-icon {
    width: 55px;
    height: 55px;
    min-width: 55px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 14px;
    background: var(--pay-orange);
    color: #ffffff;
    font-size: 23px;
    box-shadow: 0 8px 18px rgba(237, 139, 22, 0.25);
}

.header-small-title {
    display: block;
    margin-bottom: 3px;
    color: #a9bac7;
    font-size: 11px;
    font-weight: 700;
}

.payment-page-header h1 {
    margin: 0 0 5px;
    font-size: 25px;
    font-weight: 900;
    line-height: 1.5;
}

.payment-page-header p {
    margin: 0;
    color: #c8d4dc;
    font-size: 13px;
}

/* =====================================================
   ملخص بيانات المستخدم
   ===================================================== */

.user-summary {
    background: var(--pay-white);
    border: 1px solid var(--pay-border);
    border-right: 5px solid var(--pay-blue);
    border-radius: 13px;
    margin-bottom: 17px;
    box-shadow: 0 6px 18px rgba(21, 47, 66, 0.07);
}

.user-summary-head {
    min-height: 76px;
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 13px 17px;
    border-bottom: 1px solid #e8edf0;
}

.user-avatar {
    width: 43px;
    height: 43px;
    min-width: 43px;
    border-radius: 50%;
    background: var(--pay-navy);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 19px;
}

.user-name-area {
    flex: 1;
}

    .user-name-area span {
        display: block;
        color: var(--pay-blue);
        font-size: 10px;
        font-weight: 800;
        margin-bottom: 2px;
    }

    .user-name-area h2 {
        margin: 0;
        color: var(--pay-text);
        font-size: 16px;
        font-weight: 900;
    }

.verified-user {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 6px 9px;
    border-radius: 20px;
    background: #e7f6ee;
    color: var(--pay-green);
    font-size: 10px;
    font-weight: 800;
    white-space: nowrap;
}

.user-summary-details {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
}

.summary-detail {
    min-width: 0;
    padding: 13px 17px;
    border-left: 1px solid #e7ecef;
}

    .summary-detail:last-child {
        border-left: 0;
    }

    .summary-detail span {
        display: block;
        margin-bottom: 3px;
/*        color: var(--pay-muted);*/
        font-size: 12px;
    }

    .summary-detail strong {
        display: block;
        color: #2a4254;
        font-size: 12px;
        line-height: 1.6;
        overflow-wrap: anywhere;
    }

/* =====================================================
   تقسيم المدفوعات وملخص الطلب
   ===================================================== */

.payment-content-layout {
    display: grid;
    grid-template-columns: minmax(0, 2fr) minmax(285px, 0.75fr);
    gap: 17px;
    align-items: start;
}

.available-payments-area {
    min-width: 0;
}

.payments-title-bar {
    min-height: 62px;
    padding: 11px 16px;
    background: var(--pay-navy);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 14px;
    border-radius: 13px 13px 0 0;
}

    .payments-title-bar h2 {
        margin: 0 0 3px;
        font-size: 17px;
        font-weight: 900;
    }

    .payments-title-bar p {
        margin: 0;
        color: #bdcad3;
        font-size: 11px;
    }

.available-count {
    padding: 6px 10px;
    border-radius: 20px;
    background: var(--pay-orange);
    color: #ffffff;
    font-size: 11px;
    font-weight: 900;
    white-space: nowrap;
}

/* =====================================================
   جدول المدفوعات
   ===================================================== */

.payments-table-wrapper {
    overflow: hidden;
    background: var(--pay-white);
    border: 1px solid var(--pay-border);
    border-top: 0;
    border-radius: 0 0 13px 13px;
    box-shadow: 0 7px 21px rgba(21, 47, 66, 0.07);
}

.payments-table-header,
.payment-row {
    display: grid;
    grid-template-columns: 70px minmax(230px, 1fr) 115px 145px 120px;
    align-items: center;
}

.payments-table-header {
    min-height: 45px;
    background: #e4ebef;
    color: #425768;
    font-size: 10px;
    font-weight: 900;
}

    .payments-table-header > div {
        padding: 8px 12px;
    }

.payment-row {
    min-height: 95px;
    border-top: 1px solid #e4eaee;
    transition: background-color 0.16s ease, box-shadow 0.16s ease;
}

    .payment-row:first-child {
        border-top: 0;
    }

    .payment-row:hover {
        background: #f8fafb;
    }

    .payment-row.selected {
        position: relative;
        background: #fff8ed;
        box-shadow: inset -5px 0 0 var(--pay-orange);
    }

    .payment-row > div {
        padding: 13px 12px;
        min-width: 0;
    }

.select-column {
    text-align: center;
}

/* =====================================================
   تصميم Checkbox
   ===================================================== */

.payment-checkbox {
    display: inline-flex;
    cursor: pointer;
}

    .payment-checkbox input {
        position: absolute;
        opacity: 0;
        pointer-events: none;
    }

.checkbox-design {
    width: 25px;
    height: 25px;
    border: 2px solid #aab7c0;
    border-radius: 7px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    color: transparent;
    transition: background-color 0.15s ease, border-color 0.15s ease;
}

.payment-checkbox input:checked + .checkbox-design {
    background: var(--pay-orange);
    border-color: var(--pay-orange);
    color: #ffffff;
}

/* =====================================================
   اسم المدفوعة
   ===================================================== */

.payment-name-content {
    display: flex;
    align-items: flex-start;
    gap: 11px;
}

.payment-type-icon {
    width: 39px;
    height: 39px;
    min-width: 39px;
    border-radius: 10px;
    background: #e6f1f5;
    color: var(--pay-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.payment-name-content h3 {
    margin: 0 0 4px;
    color: var(--pay-text);
    font-size: 15px;
    font-weight: 900;
    line-height: 1.6;
}

.payment-name-content p {
    margin: 0;
    color: var(--pay-muted);
    font-size: 11px;
    line-height: 1.6;
}

.price-column,
.total-column {
    text-align: center;
    white-space: nowrap;
}

    .price-column strong,
    .total-column strong {
        color: var(--pay-blue);
        font-size: 15px;
        font-weight: 900;
    }

    .total-column strong {
        color: var(--pay-orange-dark);
    }

    .price-column small,
    .total-column small {
        display: block;
        color: var(--pay-muted);
        font-size: 9px;
    }

/* =====================================================
   التحكم في الكمية
   ===================================================== */

.quantity-control {
    display: flex;
    align-items: center;
    justify-content: center;
}

.payment-quantity {
    width: 48px;
    height: 34px;
    border: 1px solid #c8d3da;
    border-right: 0;
    border-left: 0;
    text-align: center;
    font-size: 13px;
    font-weight: 900;
    color: var(--pay-text);
    outline: 0;
    appearance: textfield;
}

    .payment-quantity::-webkit-inner-spin-button,
    .payment-quantity::-webkit-outer-spin-button {
        appearance: none;
    }

.quantity-button {
    width: 34px;
    height: 34px;
    border: 1px solid #c8d3da;
    background: #edf2f5;
    color: var(--pay-navy);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    cursor: pointer;
}

.increase-quantity {
    border-radius: 0 8px 8px 0;
}

.decrease-quantity {
    border-radius: 8px 0 0 8px;
}

.quantity-button:not(:disabled):hover {
    background: var(--pay-navy);
    border-color: var(--pay-navy);
    color: #ffffff;
}

.quantity-button:disabled,
.payment-quantity:disabled {
    cursor: not-allowed;
    opacity: 0.45;
}

.mobile-column-title {
    display: none;
}

/* =====================================================
   ملخص الطلب
   ===================================================== */

.payment-order-summary {
    position: sticky;
    top: 16px;
}

.order-summary-card {
    overflow: hidden;
    background: var(--pay-white);
    border: 1px solid var(--pay-border);
    border-radius: 13px;
    box-shadow: 0 8px 25px rgba(21, 47, 66, 0.1);
}

.summary-card-header {
    padding: 15px;
    background: var(--pay-navy);
    color: #ffffff;
}

    .summary-card-header > div {
        display: flex;
        align-items: center;
        gap: 10px;
    }

.summary-icon {
    width: 39px;
    height: 39px;
    min-width: 39px;
    border-radius: 10px;
    background: var(--pay-orange);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 17px;
}

.summary-card-header h2 {
    margin: 0 0 2px;
    font-size: 15px;
    font-weight: 900;
}

.summary-card-header p {
    margin: 0;
    color: #becbd3;
    font-size: 10px;
}

.empty-selection {
    padding: 28px 15px;
    text-align: center;
    color: var(--pay-muted);
}

    .empty-selection i {
        display: block;
        margin-bottom: 8px;
        color: #a4b0b8;
        font-size: 29px;
    }

    .empty-selection p {
        margin: 0;
        font-size: 11px;
    }

.selected-payments-list {
    max-height: 280px;
    overflow-y: auto;
}

.selected-summary-item {
    padding: 11px 14px;
    border-bottom: 1px solid #e6ecef;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
}

    .selected-summary-item > div {
        min-width: 0;
    }

        .selected-summary-item > div > strong {
            display: block;
            margin-bottom: 2px;
            color: var(--pay-text);
            font-size: 11px;
            line-height: 1.5;
        }

    .selected-summary-item span {
        color: var(--pay-muted);
        font-size: 9px;
    }

.selected-item-total {
    color: var(--pay-orange-dark);
    font-size: 12px;
    white-space: nowrap;
}

    .selected-item-total small {
        font-size: 8px;
    }

.summary-totals {
    padding: 12px 14px;
    background: #f3f6f8;
    border-top: 1px solid #dfe7eb;
}

    .summary-totals > div {
        min-height: 30px;
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 10px;
        color: var(--pay-muted);
        font-size: 10px;
    }

        .summary-totals > div > strong {
            color: var(--pay-text);
            font-size: 12px;
        }

.grand-total-row {
    min-height: 49px !important;
    margin-top: 7px;
    padding-top: 9px;
    border-top: 1px solid #d5dfe4;
}

    .grand-total-row > span {
        color: var(--pay-text);
        font-size: 12px;
        font-weight: 900;
    }

    .grand-total-row strong {
        color: var(--pay-orange-dark);
        font-size: 21px !important;
        font-weight: 900;
    }

    .grand-total-row small {
        color: var(--pay-muted);
        font-size: 9px;
    }

.continue-payment-button {
    width: calc(100% - 28px);
    min-height: 46px;
    margin: 14px;
    border: 0;
    border-radius: 9px;
    background: var(--pay-orange);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    font-family: inherit;
    font-size: 13px;
    font-weight: 900;
    cursor: pointer;
    box-shadow: 0 8px 18px rgba(237, 139, 22, 0.25);
}

    .continue-payment-button:not(:disabled):hover {
        background: var(--pay-orange-dark);
    }

    .continue-payment-button:disabled {
        background: #aeb9c0;
        box-shadow: none;
        cursor: not-allowed;
    }

.payment-protection-note {
    margin: 0;
    padding: 0 15px 14px;
    color: var(--pay-muted);
    font-size: 9px;
    line-height: 1.6;
    text-align: center;
}

    .payment-protection-note i {
        color: var(--pay-green);
    }

.empty-payment-list {
    padding: 60px 20px;
    background: var(--pay-white);
    border: 1px solid var(--pay-border);
    text-align: center;
}

    .empty-payment-list i {
        color: #9caab3;
        font-size: 39px;
    }

    .empty-payment-list h3 {
        margin: 12px 0 5px;
        font-size: 16px;
    }

    .empty-payment-list p {
        margin: 0;
        color: var(--pay-muted);
        font-size: 12px;
    }

/* =====================================================
   شاشة التابلت
   ===================================================== */

@media (max-width: 1050px) {

    .payment-content-layout {
        grid-template-columns: 1fr;
    }

    .payment-order-summary {
        position: static;
    }

    .payments-table-header,
    .payment-row {
        grid-template-columns: 60px minmax(200px, 1fr) 105px 135px 110px;
    }
}

/* =====================================================
   تصميم الموبايل
   ===================================================== */

@media (max-width: 700px) {

    body {
        background: #ffffff;
    }

    .payment-checkout-page {
        padding-top: 0;
    }

    .payment-page-header {
        border-radius: 12px;
        padding: 15px;
        margin-bottom: 12px;
    }

    .header-top-row {
        margin-bottom: 16px;
    }

    .secure-payment-badge {
        font-size: 9px;
    }

    .header-main-content {
        align-items: flex-start;
    }

    .header-icon {
        width: 45px;
        height: 45px;
        min-width: 45px;
        font-size: 19px;
    }

    .payment-page-header h1 {
        font-size: 18px;
    }

    .payment-page-header p {
        font-size: 11px;
        line-height: 1.6;
    }

    .user-summary {
        border-right-width: 4px;
    }

    .user-summary-head {
        min-height: 67px;
        padding: 11px;
    }

    .user-name-area h2 {
        font-size: 13px;
    }

    .verified-user {
        padding: 5px 7px;
        font-size: 9px;
    }

    .user-summary-details {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .summary-detail {
        padding: 10px;
        border-bottom: 1px solid #e7ecef;
    }

    .payments-title-bar {
        border-radius: 11px 11px 0 0;
        padding: 11px 12px;
    }

        .payments-title-bar h2 {
            font-size: 15px;
        }

        .payments-title-bar p {
            font-size: 9px;
        }

    .payments-table-header {
        display: none;
    }

    .payments-table-body {
        padding: 9px;
        background: #e8eef2;
    }

    .payment-row {
        display: grid;
        grid-template-columns: 42px 1fr;
        min-height: 0;
        margin-bottom: 9px;
        background: #ffffff;
        border: 1px solid #d3dde3;
        border-radius: 11px;
        overflow: hidden;
    }

        .payment-row:last-child {
            margin-bottom: 0;
        }

        .payment-row.selected {
            background: #fff8ed;
            border-color: #e9ab5d;
            box-shadow: inset -4px 0 0 var(--pay-orange);
        }

        .payment-row > div {
            padding: 10px;
        }

        .payment-row .select-column {
            grid-column: 1;
            grid-row: 1;
            display: flex;
            align-items: flex-start;
            justify-content: center;
            padding-top: 13px;
        }

        .payment-row .payment-name-column {
            grid-column: 2;
            grid-row: 1;
        }

    .payment-name-content h3 {
        font-size: 15px;
    }

    .payment-name-content p {
        font-size: 10px;
    }

    .payment-type-icon {
        width: 34px;
        height: 34px;
        min-width: 34px;
        font-size: 15px;
    }

    .payment-row .price-column,
    .payment-row .quantity-column,
    .payment-row .total-column {
        grid-column: 1 / -1;
        display: flex;
        align-items: center;
        justify-content: space-between;
        min-height: 48px;
        padding: 8px 12px;
        border-top: 1px solid #e7ecef;
        text-align: right;
    }

    .mobile-column-title {
        display: block;
        color: var(--pay-muted);
        font-size: 10px;
        font-weight: 700;
    }

    .price-column small,
    .total-column small {
        display: inline;
    }

    .quantity-control {
        justify-content: flex-end;
    }

    .payment-order-summary {
        margin-top: 12px;
    }

    .order-summary-card {
        border-radius: 11px;
    }

    .continue-payment-button {
        min-height: 49px;
    }
}

/* =====================================================
   أصغر شاشات الموبايل
   ===================================================== */

@media (max-width: 390px) {

    .secure-payment-badge {
        padding: 5px 7px;
    }

    .user-summary-details {
        grid-template-columns: 1fr;
    }

    .summary-detail {
        border-left: 0;
    }
}
/* =====================================================
   زر تعديل بيانات المستخدم
   ===================================================== */

.edit-user-wrapper {
    display: flex;
    justify-content: flex-end;
    margin-top: 18px;
}


.edit-user-button {
    min-height: 44px;
    padding: 9px 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 9px;
    border: 1px solid #197891;
    border-radius: 12px;
    background: #f3fafc;
    color: #197891;
    font-size: 14px;
    font-weight: 800;
    text-decoration: none;
    box-shadow: 0 3px 10px rgba(25, 120, 145, 0.10);
    transition: background-color 0.2s ease, color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}


    .edit-user-button:hover {
        background: #197891;
        color: #ffffff;
        box-shadow: 0 6px 16px rgba(25, 120, 145, 0.22);
        transform: translateY(-1px);
        text-decoration: none;
    }


    .edit-user-button:active {
        transform: translateY(0);
    }


.edit-user-icon {
    width: 28px;
    height: 28px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 8px;
    background: rgba(25, 120, 145, 0.10);
    font-size: 14px;
}


.edit-user-button:hover .edit-user-icon {
    background: rgba(255, 255, 255, 0.18);
}


/* الموبايل */
@media (max-width: 576px) {

    .edit-user-wrapper {
        justify-content: stretch;
    }

    .edit-user-button {
        width: 100%;
    }
}

/* =====================================================
   تعديل رقم التليفون
   ===================================================== */

.phone-edit-detail {
    align-items: stretch;
}

.phone-edit-box {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 5px;
}

.phone-edit-input {
    width: 165px;
    min-height: 40px;
    direction: ltr;
    text-align: left;
    border-radius: 10px;
}

.save-phone-button {
    min-height: 40px;
    border: 0;
    border-radius: 10px;
    padding: 7px 14px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    background: #ed8b16;
    color: #fff;
    font-family: inherit;
    font-size: 13px;
    font-weight: 800;
    cursor: pointer;
}

    .save-phone-button:hover {
        background: #102f4c;
    }

    .save-phone-button:disabled {
        opacity: .65;
        cursor: not-allowed;
    }

@media (max-width: 576px) {

    .phone-edit-box {
        flex-direction: column;
        align-items: stretch;
    }

    .phone-edit-input,
    .save-phone-button {
        width: 100%;
    }
}