/* ==========================================================
   Food Campus - POS screen
   ========================================================== */

:root {
	--pos-dark: #1c1917;
	--pos-dark-2: #292524;
	--pos-cream: #faf7f2;
	--pos-amber: #d97706;
	--pos-green: #166534;
	--pos-red: #b91c1c;
	--pos-muted: #a8a29e;
}

* {
	box-sizing: border-box;
}

html,
body {
	margin: 0;
	height: 100%;
	font-family: "Segoe UI", system-ui, Roboto, Arial, sans-serif;
	background: var(--pos-dark);
	color: var(--pos-cream);
	overflow: hidden;
	user-select: none;
	-webkit-user-select: none;
}

button {
	font-family: inherit;
	-webkit-tap-highlight-color: transparent;
	touch-action: manipulation;
}

/* ---------- App layout ---------- */

.pos-app {
	display: flex;
	flex-direction: column;
	/* dvh: pasek adresu przeglądarki na tablecie zjada 100vh —
	   stopka koszyka (GOTÓWKA/KARTA) wychodziła poza ekran */
	height: 100vh;
	height: 100dvh;
}

.pos-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 20px;
	background: var(--pos-dark-2);
	border-bottom: 2px solid var(--pos-amber);
}

.pos-header h1 {
	margin: 0;
	font-size: 1.4rem;
	letter-spacing: 1px;
}

.pos-clock {
	font-size: 1.2rem;
	font-weight: 700;
}

.pos-last {
	font-size: 1rem;
}

.pos-last strong {
	color: var(--pos-amber);
	font-size: 1.3rem;
}

.pos-menu-admin-btn {
	background: transparent;
	border: 2px solid var(--pos-amber);
	border-radius: 8px;
	color: var(--pos-amber);
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 1px;
	padding: 8px 12px;
	cursor: pointer;
}

.pos-menu-admin-btn:hover {
	background: rgba(217, 119, 6, 0.15);
}

.pos-menu-admin-btn.is-paused {
	background: var(--pos-red, #c62828);
	border-color: var(--pos-red, #c62828);
	color: #fff;
	animation: pos-pause-pulse 1.6s ease-in-out infinite;
}

@keyframes pos-pause-pulse {
	0%, 100% { opacity: 1; }
	50% { opacity: 0.55; }
}

.psm-close {
	font-size: 0.85rem;
	padding: 8px 14px;
	white-space: nowrap;
}

/* Komunikat awarii AJAX w POS — bez niego nieudane kliknięcie „wydane"
   i pusty pasek gotowych wyglądały jak awaria aplikacji. */
#fc-pos-error {
	position: fixed;
	left: 50%;
	top: 12px;
	transform: translate(-50%, -200%);
	z-index: 90;
	max-width: min(90vw, 900px);
	padding: 14px 22px;
	border-radius: 10px;
	background: #7f1d1d;
	border: 2px solid #fca5a5;
	color: #fff;
	font-size: clamp(0.95rem, 1.6vw, 1.35rem);
	font-weight: 800;
	line-height: 1.35;
	text-align: center;
	box-shadow: 0 10px 30px rgba(0, 0, 0, 0.45);
	opacity: 0;
	visibility: hidden;
	transition: transform 0.18s ease, opacity 0.18s ease;
	pointer-events: none;
}

#fc-pos-error.is-on {
	transform: translate(-50%, 0);
	opacity: 1;
	visibility: visible;
}

/* ---------- Gotowe do odbioru (pasek) ---------- */

.pos-ready {
	display: none;
	align-items: center;
	gap: 12px;
	padding: 8px 20px;
	background: var(--pos-green);
	border-bottom: 2px solid var(--pos-amber);
	overflow-x: auto;
}

.pos-ready-label {
	font-size: 0.85rem;
	font-weight: 800;
	letter-spacing: 1px;
	white-space: nowrap;
	color: #fff;
}

.pos-ready-list {
	display: flex;
	gap: 8px;
	flex-wrap: nowrap;
	/* Świeżo wygotowane ląduje na początku — bez tego karty doklejone
	   z prawej są poza ekranem i obsługa ich nie widzi. */
	scroll-behavior: smooth;
}

.pos-ready-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 2px;
	border: none;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.18);
	color: #fff;
	padding: 6px 14px;
	cursor: pointer;
	white-space: nowrap;
	min-width: 72px;
}

