/* Techim Cross-Sell Popup */

.tcsp-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(15, 18, 22, .6);
	opacity: 0;
	transition: opacity .22s ease;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
}

.tcsp-overlay.is-visible { opacity: 1; }

.tcsp-modal {
	position: relative;
	width: 100%;
	max-width: 720px;
	max-height: calc(100vh - 32px);
	overflow-y: auto;
	background: #fff;
	border-radius: 14px;
	box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
	padding: 28px 24px 22px;
	transform: translateY(18px) scale(.98);
	transition: transform .22s ease;
	box-sizing: border-box;
}

.tcsp-overlay.is-visible .tcsp-modal { transform: none; }

.tcsp-modal *, .tcsp-modal *::before, .tcsp-modal *::after { box-sizing: border-box; }

.tcsp-close {
	position: absolute;
	top: 8px;
	right: 10px;
	width: 38px;
	height: 38px;
	line-height: 1;
	font-size: 28px;
	color: #6b7280;
	background: none;
	border: 0;
	cursor: pointer;
	padding: 0;
}
.tcsp-close:hover { color: #111827; }

/* Header */
.tcsp-header {
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 30px 4px 0;
}
.tcsp-check {
	flex: 0 0 auto;
	width: 26px;
	height: 26px;
	border-radius: 50%;
	background: #16a34a;
	color: #fff;
	font-size: 15px;
	line-height: 26px;
	text-align: center;
}
.tcsp-title {
	margin: 0;
	font-size: 17px;
	line-height: 1.35;
	font-weight: 600;
	color: #111827;
}
.tcsp-product-name { font-weight: 700; }

.tcsp-subtitle {
	margin: 16px 0 10px;
	font-size: 14px;
	color: #6b7280;
}

/* Carosello */
.tcsp-carousel { position: relative; }

.tcsp-viewport { overflow: hidden; }

.tcsp-track {
	display: flex;
	margin: 0;
	padding: 0;
	list-style: none;
	transition: transform .3s ease;
	will-change: transform;
}
.tcsp-track.is-dragging { transition: none; }

.tcsp-slide {
	flex: 0 0 33.3333%;
	max-width: 33.3333%;
	padding: 0 6px;
	margin: 0;
	list-style: none;
}

.tcsp-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	padding: 10px;
	text-align: center;
	text-decoration: none;
	color: inherit;
	border: 1px solid #e5e7eb;
	border-radius: 10px;
	transition: border-color .18s ease, box-shadow .18s ease;
}
.tcsp-card:hover {
	border-color: #c7ccd3;
	box-shadow: 0 6px 18px rgba(0, 0, 0, .08);
}

.tcsp-thumb { display: block; margin-bottom: 8px; }
.tcsp-thumb img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 6px;
}

.tcsp-card-name {
	display: block;
	font-size: 13px;
	line-height: 1.35;
	font-weight: 600;
	color: #111827;
	margin-bottom: 4px;
}
.tcsp-card-price {
	display: block;
	font-size: 13px;
	color: #374151;
	margin-bottom: 8px;
}
.tcsp-card-price del { opacity: .6; margin-right: 4px; }

.tcsp-card-cta {
	display: block;
	margin-top: auto;
	font-size: 12px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: .04em;
	color: #2563eb;
}

/* Frecce */
.tcsp-nav {
	position: absolute;
	top: 50%;
	transform: translateY(-50%);
	width: 34px;
	height: 34px;
	display: none;
	align-items: center;
	justify-content: center;
	font-size: 22px;
	line-height: 1;
	color: #111827;
	background: #fff;
	border: 1px solid #e5e7eb;
	border-radius: 50%;
	box-shadow: 0 2px 8px rgba(0, 0, 0, .12);
	cursor: pointer;
	padding: 0;
	z-index: 2;
}
.tcsp-prev { left: -10px; }
.tcsp-next { right: -10px; }

/* Dots */
.tcsp-dots {
	display: none;
	justify-content: center;
	gap: 6px;
	margin-top: 12px;
}
.tcsp-dot {
	width: 8px;
	height: 8px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: #d1d5db;
	cursor: pointer;
}
.tcsp-dot.is-active { background: #111827; }

/* Azioni */
.tcsp-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-top: 20px;
}

.tcsp-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 1 1 auto;
	min-height: 46px;
	padding: 12px 20px;
	font-size: 15px;
	font-weight: 600;
	line-height: 1.2;
	text-align: center;
	text-decoration: none;
	border-radius: 8px;
	border: 1px solid transparent;
	cursor: pointer;
}
.tcsp-btn-primary { background: #111827; color: #fff; }
.tcsp-btn-primary:hover { background: #000; color: #fff; }
.tcsp-btn-ghost { background: #fff; color: #111827; border-color: #d1d5db; }
.tcsp-btn-ghost:hover { background: #f9fafb; }

.tcsp-cart-link {
	flex: 1 0 100%;
	text-align: center;
	font-size: 13px;
	color: #6b7280;
	text-decoration: underline;
}

body.tcsp-locked { overflow: hidden; }

/* Mobile: una slide per volta, carosello in loop */
@media (max-width: 767px) {
	.tcsp-overlay { align-items: flex-end; padding: 0; }

	.tcsp-modal {
		max-width: none;
		max-height: 92vh;
		border-radius: 16px 16px 0 0;
		padding: 22px 16px 18px;
		transform: translateY(100%);
	}

	.tcsp-slide { flex: 0 0 100%; max-width: 100%; padding: 0 4px; }

	.tcsp-card { flex-direction: row; align-items: center; text-align: left; gap: 12px; }
	.tcsp-thumb { flex: 0 0 84px; width: 84px; margin-bottom: 0; }
	.tcsp-card-cta { margin-top: 0; }

	.tcsp-nav { display: flex; }
	.tcsp-prev { left: 2px; }
	.tcsp-next { right: 2px; }
	.tcsp-viewport { margin: 0 26px; }

	.tcsp-dots { display: flex; }

	.tcsp-btn { flex: 1 0 100%; }
}

@media (prefers-reduced-motion: reduce) {
	.tcsp-overlay, .tcsp-modal, .tcsp-track { transition: none; }
}
