:root {
	--wet-gradient-start: #014576;
	--wet-gradient-end: #26949D;
	--wet-gradient: linear-gradient(135deg, var(--wet-gradient-start) 0%, var(--wet-gradient-end) 100%);
	--wet-collapsed-bg: #E8EEF1;
	--wet-tab-collapsed-width: 100px;
	--wet-tab-height: 500px;
	--wet-gap: 15px;
}

.wpb-expandable-tabs-wrapper {
	width: 100%;
	margin: 0 auto;
	box-sizing: border-box;
}

.wpb-expandable-tabs {
	display: flex;
	flex-direction: row;
	width: 100%;
	height: var(--wet-tab-height);
	/* Remove overflow:hidden to allow gaps */
	/* overflow: hidden; */ 
	background: transparent; /* Was #fff, but with gaps we want transparency behind */
	border-radius: 0; /* Handled by individual tabs if needed */
	box-shadow: none; /* Handled by individual tabs if needed */
	gap: var(--wet-gap); /* Gap between columns */
}

.wpb-expandable-tab {
	flex: 0 0 var(--wet-tab-collapsed-width);
	position: relative;
	overflow: hidden;
	cursor: pointer;
	transition: flex 0.5s ease-in-out;
	background-color: var(--wet-collapsed-bg);
	border-radius: 10px; /* Individual border radius */
	/* Requirement: "ombra esterna alle colonne con x 0, y 0 e S 20 con colore rgba(0,0,0,.1)" */
	box-shadow: 0 0 20px rgba(0,0,0,0.1);
}

/* No longer needed with gap
.wpb-expandable-tab:last-child {
	border-right: none;
}
*/

.wpb-expandable-tab.active {
	flex: 1 1 auto;
	cursor: default;
	background-image: var(--tab-bg-image);
	background-size: cover; /* Back to cover as requested */
	background-repeat: no-repeat;
	background-position: center center;
	/* No fade-in for background image required: "l'immagine di background non deve zoommare ma semplicemente essere esposta (no fade-in)" */
	/* The transition on 'flex' exposes the background naturally. */
}

/* Smoothness fix for collapsed content */
.tab-collapsed {
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	align-items: center;
	height: 100%;
	padding: 20px 0;
	opacity: 1;
	transition: opacity 0.3s ease;
	width: var(--wet-tab-collapsed-width); /* Fixed width for inner content */
	position: absolute; /* Keep it positioned relative to tab */
	left: 0;
	top: 0;
	z-index: 2; /* Above background */
	/* Background must be white as requested: "Lo sfondo di tab-collapsed deve essere bianco" */
	background-color: #fff;
}

/* When expanded, fade out collapsed content */
.wpb-expandable-tab.active .tab-collapsed {
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease; /* Fast fade out */
}

/* Expanded content logic */
.tab-expanded {
	display: flex; /* Always display flex but hidden via opacity/visibility to allow layout calc */
	height: 100%;
	width: 100%;
	padding: 40px;
	box-sizing: border-box;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	opacity: 0;
	visibility: hidden; /* Hide from interaction */
	transition: opacity 0.5s ease 0.3s, visibility 0s linear 0.3s; /* Delay appearance until expanded */
	position: relative;
	z-index: 3;
}

.wpb-expandable-tab.active .tab-expanded {
	opacity: 1;
	visibility: visible;
	transition: opacity 0.5s ease 0.2s, visibility 0s linear 0s;
}

/* Disable click on active tab */
.wpb-expandable-tab.active {
	pointer-events: none; /* Prevent re-clicking */
	cursor: default;
}
/* Re-enable pointer events for the CTA button inside active tab */
.wpb-expandable-tab.active .tab-cta-button {
	pointer-events: auto;
}

.tab-title-vertical {
	writing-mode: vertical-rl;
	transform: rotate(180deg);
	margin: auto 0;
	font-size: 18px;
	font-weight: 700;
	color: #333;
	white-space: nowrap;
	text-transform: uppercase;
	letter-spacing: 1px;
}

