.checkout-page-container {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
    align-items: flex-start;
}

.checkout-main-column {
    flex: 2.5;
    min-width: 300px;
    background-color: #fff;
    padding: 25px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.checkout-section {
    margin-bottom: 30px;
    padding-bottom: 20px;
    border-bottom: 1px solid #f0f0f0;
}

.checkout-section:last-child {
    margin-bottom: 0;
    border-bottom: none;
}

.checkout-section-header {
    display: flex;
    align-items: center;
}

.checkout-section-header h2 {
    font-size: 1.4em;
    margin: 0;
    text-align: right;
}

.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    /* عمودين للحقول المتجاورة */
    gap: 15px;
}

.form-group.full-width {
    grid-column: 1 / -1;
}

.form-group label .required-star {
    color: var(--zh-red);
    margin: 0 3px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(138, 43, 226, 0.2);
    outline: none;
}

.form-group textarea {
    min-height: 80px;
    resize: vertical;
}

.payment-method-option.green.selected,
.payment-method-option.green:hover {
    border-color: var(--zh-green);
    background: var(--zh-teal);
}

.payment-method-option.blue.selected,
.payment-method-option.blue:hover {
    border-color: var(--zh-blue);
    background: var(--zh-blue-white);
}

.payment-method-option.purple.selected,
.payment-method-option.purple:hover {
    border-color: var(--zh-purple);
    background-color: var(--zh-lightindigo);
}

/* طريقة الدفع */
.payment-method-option {
    display: flex;
    align-items: center;
    padding: 5px;
    margin: 5px 0;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    cursor: pointer;
    transition: border-color 0.2s, background-color 0.2s;
}

.payment-method-option input[type="radio"] {
    display: none;
    /* إخفاء الراديو الافتراضي */
}

.payment-method-option .custom-radio {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-radius: 50%;
    margin: 0 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color 0.2s;
}

.payment-method-option.green input[type="radio"]:checked+.custom-radio {
    border-color: #86efac;
}

.payment-method-option.green input[type="radio"]:checked+.custom-radio::after {
    content: "";
    display: block;
    width: 13px;
    height: 13px;
    background-color: #86efac;
    border-radius: 50%;
}

.payment-method-option.green input[type="radio"]:checked+.custom-radio {
    border-color: var(--zh-green);
}

.payment-method-option.green input[type="radio"]:checked+.custom-radio::after {
    content: "";
    display: block;
    width: 13px;
    height: 13px;
    background-color: var(--zh-green);
    border-radius: 50%;
}

.payment-method-option.blue input[type="radio"]:checked+.custom-radio {
    border-color: var(--zh-blue);
}

.payment-method-option.blue input[type="radio"]:checked+.custom-radio::after {
    content: "";
    display: block;
    width: 13px;
    height: 13px;
    background-color: var(--zh-blue);
    border-radius: 50%;
}

.payment-method-option.purple input[type="radio"]:checked+.custom-radio {
    border-color: var(--zh-purple);
}

.payment-method-option.purple input[type="radio"]:checked+.custom-radio::after {
    content: "";
    display: block;
    width: 13px;
    height: 13px;
    background-color: var(--zh-purple);
    border-radius: 50%;
}

.payment-method-option .payment-label h4 {
    display: block;
    font-weight: 600;
    white-space: nowrap;
}

.payment-method-option .payment-label span {
    font-size: var(--zh-font-size-sm);
}

.order-review-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 10px;
}

#orderReviewSection .order-review-header .content-title {
    width: 45%;
    display: flex;
    align-items: center;
}

.content-count-item {
    /* width: 90%; */
    display: flex;
    /* flex-direction: row; */
    justify-content: flex-end;
}

.content-count-item div {
    margin: 0 10px;
}

/* مراجعة الطلب */
.order-review-item {
    display: flex;
    align-items: center;
    padding: 12px 0;
    border-bottom: 1px solid #f0f0f0;
}

.order-review-item:last-child {
    border-bottom: none;
}

.order-review-item img {
    width: 50px;
    height: 50px;
    object-fit: contain;
    border-radius: 4px;
    margin-inline-end: 12px;
}

.order-review-item-info {
    flex-grow: 1;
}

.order-review-item-info h4 {
    margin: 0 0 4px 0;
    font-size: 0.95em;
    font-weight: 500;
}

.order-review-item-info p {
    display: flex;
    margin: 0;
    font-size: 0.85em;
    justify-content: center;
}

.order-review-item-info p span {
    margin: 0 5px;
}

.order-review-item-price {
    text-align: left;
    font-size: 0.95em;
    font-weight: 500;
}

/* قسم التخفيض */
.checkout-sidebar-column {
    flex: 1.5;
    min-width: 280px;
    position: sticky;
    top: 100px;
    align-self: flex-start;
    background-color: #fff;
    padding: 20px;
    margin: 20px 0;
    border-radius: 8px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.07);
}

