/**
 * Serafino — Negozio web e PWA (5.25.13)
 * FONTE UNICA per: layout negozio, toolbar categorie, griglia catalogo, card prodotto,
 * quantità, pannelli account/carrello, barra carrello mobile.
 * Le regole equivalenti sono state rimosse da sof-theme, sof-navigation, sof-app-shell,
 * sof-app-cards, front, front-enterprise. Non aggiungere override altrove.
 *
 * Colonne catalogo (container query sulla larghezza reale del catalogo):
 *   < 420px  → 1 card (layout orizzontale compatto)
 *   ≥ 420px  → 2 card
 *   ≥ 880px  → 3 card
 *   ≥ 1240px → 4 card
 */

.sof-shop {
	--sof-shop-gap: clamp(12px, 1.8vw, 22px);
	--sof-shop-radius: 16px;
	--sof-shop-line: rgba(211, 154, 53, 0.24);
	--sof-shop-ivory: #f6efe4;
	--sof-shop-ivory-soft: rgba(246, 239, 228, 0.78);
	--sof-shop-field: #0f0c0a;
	--sof-shop-sticky-top: 0px;
	--sof-shop-bottom-offset: 0px;
	--sof-shop-cart-w: 400px;
	color: var(--sof-shop-ivory);
}

/* ── Layout ─────────────────────────────────────────────────────────── */
.sof-shop .sof-shop__layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--sof-shop-gap);
	align-items: start;
}

.sof-shop .sof-shop__catalog {
	order: 1;
	min-width: 0;
}

/* Senza JS: carrello/checkout e account sotto al catalogo, a tutta larghezza. */
.sof-shop .sof-shop__cart {
	order: 2;
	min-width: 0;
}

.sof-shop .sof-shop__sidebar {
	order: 3;
	min-width: 0;
}

.sof-shop .sof-shop__cart-inner {
	display: flex;
	flex-direction: column;
	gap: 16px;
}

.sof-shop .sof-shop-drawer__head {
	display: none;
}

/* ── Pannelli laterali (attivi con JS: .sof-shop--enhanced) ─────────── */
.sof-shop--enhanced .sof-shop__cart,
.sof-shop--enhanced .sof-shop__sidebar {
	position: fixed;
	top: 0;
	bottom: 0;
	z-index: 1000;
	width: min(460px, 100vw);
	max-width: 100vw;
	box-sizing: border-box;
	padding: 0 16px calc(24px + env(safe-area-inset-bottom));
	background: #0b0907;
	border: 0 solid var(--sof-shop-line);
	box-shadow: 0 0 60px rgba(0, 0, 0, 0.6);
	overflow-y: auto;
	overscroll-behavior: contain;
	visibility: hidden;
	transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s linear 0.28s;
}

.sof-shop--enhanced .sof-shop__cart {
	right: 0;
	border-left-width: 1px;
	transform: translateX(100%);
}

.sof-shop--enhanced .sof-shop__sidebar {
	left: 0;
	border-right-width: 1px;
	transform: translateX(-100%);
}

