/* ==========================================================================
   NMS Recesso Online — Frontend styles
   Tutte le regole sono sotto classi con prefisso .nms-recesso- così nulla
   può sovrascrivere o rompere gli stili del tema attivo.
   ========================================================================== */

.nms-recesso {
	--nms-recesso-btn-color: #7c3aed;
	--nms-recesso-border: #e6e6ea;
	--nms-recesso-muted: #6b7280;
	--nms-recesso-radius: 8px;
	max-width: 820px;
	font-size: 15px;
	line-height: 1.55;
	color: inherit;
}

/* Normalize vertical rhythm: the theme/page-builder (often Elementor) adds
   large margins to headings, forms and paragraphs. We control spacing
   ourselves via the blocks below, so aggressively reset anything the
   theme might inject on our own direct/nested elements. */
.nms-recesso > *:first-child {
	margin-top: 0 !important;
}

.nms-recesso h1,
.nms-recesso h2,
.nms-recesso h3,
.nms-recesso h4 {
	margin: 0 0 4px !important;
	padding: 0 !important;
}

.nms-recesso p {
	margin: 0 0 1em !important;
}

.nms-recesso form {
	margin: 0 !important;
	padding: 0 !important;
}

.nms-recesso ul,
.nms-recesso ol {
	margin: 0 !important;
	padding: 0 !important;
}

/* ---- Header (titolo + sottotitolo ordine) ---- */

.nms-recesso-header {
	margin: 0 0 14px !important;
}

.nms-recesso-title {
	margin: 0 0 2px !important;
	font-size: 1.35em;
	line-height: 1.2;
	text-transform: none;
	letter-spacing: normal;
}

.nms-recesso-subtitle {
	margin: 0 !important;
	font-size: 0.85em;
	color: var(--nms-recesso-muted);
	font-weight: 500;
	letter-spacing: 0.01em;
	text-transform: none;
}

/* Remove extra top margin the theme may add to the first panel after header. */
.nms-recesso-header + .nms-recesso-form-el .nms-recesso-panel:first-child,
.nms-recesso-panel:first-of-type {
	margin-top: 0;
}

/* ---- Panels / cards ---- */

.nms-recesso-panel {
	border: 1px solid var(--nms-recesso-border);
	border-radius: var(--nms-recesso-radius);
	margin: 0 0 16px !important;
	overflow: hidden;
	background: #fff;
}

.nms-recesso-panel-head {
	padding: 12px 16px;
	background: #fafafb;
	border-bottom: 1px solid var(--nms-recesso-border);
	font-weight: 600;
	font-size: 0.9em;
	letter-spacing: 0.01em;
}

/* ---- Product select rows (form) ---- */