.discount-section .form-group {
    display: flex;
    gap: 10px;
}

#discountMessage {
    font-size: 0.85em;
    margin-top: 5px;
}

.order-summary-box a {
    text-decoration: none;
    color: var(--zh-link-color);
}

.order-summary-box a:hover {
    color: var(--zh-purple);
}

.summary-line span:last-child {
    font-weight: 500;
}

.checkout-section hr {
    border-style: solid;
    border-color: #eee;
    margin: 12px 0;
}

.place-order-btn:disabled {
    background-color: #ccc;
    cursor: not-allowed;
}

.terms-notice {
    font-size: 0.8em;
    color: #888;
    margin-top: 12px;
    text-align: center;
}

.loader-spinner {
    margin-top: 15px !important;
}

@media (max-width: 768px) {

    /* تعديل نقطة الالتفاف */
    .checkout-page-container {
        flex-direction: column;
        gap: 5px;
    }

    .checkout-main-column {
        width: 100%;
        padding: 10px;
        margin: 10px 0 5px 0;
    }

    .checkout-section {
        margin-bottom: 8px;
        padding-bottom: 0px;
    }

    .checkout-section-header {
        margin-bottom: 5px;
    }

    .checkout-section-header svg,
    .checkout-section-header svg {
        height: 30px;
    }

    .checkout-section-header h2 {
        font-size: var(--zh-font-size-sm);
        margin: 0;
    }

    .form-grid {
        grid-template-columns: 1fr;
        gap: 5px;
    }

    .form-group {
        margin-bottom: 5px;
    }

    .form-group label {
        position: absolute;
        opacity: 0.6;
        font-size: var(--zh-font-size);
        padding: 6px;
    }

    .form-group textarea {
        min-height: 50px;
    }

    .form-group input[type="text"] {
        padding: 16px 12px 10px 12px;
        font-size: var(--zh-font-size-sm);
    }

    .checkout-sidebar-column {
        position: static;
        width: 100%;
        padding: 12px;
        margin: 0 0 8px 0;
    }

    .payment-method-option .custom-radio {
        width: 15px;
        height: 15px;
    }

    .payment-method-option {
        padding: 4px;
        font-size: var(--zh-font-size-s);
    }

    .payment-method-option .payment-label span {
        font-size: var(--zh-font-size);
    }

    .order-review-item {
        padding: 8px 0;
    }

    .order-review-item img {
        width: 40px;
        height: 40px;
        margin-inline-end: 6px;
    }

    .order-review-item-info h4,
    .order-review-item-info p {
        font-size: var(--zh-font-size-s);
    }

    .order-review-item-price {
        font-size: var(--zh-font-size-sm);
    }

    .checkout-section-header svg {
        width: 18px;
        height: 18px;
        margin-inline-end: 6px;
    }

    .order-summary-box h3,
    .checkout-section-header h3 {
        font-size: var(--zh-font-size-xl);
        margin: 0;
    }

    .discount-section .form-group {
        gap: 4px;
    }

    .discount-section input[type="text"] {
        padding: 8px;
        font-size: var(--zh-font-size-sm);
    }

    .discount-section button {
        padding: 8px 12px;
        font-size: var(--zh-font-size-sm);
    }

    #discountMessage {
        font-size: var(--zh-font-size-s);
    }

    .summary-line {
        margin-bottom: 8px;
        font-size: var(--zh-font-size-sm);
    }

    .btn-checkout-mini {
        letter-spacing: 0.5px;
        transform: rotateX(24deg);
    }

    .container-loader {
        transform: scale(0.6);
    }

    .terms-notice {
        font-size: var(--zh-font-size);
        margin-top: 0px;
    }

    .title-svg {
        padding: 0 8px !important;
    }

    html[dir="rtl"] .payment-icons.flex-direction {
        justify-content: flex-end !important;
    }

    html[dir="ltr"] .payment-icons.flex-direction {
        justify-content: flex-end !important;
    }

    .payment-method-option .payment-label h4 {
        white-space: normal;
        margin: 0 2px;
    }

    .title-svg svg,
    .title-svg div svg {
        width: 30px;
    }
}

/* --- نافذة نجاح الطلب (Order Success Modal) --- */
.order-success-modal {
    display: none;
    position: fixed;
    z-index: 10000;
    left: 0;
    top: 0;
    width: 100%;
    height: 100%;
    overflow: auto;
    background-color: rgba(0, 0, 0, 0.6);
    backdrop-filter: blur(5px);
    justify-content: center;
    align-items: center;
    animation: fadeIn 0.4s ease-out;
}

.order-success-modal.show {
    display: flex !important;
}

.glassmorphism {
    top: 20px;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }

    to {
        opacity: 1;
    }
}

