/* RDN Store Panel — الكاشير. يعتمد متغيرات .rsp في panel.css */

.rsp-pos { display: grid; gap: 16px; align-items: start; }
@media (min-width: 900px) {
	.rsp-pos { grid-template-columns: minmax(0, 1fr) 380px; }
}

.rsp-pos-top { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.rsp-pos-top .rsp-search { flex: 1; margin: 0; }
.rsp-pos-top .rsp-tool { flex: none; width: 50px; height: 50px; border-radius: 14px; position: relative; }
.rsp-pos-held-btn b {
	position: absolute; top: -6px; left: -6px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px;
	background: var(--amber); color: var(--ink); font-size: 11px; font-weight: 800; line-height: 20px;
}
.rsp-pos-held-btn b:empty { display: none; }

/* المنتجات */
.rsp-pos-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
@media (min-width: 1200px) { .rsp-pos-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); } }
.rsp-pos-grid > .rsp-empty { grid-column: 1 / -1; }
.rsp-pos-tile {
	position: relative; display: flex; flex-direction: column; align-items: stretch; gap: 4px;
	min-height: 150px; padding: 8px; border-radius: 16px; text-align: right;
	background: #fff; border: 1.5px solid var(--line); box-shadow: 0 1px 2px rgba(70, 35, 10, .05);
	transition: transform .1s, border-color .15s, box-shadow .15s;
}
.rsp-pos-tile:hover { border-color: var(--red); box-shadow: var(--shadow); }
.rsp-pos-tile:active, .rsp-pos-tile.is-bump { transform: scale(.95); }
.rsp-pos-tile img, .rsp-pos-initial { width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; object-fit: cover; }
.rsp-pos-initial {
	display: grid; place-items: center; font-size: 32px; font-weight: 800; color: var(--red-600);
	background: linear-gradient(135deg, #FFE9D6, #FFD6C4);
}
.rsp-pos-name { font-size: 14px; font-weight: 700; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rsp-pos-price { margin-top: auto; font-size: 15px; font-weight: 800; color: var(--red); }
.rsp-pos-price small { font-size: 11px; color: var(--muted); }
.rsp-pos-choose { position: absolute; top: 12px; right: 12px; padding: 2px 7px; border-radius: 8px; background: var(--amber-50); color: var(--amber-800); font-size: 11px; font-weight: 800; font-style: normal; }
.rsp-pos-incart { position: absolute; top: 12px; left: 12px; min-width: 26px; height: 26px; padding: 0 6px; border-radius: 13px; background: var(--red); color: #fff; font-size: 13px; line-height: 26px; text-align: center; box-shadow: 0 2px 8px rgba(227, 38, 47, .35); }
.rsp-pos-tile.is-out { opacity: .5; cursor: not-allowed; }
.rsp-pos-out { position: absolute; bottom: 44px; right: 12px; padding: 2px 8px; border-radius: 8px; background: var(--ink); color: #fff; font-size: 11px; font-style: normal; font-weight: 700; }
.rsp-skel-tile { border: 0; background: linear-gradient(90deg, #F6ECE3 25%, #FBF4EE 50%, #F6ECE3 75%); background-size: 200% 100%; animation: rsp-shimmer 1.2s infinite; }

/* السلة */
.rsp-pos-cart {
	display: flex; flex-direction: column; background: #fff; border-radius: var(--radius);
	border: 1px solid var(--line); box-shadow: var(--shadow); overflow: hidden;
}
@media (min-width: 900px) {
	.rsp-pos-cart { position: sticky; top: 128px; max-height: calc(100vh - 150px); }
	.rsp-pos-cart-x, .rsp-pos-backdrop, .rsp-pos-bar { display: none !important; }
}
@media (max-width: 899px) {
	.rsp-pos-cart {
		position: fixed; z-index: 90; inset-inline: 0; bottom: 0; max-height: 88vh;
		border-radius: 22px 22px 0 0; transform: translateY(105%); transition: transform .25s cubic-bezier(.2,.8,.2,1);
	}
	.rsp-pos.is-cart-open .rsp-pos-cart { transform: none; }
	.rsp-pos-backdrop { position: fixed; inset: 0; z-index: 89; background: rgba(31, 22, 19, .5); display: none; }
	.rsp-pos.is-cart-open .rsp-pos-backdrop { display: block; }
}
.rsp-pos-cart-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line); }
.rsp-pos-cart-head h3 { font-size: 17px; font-weight: 800; }
.rsp-pos-cart-head h3 b { display: inline-block; min-width: 24px; padding: 0 6px; border-radius: 12px; background: var(--red-50); color: var(--red); font-size: 13px; text-align: center; }
.rsp-pos-cart-head > div { display: flex; align-items: center; gap: 8px; }

.rsp-pos-lines { flex: 1; min-height: 120px; overflow-y: auto; padding: 4px 14px; }
.rsp-pos-line { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-rows: auto auto; gap: 2px 10px; padding: 10px 0; border-bottom: 1px dashed var(--line); }
.rsp-pos-line:last-child { border-bottom: 0; }
.rsp-pos-line-info strong { display: block; font-size: 14.5px; font-weight: 700; }
.rsp-pos-line-info small { display: block; font-size: 12px; color: var(--muted); }
.rsp-pos-line-info span { font-size: 12.5px; color: var(--muted); }
.rsp-pos-line-total { grid-column: 2; font-style: normal; font-weight: 800; text-align: left; }

.rsp-pos-qty { display: flex; align-items: center; border: 1.5px solid var(--line-2); border-radius: 12px; overflow: hidden; height: 36px; align-self: start; }
.rsp-pos-qty button { width: 34px; height: 100%; display: grid; place-items: center; font-size: 18px; font-weight: 800; color: var(--ink); background: #fff; }
.rsp-pos-qty button:hover { background: var(--line); }
.rsp-pos-qty button svg { width: 15px; height: 15px; color: var(--red-700); }
.rsp-pos-qty b { min-width: 28px; text-align: center; font-size: 15px; }
.rsp-pos-qty-lg { height: 52px; border-radius: 14px; }
.rsp-pos-qty-lg button { width: 46px; font-size: 22px; }

.rsp-pos-empty { display: grid; place-items: center; gap: 8px; padding: 30px 10px; color: var(--muted); text-align: center; }
.rsp-pos-empty svg { width: 42px; height: 42px; opacity: .5; }

.rsp-pos-sum { padding: 12px 14px 14px; border-top: 1px solid var(--line); background: #FFFCF9; }
.rsp-pos-discount { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.rsp-pos-discount > span { font-weight: 700; color: var(--muted); font-size: 14px; }
.rsp-pos-discount .rsp-input { min-height: 40px; padding: 6px 10px; flex: 1; font-weight: 700; }
.rsp-seg { display: inline-flex; padding: 3px; border-radius: 12px; background: var(--line); flex: none; }
.rsp-seg button { min-width: 42px; height: 34px; padding: 0 10px; border-radius: 9px; font-weight: 800; font-size: 13px; color: var(--muted); }
.rsp-seg button.is-active { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(0,0,0,.1); }
.rsp-pos-sum .rsp-kv { padding: 3px 0; font-size: 14px; }
.rsp-pos-sum .rsp-kv-total { font-size: 19px; margin-top: 2px; padding-top: 8px; }
.rsp-pos-actions { display: flex; gap: 8px; margin-top: 10px; }
.rsp-pos-actions .rsp-btn { height: 54px; }
.rsp-pos-actions .rsp-btn svg { width: 16px; height: 16px; }
.rsp-pos-actions .rsp-btn-primary { justify-content: space-between; font-size: 16px; }

.rsp-pos-bar {
	position: fixed; z-index: 40; inset-inline: 12px; bottom: calc(var(--nav-h) + 10px + env(safe-area-inset-bottom));
	display: flex; align-items: center; gap: 10px; height: 58px; padding: 0 16px; border-radius: 16px;
	background: var(--ink); color: #fff; font-weight: 800; box-shadow: 0 10px 30px rgba(31, 22, 19, .35);
}
.rsp-pos-bar[hidden] { display: none; }
.rsp-pos-bar span { position: relative; display: flex; }
.rsp-pos-bar span b { position: absolute; top: -8px; left: -10px; min-width: 20px; height: 20px; padding: 0 5px; border-radius: 10px; background: var(--red); font-size: 11px; line-height: 20px; text-align: center; }
.rsp-pos-bar strong { flex: 1; text-align: right; }
.rsp-pos-bar em { font-style: normal; color: var(--amber); font-size: 17px; }

/* اختيار الخيارات */
.rsp-pos-group-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.rsp-pos-group-head i { font-style: normal; font-size: 11.5px; font-weight: 800; padding: 3px 9px; border-radius: 99px; background: var(--line); color: var(--muted); }
.rsp-pos-group-head i.is-req { background: var(--ink); color: #fff; }
.rsp-pos-group.is-missing { box-shadow: 0 0 0 2px #fc8181; background: #FFF6F6; }
.rsp-pos-opts { display: flex; flex-wrap: wrap; gap: 8px; }
.rsp-pos-opt {
	display: inline-flex; flex-direction: column; align-items: center; justify-content: center; min-height: 52px; min-width: 76px;
	padding: 8px 14px; border-radius: 14px; border: 2px solid var(--line-2); background: #fff; font-weight: 700; font-size: 15px;
}
.rsp-pos-opt small { font-size: 12px; color: var(--muted); font-weight: 600; }
.rsp-pos-opt.is-selected { border-color: var(--red); background: var(--red); color: #fff; }
.rsp-pos-opt.is-selected small { color: rgba(255,255,255,.85); }
.rsp-pos-opt[disabled] { opacity: .45; }
.rsp-pos-picker .rsp-sheet-foot .rsp-btn { height: 52px; justify-content: space-between; }

/* الدفع */
.rsp-sheet-wrap.is-refresh .rsp-sheet, .rsp-sheet-wrap.is-refresh .rsp-sheet-backdrop { animation: none; }
.rsp-pos-due { display: flex; align-items: baseline; justify-content: space-between; background: var(--ink); color: #fff; border: 0; }
.rsp-pos-due span { font-weight: 700; opacity: .8; }
.rsp-pos-due strong { font-size: 32px; font-weight: 800; }
.rsp-pos-due small { font-size: 15px; opacity: .7; }
.rsp-pos-methods { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rsp-pos-methods button, .rsp-pos-status button {
	display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 12px 6px; border-radius: 14px;
	border: 2px solid var(--line-2); background: #fff; font-weight: 800; font-size: 15px;
}
.rsp-pos-methods i { font-style: normal; font-size: 22px; }
.rsp-pos-methods button.is-active, .rsp-pos-status button.is-active { border-color: var(--red); background: var(--red-50); color: var(--red-700); }
.rsp-pos-status { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 10px; }
.rsp-pos-types { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.rsp-pos-types button { display: flex; flex-direction: column; align-items: center; gap: 2px; padding: 10px 6px; border-radius: 14px; border: 2px solid var(--line-2); background: #fff; font-weight: 800; font-size: 14.5px; }
.rsp-pos-types i { font-style: normal; font-size: 22px; }
.rsp-pos-types button.is-active { border-color: var(--ink); background: var(--ink); color: #fff; }
.rsp-pos-type-field { margin: 12px 0 0 !important; }
.rsp-pos-loyalty { color: var(--amber-800); font-weight: 700; }
.rsp-pos-fee { display: block; font-size: 12px; font-weight: 600; opacity: .75; }
.rsp-pos-status small { font-size: 12px; font-weight: 600; color: var(--muted); }
#rsp-pos-cash { margin-top: 14px; }
#rsp-pos-cash .rsp-field { margin-bottom: 8px; }
.rsp-pos-received { font-size: 24px !important; font-weight: 800 !important; text-align: center; min-height: 58px !important; }
.rsp-pos-quick { display: flex; flex-wrap: wrap; gap: 6px; }
.rsp-pos-quick button { flex: 1; min-width: 60px; height: 42px; border-radius: 12px; background: var(--line); font-weight: 800; }
.rsp-pos-quick button:hover { background: var(--line-2); }
.rsp-pos-change { display: flex; align-items: baseline; justify-content: space-between; margin-top: 10px; padding: 12px 14px; border-radius: 14px; background: var(--green-50); color: #11773A; }
.rsp-pos-change:empty { display: none; }
.rsp-pos-change strong { font-size: 24px; font-weight: 800; }
.rsp-pos-change.is-short { background: var(--red-50); color: var(--red-700); }
.rsp-pos-more summary { cursor: pointer; font-weight: 800; color: var(--ink-2); }
.rsp-pos-print { display: flex; align-items: center; justify-content: space-between; padding: 6px 4px 10px; font-weight: 700; cursor: pointer; }
.rsp-pos-confirm { height: 58px !important; font-size: 17px !important; }
.rsp-pos-confirm svg { width: 20px; height: 20px; }

/* بعد الطلب */
.rsp-pos-done { text-align: center; padding: 20px 10px; }
.rsp-pos-done-icon { display: inline-grid; place-items: center; width: 84px; height: 84px; border-radius: 50%; background: var(--green); color: #fff; margin-bottom: 12px; animation: rsp-pop .3s ease; }
.rsp-pos-done-icon svg { width: 44px; height: 44px; }
.rsp-pos-done h3 { font-size: 26px; font-weight: 800; }
.rsp-pos-done p { color: var(--muted); margin: 4px 0 12px; }

/* المعلّقة والموازنة */
.rsp-pos-held { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.rsp-pos-held small { display: block; color: var(--muted); font-size: 12.5px; }
.rsp-pos-held p { margin-top: 4px; font-size: 13px; color: var(--ink-2); display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.rsp-pos-held-actions { display: flex; gap: 6px; flex: none; }
.rsp-pos-balance-filter { display: flex; gap: 8px; align-items: center; }
.rsp-pos-balance-filter .rsp-input { flex: 1; min-height: 42px; }