.tab-icon-circle {
	width: 63px;
	height: 63px;
	/* Circle background: #E8EEF1 */
	background-color: var(--wet-collapsed-bg);
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 20px;
	box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}

/* Replaces .tab-icon-svg */
.tab-icon-image-mask {
	width: 40px; /* Increased from 20px to 40px */
	height: 40px;
	background: var(--wet-gradient); /* The gradient source */
	/* Mask the gradient with the Image URL (PNG/SVG) */
	-webkit-mask-image: var(--tab-icon-url);
	mask-image: var(--tab-icon-url);
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
}


/* --- Expanded State Styles --- */

.tab-expanded {
	display: none;
	height: 100%;
	width: 100%;
	padding: 40px;
	box-sizing: border-box;
	flex-direction: column;
	justify-content: center;
	align-items: flex-start;
	opacity: 0;
	transition: opacity 0.5s ease 0.2s;
}

.wpb-expandable-tab.active .tab-expanded {
	display: flex;
	opacity: 1;
}

.tab-content-box {
	background: #fff;
	padding: 40px;
	border-radius: 8px;
	max-width: 400px;
	box-shadow: 0 15px 40px rgba(0,0,0,0.2);
}

.tab-header {
	display: flex;
	align-items: center;
	margin-bottom: 20px;
}

.tab-icon-circle-large {
	width: 63px;
	height: 63px;
	background: var(--wet-gradient);
	border-radius: 50%;
	display: flex;
	justify-content: center;
	align-items: center;
	margin-right: 20px;
	flex-shrink: 0;
}

/* Expanded Icon: White (using brightness/filter since it's an image now) */
.tab-icon-img {
	/* Requirement: "larghezza massima dell'80%" */
	width: auto; /* Let width scale */
	max-width: 50%; /* Further reduced to look balanced as "at least 10px" but relative to 63px circle. 50% = ~31px */
	height: auto; /* Let height scale */
	max-height: 50%; /* Cap height too to be safe inside circle */
	object-fit: contain;
	/* Force white color for PNG/SVG */
	filter: brightness(0) invert(1);
	
	/* Centering is handled by parent flexbox (.tab-icon-circle-large has display:flex, justify-content:center, align-items:center) */
	/* But let's ensure margin auto if flex fails somehow */
	margin: 0 !important;
	display: block;
}

.tab-title-horizontal {
	font-size: 24px;
	font-weight: 700;
	color: #333;
	margin: 0;
	line-height: 1.2;
}

.tab-body {
	color: #666;
}

.tab-description {
	margin-bottom: 25px;
	line-height: 1.6;
	font-size: 16px;
}

.tab-cta-button {
	display: inline-block;
	padding: 12px 24px;
	background: var(--wet-gradient);
	color: #fff;
	text-decoration: none;
	text-transform: uppercase;
	font-weight: 600;
	border-radius: 1px; /* Requirement: "border-radius di 1px" */
	transition: transform 0.2s ease, box-shadow 0.2s ease;
	font-size: 14px;
}

.tab-cta-button:hover {
	transform: translateY(-2px);
	box-shadow: 0 5px 15px rgba(0,0,0,0.2);
	color: #fff;
}

/* --- Responsive / Mobile --- */

@media (max-width: 768px) {
	.wpb-expandable-tabs {
		flex-direction: column;
		height: auto;
		min-height: 600px;
		gap: 10px; /* Smaller gap on mobile */
	}

	.wpb-expandable-tab {
		width: 100%;
		flex: 0 0 80px;
		border-right: none;
		/* border-bottom: 1px solid rgba(255,255,255,0.5); Removed for gap */
	}

	.wpb-expandable-tab.active {
		flex: 1 1 auto;
		min-height: 400px;
	}

	.tab-collapsed {
		flex-direction: row;
		padding: 0 20px;
	}

	.tab-title-vertical {
		writing-mode: horizontal-tb;
		transform: none;
		margin: 0;
	}
	
	.tab-icon-circle {
		margin-top: 0;
	}

	.tab-content-box {
		max-width: 100%;
		padding: 20px;
	}
	
	.tab-expanded {
		padding: 20px;
	}
}
