/* Filtros de Tienda — estilos
   Toma el color de acento de Astra (--ast-global-color-0) y, si no existe, usa el de respaldo.
   Para cambiar el color a mano, definí --ft-accent en tu CSS adicional:
   .ft-wrap { --ft-accent: #c0392b; } */

.ft-wrap {
	--ft-accent: var(--ast-global-color-0, #2563eb);
	--ft-muted: #6b7280;
	--ft-line: rgba(0, 0, 0, 0.12);
	--ft-radius: 6px;
	font-size: 0.95rem;
	line-height: 1.4;
}

.ft-wrap *,
.ft-wrap *::before,
.ft-wrap *::after {
	box-sizing: border-box;
}

/* ---- Secciones plegables ---- */

.ft-section {
	border-bottom: 1px solid var(--ft-line);
	padding: 0.9rem 0;
}

.ft-section:first-child {
	padding-top: 0;
}

.ft-title {
	display: flex;
	align-items: center;
	justify-content: space-between;
	cursor: pointer;
	font-weight: 700;
	list-style: none;
}

.ft-title::-webkit-details-marker,
.ft-cat > summary::-webkit-details-marker {
	display: none;
}

.ft-title::after,
.ft-cat > summary::after {
	content: "";
	width: 0.5rem;
	height: 0.5rem;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform 0.15s ease;
	flex-shrink: 0;
	margin-left: 0.5rem;
	opacity: 0.6;
}

.ft-section[open] > .ft-title::after,
.ft-cat[open] > summary::after {
	transform: rotate(-135deg);
}

.ft-body {
	margin-top: 0.7rem;
}

/* ---- Listas ---- */

.ft-wrap .ft-list {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ft-wrap .ft-list .ft-list {
	padding-left: 0.9rem;
	margin-top: 0.15rem;
	border-left: 1px solid var(--ft-line);
	margin-left: 0.15rem;
}

.ft-wrap .ft-list li {
	margin: 0;
	padding: 0;
}

.ft-wrap .ft-list a,
.ft-cat > summary {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 0.5rem;
	padding: 0.32rem 0;
	color: inherit;
	text-decoration: none;
	transition: color 0.15s ease;
}

.ft-cat > summary {
	cursor: pointer;
	list-style: none;
}

.ft-wrap .ft-list a:hover,
.ft-cat > summary:hover {
	color: var(--ft-accent);
}

.ft-wrap .ft-list a.is-active {
	color: var(--ft-accent);
	font-weight: 700;
}

.ft-wrap .ft-all {
	font-size: 0.88em;
	color: var(--ft-muted);
}

.ft-count {
	margin-left: auto;
	font-size: 0.82em;
	color: var(--ft-muted);
	font-variant-numeric: tabular-nums;
}

.ft-cat > summary .ft-count {
	margin-right: 0;
}

/* ---- Atributos como casillas ---- */

.ft-wrap a.ft-check {
	justify-content: flex-start;
}

.ft-wrap a.ft-check::before {
	content: "";
	width: 1rem;
	height: 1rem;
	border: 1.5px solid var(--ft-muted);
	border-radius: 3px;
	flex-shrink: 0;
	background-color: #fff;
	background-position: center;
	background-repeat: no-repeat;
	background-size: 0.7rem;
	transition: background-color 0.15s ease, border-color 0.15s ease;
}

.ft-wrap a.ft-check:hover::before {
	border-color: var(--ft-accent);
}

.ft-wrap a.ft-check.is-active::before {
	background-color: var(--ft-accent);
	border-color: var(--ft-accent);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 12'%3E%3Cpath d='M2 6.5l2.6 2.6L10 3.4' fill='none' stroke='%23fff' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

/* ---- Precio ---- */

.ft-price-fields {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.5rem;
}

.ft-money {
	display: flex;
	align-items: center;
	border: 1px solid var(--ft-line);
	border-radius: var(--ft-radius);
	background: #fff;
	padding-left: 0.55rem;
	transition: border-color 0.15s ease;
}

.ft-money:focus-within {
	border-color: var(--ft-accent);
}

.ft-symbol {
	color: var(--ft-muted);
	font-size: 0.9em;
}

.ft-wrap .ft-money input[type="number"] {
	width: 100%;
	min-width: 0;
	border: 0;
	background: transparent;
	box-shadow: none;
	padding: 0.5rem 0.5rem 0.5rem 0.3rem;
	font-size: 0.92rem;
	-moz-appearance: textfield;
	appearance: textfield;
}

.ft-wrap .ft-money input[type="number"]:focus {
	outline: none;
	box-shadow: none;
}

.ft-wrap .ft-money input::-webkit-outer-spin-button,
.ft-wrap .ft-money input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.ft-wrap .ft-button {
	display: block;
	width: 100%;
	margin-top: 0.6rem;
	padding: 0.55rem 1rem;
	border: 0;
	border-radius: var(--ft-radius);
	background: var(--ft-accent);
	color: #fff;
	font-weight: 600;
	font-size: 0.92rem;
	cursor: pointer;
	transition: filter 0.15s ease;
}

.ft-wrap .ft-button:hover {
	filter: brightness(0.9);
}

/* ---- Limpiar filtros ---- */

.ft-wrap .ft-clear {
	display: inline-block;
	margin-top: 0.9rem;
	color: var(--ft-muted);
	font-size: 0.9em;
	text-decoration: underline;
}

.ft-wrap .ft-clear:hover {
	color: var(--ft-accent);
}

/* ---- Accesibilidad ---- */

.ft-wrap a:focus-visible,
.ft-wrap summary:focus-visible,
.ft-wrap .ft-button:focus-visible {
	outline: 2px solid var(--ft-accent);
	outline-offset: 2px;
	border-radius: 3px;
}

@media (prefers-reduced-motion: reduce) {
	.ft-wrap * {
		transition: none !important;
	}
}
