/* ==========================================================================
   [tp_configuratore] — vassoi in 3D
   Visore a tutta altezza che resta fermo, opzioni in colonna a destra,
   titolo e azioni in una barra in basso. Font e colori dal design system.
   ========================================================================== */

.tp-cfg {
	--cfg-panel: clamp(350px, 30vw, 490px);
	--cfg-bar-h: 150px;
	--cfg-stage-a: #E3E7E2;
	--cfg-stage-b: #CFD6D0;
	--cfg-stage-c: #B9C2BC;
	--cfg-soft: #474C49; /* testo secondario sul fondo del visore: 4.7:1 su --cfg-stage-c */
	position: relative;
	color: var(--tp-ink);
}
.tp-cfg *, .tp-cfg *::before, .tp-cfg *::after { box-sizing: border-box; }
.tp-cfg p { margin: 0; }

/* --------------------------------------------------------------------------
   Griglia principale
   -------------------------------------------------------------------------- */
.tp-cfg__main {
	position: relative;
	display: grid;
	grid-template-columns: minmax(0, 1fr) var(--cfg-panel);
	grid-template-rows: 1fr auto;
	min-height: 100vh; min-height: 100svh;
	background: radial-gradient(120% 95% at 38% 42%, var(--cfg-stage-a) 0%, var(--cfg-stage-b) 55%, var(--cfg-stage-c) 100%);
}

/* Visore */
.tp-cfg__stage {
	grid-column: 1; grid-row: 1 / span 2;
	position: sticky; top: 0; align-self: start;
	height: 100vh; height: 100svh; min-height: 480px;
}
.tp-cfg__viewer {
	position: absolute;
	top: var(--tp-header-h); right: 0; bottom: var(--cfg-bar-h); left: 0;
	width: auto; height: auto;
	background: transparent;
	--poster-color: transparent;
	--progress-bar-color: var(--tp-teal);
	--progress-bar-height: 2px;
}

/* Zoom */
.tp-cfg__zoom {
	position: absolute; z-index: 2;
	left: var(--tp-gutter); top: 50%; transform: translateY(-50%);
	display: grid; gap: 8px;
}
.tp-cfg__zoom button {
	width: 40px; height: 40px; padding: 0;
	display: grid; place-items: center;
	border: 1px solid color-mix(in srgb, var(--tp-ink) 22%, transparent); border-radius: 50%;
	background: color-mix(in srgb, var(--tp-paper) 55%, transparent);
	color: var(--tp-ink); cursor: pointer;
	transition: background-color .3s var(--tp-ease), color .3s var(--tp-ease), border-color .3s var(--tp-ease);
}
.tp-cfg__zoom button:focus { background: color-mix(in srgb, var(--tp-paper) 55%, transparent); color: var(--tp-ink); }
.tp-cfg__zoom button:hover, .tp-cfg__zoom button:focus-visible { background: var(--tp-teal); border-color: var(--tp-teal); color: var(--tp-bg); }
.tp-cfg__zoom svg { width: 16px; height: 16px; display: block; }

/* Avvisi (modello mancante, realtà aumentata) */
.tp-cfg__notice {
	position: absolute; z-index: 3;
	left: 50%; top: 50%; transform: translate(-50%, -50%);
	width: max-content; max-width: min(420px, calc(100% - 2 * var(--tp-gutter)));
	padding: 16px 22px;
	background: var(--tp-ink); color: var(--tp-bg);
	border-radius: 14px;
	font-size: 15px; line-height: 1.45; text-align: center;
	opacity: 0; visibility: hidden; pointer-events: none;
	transition: opacity .3s, visibility .3s;
}
.tp-cfg__notice.is-on { opacity: 1; visibility: visible; pointer-events: auto; cursor: pointer; }

/* --------------------------------------------------------------------------
   Colonna opzioni
   -------------------------------------------------------------------------- */
.tp-cfg__panel {
	grid-column: 2; grid-row: 1;
	position: relative; z-index: 2;
	display: flex; flex-direction: column; gap: 22px;
	padding: calc(var(--tp-header-h) + 8px) var(--tp-gutter) 28px 0;
}
.tp-cfg__lede .tp-label { margin-bottom: 0.9em; }
.tp-cfg__claim {
	font-size: clamp(22px, 1.25vw + 8px, 30px); font-weight: 300; line-height: 1.15; letter-spacing: -0.02em;
}
.tp-cfg__claim em { font-style: italic; font-weight: 200; color: var(--tp-teal); }
.tp-cfg .tp-cfg__intro { margin-top: 12px; font-size: 15px; line-height: 1.55; color: var(--cfg-soft); }

