// Questo file fa parte di MyTown.
// MyTown è software libero: puoi ridistribuirlo e/o modificarlo secondo
// i termini della GNU Affero General Public License come pubblicata dalla
// Free Software Foundation, versione 3.
// Distribuito senza ALCUNA GARANZIA; vedi la GNU AGPL v3 per i dettagli.
// Copyright (C) Kondor Consulting & Services S.r.l.
// SPDX-License-Identifier: AGPL-3.0-or-later

.ordine-section-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--ion-color-medium-shade);
	padding: 12px 16px 4px;
}

.menu-cat-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 10px 16px 8px;
	background: var(--ion-color-light);
	border-top: 1px solid var(--ion-color-light-shade);
	border-bottom: 1px solid var(--ion-color-light-shade);
	font-size: 13px;
	font-weight: 600;
	color: var(--ion-color-primary);
	cursor: pointer;
}

.menu-item-img-wrap {
	width: 60px;
	height: 60px;
	border-radius: 8px;
	overflow: hidden;
	flex-shrink: 0;
	background: var(--ion-color-light);
	display: flex;
	align-items: center;
	justify-content: center;
}

.menu-item-img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.menu-item-img-placeholder {
	width: 100%;
	height: 100%;
	display: flex;
	align-items: center;
	justify-content: center;
	color: var(--ion-color-medium);
	font-size: 24px;
}

.menu-item-desc {
	font-size: 11px;
	color: var(--ion-color-medium);
	white-space: normal;
}

.ordine-fab-bar {
	position: fixed;
	bottom: 20px;
	left: 0;
	right: 0;
	display: flex;
	justify-content: space-between;
	padding: 0 20px;
	pointer-events: none;
	z-index: 999;
}

.ordine-fab-btn {
	position: relative;
	width: 56px;
	height: 56px;
	border-radius: 50%;
	background: var(--ion-color-medium);
	display: flex;
	align-items: center;
	justify-content: center;
	pointer-events: all;
	cursor: pointer;
	box-shadow: 0 4px 12px rgba(0,0,0,0.25);

	ion-icon {
		font-size: 24px;
		color: #fff;
	}

	&.cart {
		background: var(--ion-color-success);
	}
}

.ordine-fab-badge {
	position: absolute;
	top: -4px;
	right: -4px;
	min-width: 20px;
	height: 20px;
	border-radius: 10px;
	background: var(--ion-color-primary);
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0 5px;
	box-shadow: 0 1px 4px rgba(0,0,0,0.3);

	&.danger {
		background: var(--ion-color-danger);
	}
}

.item-price {
	font-weight: 600;
	color: var(--ion-color-success-shade);
}

.qty-controls {
	display: flex;
	align-items: center;
	gap: 0;
}

.qty-num {
	font-size: 15px;
	font-weight: 600;
	min-width: 22px;
	text-align: center;
}

.qty-label {
	font-size: 12px;
	color: var(--ion-color-medium);
}

.cart-item-end {
	display: flex;
	flex-direction: row;
	align-items: center;
	gap: 8px;
}

.payment-items-summary {
	font-size: 12px;
	color: var(--ion-color-medium);
	font-style: italic;
}

.method-section {
	padding-top: 8px;
	padding-bottom: 4px;
}

.method-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--ion-color-medium-shade);
	margin: 0 0 8px;
}

.method-buttons {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(90px, 1fr));
	gap: 10px;
	margin-bottom: 4px;
}

.method-label {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--ion-color-medium-shade);
	margin: 16px 0 8px;
}