.pos-ready-btn:hover {
	background: rgba(255, 255, 255, 0.3);
}

.pos-ready-btn strong {
	font-size: 1.5rem;
	line-height: 1.1;
}

.pos-ready-items {
	font-size: 0.7rem;
	opacity: 0.9;
	max-width: 200px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pos-ready-tags {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
	justify-content: center;
}

.pos-ready-tag {
	font-style: normal;
	font-size: 0.6rem;
	font-weight: 800;
	letter-spacing: 0.5px;
	color: #fff;
	background: rgba(255, 255, 255, 0.22);
	padding: 1px 6px;
	border-radius: 6px;
}

.pos-ready-tag-unpaid {
	background: var(--pos-red);
}

.pos-ready-btn.pos-ready-unpaid {
	border: 2px solid var(--pos-red);
}

/* ---------- Nieopłacone (pasek) ---------- */

.pos-unpaid {
	display: none;
	align-items: center;
	gap: 12px;
	padding: 8px 20px;
	background: var(--pos-red);
	border-bottom: 2px solid var(--pos-amber);
	overflow-x: auto;
}

.pos-unpaid-label {
	font-size: 0.85rem;
	font-weight: 800;
	letter-spacing: 1px;
	white-space: nowrap;
	color: #fff;
}

.pos-unpaid-list {
	display: flex;
	gap: 8px;
	flex-wrap: nowrap;
}

.pos-unpaid-btn {
	display: flex;
	align-items: center;
	gap: 8px;
	border: none;
	border-radius: 10px;
	background: rgba(255, 255, 255, 0.2);
	color: #fff;
	padding: 6px 14px;
	cursor: pointer;
	white-space: nowrap;
	min-width: 90px;
}

.pos-unpaid-btn:hover {
	background: rgba(255, 255, 255, 0.32);
}

.pos-unpaid-btn strong {
	font-size: 1.3rem;
	line-height: 1.1;
}

.pos-unpaid-items {
	font-size: 0.7rem;
	opacity: 0.92;
	max-width: 180px;
	overflow: hidden;
	text-overflow: ellipsis;
}

.pos-unpaid-total {
	font-size: 0.9rem;
	font-weight: 800;
}

.pos-unpaid-item {
	display: flex;
	align-items: center;
	gap: 4px;
	flex: 0 0 auto;
}

.pos-unpaid-vbtn {
	border: none;
	border-radius: 8px;
	background: rgba(0, 0, 0, 0.28);
	color: #fff;
	width: 28px;
	height: 28px;
	font-size: 0.9rem;
	line-height: 1;
	cursor: pointer;
	flex: 0 0 auto;
}

.pos-unpaid-vbtn:hover {
	background: rgba(0, 0, 0, 0.45);
}

.pos-main {
	display: grid;
	grid-template-columns: 200px 1fr 360px;
	flex: 1;
	min-height: 0;
}

/* ---------- Categories ---------- */

.pos-cats {
	background: var(--pos-dark-2);
	padding: 12px;
	overflow-y: auto;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.pos-cat {
	background: transparent;
	color: var(--pos-cream);
	border: 2px solid transparent;
	border-radius: 10px;
	padding: 16px 12px;
	font-size: 1rem;
	font-weight: 700;
	cursor: pointer;
	text-align: left;
}

.pos-cat:hover {
	background: rgba(217, 119, 6, 0.15);
}

.pos-cat-active {
	background: var(--pos-amber);
	color: #fff;
}

/* ---------- Products ---------- */

.pos-products {
	overflow-y: auto;
	padding: 16px;
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
	gap: 12px;
	align-content: start;
}

.pos-product {
	background: var(--pos-dark-2);
	border-radius: 12px;
	overflow: hidden;
	display: flex;
	flex-direction: column;
	transition: background 0.15s;
}

.pos-product .pp-main {
	background: none;
	border: none;
	color: var(--pos-cream);
	padding: 16px 10px;
	font-size: 0.95rem;
	font-weight: 600;
	cursor: pointer;
	min-height: 84px;
	display: flex;
	flex-direction: column;
	justify-content: center;
	gap: 6px;
	text-align: center;
	flex: 1;
	width: 100%;
}

.pos-product .pp-main:hover {
	background: rgba(217, 119, 6, 0.25);
}

.pos-product .pp-main:active {
	background: rgba(217, 119, 6, 0.35);
}

.pos-side-btn {
	background: var(--pos-amber);
	border: none;
	color: #fff;
	font-size: 0.78rem;
	font-weight: 800;
	letter-spacing: 1px;
	padding: 8px;
	cursor: pointer;
	width: 100%;
}

.pos-side-btn:hover {
	background: #f59e0b;
}

.pos-product .pp-name {
	font-size: 1rem;
}

.pos-product .pp-price {
	color: var(--pos-amber);
	font-size: 1.1rem;
	font-weight: 800;
}

.pos-product.pos-out {
	opacity: 0.45;
	cursor: not-allowed;
}

.pos-product.pos-out .pp-main,
.pos-product.pos-out .pos-side-btn {
	cursor: not-allowed;
}

.pos-product.pos-out .pos-side-btn {
	background: #57534e;
}

.pos-product.pos-out::after {
	content: "BRAK";
	display: block;
	color: var(--pos-red);
	font-weight: 800;
	font-size: 0.8rem;
	text-align: center;
	padding: 4px;
}

/* Opakowanie przy „na wynos": doliczane automatycznie — ręczne dodanie zablokowane. */
.pos-product.pos-pack-blocked {
	opacity: 0.5;
	cursor: not-allowed;
}

.pos-product.pos-pack-blocked .pp-main {
	cursor: not-allowed;
}

.pos-product.pos-pack-blocked::after {
	content: "AUTO";
	display: block;
	color: var(--pos-red);
	font-weight: 800;
	font-size: 0.8rem;
	text-align: center;
	padding: 4px;
}

/* ---------- Category groups ---------- */

.pos-group-title {
	grid-column: 1 / -1;
	color: var(--pos-amber);
	font-size: 1.1rem;
	font-weight: 800;
	letter-spacing: 1px;
	text-transform: uppercase;
	margin: 10px 0 6px;
	padding-bottom: 6px;
	border-bottom: 2px solid rgba(217, 119, 6, 0.35);
}

.pos-group-title:first-child {
	margin-top: 0;
}

/* ---------- Cart ---------- */

.pos-cart {
	background: var(--pos-dark-2);
	border-left: 2px solid var(--pos-amber);
	display: flex;
	flex-direction: column;
	min-height: 0;
}

.pos-cart h2 {
	margin: 14px 16px 8px;
	font-size: 1.1rem;
	color: var(--pos-amber);
}

.pos-cart-lines {
	list-style: none;
	margin: 0;
	padding: 0 12px;
	overflow-y: auto;
	flex: 1;
	min-height: 0;
}

.pos-cart-line {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	padding: 8px 6px;
	border-bottom: 1px solid rgba(250, 247, 242, 0.08);
}

/* Gdy wiersz nie mieści wszystkiego w jednej linii, nazwa zostaje na swojej,
   a ilość/cena/notatka schodzą pod nią — zamiast ściskać nazwę do zera. */
.pos-cart-line > .pl-name-box {
	flex: 1 1 150px;
}

/* Elementy sterujące nigdy nie znikają ani nie nachodzą na nazwę. */
.pos-cart-line > .pl-qty,
.pos-cart-line > .pl-price,
.pos-cart-line > .pl-remove,
.pos-cart-line > .pl-note-btn {
	flex-shrink: 0;
}

.pos-cart-line > .pl-price {
	margin-left: auto;
}

.pos-cart-side {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 4px 6px 4px 20px;
	border-bottom: 1px solid rgba(250, 247, 242, 0.06);
}

.pl-side-name {
	flex: 1;
	font-size: 0.85rem;
	color: #d6c6a5;
}

.pl-side-qty {
	font-size: 0.85rem;
	color: var(--pos-muted);
	min-width: 22px;
	text-align: center;
}

.pl-name {
	font-size: 0.92rem;
	overflow-wrap: break-word;
}

.pl-qty {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-shrink: 0;
}

.pl-qty button {
	width: 30px;
	height: 30px;
	border-radius: 50%;
	border: none;
	background: var(--pos-dark);
	color: var(--pos-cream);
	font-size: 1.1rem;
	font-weight: 700;
	cursor: pointer;
}

.pl-price {
	width: 84px;
	text-align: right;
	font-weight: 700;
	flex-shrink: 0;
}

.pl-remove {
	background: none;
	border: none;
	color: var(--pos-red);
	font-size: 1.2rem;
	cursor: pointer;
	flex-shrink: 0;
}

.pos-cart-empty {
	padding: 20px 16px;
	color: var(--pos-muted);
	text-align: center;
	font-size: 0.9rem;
}

.pos-cart-total {
	display: flex;
	justify-content: space-between;
	align-items: center;
	padding: 14px 16px;
	background: var(--pos-dark);
	border-top: 2px solid var(--pos-amber);
}

.pos-cart-total span {
	font-size: 0.95rem;
}

.pos-cart-total strong {
	font-size: 1.5rem;
	color: var(--pos-amber);
}

.pos-pay {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 8px;
	padding: 10px 16px;
}

.pos-toggle-takeaway {
	background: transparent;
	border: 2px solid var(--pos-amber);
	color: var(--pos-amber);
	font-size: 0.95rem;
	padding: 10px;
	margin: 0 16px;
	letter-spacing: 1px;
}

.pos-toggle-takeaway.active {
	background: var(--pos-amber);
	color: #fff;
}

.pos-toggle-takeaway:disabled {
	cursor: default;
	opacity: 0.65;
}

.pos-btn {
	border: none;
	border-radius: 10px;
	padding: 16px 12px;
	font-size: 1.05rem;
	font-weight: 800;
	cursor: pointer;
	color: #fff;
}

.pos-btn-cash {
	background: var(--pos-green);
}

.pos-btn-card {
	background: var(--pos-amber);
}

.pos-btn-clear {
	background: transparent;
	border: 2px solid var(--pos-muted);
	color: var(--pos-muted);
	font-size: 0.9rem;
	padding: 10px;
}

/* ---------- Success overlay ---------- */

.pos-success {
	position: fixed;
	inset: 0;
	background: rgba(28, 25, 23, 0.92);
	display: none;
	align-items: center;
	justify-content: center;
	z-index: 50;
}

.pos-success.show {
	display: flex;
}

.success-box {
	text-align: center;
	background: var(--pos-dark-2);
	border: 3px solid var(--pos-amber);
	border-radius: 20px;
	padding: 48px 72px;
}

.success-check {
	font-size: 4rem;
	color: var(--pos-green);
}

.success-number {
	font-size: 5rem;
	font-weight: 900;
	color: var(--pos-amber);
	margin: 8px 0;
}

.success-total {
	font-size: 1.3rem;
	margin-bottom: 24px;
}

.success-actions {
	display: flex;
	gap: 12px;
	justify-content: center;
}

.pos-btn-primary {
	background: var(--pos-amber);
}

.pos-btn-print {
	background: transparent;
	border: 2px solid var(--pos-cream);
	color: var(--pos-cream);
}

.pos-btn-outline {
	background: transparent;
	border: 2px solid var(--pos-cream);
	color: var(--pos-cream);
}

.pos-btn-secondary {
	background: var(--pos-green);
}

#pos-cardpay-info {
	margin: 0 0 12px;
	min-height: 48px;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 12px;
	border-radius: 8px;
	background: var(--pos-dark-2);
	border: 1px solid var(--pos-amber);
	color: var(--pos-cream);
	font-size: 1.05rem;
	font-weight: 700;
}

.cardpay-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	justify-content: center;
}

