/**
 * molo&CO Search Filter for Elementor
 * Widget styles
 */

.moloandco-sf {
	display: flex;
	align-items: stretch;
	gap: 8px;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	flex-wrap: wrap;
}

.moloandco-sf *,
.moloandco-sf *::before,
.moloandco-sf *::after {
	box-sizing: border-box;
}

/* --- Layouts --- */
.moloandco-sf--inline {
	flex-direction: row;
}

.moloandco-sf--stacked {
	flex-direction: column;
}

.moloandco-sf--stacked .moloandco-sf__fields,
.moloandco-sf--stacked .moloandco-sf__submit {
	width: 100%;
}

/* --- Campos --- */
.moloandco-sf__fields {
	display: flex;
	flex: 1 1 auto;
	min-width: 0;
	gap: 8px;
	position: relative;
}

.moloandco-sf__field {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
}

/* En modo toggle se ocultan los campos inactivos. */
.moloandco-sf--filter-toggle .moloandco-sf__field {
	display: none;
}

.moloandco-sf--filter-toggle .moloandco-sf__field.is-visible {
	display: flex;
}

.moloandco-sf__input,
.moloandco-sf__select {
	width: 100%;
	min-width: 0;
	padding: 10px 14px;
	font-size: 16px;
	line-height: 1.4;
	color: inherit;
	background-color: #fff;
	border: 1px solid #d1d5db;
	border-radius: 4px;
	outline: none;
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
	-webkit-appearance: none;
	-moz-appearance: none;
	appearance: none;
}

.moloandco-sf__input:focus,
.moloandco-sf__select:focus {
	border-color: #111;
	box-shadow: 0 0 0 3px rgba(17, 17, 17, 0.08);
}

.moloandco-sf__select {
	padding-right: 36px;
	background-image: url("data:image/svg+xml;charset=UTF-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23666' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'%3E%3C/polyline%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 12px center;
	background-size: 12px 12px;
	cursor: pointer;
}

/* Estilo propio del input search, desactivar “X” nativa en algunos browsers. */
.moloandco-sf__input::-webkit-search-decoration,
.moloandco-sf__input::-webkit-search-cancel-button {
	-webkit-appearance: none;
}

/* --- Botón submit --- */
.moloandco-sf__submit {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 18px;
	font-size: 16px;
	line-height: 1.4;
	color: #fff;
	background-color: #111;
	border: 1px solid transparent;
	border-radius: 4px;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.1s ease;
	font-family: inherit;
	white-space: nowrap;
}

.moloandco-sf__submit:hover {
	background-color: #333;
}

.moloandco-sf__submit:active {
	transform: translateY(1px);
}

.moloandco-sf__submit:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

.moloandco-sf__submit-icon {
	flex-shrink: 0;
}

/* --- Toggle texto/categoría --- */
.moloandco-sf__toggle {
	display: inline-flex;
	gap: 16px;
	width: 100%;
	flex-basis: 100%;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	margin-bottom: 4px;
}

.moloandco-sf__toggle-btn {
	position: relative;
	background: transparent;
	border: 0;
	padding: 6px 0;
	font-size: 14px;
	line-height: 1.4;
	color: rgba(0, 0, 0, 0.55);
	cursor: pointer;
	font-family: inherit;
	transition: color 0.2s ease;
}

.moloandco-sf__toggle-btn::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 2px;
	background-color: transparent;
	transition: background-color 0.2s ease;
}

.moloandco-sf__toggle-btn.is-active {
	color: #111;
}

.moloandco-sf__toggle-btn.is-active::after {
	background-color: #111;
}

.moloandco-sf__toggle-btn:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 2px;
}

/* --- Accesibilidad --- */
.moloandco-sf .screen-reader-text {
	border: 0;
	clip: rect(1px, 1px, 1px, 1px);
	-webkit-clip-path: inset(50%);
	clip-path: inset(50%);
	height: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
	width: 1px;
	word-wrap: normal !important;
}

/* --- Responsive --- */
@media (max-width: 640px) {
	.moloandco-sf--inline {
		flex-wrap: wrap;
	}

	.moloandco-sf--inline .moloandco-sf__fields {
		flex-basis: 100%;
	}

	.moloandco-sf--inline .moloandco-sf__submit {
		flex-basis: 100%;
		justify-content: center;
	}

	.moloandco-sf--filter-combine .moloandco-sf__fields {
		flex-direction: column;
	}
}