.method-btn {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 6px;
	padding: 14px 8px;
	border: 2px solid var(--ion-color-light-shade, #d7d8da);
	border-radius: 12px;
	background: #fff;
	cursor: pointer;
	transition: border-color 0.15s, background 0.15s, box-shadow 0.15s, transform 0.05s;
	position: relative;

	ion-icon {
		font-size: 26px;
		color: var(--ion-color-medium, #92949c);
		transition: color 0.15s;
	}

	span {
		font-size: 12px;
		font-weight: 600;
		color: var(--ion-color-dark, #222428);
		transition: color 0.15s;
	}

	&:active {
		transform: scale(0.97);
	}

	&.selected {
		border-color: var(--ion-color-primary, #3880ff);
		background: rgba(56, 128, 255, 0.10);
		box-shadow: 0 2px 6px rgba(56, 128, 255, 0.20);

		ion-icon { color: var(--ion-color-primary, #3880ff); }
		span     { color: var(--ion-color-primary, #3880ff); font-weight: 700; }

		// Checkmark in alto a destra
		&::after {
			content: '\2713';
			position: absolute;
			top: 4px;
			right: 6px;
			font-size: 12px;
			font-weight: 700;
			color: var(--ion-color-primary, #3880ff);
			width: 16px;
			height: 16px;
			line-height: 16px;
			text-align: center;
		}
	}
}

.cassa-section-title {
	font-size: 11px;
	font-weight: 700;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--ion-color-medium-shade);
	padding: 12px 16px 4px;

	&.storico-header {
		display: flex;
		align-items: center;
		justify-content: space-between;
		cursor: pointer;
		padding-right: 16px;
	}
}

// ── Cassa Ordini (replica web) ────────────────────────────
.cassa-orders-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding-right: 12px;

	ion-button {
		margin: 0;
		--padding-start: 12px;
		--padding-end: 12px;
	}
}

.cassa-orders-list {
	background: transparent;

	.paid-row {
		opacity: 0.55;

		ion-icon {
			font-size: 16px;
			margin-right: 6px;
		}
	}
}

.cassa-subsection-title {
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	color: var(--ion-color-medium-shade);
	padding: 16px 16px 4px;
}

.cassa-empty-payments {
	font-size: 13px;
	color: var(--ion-color-medium);
	padding: 12px 16px;
	font-style: italic;
}

// ── Checkout dialog ───────────────────────────────────────
.checkout-amount-row {
	display: flex;
	justify-content: space-between;
	align-items: center;
	background: var(--ion-color-light, #f5f5f5);
	border-radius: 10px;
	padding: 14px 16px;
	margin-bottom: 16px;
	font-size: 14px;

	strong {
		font-size: 22px;
		color: var(--ion-color-success);
	}
}

.paypal-container {
	margin-top: 16px;
	min-height: 60px;
}

// ── Bottone metodo NFC (riscossione manager) ──────────────
.method-btn--nfc {
	border-color: var(--ion-color-tertiary, #5260ff) !important;

	ion-icon { color: var(--ion-color-tertiary, #5260ff) !important; }
	span     { color: var(--ion-color-tertiary, #5260ff) !important; }

	&.selected {
		background: var(--ion-color-tertiary, #5260ff) !important;
		ion-icon, span { color: #fff !important; }
	}
}

// ── Modale NFC fullscreen ─────────────────────────────────
.nfc-modal-content {
	--background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
	color: #fff;
}

.nfc-modal-wrap {
	min-height: 100%;
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	gap: 18px;
	padding: 20px;
	text-align: center;
	color: #fff;

	&[data-status="done"]   .nfc-icon-inner { color: var(--ion-color-success); }
	&[data-status="error"]  .nfc-icon-inner,
	&[data-status="unsupported"] .nfc-icon-inner { color: var(--ion-color-danger); }
}

.nfc-circle {
	position: relative;
	width: 180px;
	height: 180px;
	display: flex;
	align-items: center;
	justify-content: center;
	margin-bottom: 8px;
}

.nfc-icon-inner {
	width: 96px;
	height: 96px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.16);
	border: 2px solid rgba(255, 255, 255, 0.4);
	display: flex;
	align-items: center;
	justify-content: center;
	z-index: 5;
	color: #fff;
	transition: color 0.2s;

	ion-icon {
		font-size: 52px;
	}
}

.nfc-ring {
	position: absolute;
	top: 50%;
	left: 50%;
	width: 100px;
	height: 100px;
	border-radius: 50%;
	border: 2px solid rgba(255, 255, 255, 0.5);
	transform: translate(-50%, -50%);
	animation: nfcPulse 2s infinite ease-out;
	opacity: 0;
}

.nfc-ring-1 { animation-delay: 0s;    }
.nfc-ring-2 { animation-delay: 0.6s;  }
.nfc-ring-3 { animation-delay: 1.2s;  }

@keyframes nfcPulse {
	0%   { transform: translate(-50%, -50%) scale(0.6); opacity: 0.9; }
	100% { transform: translate(-50%, -50%) scale(1.8); opacity: 0;   }
}

.nfc-title {
	font-size: 22px;
	font-weight: 700;
	margin: 0;
}

.nfc-amount {
	font-size: 32px;
	font-weight: 800;
	margin: 4px 0 0;
	color: #ffd166;
}

.nfc-message {
	font-size: 13px;
	color: rgba(255, 255, 255, 0.8);
	margin: 0 0 8px;
	max-width: 280px;
	line-height: 1.4;
}

.nfc-actions {
	width: 100%;
	max-width: 280px;
	margin-top: 12px;

	ion-button {
		--color: #fff;
		--border-color: rgba(255, 255, 255, 0.5);
	}
}