.tp-site .tp-cfg__gtitle {
	margin: 0 0 8px;
	font-size: 17px; font-weight: 400; line-height: 1.3; letter-spacing: -0.005em;
}
.tp-cfg__card {
	margin: 0; padding: 12px 14px 14px;
	background: var(--tp-paper);
	border: 1px solid var(--tp-line-soft); border-radius: 4px;
}
.tp-cfg__row {
	display: flex; align-items: baseline; justify-content: space-between; gap: 12px;
	padding-bottom: 11px; margin-bottom: 12px !important;
	border-bottom: 1px solid var(--tp-line-soft);
	font-size: 14px; line-height: 1.35; color: var(--tp-ink-2);
}
.tp-cfg__row b { font-weight: 500; color: var(--tp-ink); }
.tp-cfg__row > span:last-child { text-align: right; font-variant-numeric: tabular-nums; }

/* Finiture */
.tp-cfg__swatches { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.tp-cfg__swatch, .tp-cfg__size {
	font: inherit; color: var(--tp-ink); cursor: pointer;
	background: var(--tp-paper);
	border: 1px solid var(--tp-line-soft); border-radius: 3px;
	transition: border-color .25s var(--tp-ease), background-color .25s var(--tp-ease), color .25s var(--tp-ease);
}
.tp-cfg__swatch {
	display: grid; justify-items: center; gap: 8px;
	padding: 12px 4px 10px;
	font-size: 12.5px; line-height: 1.2; text-align: center; white-space: normal;
}
.tp-cfg__chip {
	width: 32px; height: 32px; border-radius: 50%; display: block;
	border: 1px solid rgba(21, 22, 21, 0.14);
	box-shadow: inset 0 -3px 6px rgba(21, 22, 21, 0.06);
}
.tp-cfg__chip--oro { background: linear-gradient(135deg, #E8C66A, #B8892F 60%, #F2DFA4); }
.tp-cfg__chip--bianco { background: linear-gradient(135deg, #FFFFFF, #E8E6E2); }
.tp-cfg__chip--perla { background: linear-gradient(135deg, #F4F4F2, #D8D9D6 70%, #FFFFFF); }
.tp-cfg__chip--nero { background: linear-gradient(135deg, #3A3A3A, #0E0E0E 60%, #4A4A4A); }
.tp-cfg__swatches--2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* Prodotto: le quattro pagine 3D (2.4.0) */
.tp-cfg__lineset { list-style: none; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
.tp-cfg__lineset li { margin: 0; }
.tp-site a.tp-cfg__line {
	display: grid; gap: 3px; height: 100%; padding: 9px 11px 8px;
	background: var(--tp-paper); color: var(--tp-ink); text-decoration: none; line-height: 1.2;
	border: 1px solid var(--tp-line-soft); border-radius: 3px;
	transition: border-color .25s var(--tp-ease), color .25s var(--tp-ease);
}
.tp-cfg__line b { font-size: 14px; font-weight: 400; }
.tp-cfg__line small { font-size: 11.5px; color: var(--tp-muted); }
.tp-site a.tp-cfg__line:hover, .tp-site a.tp-cfg__line:focus-visible { border-color: var(--tp-ink-2); color: var(--tp-ink); }
.tp-site a.tp-cfg__line[aria-current="page"] { border-color: var(--tp-teal); box-shadow: inset 0 0 0 1px var(--tp-teal); color: var(--tp-teal-dark); }
.tp-cfg__line[aria-current="page"] b { font-weight: 500; }
.tp-cfg__line[aria-current="page"] small { color: var(--tp-teal); }

/* Misure */
.tp-cfg__sizes { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)); gap: 6px; }
.tp-cfg__size { padding: 9px 2px 8px; display: grid; gap: 3px; text-align: center; line-height: 1.1; }
.tp-cfg__size b { font-size: 16px; font-weight: 400; }
.tp-cfg__size small { font-size: 10.5px; letter-spacing: -0.01em; color: var(--tp-muted); font-variant-numeric: tabular-nums; }

.tp-cfg__swatch:hover, .tp-cfg__size:hover,
.tp-cfg__swatch:focus, .tp-cfg__size:focus { background: var(--tp-paper); color: var(--tp-ink); border-color: var(--tp-ink-2); }
.tp-cfg__swatch[aria-pressed="true"], .tp-cfg__size[aria-pressed="true"] {
	border-color: var(--tp-teal); box-shadow: inset 0 0 0 1px var(--tp-teal); color: var(--tp-teal-dark);
}
.tp-cfg__swatch[aria-pressed="true"] { font-weight: 500; }
.tp-cfg__size[aria-pressed="true"] b { font-weight: 500; }
.tp-cfg__size[aria-pressed="true"] small { color: var(--tp-teal); }

/* Scheda */
.tp-cfg__sheet { padding: 2px 14px; }
.tp-cfg__sheet > div {
	display: flex; justify-content: space-between; gap: 16px;
	padding: 10px 0; border-bottom: 1px solid var(--tp-line-soft);
	font-size: 14px; line-height: 1.35;
}
.tp-cfg__sheet > div:last-child { border-bottom: 0; }
.tp-cfg__sheet dt { margin: 0; font-weight: 300; color: var(--tp-muted); }
.tp-cfg__sheet dd { margin: 0; font-weight: 500; text-align: right; font-variant-numeric: tabular-nums; }

.tp-cfg__incl { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; font-size: 13.5px; line-height: 1.35; color: var(--cfg-soft); }
.tp-cfg__incl li { display: flex; align-items: flex-start; gap: 8px; }
.tp-cfg__incl svg { flex: 0 0 auto; width: 14px; height: 14px; margin-top: 2px; fill: var(--tp-teal); }

.tp-site a.tp-cfg__quote-m { display: none; }

/* --------------------------------------------------------------------------
   Barra in basso: titolo a sinistra, misura reale e azioni a destra
   -------------------------------------------------------------------------- */
.tp-cfg__bar {
	grid-column: 1 / -1; grid-row: 2;
	position: sticky; bottom: 0; z-index: 3;
	display: grid; grid-template-columns: minmax(0, 1fr) var(--cfg-panel); align-items: end;
	pointer-events: none;
}
.tp-cfg__bar > * { pointer-events: auto; }
.tp-cfg__id { padding: 0 24px clamp(18px, 1.8vw, 30px) var(--tp-gutter); pointer-events: none; }
.tp-cfg__id a { pointer-events: auto; }
.tp-site .tp-cfg__title {
	margin: 0;
	font-size: clamp(38px, 3.4vw + 6px, 76px); font-weight: 300; line-height: 1; letter-spacing: -0.035em;
}
.tp-cfg__title em { font-style: italic; font-weight: 200; color: var(--tp-teal); }
.tp-cfg__links {
	list-style: none; margin: clamp(12px, 1.2vw, 20px) 0 0; padding: 0;
	display: flex; flex-wrap: wrap; gap: 6px 26px;
	font-size: 12px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase;
}
.tp-site .tp-cfg__links a {
	display: inline-flex; align-items: center; gap: 0.5em; min-height: 24px;
	color: var(--tp-ink); text-decoration: none;
	border-bottom: 1px dotted color-mix(in srgb, var(--tp-ink) 55%, transparent);
	transition: color .3s var(--tp-ease), border-color .3s var(--tp-ease);
}
.tp-site .tp-cfg__links a:hover { color: var(--tp-teal); border-bottom-color: var(--tp-teal); }

.tp-cfg__buy {
	display: grid; gap: 12px;
	padding: 14px var(--tp-gutter) clamp(18px, 1.8vw, 30px) 0;
	position: relative;
}
/* velo dietro la zona azioni: le schede della colonna scorrono sotto */
.tp-cfg__buy::before {
	content: ""; position: absolute; z-index: -1;
	top: 0; right: 0; bottom: 0; left: -16px;
	background: color-mix(in srgb, var(--cfg-stage-c) 82%, transparent);
	-webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px);
	-webkit-mask-image: linear-gradient(to bottom, transparent, #000 18px); mask-image: linear-gradient(to bottom, transparent, #000 18px);
}
.tp-cfg__real { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; }
.tp-cfg__real span { font-size: 13px; color: var(--cfg-soft); white-space: nowrap; }
.tp-cfg__real b {
	font-size: clamp(24px, 1.5vw + 8px, 36px); font-weight: 300; line-height: 1; letter-spacing: -0.03em;
	font-variant-numeric: tabular-nums; white-space: nowrap;
}
.tp-cfg__actions { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 8px; }
.tp-site .tp-cfg__actions .tp-pill { padding: 0.95em 0.8em; font-size: 14px; white-space: nowrap; }
.tp-site .tp-cfg__quote { color: var(--tp-teal-dark); border-color: color-mix(in srgb, var(--tp-teal-dark) 55%, transparent); }
.tp-site button.tp-cfg__ar { background: var(--tp-teal); border-color: var(--tp-teal); color: var(--tp-bg); }
.tp-site button.tp-cfg__ar:hover, .tp-site button.tp-cfg__ar:focus { background: var(--tp-teal-dark); border-color: var(--tp-teal-dark); color: var(--tp-bg); }
.tp-cfg__ar svg { width: 18px; height: 18px; flex: 0 0 auto; }

/* --------------------------------------------------------------------------
   Sotto il configuratore
   -------------------------------------------------------------------------- */
.tp-cfg__more { background: var(--tp-bg); }
.tp-cfg__sec {
	max-width: var(--tp-max); margin: 0 auto;
	padding: clamp(64px, 8vw, 150px) var(--tp-gutter) 0;
	scroll-margin-top: var(--tp-header-h);
}
.tp-cfg__sec:last-child { padding-bottom: clamp(64px, 8vw, 150px); }
.tp-cfg__sec .tp-h2 { margin: 0; }
.tp-cfg__why { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 32px 6vw; align-items: end; }
.tp-cfg__why .tp-lead { max-width: 42ch; }

.tp-cfg__steps {
	list-style: none; margin: 0; padding: 0;
	display: grid; grid-template-columns: repeat(3, minmax(0, 1fr));
	border-top: 1px solid var(--tp-line);
}
.tp-cfg__steps li { padding: 26px clamp(16px, 2.4vw, 44px) 0 0; }
.tp-cfg__n { display: block; margin-bottom: clamp(28px, 4vw, 72px); font-size: 13px; letter-spacing: 0.04em; color: var(--tp-red-text); }
.tp-site .tp-cfg__steps h3 { margin: 0 0 10px; }
.tp-cfg__steps p { max-width: 34ch; color: var(--tp-ink-2); }

.tp-cfg__fhead { margin-bottom: clamp(28px, 3.4vw, 56px); }
.tp-site .tp-cfg__table { width: 100%; margin: 0; border-collapse: collapse; border: 0; border-top: 1px solid var(--tp-line); font-size: var(--tp-fs-body); background: transparent; }
.tp-site .tp-cfg__table th, .tp-site .tp-cfg__table td {
	padding: clamp(12px, 1.3vw, 20px) 16px clamp(12px, 1.3vw, 20px) 0;
	border: 0; border-bottom: 1px solid var(--tp-line-soft);
	background: transparent; text-align: left; vertical-align: baseline; font-variant-numeric: tabular-nums;
}
.tp-site .tp-cfg__table thead th { padding-top: 14px; padding-bottom: 14px; font-size: 12px; font-weight: 400; letter-spacing: 0.14em; text-transform: uppercase; color: var(--tp-muted); }
.tp-site .tp-cfg__table tbody th { width: 16%; font-size: var(--tp-fs-h3); font-weight: 300; line-height: 1; letter-spacing: -0.02em; }
.tp-site .tp-cfg__table td:last-child, .tp-site .tp-cfg__table th:last-child { padding-right: 0; text-align: right; }
.tp-site .tp-cfg__table tbody tr:hover > * { background: transparent; }
.tp-cfg__table tr.is-current th, .tp-cfg__table tr.is-current td { color: var(--tp-teal); }
.tp-cfg__see {
	font: inherit; font-size: 14px; white-space: nowrap; cursor: pointer;
	display: inline-flex; align-items: center; gap: 0.5em; min-height: 32px; padding: 0;
	background: none; border: 0; border-radius: 0; color: var(--tp-ink);
	border-bottom: 1px solid transparent;
}
.tp-cfg__see:hover, .tp-cfg__see:focus { background: none; color: var(--tp-teal); border-bottom-color: currentColor; }
.tp-cfg__table tr.is-current .tp-cfg__see { color: var(--tp-teal); }

/* --------------------------------------------------------------------------
   Schermi bassi: più compatto
   -------------------------------------------------------------------------- */
@media (min-width: 901px) and (max-height: 820px) {
	.tp-cfg__panel { gap: 16px; }
	.tp-cfg .tp-cfg__intro { display: none; }
	.tp-cfg__chip { width: 26px; height: 26px; }
	.tp-cfg__swatch { padding: 9px 6px 8px; gap: 6px; }
}

/* Colonna stretta: «Richiedi un preventivo» passa in fondo alle opzioni, in barra resta la realtà aumentata */
@media (max-width: 1420px) {
	.tp-site a.tp-cfg__quote-m { display: inline-flex; align-self: flex-start; }
	.tp-cfg__actions { grid-template-columns: 1fr; }
	.tp-site .tp-cfg__actions .tp-cfg__quote { display: none; }
}

/* --------------------------------------------------------------------------
   Tablet e telefono: visore fermo in alto, opzioni che scorrono sotto,
   misura reale e realtà aumentata sempre a portata di pollice
   -------------------------------------------------------------------------- */
@media (max-width: 900px) {
	.tp-cfg__main { display: flex; flex-direction: column; min-height: 0; background: var(--tp-bg); }
	.tp-cfg__stage {
		order: 1; z-index: 4; align-self: stretch; width: 100%;
		height: 44vh; height: 44svh; min-height: 280px;
		background: radial-gradient(130% 110% at 50% 45%, var(--cfg-stage-a) 0%, var(--cfg-stage-b) 55%, var(--cfg-stage-c) 100%);
		border-bottom: 1px solid var(--tp-line-soft);
	}
	.tp-cfg__viewer { top: 44px; bottom: 0; }
	.tp-cfg__zoom { top: auto; bottom: 12px; left: auto; right: var(--tp-gutter); transform: none; grid-auto-flow: column; }
	.tp-cfg__zoom button { width: 36px; height: 36px; }
	.tp-cfg__bar { display: contents; }
	.tp-cfg__id { order: 2; padding: 22px var(--tp-gutter) 0; }
	.tp-cfg__panel { order: 3; padding: 22px var(--tp-gutter) 28px; }
	.tp-cfg .tp-cfg__intro { color: var(--tp-ink-2); }
	.tp-cfg__incl { color: var(--tp-ink-2); }
	.tp-cfg__real span { color: var(--tp-ink-2); }
	.tp-cfg__buy {
		order: 4; position: sticky; bottom: 0; z-index: 5;
		grid-template-columns: minmax(0, 1fr) auto; align-items: center; gap: 12px;
		padding: 10px var(--tp-gutter) calc(10px + env(safe-area-inset-bottom, 0px));
		border-top: 1px solid var(--tp-line-soft);
	}
	.tp-cfg__buy::before { left: 0; background: color-mix(in srgb, var(--tp-bg) 90%, transparent); -webkit-mask-image: none; mask-image: none; }
	.tp-cfg__real { display: grid; gap: 4px; justify-content: start; }
	.tp-cfg__real span { font-size: 11.5px; }
	.tp-cfg__real b { font-size: 19px; }
	.tp-site .tp-cfg__actions .tp-pill { padding: 0.95em 1.2em; }

	.tp-cfg__why { grid-template-columns: 1fr; }
	.tp-cfg__steps { grid-template-columns: 1fr; border-top: 0; }
	.tp-cfg__steps li { padding: 22px 0 26px; border-top: 1px solid var(--tp-line); display: grid; grid-template-columns: 44px minmax(0, 1fr); column-gap: 8px; }
	.tp-cfg__n { margin: 6px 0 0; grid-row: span 2; }
}
@media (max-width: 560px) {
	.tp-cfg__sizes { gap: 5px; }
	.tp-cfg__swatch { font-size: 12px; }
	.tp-cfg__size small { font-size: 10px; }
	.tp-site .tp-cfg__table th, .tp-site .tp-cfg__table td { padding-right: 10px; font-size: 14px; }
	.tp-site .tp-cfg__table thead th { font-size: 10px; letter-spacing: 0.08em; }
	.tp-site .tp-cfg__table tbody th { font-size: 22px; width: auto; }
	.tp-cfg__see span:first-child { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(1px, 1px, 1px, 1px); white-space: nowrap; }
	.tp-cfg__see { min-width: 32px; justify-content: flex-end; }
}

@media (prefers-reduced-motion: reduce) {
	.tp-cfg__notice, .tp-cfg__zoom button, .tp-cfg__swatch, .tp-cfg__size { transition: none; }
}
