/* ===== صفحة السلّة / إتمام الدفع — تعتمد متغيّرات site.css ===== */

/* خطوات */
.cart-steps { display: flex; align-items: center; justify-content: center; gap: 10px; flex-wrap: wrap; }
.cart-step { display: flex; align-items: center; gap: 8px; font-weight: 700; color: var(--c-muted-3); font-size: 15px; }
.cart-step__no { width: 26px; height: 26px; border-radius: 50%; background: #fff; border: 2px solid var(--line); display: flex; align-items: center; justify-content: center; font-size: 13px; }
.cart-step.is-active { color: var(--c-teal-d); }
.cart-step.is-active .cart-step__no { background: var(--c-teal); border-color: var(--c-teal); color: #fff; }
.cart-step__sep { width: 40px; height: 2px; background: var(--line); border-radius: 2px; }

/* تنبيه */
.cart-alert { padding: 13px 18px; border-radius: var(--r-md); font-weight: 700; font-size: 14.5px; }
.cart-alert.is-ok { background: #eaf7ee; color: #2f7d3f; border: 1px solid #bfe6c8; }
.cart-alert.is-error { background: #fdecec; color: #b3261e; border: 1px solid #f3c4c0; }

/* فارغة */
.cart-empty { text-align: center; padding: 70px 20px; }
.cart-empty__icon { font-size: 54px; margin-bottom: 10px; }
.cart-empty h3 { font-family: var(--font-head); font-weight: 800; color: var(--c-ink); margin: 0 0 6px; }
.cart-empty p { color: var(--c-muted); margin: 0 0 18px; }

/* بطاقة العناصر */
.cart-card { background: var(--bg-panel); border: 1px solid var(--line); border-radius: 20px; padding: 8px 18px; }
.cart-card__head { display: flex; align-items: center; justify-content: space-between; padding: 14px 4px; border-bottom: 1px solid var(--line); font-family: var(--font-head); font-weight: 800; color: var(--c-ink); font-size: 17px; }
.cart-link-danger { background: none; border: none; color: #c0392b; font-weight: 700; font-size: 13.5px; cursor: pointer; }

/* صف عنصر */
.cart-row { display: flex; align-items: center; gap: 14px; padding: 16px 4px; border-bottom: 1px solid var(--line); }
.cart-row:last-child { border-bottom: none; }
.cart-row__thumb { width: 64px; height: 64px; border-radius: 14px; background: var(--bg-page); display: flex; align-items: center; justify-content: center; font-size: 26px; flex-shrink: 0; overflow: hidden; }
.cart-row__thumb img { width: 100%; height: 100%; object-fit: cover; }
.cart-row__info { flex: 1; min-width: 0; }
.cart-row__name { font-weight: 700; color: var(--c-ink); line-height: 1.4; }
.cart-row__meta { font-size: 13px; color: var(--c-teal); margin-top: 2px; }
.cart-row__unit { font-size: 12.5px; color: var(--c-muted-3); margin-top: 2px; }
.cart-row__total { font-weight: 800; color: var(--c-teal-d); min-width: 92px; text-align: left; font-size: 16px; }
.cart-row__total span { font-size: 12px; font-weight: 700; color: var(--c-muted); }
.cart-row__remove button { width: 32px; height: 32px; border-radius: 9px; border: none; background: var(--bg-page); color: var(--c-muted); cursor: pointer; font-size: 13px; }
.cart-row__remove button:hover { background: #fdecec; color: #c0392b; }

/* شارة نوع العنصر */
.cart-type { display: inline-block; font-weight: 800; font-size: 11px; padding: 3px 10px; border-radius: 20px; margin-bottom: 5px; }
.cart-type.is-product { background: var(--bg-soft-teal); color: var(--c-teal-d); }
.cart-type.is-program { background: var(--bg-soft-lime); color: var(--c-lime-d); }
.cart-type.is-consult { background: var(--bg-soft-blue); color: var(--c-blue-d); }

/* كمية ثابتة (تسجيل برنامج / استشارة — لا تُعدّل) */
.cart-fixed { display: inline-block; font-size: 12.5px; font-weight: 700; color: var(--c-muted); background: var(--bg-page); border-radius: var(--r-sm); padding: 7px 12px; white-space: nowrap; }

/* footer الثقة + طرق الدفع */
.cart-trust { display: flex; align-items: center; justify-content: center; gap: 7px; margin-top: 14px; color: var(--c-muted); font-size: 12.5px; font-weight: 700; }
.cart-pays { display: flex; align-items: center; justify-content: center; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.cart-pays span { background: #fff; border: 1px solid var(--line); border-radius: 8px; padding: 5px 11px; font-size: 11.5px; font-weight: 800; color: var(--c-muted-2); }

/* الكمية */
.cart-qty { gap: 4px; }
.cart-qty form { display: inline; margin: 0; }
.cart-qty span { min-width: 26px; text-align: center; font-weight: 800; color: var(--c-ink); }

.cart-continue { display: inline-block; margin-top: 16px; color: var(--c-teal-d); font-weight: 700; text-decoration: none; }

/* ملخّص */
.cart-summary { background: var(--bg-panel); border: 1px solid var(--line); border-radius: 20px; padding: 22px; position: sticky; top: 96px; }
.cart-summary__title { font-family: var(--font-head); font-weight: 800; color: var(--c-ink); font-size: 19px; margin: 0 0 16px; }

.cart-coupon { display: flex; gap: 8px; margin-bottom: 14px; }
.cart-coupon input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; font-family: inherit; }
.cart-coupon button { background: var(--c-teal); color: #fff; border: none; border-radius: var(--r-sm); padding: 0 16px; font-weight: 800; cursor: pointer; }
.cart-coupon-applied { display: flex; align-items: center; justify-content: space-between; background: #eaf7ee; border: 1px solid #bfe6c8; border-radius: var(--r-sm); padding: 10px 14px; margin-bottom: 14px; color: #2f7d3f; font-weight: 700; }
.cart-coupon-applied button { background: none; border: none; color: #c0392b; font-weight: 700; cursor: pointer; font-size: 13px; }

.cart-points { margin-bottom: 14px; }
.cart-points label { display: block; font-size: 13px; color: var(--c-muted); margin-bottom: 6px; font-weight: 700; }
.cart-points__row { display: flex; gap: 8px; }
.cart-points__row input { flex: 1; min-width: 0; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; font-family: inherit; }
.cart-points__row button { background: var(--bg-page); color: var(--c-teal-d); border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 0 14px; font-weight: 800; cursor: pointer; }

/* طريقة التسليم — بنفس لغة تصميم الكوبون/النقاط */
.cart-delivery { margin-bottom: 14px; }
.cart-delivery__title { display: block; font-size: 13px; color: var(--c-muted); margin-bottom: 6px; font-weight: 700; }
.cart-delivery__opt { display: flex; align-items: center; gap: 10px; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 10px 12px; cursor: pointer; font-size: 14.5px; color: var(--c-ink); transition: border-color .15s ease, background .15s ease; }
.cart-delivery__opt + .cart-delivery__opt { margin-top: 8px; }
.cart-delivery__opt span { flex: 1; font-weight: 600; }
.cart-delivery__opt b { font-weight: 800; }
.cart-delivery__opt input { accent-color: var(--c-teal); width: 16px; height: 16px; }
.cart-delivery__opt:has(input:checked) { border-color: var(--c-teal); background: #f4faf9; }
.cart-delivery__free { color: var(--c-teal-d); }
.cart-delivery__branch { width: 100%; margin-top: 8px; border: 1.5px solid var(--line); border-radius: var(--r-sm); padding: 9px 12px; font-family: inherit; font-size: 14.5px; color: var(--c-ink); background: var(--bg-page); }

.cart-lines { border-top: 1px solid var(--line); padding-top: 14px; margin-top: 4px; }
.cart-line { display: flex; justify-content: space-between; padding: 7px 0; color: var(--c-muted); font-size: 14.5px; }
.cart-line--minus span:last-child { color: #2f7d3f; font-weight: 700; }

.cart-total { display: flex; align-items: center; justify-content: space-between; border-top: 2px solid var(--line); margin-top: 10px; padding-top: 14px; }
.cart-total span { font-weight: 800; color: var(--c-ink); }
.cart-total b { font-family: var(--font-head); font-size: 26px; color: var(--c-teal-d); }
.cart-total small { font-size: 13px; font-weight: 700; }

.cart-earn { background: #fff6ea; color: #c47512; border: 1px solid #f6dcb4; border-radius: var(--r-sm); padding: 9px 12px; font-size: 13px; text-align: center; margin: 14px 0; }

.cart-checkout { display: block; width: 100%; text-align: center; background: var(--c-accent, #F7941E); color: #fff; border: none; border-radius: var(--r-md); padding: 14px; font-weight: 800; font-size: 16px; cursor: pointer; text-decoration: none; margin-top: 8px; }
.cart-checkout:hover { filter: brightness(.96); }

/* تخطيط صف السلّة على الجوال: شبكة سطرين بدل ضغط الاسم أفقيًا */
@media (max-width: 767.98px) {
    .cart-row {
        display: grid;
        grid-template-columns: 56px minmax(0, 1fr) auto;
        grid-template-areas:
            "thumb info   remove"
            "thumb qty    total";
        align-items: center;
        column-gap: 12px;
        row-gap: 10px;
    }
    .cart-row__thumb  { grid-area: thumb; width: 56px; height: 56px; }
    .cart-row__info   { grid-area: info; min-width: 0; }
    .cart-row__qty    { grid-area: qty; justify-self: start; }
    .cart-row__total  { grid-area: total; min-width: 0; text-align: start; }
    .cart-row__remove { grid-area: remove; justify-self: end; }
    .cart-row__name   { font-size: 14.5px; }
    .cart-summary { position: static; }
}
