/* =========================================================
 * WS Accordion Expand - Webshero Widgets
 * Banners horizontales que se expanden al hacer hover.
 * ========================================================= */

.wsw-acex {
	--wsw-acex-grow: 3;
	--wsw-acex-speed: 600ms;
	--wsw-acex-ease: cubic-bezier(.4, 0, .2, 1);
	display: flex;
	width: 100%;
	height: 520px;
	gap: 12px;
	overflow: hidden;
}

/* Cada banner ocupa partes iguales por defecto */
.wsw-acex__item {
	position: relative;
	flex: 1 1 0%;
	min-width: 0;
	overflow: hidden;
	cursor: pointer;
	transition: flex-grow var(--wsw-acex-speed) var(--wsw-acex-ease);
	will-change: flex-grow;
	background-color: #1a1308;
}

/* Cuando el ratón está sobre el contenedor: el banner hovered crece,
 * los demás mantienen flex-grow 1 (= se hacen pequeños en proporción). */
.wsw-acex:hover .wsw-acex__item:hover,
.wsw-acex__item:focus,
.wsw-acex__item.is-open {
	flex-grow: var(--wsw-acex-grow);
}

/* Banner por defecto (cuando nadie hace hover): is-open hace su trabajo
 * gracias a la regla de arriba. Si hay default-open, el padre quita la
 * marca al hacer hover en otro distinto. */
.wsw-acex:hover .wsw-acex__item.is-open:not(:hover) {
	flex-grow: 1;
}

/* Fondo */
.wsw-acex__bg {
	position: absolute;
	inset: 0;
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	transition: transform 800ms var(--wsw-acex-ease);
	will-change: transform;
}

.wsw-acex-zoom-yes .wsw-acex__item:hover .wsw-acex__bg,
.wsw-acex-zoom-yes .wsw-acex__item.is-open .wsw-acex__bg {
	transform: scale(1.06);
}

/* Overlay encima de la imagen */
.wsw-acex__overlay {
	position: absolute;
	inset: 0;
	background-color: rgba(0, 0, 0, 0.35);
	transition: background-color var(--wsw-acex-speed) ease;
	pointer-events: none;
}

/* Cover link para hacer todo el banner clicable */
.wsw-acex__cover-link {
	position: absolute;
	inset: 0;
	z-index: 2;
	text-indent: -9999px;
	overflow: hidden;
}

/* Contenido (título / párrafo / botón).
 * Posicionado absoluto con ANCHO FIJO = ancho del banner expandido.
 * Así, al contraerse el banner, el contenido NO reflowea: queda
 * estático en su sitio y se recorta por overflow:hidden del padre,
 * igual que la imagen. El JS calcula --wsw-acex-content-width en px. */
.wsw-acex__content {
	position: absolute;
	left: 0;
	top: 0;
	bottom: 0;
	z-index: 3;
	display: flex;
	flex-direction: column;
	gap: 16px;
	width: var(--wsw-acex-content-width, 100%);
	padding: 36px;
	align-items: flex-start;
	justify-content: flex-end;
	text-align: left;
}

.wsw-acex__title {
	margin: 0;
	color: #fff;
}

.wsw-acex__text {
	margin: 0;
	color: #fff;
}

.wsw-acex__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 0.9em 1.6em;
	background-color: #FFBC58;
	color: #1A1308;
	border-radius: 999px;
	text-decoration: none;
	transition: background-color 250ms ease, color 250ms ease, border-color 250ms ease, transform 300ms ease;
	pointer-events: auto;
	position: relative;
	z-index: 4;
}

.wsw-acex__btn:hover,
.wsw-acex__btn:focus {
	background-color: #86BD41;
	color: #fff;
}

.wsw-acex__btn-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 0 0 auto;
	font-size: 1em;
	line-height: 1;
}

.wsw-acex__btn-icon svg {
	width: 1em;
	height: 1em;
	fill: currentColor;
	display: block;
}

.wsw-acex__btn-icon i {
	font-size: inherit;
	line-height: 1;
}

/* Reveal on hover: el contenido aparece solo si el banner está expandido */
.wsw-acex-reveal-yes .wsw-acex__item .wsw-acex__content {
	opacity: 0;
	transform: translateY(20px);
	transition: opacity 400ms ease, transform 400ms var(--wsw-acex-ease);
	transition-delay: 0ms;
}

.wsw-acex-reveal-yes .wsw-acex__item:hover .wsw-acex__content,
.wsw-acex-reveal-yes .wsw-acex__item.is-open .wsw-acex__content,
.wsw-acex-reveal-yes .wsw-acex__item:focus-within .wsw-acex__content {
	opacity: 1;
	transform: translateY(0);
	transition-delay: 180ms;
}

.wsw-acex:hover .wsw-acex-reveal-yes .wsw-acex__item.is-open:not(:hover) .wsw-acex__content,
.wsw-acex-reveal-yes .wsw-acex:hover .wsw-acex__item.is-open:not(:hover) .wsw-acex__content {
	opacity: 0;
	transform: translateY(20px);
	transition-delay: 0ms;
}

/* Apilar en móvil: convierte el conjunto en columna y deshace el flex-grow */
@media ( max-width: 767px ) {
	.wsw-acex-mob-stack-yes .wsw-acex {
		flex-direction: column;
		height: auto;
		/* En apilado los banners ocupan ancho completo, así que el
		 * contenido también: anulamos la variable de ancho fijo. */
		--wsw-acex-content-width: 100% !important;
	}
	.wsw-acex-mob-stack-yes .wsw-acex .wsw-acex__item {
		flex: 0 0 auto;
		width: 100%;
		min-height: 240px;
	}
}

/* En el editor de Elementor mostramos el primer banner expandido por defecto
 * y aseguramos visibilidad del contenido. */
.elementor-editor-active .wsw-acex-reveal-yes .wsw-acex__item .wsw-acex__content {
	opacity: 1 !important;
	transform: none !important;
}
