.ec-card-wrapper {
	position: relative;
	width: 100%;
	/* Removed height: 100% to allow natural flow */
	z-index: 1;
	display: flex;
	flex-direction: column;
}

.ec-card {
	position: relative;
	width: 100%;
	/* Removed height: 100% to prevent forced stretching */
	height: auto; 
	overflow: hidden;
	transition: all 0.4s ease;
	display: flex;
	flex-direction: column;
}

.ec-card-inner {
	position: relative;
	width: 100%;
	z-index: 2;
	height: 100%; /* Fill the card */
	display: flex;
	flex-direction: column;
}

.ec-title {
	margin-bottom: 20px;
	line-height: 1.2;
}

.ec-content {
	position: relative;
	flex-grow: 1;
}

.ec-hidden-content-wrapper {
	display: grid;
	grid-template-rows: 0fr;
	transition: grid-template-rows 0.5s ease-out;
}

.ec-hidden-content {
	overflow: hidden;
	opacity: 0;
	transition: opacity 0.3s ease;
	padding-top: 0;
}

/* Expanded State - STRICTLY tied to the specific wrapper class */
.ec-card-wrapper.is-expanded .ec-hidden-content-wrapper {
	grid-template-rows: 1fr;
}

.ec-card-wrapper.is-expanded .ec-hidden-content {
	opacity: 1;
	/* Delay opacity slightly to allow expansion to start */
	transition: opacity 0.4s ease 0.1s;
	padding-top: 15px;
}

/* Toggle Button Styling */
.ec-toggle-wrapper {
	position: relative;
	z-index: 3;
	display: flex;
	justify-content: center; /* Center horizontally relative to card */
	/* Margin and height are set dynamically via JS/PHP controls */
	pointer-events: none; /* Let clicks pass through to potential links below */
}

.ec-toggle-btn {
	border-radius: 50%;
	display: flex;
	align-items: center;
	justify-content: center;
	position: relative;
	transition: all 0.3s ease;
	box-shadow: 0 4px 10px rgba(0,0,0,0.1);
	pointer-events: auto;
}

.ec-icon-plus, 
.ec-icon-minus {
	position: absolute;
	top: 50%;
	left: 50%;
	transform: translate(-50%, -50%);
	display: flex;
	align-items: center;
	justify-content: center;
	transition: all 0.3s ease;
}

.ec-icon-minus {
	opacity: 0;
	transform: translate(-50%, -50%) rotate(-90deg);
}

/* Expanded State for Toggle - STRICTLY tied to wrapper class */
.ec-card-wrapper.is-expanded .ec-icon-plus {
	opacity: 0;
	transform: translate(-50%, -50%) rotate(90deg);
}

.ec-card-wrapper.is-expanded .ec-icon-minus {
	opacity: 1;
	transform: translate(-50%, -50%) rotate(0);
}

/* Fix for Hebrew/RTL */
.rtl .ec-title, 
.rtl .ec-content {
	text-align: right;
}

/* Important: Ensure Flexbox layout doesn't force height matching */
.elementor-widget-expanding_card {
	height: auto !important;
	align-self: flex-start; /* Prevents stretching in flex container */
	width: 100%; /* Ensure full width in column */
}