.cardpay-actions .pos-btn {
	flex: 1 1 auto;
	min-width: 150px;
}

/* ---------- KOT preview modal ---------- */

.pos-kot-modal {
	position: fixed;
	inset: 0;
	z-index: 200;
	background: rgba(0, 0, 0, 0.7);
	display: flex;
	align-items: center;
	justify-content: center;
}

.kot-box {
	background: var(--pos-dark);
	border: 2px solid var(--pos-line);
	border-radius: 12px;
	padding: 20px;
	max-width: 400px;
	width: 90%;
	text-align: center;
}

.kot-box h3 {
	margin: 0 0 12px;
	color: var(--pos-cream);
	font-size: 1.1rem;
}

.kot-box pre {
	background: #fff;
	color: #000;
	padding: 16px;
	border-radius: 8px;
	font-family: monospace;
	font-size: 13px;
	line-height: 1.5;
	white-space: pre;
	text-align: left;
	overflow-x: auto;
	margin: 0 0 12px;
}

#pos-paragon-info {
	background: #fff;
	color: #000;
	padding: 8px 12px;
	border-radius: 8px;
	font-family: monospace;
	font-size: 13px;
	margin: 0 0 12px;
}

#pos-paragon-img img {
	background: #fff;
	max-width: 100%;
	border-radius: 8px;
	margin: 0 0 12px;
}