.nms-recesso-product-select {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nms-recesso-product-row {
	display: flex;
	align-items: center;
	gap: 16px;
	padding: 14px 16px;
	margin: 0;
	border-bottom: 1px solid #f1f1f3;
}

.nms-recesso-product-row:last-child {
	border-bottom: none;
}

/* The whole left part is a clickable label: checkbox + image + info. */
.nms-recesso-product-pick {
	display: flex;
	align-items: center;
	gap: 14px;
	flex: 1 1 auto;
	min-width: 0;
	margin: 0;
	cursor: pointer;
}

/* Hide the real checkbox but keep it accessible/clickable. */
.nms-recesso-product-pick .nms-recesso-check {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
	margin: 0;
	pointer-events: none;
}

/* Custom, theme-proof checkbox square (never hidden by the theme). */
.nms-recesso-checkbox {
	flex: 0 0 auto;
	width: 22px;
	height: 22px;
	border: 2px solid #c4c4cc;
	border-radius: 5px;
	background: #fff;
	position: relative;
	transition: border-color 0.15s ease, background-color 0.15s ease;
	box-sizing: border-box;
}

.nms-recesso-checkbox::after {
	content: "";
	position: absolute;
	left: 6px;
	top: 2px;
	width: 6px;
	height: 11px;
	border: solid #fff;
	border-width: 0 2px 2px 0;
	transform: rotate(45deg) scale(0);
	transition: transform 0.15s ease;
}

.nms-recesso-check:checked + .nms-recesso-checkbox {
	background: var(--nms-recesso-btn-color);
	border-color: var(--nms-recesso-btn-color);
}

.nms-recesso-check:checked + .nms-recesso-checkbox::after,
.nms-recesso-checkbox.is-checked::after {
	transform: rotate(45deg) scale(1);
}

.nms-recesso-check:focus-visible + .nms-recesso-checkbox {
	outline: 2px solid var(--nms-recesso-btn-color);
	outline-offset: 2px;
}

.nms-recesso-product-media {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
}

.nms-recesso-product-thumb {
	width: 56px;
	height: 56px;
	object-fit: cover;
	border-radius: 6px;
	border: 1px solid var(--nms-recesso-border);
	background: #f7f7f7;
	display: block;
}

/* Flexible info column: min-width:0 lets the name wrap normally. */
.nms-recesso-product-info {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 2px;
}

.nms-recesso-product-name {
	margin: 0;
	font-weight: 500;
	min-width: 0;
	line-height: 1.35;
	overflow-wrap: break-word;
	word-break: normal;
	hyphens: none;
}

.nms-recesso-product-variation {
	font-size: 0.82em;
	color: var(--nms-recesso-muted);
	line-height: 1.3;
}

.nms-recesso-product-qty {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: flex-end;
}

/* Quantity stepper: - [ n ] + */
.nms-recesso-qty-stepper {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid #d0d0d5;
	border-radius: 6px;
	overflow: hidden;
	height: 36px;
	background: #fff;
}

.nms-recesso .nms-recesso-qty-stepper button.nms-recesso-qty-btn {
	width: 34px;
	min-width: 34px;
	border: none !important;
	background: #f2f2f4 !important;
	background-image: none !important;
	color: #333 !important;
	font-size: 18px !important;
	font-weight: 400 !important;
	line-height: 1 !important;
	cursor: pointer;
	padding: 0 !important;
	margin: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	text-shadow: none !important;
	display: flex;
	align-items: center;
	justify-content: center;
	text-transform: none !important;
	min-height: 0;
	height: auto;
	letter-spacing: normal !important;
}

.nms-recesso .nms-recesso-qty-stepper button.nms-recesso-qty-btn:hover:not(:disabled) {
	background: #e6e6e9 !important;
	color: #111 !important;
}

.nms-recesso .nms-recesso-qty-stepper button.nms-recesso-qty-btn:disabled {
	opacity: 0.4;
	cursor: default;
}

.nms-recesso-qty-input {
	width: 46px;
	border: none;
	border-left: 1px solid #e2e2e6;
	border-right: 1px solid #e2e2e6;
	text-align: center;
	padding: 0;
	font-size: 0.95em;
	-moz-appearance: textfield;
	appearance: textfield;
	background: #fff;
}

.nms-recesso-qty-input::-webkit-outer-spin-button,
.nms-recesso-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.nms-recesso-qty-input:disabled {
	background: #f6f6f7;
	color: #b0b0b5;
}

/* Mobile: stack into a clean vertical card. */
@media (max-width: 560px) {
	.nms-recesso-product-row {
		flex-wrap: wrap;
	}

	.nms-recesso-product-pick {
		flex: 1 1 100%;
	}

	.nms-recesso-product-qty {
		flex: 1 1 100%;
		justify-content: flex-start;
		padding-left: 36px;
	}
}

/* ---- Fields (reason, message) ---- */

.nms-recesso-field {
	margin: 0 0 18px;
}

.nms-recesso-label {
	display: block;
	font-weight: 600;
	font-size: 0.9em;
	margin: 0 0 6px;
}

.nms-recesso-required {
	color: #b91c1c;
}

.nms-recesso-field select,
.nms-recesso-field textarea,
.nms-recesso input[type="text"],
.nms-recesso input[type="email"] {
	width: 100%;
	max-width: 480px;
	padding: 9px 11px;
	border: 1px solid #ccc;
	border-radius: 6px;
	box-sizing: border-box;
}

.nms-recesso-field textarea {
	max-width: 100%;
	resize: vertical;
}

/* ---- Summary (review) ---- */

.nms-recesso-summary {
	margin: 0 0 18px;
	display: grid;
	grid-template-columns: 120px 1fr;
	gap: 8px 16px;
	padding: 0;
}

.nms-recesso-summary dt {
	font-weight: 600;
	color: var(--nms-recesso-muted);
	font-size: 0.9em;
	margin: 0;
	padding: 0;
}

.nms-recesso-summary dd {
	margin: 0 !important;
	padding: 0;
}

.nms-recesso-confirm-hint {
	color: var(--nms-recesso-muted);
	font-size: 0.9em;
	margin: 0 0 16px !important;
}

/* ---- Product list with thumbs (review / detail) ---- */

.nms-recesso-product-list-thumbs {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nms-recesso-product-list-thumbs li {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 10px 16px;
	border-bottom: 1px solid #f1f1f3;
}

.nms-recesso-product-list-thumbs li:last-child {
	border-bottom: none;
}

.nms-recesso-product-list-thumbs .nms-recesso-product-name {
	flex: 1;
}

.nms-recesso-product-qty-badge {
	color: var(--nms-recesso-muted);
	font-variant-numeric: tabular-nums;
}

/* ---- Actions / buttons ---- */

.nms-recesso-actions {
	margin: 4px 0 0;
}

.nms-recesso .nms-recesso-btn {
	cursor: pointer;
	border: 1px solid var(--nms-recesso-btn-color);
	background-color: var(--nms-recesso-btn-color);
	color: #fff !important;
	padding: 11px 22px;
	border-radius: 6px;
	font-weight: 600;
	line-height: 1.2;
	transition: opacity 0.15s ease;
}

.nms-recesso .nms-recesso-btn:hover {
	opacity: 0.9;
	color: #fff;
}

/* Small, proportionate "Visualizza" link in the list */
.nms-recesso-view-link {
	display: inline-block;
	padding: 7px 16px;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1.4;
	border: 1px solid var(--nms-recesso-border);
	border-radius: 6px;
	text-decoration: none;
	color: inherit;
	white-space: nowrap;
	vertical-align: middle;
}

.nms-recesso-view-link:hover {
	border-color: #bbb;
	background: #fafafb;
}

.nms-recesso-table .nms-recesso-cell-action {
	text-align: right;
	white-space: nowrap;
	width: 1%;
}

/* Force consistent vertical centering; beat theme table rules with a
   more specific selector than a bare td. */
.nms-recesso-account .nms-recesso-table tbody td,
.nms-recesso-table tbody td {
	vertical-align: middle !important;
	height: auto;
	line-height: 1.4;
}

.nms-recesso-table tbody td .nms-badge,
.nms-recesso-table tbody td .nms-recesso-view-link {
	vertical-align: middle;
	margin: 0 !important;
	float: none !important;
}

/* Status column: left-aligned, comfortable width. */
.nms-recesso-table th:nth-child(4),
.nms-recesso-table td:nth-child(4) {
	white-space: nowrap;
}

/* ---- Notices ---- */

.nms-recesso-notice {
	background: #f7f7f7;
	border-left: 4px solid #ccc;
	padding: 1em 1.2em;
	border-radius: 0 var(--nms-recesso-radius) var(--nms-recesso-radius) 0;
}

.nms-recesso .nms-recesso-error {
	color: #b32d2e;
	font-weight: 600;
}

.nms-recesso-shipping-notice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: #fff8e6;
	border: 1px solid #f3dfa3;
	border-radius: var(--nms-recesso-radius);
	padding: 12px 14px;
	margin: 0 0 18px;
}

.nms-recesso-shipping-notice .dashicons {
	color: #9a6b00;
	margin-top: 1px;
	flex-shrink: 0;
}

.nms-recesso-shipping-notice p {
	margin: 0 !important;
	font-size: 0.9em;
	color: #5c4200;
}

/* ---- Status badges ---- */

.nms-recesso .nms-badge {
	display: inline-block;
	padding: 4px 12px;
	border-radius: 4px;
	font-size: 0.78em;
	font-weight: 600;
	line-height: 1.5;
	white-space: nowrap;
	text-align: center;
	vertical-align: middle;
	border: 0;
	box-shadow: none;
	min-width: 0;
	width: auto;
}

.nms-recesso .nms-badge-nuova,
.nms-badge-nuova { background: #e0ecff; color: #1d4ed8; }
.nms-recesso .nms-badge-in_valutazione,
.nms-badge-in_valutazione { background: #fef3c7; color: #92400e; }
.nms-recesso .nms-badge-approvata,
.nms-badge-approvata { background: #dcfce7; color: #15803d; }
.nms-recesso .nms-badge-rifiutata,
.nms-badge-rifiutata { background: #fee2e2; color: #b91c1c; }
.nms-recesso .nms-badge-chiusa,
.nms-badge-chiusa { background: #f1f1f1; color: #50575e; }

/* ---- My Account: requests list ---- */

.nms-recesso-account {
	max-width: 100%;
}

.nms-recesso-empty-state {
	text-align: center;
	padding: 44px 20px;
	border: 1px dashed var(--nms-recesso-border);
	border-radius: var(--nms-recesso-radius);
	color: var(--nms-recesso-muted);
}

.nms-recesso-empty-state .dashicons {
	font-size: 34px;
	width: 34px;
	height: 34px;
	color: #c4c4cc;
	margin-bottom: 6px;
}

.nms-recesso-empty-state p {
	margin: 4px 0 !important;
}

.nms-recesso-empty-state .nms-recesso-empty-hint {
	font-size: 0.85em;
	color: #9aa0a6;
	max-width: 420px;
	margin: 4px auto 0 !important;
}

.nms-recesso-table {
	width: 100%;
	border-collapse: collapse !important;
	border-spacing: 0 !important;
	border: 1px solid var(--nms-recesso-border);
	border-radius: var(--nms-recesso-radius);
	overflow: hidden;
}

.nms-recesso-table tbody tr {
	height: auto;
}

.nms-recesso-table tbody td > * {
	margin-bottom: 0 !important;
	margin-top: 0 !important;
}

.nms-recesso-table {
	table-layout: auto;
}

.nms-recesso-table,
.nms-recesso-table tbody,
.nms-recesso-table tr {
	display: table !important;
	width: 100%;
}

.nms-recesso-table tbody {
	display: table-row-group !important;
}

.nms-recesso-table tr {
	display: table-row !important;
}

.nms-recesso-table th,
.nms-recesso-table td {
	display: table-cell !important;
	text-align: left;
	padding-top: 14px !important;
	padding-bottom: 14px !important;
	padding-left: 14px !important;
	padding-right: 14px !important;
	border-bottom: 1px solid #f1f1f3;
	vertical-align: middle !important;
	line-height: 1.4 !important;
	box-sizing: border-box;
}

.nms-recesso-table thead th {
	background: #fafafb;
	font-size: 0.72em;
	text-transform: uppercase;
	letter-spacing: 0.05em;
	color: var(--nms-recesso-muted);
	font-weight: 700;
}

.nms-recesso-table tbody tr:last-child td {
	border-bottom: none;
}

.nms-recesso-table .nms-practice-number {
	font-weight: 600;
}

/* Responsive: rows become stacked cards below 640px */
@media (max-width: 640px) {
	.nms-recesso-table thead {
		display: none;
	}

	.nms-recesso-table,
	.nms-recesso-table tbody,
	.nms-recesso-table tr,
	.nms-recesso-table td {
		display: block !important;
		width: 100%;
		box-sizing: border-box;
	}

	.nms-recesso-table tr {
		border: 1px solid var(--nms-recesso-border);
		border-radius: var(--nms-recesso-radius);
		padding: 8px 14px;
		margin-bottom: 12px;
	}

	.nms-recesso-table td {
		border: none;
		padding: 7px 0 !important;
		display: flex !important;
		justify-content: space-between;
		align-items: center;
		gap: 12px;
	}

	.nms-recesso-table td[data-label]::before {
		content: attr(data-label);
		font-weight: 600;
		color: var(--nms-recesso-muted);
		font-size: 0.75em;
		text-transform: uppercase;
		letter-spacing: 0.03em;
	}

	.nms-recesso-table td[data-label=""]::before {
		content: none;
	}
}

/* ---- My Account: detail / receipt ---- */

.nms-recesso-detail-heading {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 16px;
}

.nms-recesso-detail-heading h3 {
	margin: 0;
	font-size: 1.2em;
}

.nms-recesso-success-banner {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: #f0fbf3;
	border: 1px solid #cdeed8;
	border-radius: var(--nms-recesso-radius);
	padding: 14px 16px;
	margin: 0 0 20px;
}

.nms-recesso-success-banner .dashicons {
	color: #15803d;
	margin-top: 1px;
}

.nms-recesso-success-banner p {
	margin: 0 !important;
}

.nms-recesso-receipt-table {
	width: 100%;
	border-collapse: collapse;
	border: 1px solid var(--nms-recesso-border);
	border-radius: var(--nms-recesso-radius);
	overflow: hidden;
}

.nms-recesso-receipt-table td {
	padding: 11px 14px;
	border-bottom: 1px solid #f1f1f3;
	vertical-align: top;
}

.nms-recesso-receipt-table tr:last-child td {
	border-bottom: none;
}

.nms-recesso-receipt-table td:first-child {
	width: 150px;
	color: var(--nms-recesso-muted);
	font-weight: 600;
	font-size: 0.9em;
}

.nms-recesso-product-list {
	margin: 0;
	padding-left: 18px;
}

.nms-recesso-back-link {
	margin-top: 18px;
}

.nms-recesso-back-link a {
	font-size: 0.9em;
	text-decoration: none;
}

/* ---- Order action button (single order view) ---- */

.nms-recesso-order-action {
	margin-top: 12px;
}

/* "Reso avviato" indicator in the Orders list: inert, badge-like, not a real action. */
a.nms_recesso_active,
a.button.nms_recesso_active {
	pointer-events: none !important;
	cursor: default !important;
	background: #f1f1f1 !important;
	border-color: #e2e2e2 !important;
	color: #6b7280 !important;
	opacity: 1 !important;
}

.nms-recesso-order-detail-notice {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	background: #eef2ff;
	border: 1px solid #dbe3fb;
	border-radius: 6px;
	padding: 12px 14px;
	margin: 12px 0 0;
}

.nms-recesso-order-detail-notice .dashicons {
	color: #4338ca;
	margin-top: 1px;
}

.nms-recesso-order-detail-notice p {
	margin: 0;
	font-size: 0.9em;
}

/* ---- Guest identify / orders-list small helpers ---- */

.nms-recesso-orders-list ul {
	list-style: none;
	margin: 0;
	padding: 0;
}

.nms-recesso-orders-list li {
	padding: 12px 14px;
	border: 1px solid var(--nms-recesso-border);
	border-radius: 6px;
	margin-bottom: 8px;
}