@keyframes slideIn {
    from {
        transform: translateY(50px);
        opacity: 0;
    }

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

.modal-checkout {
    display: flex;
    justify-content: center;
    align-items: center;
}

.success-icon-wrapper {
    margin-bottom: 6px;
}

.success-icon {
    width: 50px;
    height: 50px;
    display: block;
    margin: 0 auto;
}

.success-icon__circle {
    stroke-dasharray: 166;
    stroke-dashoffset: 166;
    stroke-width: 2;
    stroke-miterlimit: 10;
    stroke: #4bb71b;
    fill: none;
    animation: stroke 0.6s cubic-bezier(0.65, 0, 0.45, 1) forwards;
}

.success-icon__check {
    transform-origin: 50% 50%;
    stroke-dasharray: 48;
    stroke-dashoffset: 48;
    stroke-width: 3;
    stroke: #4bb71b;
    animation: stroke 0.3s cubic-bezier(0.65, 0, 0.45, 1) 0.8s forwards;
}

@keyframes stroke {
    100% {
        stroke-dashoffset: 0;
    }
}

.modal-header h2 {
    color: #333;
    margin-bottom: 5px;
    font-size: 1.8rem;
}

.modal-header p {
    color: #666;
    font-size: 0.95rem;
}

.modal-body {
    width: 95%;
    margin: 5px 0;
    text-align: right;
}

.order-info-grid {
    display: flex;
    background: var(--secondary-color);
    padding: 6px;
    border-radius: 8px;
    margin-bottom: 10px;
    box-shadow: 0 0 10px -5px var(--primary-color);
    flex-direction: column;
}

.products-list,
.customer-details {
    text-align: center;
}

.info-label {
    font-size: 0.8rem;
}

.info-value {
    font-weight: var(--zh-font-weight-sm);
    color: var(--primary-color);
}

.customer-details h3,
.products-list h3 {
    font-size: 1.1rem;
    color: #333;
    border-bottom: 2px solid var(--primary-color);
    display: inline-block;
    margin-bottom: 10px;
    padding-bottom: 2px;
}

#modalProductsContainer {
    background-color: var(--icon-header-color);
    border-radius: 4px;
    box-shadow: 0px 0px 6px -3px var(--zh-form-valid-color);
}

.modal-product-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 4px 0;
    border-bottom: 1px solid var(--zh-focus-ring-color);
}

.modal-product-item:last-child {
    border-bottom: none;
}

.modal-product-item .name {
    width: 50% !important;
    font-size: 0.9rem;
    color: #333;
    flex: 1;
    text-align: justify;
    padding: 0 6px;
}

.modal-product-item .qty {
    width: 15%;
    font-size: 0.85rem;
    color: #777;
    margin: 0 10px;
}

.modal-product-item .price {
    width: 35%;
    font-weight: bold;
    color: #333;
    text-align: justify;
}

.summary-details {
    margin-top: 2px;
    padding-top: 2px;
    /* border-top: 2px dashed var(--zh-success-text-emphasis); */
}

.summary-details .total-line {
    margin-top: 2px;
    padding-top: 2px;
    border-top: 1px solid var(--zh-success-text-emphasis);
}

.summary-details .total-line .name,
.summary-details .total-line .price {
    color: var(--zh-form-invalid-color);
    font-size: 1.2rem;
    font-weight: bold;
}

.modal-footer {
    width: 100%;
    margin-top: 0px;
}

.modal-footer .btn-checkout-mini {
    width: 100%;
    font-size: 14px;
    border-radius: 10px;
    margin-top: 0;
}

@media (max-width: 480px) {
    .order-info-grid {
        grid-template-columns: 1fr;
    }
}

.payment-details-box {
    display: none;
    background-color: #f9f9f9;
    border: 1px dashed #ccc;
    width: 100%;
    box-sizing: border-box;
    padding: 15px;
    border-radius: 8px;
    margin-top: 10px;
}

.loading-paypal {
    display: flex;
    padding: 10px;
    color: #666;
    align-items: center;
}

.loading-paypal svg {
    width: 20px;
    height: 20px;
    margin: 0 6px;
    animation: spin 1.8s linear infinite;
}

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

    100% {
        transform: rotate(360deg);
    }
}

.payment-method-option {
    flex-wrap: wrap;
    /* Allow wrapping if needed */
}

.payment-label {
    flex: 1;
    /* Take remaining space */
}

.payment-label i {
    width: max-content;
    height: min-content;
    border: 1px solid var(--zh-green);
    border-radius: 3px;
}

.temporary-text {
    display: flex;
    font-size: 0.9em;
    margin: 0px;
    align-items: center;
}

.temporary-text svg {
    width: 14px;
    height: 14px;
    margin-inline-end: 6px;
}

.title-svg {
    padding: 0 10px;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.title-icon {
    width: 100%;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.payment-icons.flex-direction {
    display: flex;
    align-items: center;
    gap: 4px;
    flex-wrap: wrap;
    /* justify-content: center; */
}

.payment-icons.flex-direction img {
    width: 48px;
    height: 30px;
    border: 1px solid green;
    padding: 0px;
    border-radius: 4px;
}