/* ---------- PIN screen ---------- */

.pos-pin-screen {
	position: fixed;
	inset: 0;
	background: var(--pos-dark);
	z-index: 60;
	display: flex;
	align-items: center;
	justify-content: center;
}

.pin-box {
	background: var(--pos-dark-2);
	border-radius: 16px;
	padding: 40px;
	text-align: center;
	width: 320px;
}

.pin-box input {
	width: 100%;
	padding: 14px;
	font-size: 1.6rem;
	text-align: center;
	border-radius: 8px;
	border: 2px solid var(--pos-amber);
	background: var(--pos-dark);
	color: var(--pos-cream);
	margin: 16px 0;
}

.pin-error {
	color: var(--pos-red);
	min-height: 1.2em;
}

/* ---------- Panel dostępności menu (skończyło się) ---------- */

.pos-soldout-modal {
	position: fixed;
	inset: 0;
	z-index: 95;
	background: rgba(10, 8, 4, 0.72);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.psm-box {
	background: var(--pos-dark-2);
	border: 3px solid var(--pos-amber);
	border-radius: 16px;
	width: min(760px, 100%);
	max-height: 92vh;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.5);
}

.psm-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 14px 18px;
	border-bottom: 2px solid var(--pos-amber);
	flex: 0 0 auto;
}