.sof-shop--enhanced .sof-shop__cart.is-open,
.sof-shop--enhanced .sof-shop__sidebar.is-open {
	visibility: visible;
	transform: none;
	transition: transform 0.28s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.sof-shop--enhanced .sof-shop-drawer__head {
	position: sticky;
	top: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	margin: 0 -16px 12px;
	padding: calc(12px + env(safe-area-inset-top)) 16px 12px;
	background: #0b0907;
	border-bottom: 1px solid var(--sof-shop-line);
}

.sof-shop .sof-shop-drawer__title {
	margin: 0;
	font-family: var(--sof-font-title, Georgia, serif);
	font-size: 1.45rem;
	font-weight: 600;
	color: var(--sof-gold-light, #efc973);
}

.sof-shop .sof-shop-drawer__close {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-width: 44px;
	min-height: 44px;
	padding: 0 14px;
	border-radius: 999px;
	border: 1px solid rgba(246, 239, 228, 0.28);
	background: transparent;
	color: var(--sof-shop-ivory);
	font: inherit;
	font-weight: 600;
	cursor: pointer;
}

.sof-shop .sof-shop-drawer__close:hover {
	border-color: var(--sof-gold-light, #efc973);
}

.sof-shop-overlay {
	position: fixed;
	inset: 0;
	z-index: 999;
	background: rgba(0, 0, 0, 0.62);
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.25s ease;
}

.sof-shop-overlay.is-visible {
	opacity: 1;
	pointer-events: auto;
}

html.sof-shop-drawer-open,
html.sof-shop-drawer-open body {
	overflow: hidden;
}

/* Il riepilogo nel pannello non ripete il titolo: lo dà l'intestazione del pannello. */
.sof-shop--enhanced .sof-shop__cart .sof-shop-checkout-panel > .sof-shop-panel-title {
	display: none;
}

/* Carrello unico: su ogni larghezza il carrello si apre solo dall'icona in toolbar
   (pannello laterale con overlay). Nessuna colonna carrello permanente su desktop.
   Su desktop/tablet il pannello è più largo per contenere il checkout senza comprimerlo. */
@media (min-width: 768px) {
	.sof-shop--enhanced .sof-shop__cart {
		width: min(var(--sof-shop-drawer-w, 600px), 100vw);
		padding-left: 24px;
		padding-right: 24px;
	}

	.sof-shop--enhanced .sof-shop__cart .sof-shop-drawer__head {
		margin-left: -24px;
		margin-right: -24px;
		padding-left: 24px;
		padding-right: 24px;
	}
}

@media (min-width: 1440px) {
	.sof-shop--enhanced .sof-shop__cart {
		--sof-shop-drawer-w: 640px;
	}
}

/* ── Toolbar: categorie + account + carrello ────────────────────────── */
.sof-shop .sof-shop-toolbar {
	position: sticky;
	top: var(--sof-shop-sticky-top);
	z-index: 40;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 0 18px;
	padding: 10px 0;
	background: rgba(5, 4, 3, 0.94);
	border-bottom: 1px solid var(--sof-shop-line);
}

@supports (backdrop-filter: blur(4px)) {
	.sof-shop .sof-shop-toolbar {
		background: rgba(5, 4, 3, 0.82);
		backdrop-filter: blur(10px);
	}
}

.sof-shop .sof-shop-cats {
	display: flex;
	flex: 1 1 auto;
	gap: 8px;
	min-width: 0;
	margin: 0;
	padding: 2px;
	overflow-x: auto;
	scroll-snap-type: x proximity;
	scrollbar-width: none;
	-webkit-overflow-scrolling: touch;
}

.sof-shop .sof-shop-cats::-webkit-scrollbar {
	display: none;
}

.sof-shop .sof-shop-cats[hidden] {
	display: none;
}

.sof-shop .sof-shop-cats__chip {
	flex: 0 0 auto;
	display: inline-flex;
	align-items: center;
	min-height: 44px;
	padding: 0 16px;
	border-radius: 999px;
	border: 1px solid rgba(211, 154, 53, 0.38);
	background: #16120f;
	color: var(--sof-shop-ivory);
	font-size: 0.95rem;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
	scroll-snap-align: start;
	transition: background-color 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.sof-shop .sof-shop-cats__chip:hover {
	border-color: var(--sof-gold-light, #efc973);
	color: #fff;
}

.sof-shop .sof-shop-cats__chip[aria-current="true"] {
	background: linear-gradient(135deg, var(--sof-gold, #d39a35), var(--sof-gold-light, #efc973));
	border-color: transparent;
	color: #120d08;
}

.sof-shop .sof-shop-toolbar__actions {
	display: flex;
	flex: 0 0 auto;
	gap: 8px;
}

.sof-shop .sof-shop-toolbar__btn {
	position: relative;
	display: inline-flex;
	align-items: center;
	gap: 8px;
	min-height: 44px;
	padding: 0 14px;
	border-radius: 12px;
	border: 1px solid rgba(246, 239, 228, 0.26);
	background: #16120f;
	color: var(--sof-shop-ivory);
	font: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	cursor: pointer;
	white-space: nowrap;
}

.sof-shop .sof-shop-toolbar__btn svg {
	width: 20px;
	height: 20px;
	flex: 0 0 auto;
}

.sof-shop .sof-shop-toolbar__btn:hover {
	border-color: var(--sof-gold-light, #efc973);
}

.sof-shop .sof-shop-toolbar__btn--cart {
	background: linear-gradient(135deg, var(--sof-gold, #d39a35), var(--sof-gold-light, #efc973));
	border-color: transparent;
	color: #120d08;
}

.sof-shop .sof-shop-toolbar__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 999px;
	background: #120d08;
	color: var(--sof-gold-light, #efc973);
	font-size: 0.8rem;
	font-variant-numeric: tabular-nums;
}

.sof-shop .sof-shop-toolbar__total {
	font-variant-numeric: tabular-nums;
}

.sof-shop .sof-shop-toolbar__total:empty {
	display: none;
}

.sof-shop .sof-shop-toolbar__btn.is-bumped {
	animation: sof-shop-bump 0.45s ease;
}

@keyframes sof-shop-bump {
	0% { transform: scale(1); }
	40% { transform: scale(1.07); }
	100% { transform: scale(1); }
}

@media (max-width: 559px) {
	.sof-shop .sof-shop-toolbar__text,
	.sof-shop .sof-shop-toolbar__total {
		position: absolute;
		width: 1px;
		height: 1px;
		overflow: hidden;
		clip: rect(0 0 0 0);
		white-space: nowrap;
	}

	.sof-shop .sof-shop-toolbar__btn {
		padding: 0 11px;
	}
}

/* ── Categorie ──────────────────────────────────────────────────────── */
.sof-catalogo {
	container-type: inline-size;
	container-name: sof-catalog;
}

.sof-shop .sof-categoria-blocco {
	margin: 0 0 clamp(28px, 4vw, 44px);
	scroll-margin-top: calc(var(--sof-shop-sticky-top) + 80px);
}

.sof-shop .sof-categoria-titolo {
	display: flex;
	align-items: baseline;
	gap: 12px;
	margin: 0 0 14px;
	padding-bottom: 10px;
	border-bottom: 1px solid var(--sof-shop-line);
	font-family: var(--sof-font-title, Georgia, serif);
	font-size: clamp(1.45rem, 2.4vw, 1.85rem);
	font-weight: 600;
	line-height: 1.15;
	color: var(--sof-gold-light, #efc973);
}

.sof-shop .sof-categoria-descrizione {
	margin: -6px 0 14px;
	font-size: 0.95rem;
	color: var(--sof-shop-ivory-soft);
}

/* ── Griglia catalogo ───────────────────────────────────────────────── */
.sof-catalogo .sof-prodotti-grid,
.sof-shop .sof-catalogo .sof-prodotti-grid {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: var(--sof-shop-gap, 16px);
	width: 100%;
}

@container sof-catalog (min-width: 420px) {
	.sof-catalogo .sof-prodotti-grid,
	.sof-shop .sof-catalogo .sof-prodotti-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@container sof-catalog (min-width: 880px) {
	.sof-catalogo .sof-prodotti-grid,
	.sof-shop .sof-catalogo .sof-prodotti-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@container sof-catalog (min-width: 1240px) {
	.sof-catalogo .sof-prodotti-grid,
	.sof-shop .sof-catalogo .sof-prodotti-grid {
		grid-template-columns: repeat(4, minmax(0, 1fr));
	}
}

/* Browser senza container query: stessa logica sul viewport. */
@supports not (container-type: inline-size) {
	@media (min-width: 480px) {
		.sof-shop .sof-catalogo .sof-prodotti-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	}
	@media (min-width: 960px) {
		.sof-shop .sof-catalogo .sof-prodotti-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	}
}

/* ── Card prodotto ──────────────────────────────────────────────────── */
.sof-catalogo .sof-prodotto-card {
	position: relative;
	display: flex;
	flex-direction: column;
	min-width: 0;
	height: 100%;
	margin: 0;
	overflow: hidden;
	background: #16120f;
	border: 1px solid rgba(211, 154, 53, 0.22);
	border-radius: var(--sof-shop-radius, 16px);
	box-shadow: 0 10px 26px rgba(0, 0, 0, 0.3);
	color: var(--sof-shop-ivory, #f6efe4);
	transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
	.sof-catalogo .sof-prodotto-card:hover {
		border-color: rgba(239, 201, 115, 0.5);
		box-shadow: 0 16px 36px rgba(0, 0, 0, 0.4);
		transform: translateY(-2px);
	}
}

.sof-catalogo .sof-prodotto-media {
	position: relative;
	display: block;
	aspect-ratio: 4 / 3;
	min-height: 0;
	overflow: hidden;
	background: #0d0b09;
}

.sof-catalogo .sof-prodotto-img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.sof-catalogo .sof-prodotto-placeholder {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	padding: 0;
	background:
		radial-gradient(circle at 50% 42%, rgba(211, 154, 53, 0.16), transparent 60%),
		linear-gradient(160deg, #1a1511, #0c0a08);
	color: rgba(239, 201, 115, 0.7);
	font-family: var(--sof-font-title, Georgia, serif);
	font-size: clamp(2rem, 6cqi, 3rem);
	line-height: 1;
}

.sof-catalogo .sof-prodotto-body {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: 8px;
	min-width: 0;
	padding: 14px 16px 16px;
}

.sof-catalogo .sof-prodotto-titolo {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	min-height: 2.6em;
	font-family: var(--sof-font-body, inherit);
	font-size: 1.08rem;
	font-weight: 700;
	line-height: 1.3;
	color: #fff8ec;
}

.sof-catalogo .sof-prodotto-descrizione {
	display: -webkit-box;
	margin: 0;
	overflow: hidden;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	min-height: 2.9em;
	font-size: 0.92rem;
	line-height: 1.45;
	color: var(--sof-shop-ivory-soft, rgba(246, 239, 228, 0.78));
}

.sof-catalogo .sof-prodotto-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 2px 10px;
	margin: 0;
	font-size: 0.85rem;
	color: var(--sof-shop-ivory-soft, rgba(246, 239, 228, 0.78));
}

.sof-catalogo .sof-prezzo {
	display: inline-flex;
	align-items: baseline;
	gap: 4px;
	font-size: 1.25rem;
	font-weight: 800;
	line-height: 1.2;
	flex-wrap: wrap; /* 320px: "€ / unità" va a capo invece di uscire dalla card */
	max-width: 100%;
	color: var(--sof-gold-light, #efc973);
	font-variant-numeric: tabular-nums;
}

.sof-catalogo .sof-prezzo__unit {
	white-space: nowrap;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--sof-shop-ivory-soft, rgba(246, 239, 228, 0.78));
}

.sof-catalogo .sof-stock {
	font-size: 0.85rem;
	color: rgba(246, 239, 228, 0.72);
}

.sof-catalogo .sof-prodotto-azione {
	display: grid;
	gap: 8px;
	margin-top: auto;
	padding-top: 12px;
	border-top: 1px solid rgba(211, 154, 53, 0.16);
}

.sof-catalogo .sof-prodotto-azione .sof-qty-label {
	display: block;
	margin: 0;
	font-size: 0.85rem;
	font-weight: 600;
	color: var(--sof-shop-ivory, #f6efe4);
}

.sof-catalogo .sof-qty-row,
.sof-catalogo .sof-qty-row--with-unit {
	display: flex;
	align-items: stretch;
	gap: 8px;
	min-width: 0;
}

.sof-catalogo .sof-qty-field {
	display: flex;
	flex: 1 1 auto;
	align-items: stretch;
	min-width: 0;
	gap: 0;
	overflow: hidden;
	background: var(--sof-shop-field, #0f0c0a);
	border: 1px solid rgba(246, 239, 228, 0.24);
	border-radius: 12px;
}

.sof-catalogo .sof-qty-step {
	flex: 0 0 44px;
	min-width: 44px;
	min-height: 46px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: rgba(211, 154, 53, 0.16);
	color: var(--sof-gold-light, #efc973);
	font-size: 1.4rem;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	touch-action: manipulation;
}

.sof-catalogo .sof-qty-step:hover {
	background: rgba(211, 154, 53, 0.3);
}

.sof-catalogo .sof-qty-step:active {
	background: rgba(211, 154, 53, 0.42);
}

.sof-catalogo .sof-qty-input {
	flex: 1 1 auto;
	width: 100%;
	min-width: 0;
	min-height: 46px;
	margin: 0;
	padding: 0 4px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #fff8ec;
	font-size: 1.05rem;
	font-weight: 700;
	text-align: center;
	font-variant-numeric: tabular-nums;
	box-shadow: none;
}

.sof-catalogo .sof-qty-unit-select {
	flex: 0 0 auto;
	width: auto;
	min-width: 66px;
	min-height: 48px;
	margin: 0;
	padding: 0 30px 0 12px;
	border: 1px solid rgba(246, 239, 228, 0.24);
	border-radius: 12px;
	background-color: var(--sof-shop-field, #0f0c0a);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='%23efc973' d='M6 8 0 0h12z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	color: #fff8ec;
	font-size: 1rem;
	font-weight: 700;
	-webkit-appearance: none;
	appearance: none;
	cursor: pointer;
}

/* Unità unica (pezzi/confezioni): mostrata come etichetta, non come menu. */
.sof-catalogo .sof-qty-unit-select:has(> option:only-child) {
	padding-right: 12px;
	background-image: none;
	pointer-events: none;
	border-style: dashed;
}

.sof-catalogo .sof-qty-hint {
	margin: 0;
	font-size: 0.85rem;
	line-height: 1.35;
	color: rgba(246, 239, 228, 0.72);
}

.sof-catalogo .sof-prodotto-cta {
	display: flex;
	margin: 0;
}

.sof-catalogo .sof-btn-aggiungi {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	max-width: none;
	min-height: 50px;
	margin: 0;
	padding: 0 16px;
	border: 0;
	border-radius: 12px;
	background: linear-gradient(135deg, var(--sof-gold, #d39a35), var(--sof-gold-light, #efc973));
	color: #120d08;
	font: inherit;
	font-size: 1rem;
	font-weight: 800;
	letter-spacing: 0.01em;
	text-align: center;
	cursor: pointer;
	box-shadow: 0 6px 18px rgba(211, 154, 53, 0.22);
	transition: box-shadow 0.2s ease, filter 0.2s ease;
	touch-action: manipulation;
}

.sof-catalogo .sof-btn-aggiungi:hover {
	filter: brightness(1.05);
	box-shadow: 0 10px 24px rgba(211, 154, 53, 0.34);
}

.sof-catalogo .sof-btn-aggiungi:disabled {
	cursor: default;
	opacity: 1;
}

.sof-catalogo .sof-btn-aggiungi.is-added {
	background: #1d1813;
	color: var(--sof-gold-light, #efc973);
	box-shadow: inset 0 0 0 2px var(--sof-gold, #d39a35);
}

/* Card compatta orizzontale quando il catalogo è stretto (smartphone). */
@container sof-catalog (max-width: 419px) {
	.sof-catalogo .sof-prodotto-card {
		display: grid;
		grid-template-columns: 104px minmax(0, 1fr);
		grid-template-areas:
			"media title"
			"media desc"
			"media meta"
			"action action";
		column-gap: 12px;
		row-gap: 4px;
		align-content: start;
		padding: 12px;
		height: auto;
	}

	.sof-catalogo .sof-prodotto-body {
		display: contents;
	}

	.sof-catalogo .sof-prodotto-media {
		grid-area: media;
		align-self: start;
		aspect-ratio: 1;
		border-radius: 12px;
	}

	.sof-catalogo .sof-prodotto-titolo {
		grid-area: title;
		min-height: 0;
		font-size: 1.02rem;
	}

	.sof-catalogo .sof-prodotto-descrizione {
		grid-area: desc;
		min-height: 0;
		font-size: 0.88rem;
	}

	.sof-catalogo .sof-prodotto-meta {
		grid-area: meta;
	}

	.sof-catalogo .sof-prodotto-azione {
		grid-area: action;
		margin-top: 8px;
		padding-top: 10px;
	}

	.sof-catalogo .sof-prodotto-placeholder {
		font-size: 2rem;
	}
}

/* ── Carrello nel pannello ──────────────────────────────────────────── */
.sof-shop .sof-shop-cart-panel .sof-cart-cards {
	display: grid;
	gap: 10px;
}

.sof-shop .sof-shop-cart-panel .sof-cart-card {
	display: grid;
	gap: 8px;
	padding: 12px;
	border-radius: 12px;
	background: #16120f;
	border: 1px solid rgba(211, 154, 53, 0.2);
}

.sof-shop .sof-shop-cart-panel .sof-cart-card__head {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 10px;
}

.sof-shop .sof-shop-cart-panel .sof-cart-card__qty {
	display: flex;
	align-items: center;
	gap: 8px;
	flex-wrap: wrap;
	color: var(--sof-shop-ivory-soft);
}

.sof-shop .sof-shop-cart-panel .sof-cart-card__qty label {
	flex: 1 1 100%;
	font-size: 0.85rem;
}

.sof-shop .sof-shop-cart-panel .sof-qty-edit {
	width: 110px;
	min-height: 44px;
	font-size: 16px;
	text-align: center;
}

.sof-shop .sof-shop-cart-panel .sof-link-btn {
	min-height: 36px;
	padding: 0 4px;
	color: var(--sof-gold-light, #efc973);
	text-decoration: underline;
	text-underline-offset: 3px;
	font-weight: 600;
}

/* ── Barra carrello mobile / PWA ────────────────────────────────────── */
.sof-shop-mobile-bar {
	position: fixed;
	left: 12px;
	right: 12px;
	bottom: calc(var(--sof-shop-bottom-offset, 0px) + max(12px, env(safe-area-inset-bottom)));
	z-index: 120;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	min-height: 56px;
	padding: 8px 8px 8px 18px;
	border: 0;
	border-radius: 16px;
	background: linear-gradient(135deg, var(--sof-gold, #d39a35), var(--sof-gold-light, #efc973));
	color: #120d08;
	font: inherit;
	font-weight: 700;
	text-decoration: none;
	box-shadow: 0 14px 36px rgba(0, 0, 0, 0.5);
	box-sizing: border-box;
	cursor: pointer;
}

.sof-shop-mobile-bar.sof-is-hidden {
	display: none;
}

.sof-shop-mobile-bar__meta {
	font-size: 1rem;
	font-variant-numeric: tabular-nums;
}

.sof-shop-mobile-bar__label {
	display: inline-flex;
	align-items: center;
	min-height: 42px;
	padding: 0 16px;
	border-radius: 12px;
	background: #120d08;
	color: var(--sof-gold-light, #efc973);
	white-space: nowrap;
}

.sof-shop-mobile-bar--wa {
	justify-content: center;
}

html.sof-shop-drawer-open .sof-shop-mobile-bar:not(.sof-shop-mobile-bar--wa) {
	display: none;
}

@media (min-width: 1024px) {
	.sof-shop-mobile-bar:not(.sof-shop-mobile-bar--wa) {
		display: none;
	}
}

@media (max-width: 1023px) {
	.sof-shop[data-sof-surface="shop"] {
		padding-bottom: calc(84px + var(--sof-shop-bottom-offset, 0px));
	}
}

/* ── Checkout nel pannello ──────────────────────────────────────────── */
.sof-shop .sof-checkout-section-title {
	margin: 18px 0 8px;
	padding-top: 14px;
	border-top: 1px solid rgba(211, 154, 53, 0.18);
	font-size: 1rem;
	font-weight: 700;
	letter-spacing: 0.02em;
	color: var(--sof-gold-light, #efc973);
}

.sof-shop .sof-checkout-address-fields[hidden] {
	display: none;
}

.sof-shop .sof-checkout-weight-note {
	margin: 10px 0 0;
	padding: 10px 12px;
	border-radius: 10px;
	border-left: 3px solid var(--sof-gold, #d39a35);
	background: rgba(211, 154, 53, 0.1);
	font-size: 0.9rem;
	color: var(--sof-shop-ivory);
}

.sof-shop input::placeholder,
.sof-shop textarea::placeholder {
	color: rgba(246, 239, 228, 0.6);
	opacity: 1;
}

/* Hero */
.sof-shop .sof-shop__hero {
	margin: 0 0 8px;
	text-align: center;
}

.sof-shop .sof-shop__subtitle {
	max-width: 62ch;
	margin: 6px auto 0;
	color: var(--sof-shop-ivory-soft);
}

/* Campi checkout/account coerenti (web e PWA) */
.sof-shop .sof-form-row label {
	font-size: 0.95rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--sof-shop-ivory);
}

.sof-shop .sof-form-row input:not([type="checkbox"]):not([type="radio"]),
.sof-shop .sof-form-row select,
.sof-shop .sof-form-row textarea {
	width: 100%;
	min-height: 48px;
	box-sizing: border-box;
	padding: 10px 14px;
	border: 1px solid rgba(246, 239, 228, 0.26);
	border-radius: 12px;
	background-color: var(--sof-shop-field);
	color: #fff8ec;
	font-size: 16px;
}

.sof-shop .sof-form-row input[readonly] {
	color: var(--sof-shop-ivory-soft);
	border-style: dashed;
}

.sof-shop .sof-front-notice {
	position: static;
	height: auto;
	margin: 0 0 12px;
	padding: 12px 14px;
	border-radius: 12px;
	font-size: 0.95rem;
	line-height: 1.45;
}

.sof-shop .sof-front-notice--success {
	background: rgba(46, 125, 80, 0.18);
	border: 1px solid rgba(130, 205, 160, 0.45);
	color: #d8f3e2;
}

.sof-shop .sof-front-notice--error {
	background: rgba(170, 45, 45, 0.22);
	border: 1px solid rgba(255, 150, 140, 0.5);
	color: #ffe0db;
}

/* Totali carrello/riepilogo (front.css legacy usava testo scuro su fondo scuro) */
.sof-shop .sof-riepilogo-footer,
.sof-shop .sof-riepilogo-totale {
	color: var(--sof-shop-ivory);
}

.sof-shop .sof-riepilogo-footer > strong,
.sof-shop .sof-riepilogo-totale > strong {
	font-size: 1.1rem;
	color: var(--sof-gold-light, #efc973);
}

/* ── Accessibilità ──────────────────────────────────────────────────── */
.sof-shop a:focus-visible,
.sof-shop button:focus-visible,
.sof-shop input:focus-visible,
.sof-shop select:focus-visible,
.sof-shop textarea:focus-visible,
.sof-shop-mobile-bar:focus-visible {
	outline: 3px solid #ffe6a8;
	outline-offset: 2px;
}

.sof-catalogo .sof-qty-field:focus-within {
	border-color: var(--sof-gold-light, #efc973);
}

.sof-catalogo .sof-qty-field .sof-qty-input:focus-visible,
.sof-catalogo .sof-qty-field .sof-qty-step:focus-visible {
	outline-offset: -3px;
}

@media (prefers-reduced-motion: reduce) {
	.sof-shop *,
	.sof-shop-overlay,
	.sof-shop-mobile-bar {
		animation: none !important;
		transition: none !important;
		scroll-behavior: auto !important;
	}

	.sof-catalogo .sof-prodotto-card:hover {
		transform: none;
	}
}

/* ── Checkout in 3 passaggi nel pannello carrello ───────────────────── */
.sof-shop .sof-shop-drawer__head {
	flex-wrap: wrap;
}

.sof-shop .sof-checkout-steps--nav {
	flex: 1 0 100%;
	display: flex;
	gap: 6px;
	margin: 4px 0 0;
	padding: 0;
	list-style: none;
}

.sof-shop .sof-checkout-steps--nav li {
	flex: 1 1 0;
	min-width: 0;
	padding: 0;
	border: 0;
	background: none;
}

.sof-shop .sof-checkout-steps--nav a {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	min-height: 40px;
	padding: 6px 8px;
	border-radius: 999px;
	border: 1px solid rgba(246, 239, 228, 0.18);
	background: rgba(246, 239, 228, 0.04);
	color: var(--sof-shop-ivory);
	font-size: 0.82rem;
	font-weight: 600;
	line-height: 1.15;
	text-align: center;
	text-decoration: none;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
}

.sof-shop .sof-checkout-steps--nav a span {
	display: inline-grid;
	place-items: center;
	flex: 0 0 auto;
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: rgba(246, 239, 228, 0.14);
	font-size: 0.75rem;
}

.sof-shop .sof-checkout-steps--nav a.is-active {
	background: linear-gradient(135deg, var(--sof-gold, #d39a35), var(--sof-gold-light, #efc973));
	border-color: transparent;
	color: #120d07;
}

.sof-shop .sof-checkout-steps--nav a.is-active span {
	background: rgba(18, 13, 7, 0.18);
}

.sof-shop .sof-checkout-steps--nav a:focus-visible {
	outline: 3px solid var(--sof-gold-light, #efc973);
	outline-offset: 2px;
}

/* Dopo l'invio (schermata WhatsApp) gli step non servono più. */
.sof-shop .sof-shop__cart:has([data-sof-order-success="1"]) .sof-checkout-steps--nav {
	display: none;
}

.sof-shop .sof-step-title {
	display: flex;
	align-items: center;
	gap: 10px;
	scroll-margin-top: 130px;
}

.sof-shop .sof-step-num {
	display: inline-grid;
	place-items: center;
	flex: 0 0 auto;
	width: 30px;
	height: 30px;
	border-radius: 50%;
	background: linear-gradient(135deg, var(--sof-gold, #d39a35), var(--sof-gold-light, #efc973));
	color: #120d07;
	font-family: system-ui, sans-serif;
	font-size: 0.95rem;
	font-weight: 800;
}

.sof-shop .sof-checkout-step3 {
	margin: 22px 0 12px;
	padding-top: 18px;
	border-top: 1px solid var(--sof-shop-line);
}

.sof-shop .sof-checkout-step3 .sof-step-title {
	margin: 0 0 12px;
	font-size: 1.15rem;
}

.sof-shop #sof-btn-submit-order {
	width: 100%;
	min-height: 52px;
	white-space: normal;
}

.sof-wa-fallback a {
	color: inherit;
	font-weight: 700;
	text-decoration: underline;
}

/* ── Convivenza con header/menu del tema (T02-A) ────────────────────── */
/* Scala z-index del plugin: toolbar 40, header app 500, overlay 999, pannelli 1000,
   modali 1100, notifiche 1200. Nessun valore "estremo" (99999).
   Mentre un pannello o una modale del plugin è aperto, l'header sticky del tema non deve
   coprirne l'intestazione (pulsante Chiudi): lo si riporta temporaneamente al livello base. */
html.sof-shop-drawer-open body > header,
html.sof-shop-drawer-open .wp-site-blocks > header,
html.sof-shop-drawer-open header.wp-block-template-part,
html.sof-shop-drawer-open .serafino-header-shell,
html.sof-shop-drawer-open .site-header {
	z-index: auto !important;
}

/* Campi del plugin: quando ricevono il focus non finiscono sotto un header sticky del tema. */
.sof-shop :is(input, select, textarea, button),
.sof-front-wrap :is(input, select, textarea, button),
.sof-console-wrap :is(input, select, textarea) {
	scroll-margin-top: var(--sof-theme-header-offset, 120px);
	scroll-margin-bottom: 96px;
}

/* Regole globali del tema su "header" (sticky, z-index 99999, grid a 4 colonne, sfondo):
   gli <header> interni del plugin restano elementi di contenuto statici. */
.sof-shop header:not(.sof-app-header),
.sof-front-wrap header:not(.sof-app-header),
.sof-console-wrap header:not(.sof-app-header),
.sof-owner-dashboard header,
.sof-fidelity-staff-page header,
#sof-pwa-root header {
	position: static !important;
	top: auto !important;
	z-index: auto !important;
	display: block !important;
	grid-template-columns: none !important;
	background: none !important;
}

.sof-dash-hero,
.sof-fidelity-staff-page__hero,
.sof-owner-dashboard__hero,
.sof-order-mobile-card__head {
	display: flex !important;
}

.sof-dash-hero {
	background: linear-gradient(135deg, var(--sof-burgundy) 0%, var(--sof-burgundy-dark) 55%, #3b141c 100%) !important;
}

/* Header app del plugin: mantiene la propria scala (500) anche se il tema forza 99999 su "header". */
header.sof-app-header {
	position: sticky !important;
	top: 0 !important;
	z-index: 500 !important;
	display: block !important;
	grid-template-columns: none !important;
	background: linear-gradient(180deg, rgba(5, 4, 3, 0.99), rgba(5, 4, 3, 0.95)) !important;
}

@media (max-width: 767px) {
	header.sof-app-header {
		position: relative !important;
	}
}