.psm-header h2 {
	margin: 0;
	font-size: 1.1rem;
	letter-spacing: 1px;
	color: var(--pos-amber);
}

.psm-search {
	flex: 1 1 auto;
	min-width: 0;
	max-width: 320px;
	padding: 8px 12px;
	font-family: inherit;
	font-size: 0.95rem;
	color: var(--pos-cream);
	background: var(--pos-dark);
	border: 2px solid var(--pos-amber);
	border-radius: 8px;
	outline: none;
}

.psm-search::placeholder {
	color: var(--pos-muted);
}

.psm-search:focus {
	border-color: var(--pos-cream);
}

.psm-body {
	overflow-y: auto;
	padding: 12px 18px 18px;
}

.psm-empty {
	color: var(--pos-muted);
	text-align: center;
	padding: 24px 0;
}

.psm-cat {
	margin-bottom: 18px;
}

.psm-cat-name {
	color: var(--pos-amber);
	font-size: 0.95rem;
	letter-spacing: 1px;
	text-transform: uppercase;
	margin: 10px 0 8px;
	padding-bottom: 4px;
	border-bottom: 2px solid rgba(217, 119, 6, 0.35);
}

.psm-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
	gap: 10px;
}

.psm-dish {
	background: var(--pos-dark);
	border: 2px solid transparent;
	border-radius: 10px;
	padding: 10px;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.psm-dish.is-sold {
	border-color: var(--pos-red);
	opacity: 0.85;
}

.psm-dish-name {
	font-size: 0.9rem;
	font-weight: 600;
	line-height: 1.15;
	min-height: 2.3em;
}

.psm-dish-price {
	color: var(--pos-muted);
	font-size: 0.85rem;
	font-weight: 700;
}

.psm-dish-btn {
	border: none;
	border-radius: 8px;
	padding: 10px;
	font-size: 0.8rem;
	font-weight: 800;
	letter-spacing: 0.5px;
	cursor: pointer;
	background: var(--pos-green);
	color: #fff;
}

.psm-dish-btn.is-sold {
	background: var(--pos-red);
}

.psm-dish-btn:disabled {
	opacity: 0.6;
	cursor: default;
}

@media (max-width: 620px) {
	.psm-grid {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}

	.psm-box {
		max-height: 90vh;
	}
}

/* ---------- Responsywność i ekrany dotykowe ---------- */

/* Urządzenia dotykowe: nie trzymaj stanu :hover po dotknięciu */
@media (hover: none) {
	.pos-cat:hover {
		background: none;
	}

	.pos-product .pp-main:hover {
		background: none;
	}

	.pos-ready-btn:hover {
		background: rgba(255, 255, 255, 0.18);
	}
}

/* Tablet w poziomie / małe ekrany */
@media (max-width: 1100px) {
	.pos-main {
		grid-template-columns: 170px 1fr 320px;
	}

	.pos-products {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
	}
}

/* Tablet w pionie */
@media (max-width: 860px) {
	.pos-main {
		grid-template-columns: 140px 1fr 300px;
	}

	.pos-cat {
		padding: 12px 10px;
		font-size: 0.92rem;
	}

	.pos-product .pp-main {
		min-height: 72px;
		padding: 12px 8px;
	}

	.pl-price {
		width: 70px;
	}
}

/* Tablet poziomo / niskie ekrany: kompaktowa stopka koszyka,
   żeby GOTÓWKA/KARTA mieściły się w całości */
@media (min-width: 621px) and (max-height: 840px) {
	.pos-header {
		padding: 6px 14px;
	}

	.pos-header h1 {
		font-size: 1.15rem;
	}

	.pos-cart h2 {
		margin: 10px 14px 4px;
		font-size: 1rem;
	}

	.pos-cart-lines {
		min-height: 64px;
	}

	.pos-cart-total {
		padding: 10px 14px;
	}

	.pos-cart-total strong {
		font-size: 1.3rem;
	}

	.pos-toggle-takeaway {
		padding: 7px;
		margin: 0 14px;
		font-size: 0.88rem;
	}

	.pos-order-comment {
		margin: 6px 0;
		padding: 6px 8px;
		max-height: 3.2em;
		font-size: 0.78rem;
	}

	.pos-pay {
		padding: 8px 14px;
		gap: 6px;
	}

	.pos-btn {
		padding: 12px 10px;
		font-size: 0.98rem;
	}

	.pos-btn-clear {
		padding: 7px;
	}
}

/* Telefon / bardzo wąski ekran: układ w jednej kolumnie */
@media (max-width: 620px) {
	.pos-header {
		padding: 8px 12px;
	}

	.pos-header h1 {
		font-size: 1.05rem;
	}

	.pos-clock {
		font-size: 1rem;
	}

	.pos-last {
		display: none;
	}

	.pos-main {
		grid-template-columns: 1fr;
		grid-template-rows: auto minmax(0, 1fr) auto;
		overflow: hidden;
	}

	.pos-cats {
		flex-direction: row;
		overflow-x: auto;
		padding: 8px;
		gap: 6px;
	}

	.pos-cat {
		flex: 0 0 auto;
		padding: 10px 14px;
		white-space: nowrap;
	}

	.pos-products {
		grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
		padding: 12px;
		gap: 10px;
	}

	.pos-cart {
		border-left: none;
		border-top: 2px solid var(--pos-amber);
		max-height: 42vh;
		overflow-y: auto;
	}

	.pos-cart h2 {
		margin: 10px 12px 6px;
		font-size: 1rem;
	}

	.pos-pay {
		padding: 8px 12px;
	}

	.pos-btn {
		padding: 14px 10px;
		font-size: 1rem;
	}

	.success-box {
		padding: 32px 24px;
		width: min(92vw, 480px);
	}

	.success-number {
		font-size: 3.5rem;
	}

	.pin-box {
		width: min(320px, 90vw);
		padding: 28px 20px;
	}

	.vm-box {
		padding: 18px 16px 14px;
	}

	.vm-title {
		font-size: 1.15rem;
	}
}

/* ---------- Warianty ---------- */

.pl-name-box {
	flex: 1 1 auto;
	display: flex;
	flex-direction: column;
	gap: 2px;
	min-width: 0;
}

.pl-variant {
	font-size: 0.72rem;
	font-style: italic;
	color: #8a7a5a;
	white-space: normal;
	line-height: 1.15;
}

.pos-variant-modal {
	position: fixed;
	inset: 0;
	z-index: 90;
	background: rgba(10, 8, 4, 0.72);
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 20px;
}

.vm-box {
	background: #faf7f2;
	color: #2a2318;
	border-radius: 16px;
	padding: 26px 26px 20px;
	width: min(520px, 100%);
	max-height: 90vh;
	overflow-y: auto;
	box-shadow: 0 24px 60px rgba(0, 0, 0, 0.4);
}

.vm-title {
	margin: 0 0 18px;
	font-size: 1.4rem;
}

.vm-group {
	margin-bottom: 18px;
}

.vm-group-label {
	font-size: 0.8rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #8a7a5a;
	margin-bottom: 8px;
}

.vm-option {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	width: 100%;
	padding: 12px 14px;
	margin-bottom: 8px;
	border: 2px solid #ded3bd;
	border-radius: 10px;
	background: #fff;
	color: #2a2318;
	font-size: 1rem;
	cursor: pointer;
	text-align: left;
}

.vm-option:hover {
	border-color: #d97706;
}

.vm-option-active {
	border-color: #d97706;
	background: #fdeed8;
	font-weight: 600;
}

.vm-option-price {
	color: #8a7a5a;
	font-weight: 600;
	white-space: nowrap;
}

.vm-actions {
	display: flex;
	gap: 10px;
	margin-top: 8px;
}

.vm-actions .pos-btn {
	flex: 1;
}

/* Dodatki do dania — wiersze z ilością */
.vm-side-row {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 8px 4px;
	border-bottom: 1px solid #eee2cc;
}

.vm-side-row:last-child {
	border-bottom: none;
}

.vm-side-name {
	flex: 1;
	font-size: 1rem;
}

.vm-side-qty {
	display: flex;
	align-items: center;
	gap: 10px;
}

.vm-side-qty button {
	width: 34px;
	height: 34px;
	border-radius: 50%;
	border: 2px solid #ded3bd;
	background: #fff;
	color: #2a2318;
	font-size: 1.1rem;
	font-weight: 700;
	cursor: pointer;
}

.vm-side-qty button:hover {
	border-color: #d97706;
}

.vm-side-qty span {
	min-width: 20px;
	text-align: center;
	font-weight: 700;
	font-size: 1.1rem;
}

.pl-note {
	font-size: 0.75rem;
	font-style: italic;
	color: #d6c6a5;
	white-space: normal;
	line-height: 1.15;
	margin-top: 2px;
}

.pl-note-btn {
	background: none;
	border: 2px solid var(--pos-muted);
	border-radius: 8px;
	color: var(--pos-muted);
	font-size: 0.9rem;
	width: 34px;
	height: 34px;
	cursor: pointer;
	flex: 0 0 auto;
}

.pl-note-btn.pl-note-set {
	border-color: var(--pos-amber);
	color: var(--pos-amber);
}

.pl-note-btn:hover {
	border-color: var(--pos-amber);
	color: var(--pos-amber);
}

.vm-qty {
	display: flex;
	align-items: center;
	gap: 12px;
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid #eee2cc;
}

.vm-qty-label {
	flex: 1;
	font-size: 0.85rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
	color: #8a7a5a;
}

.vm-qty-btn {
	width: 48px;
	height: 44px;
	padding: 0;
	border-radius: 8px;
	background: #d97706;
	border: none;
	color: #fff;
	font-size: 1.2rem;
	font-weight: 800;
	cursor: pointer;
}

.vm-qty-val {
	min-width: 32px;
	text-align: center;
	font-size: 1.3rem;
	font-weight: 800;
	color: #2a2318;
}

/* KDS: wariant na karcie kuchni */

.kds-item-variant {
	display: block;
	width: 100%;
	font-size: 0.72rem;
	font-style: italic;
	color: #c8b795;
	padding-left: 4px;
}

.kds-item-note {
	display: block;
	width: 100%;
	font-size: 0.75rem;
	font-weight: 700;
	color: var(--pos-amber);
	padding-left: 4px;
	margin-top: 2px;
}

.pos-cart-packaging {
	padding-left: 6px;
	border-top: 1px dashed rgba(245, 158, 11, 0.4);
	margin-top: 4px;
}
.pos-cart-packaging .pl-side-name {
	color: #f59e0b;
	font-weight: 600;
}

/* Komentarz zamówienia (POS + online). */
.pos-order-comment {
	display: block;
	width: 100%;
	margin: 8px 0;
	padding: 10px 12px;
	background: rgba(250, 247, 242, 0.1);
	color: #e2e8f0;
	border: 2px solid var(--pos-muted);
	border-radius: 8px;
	font: inherit;
	font-size: 0.9rem;
	resize: none;
}

.pos-order-comment::placeholder {
	color: rgba(250, 247, 242, 0.6);
	font-size: 0.85rem;
}

.pos-order-comment:focus {
	outline: none;
	border-color: var(--pos-amber);
}
