/**
 * Widget "Filtros de la tienda" (woocommerce/shop-filters.php).
 * Una sola tarjeta con secciones plegables (<details>).
 */

.oz-shop-sidebar__widget.oz-filtros-widget {
	--oz-f-azul: #003a7c;
	--oz-f-texto: #1f2937;
	--oz-f-suave: #6b7280;
	--oz-f-linea: #e5e9f0;
	--oz-f-fondo-hover: #f3f6fb;
	--oz-f-verde: #bfe000;
	padding: 0 !important;
	overflow: hidden;
}

.oz-filtros {
	font-size: 14px;
	color: var(--oz-f-texto);
}

/* Cabecera "Filtros (n)" */
.oz-filtros__head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 16px 18px 14px;
	border-bottom: 1px solid var(--oz-f-linea);
}
.oz-filtros__titulo {
	font-size: 16px;
	font-weight: 700;
	color: var(--oz-f-azul);
}
.oz-filtros__badge,
.oz-filtro__badge {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 20px;
	height: 20px;
	padding: 0 6px;
	border-radius: 999px;
	background: var(--oz-f-verde);
	color: var(--oz-f-azul);
	font-size: 11px;
	font-weight: 700;
	line-height: 1;
}

/* Filtros activos (chips) */
.oz-filtros__activos {
	padding: 12px 18px 14px;
	border-bottom: 1px solid var(--oz-f-linea);
	background: #fafbfd;
}
.oz-filtros__chips {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin: 0 0 10px;
	padding: 0;
	list-style: none;
}
.oz-filtros__chip {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 5px 8px 5px 10px;
	border: 1px solid #cfd8e6;
	border-radius: 999px;
	background: #fff;
	color: var(--oz-f-azul);
	font-size: 12.5px;
	font-weight: 600;
	line-height: 1.2;
	text-decoration: none !important;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.oz-filtros__chip:hover {
	border-color: var(--oz-f-azul);
	background: var(--oz-f-fondo-hover);
}
.oz-filtros__chip-x {
	font-size: 15px;
	line-height: 1;
	color: var(--oz-f-suave);
}
.oz-filtros__chip:hover .oz-filtros__chip-x { color: #c62828; }
.oz-filtros__limpiar {
	font-size: 12.5px;
	font-weight: 600;
	color: var(--oz-f-suave);
	text-decoration: underline !important;
	text-underline-offset: 2px;
}
.oz-filtros__limpiar:hover { color: #c62828; }

/* Cada sección */
.oz-filtro {
	border-bottom: 1px solid var(--oz-f-linea);
}
.oz-filtro:last-child { border-bottom: 0; }

.oz-filtro__head {
	display: flex;
	align-items: center;
	gap: 8px;
	padding: 14px 18px;
	cursor: pointer;
	list-style: none;
	user-select: none;
}
.oz-filtro__head::-webkit-details-marker { display: none; }
.oz-filtro__head::after {
	content: "";
	width: 8px;
	height: 8px;
	margin-left: auto;
	border-right: 2px solid var(--oz-f-suave);
	border-bottom: 2px solid var(--oz-f-suave);
	transform: rotate(45deg) translateY(-2px);
	transition: transform 0.2s ease;
}
.oz-filtro[open] > .oz-filtro__head::after { transform: rotate(225deg) translateY(-2px); }
.oz-filtro__head:hover .oz-filtro__titulo { color: var(--oz-f-azul); }
.oz-filtro__head:focus-visible {
	outline: 2px solid var(--oz-f-azul);
	outline-offset: -2px;
}
.oz-filtro__titulo {
	font-size: 14px;
	font-weight: 700;
	color: var(--oz-f-texto);
	transition: color 0.15s ease;
}

.oz-filtro__body { padding: 0 12px 14px; }

/* "Volver" en categorías */
.oz-filtro__volver {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	margin: 0 6px 8px;
	font-size: 12.5px;
	font-weight: 600;
	color: var(--oz-f-suave);
	text-decoration: none !important;
}
.oz-filtro__volver::before {
	content: "";
	width: 6px;
	height: 6px;
	border-left: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
}
.oz-filtro__volver:hover { color: var(--oz-f-azul); }

/* Buscador dentro de la lista */
.oz-filtro__buscar {
	width: 100%;
	height: 36px;
	margin: 0 0 8px;
	padding: 0 12px;
	border: 1px solid #d5dce8;
	border-radius: 8px;
	background: #fff;
	font-size: 13px;
	color: var(--oz-f-texto);
	box-sizing: border-box;
}
.oz-filtro__buscar:focus {
	border-color: var(--oz-f-azul);
	outline: none;
	box-shadow: 0 0 0 3px rgba(0, 58, 124, 0.12);
}

/* Lista de opciones */
.oz-filtro__lista {
	margin: 0;
	padding: 0;
	list-style: none;
}
.oz-filtro__lista.is-desplazable {
	max-height: 300px;
	overflow-y: auto;
	overscroll-behavior: contain;
}
.oz-filtro__item { margin: 0; }
.oz-filtro__item.is-oculto { display: none; }

.oz-filtro__opcion,
.oz-filtro__cat {
	display: flex;
	align-items: center;
	gap: 10px;
	padding: 7px 6px;
	border-radius: 6px;
	color: var(--oz-f-texto) !important;
	font-size: 13.5px;
	line-height: 1.3;
	text-decoration: none !important;
	transition: background 0.15s ease;
}
.oz-filtro__opcion:hover,
.oz-filtro__cat:hover { background: var(--oz-f-fondo-hover); }

.oz-filtro__nombre {
	flex: 1 1 auto;
	min-width: 0;
}
.oz-filtro__count {
	flex: 0 0 auto;
	min-width: 26px;
	padding: 1px 7px;
	border-radius: 999px;
	background: #eef1f6;
	color: var(--oz-f-suave);
	font-size: 11.5px;
	font-weight: 600;
	text-align: center;
}

/* Casilla (marca y atributos) */
.oz-filtro__check {
	position: relative;
	flex: 0 0 18px;
	width: 18px;
	height: 18px;
	border: 1.5px solid #b8c2d3;
	border-radius: 4px;
	background: #fff;
	transition: border-color 0.15s ease, background 0.15s ease;
}
.oz-filtro__opcion:hover .oz-filtro__check { border-color: var(--oz-f-azul); }
.oz-filtro__item.is-activo .oz-filtro__check {
	border-color: var(--oz-f-azul);
	background: var(--oz-f-azul);
}
.oz-filtro__item.is-activo .oz-filtro__check::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 5px;
	height: 10px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg);
}
.oz-filtro__item.is-activo .oz-filtro__nombre { font-weight: 700; color: var(--oz-f-azul); }

/* Categoría actual */
.oz-filtro__item.is-activo > .oz-filtro__cat {
	background: var(--oz-f-fondo-hover);
	box-shadow: inset 3px 0 0 var(--oz-f-verde);
	font-weight: 700;
	color: var(--oz-f-azul) !important;
}

/* "Ver más" / sin resultados */
.oz-filtro__mas {
	margin: 6px 6px 0;
	padding: 0;
	border: 0;
	background: none;
	color: var(--oz-f-azul);
	font-size: 12.5px;
	font-weight: 700;
	cursor: pointer;
}
.oz-filtro__mas:hover { text-decoration: underline; }
.oz-filtro__vacio {
	margin: 4px 6px 0;
	color: var(--oz-f-suave);
	font-size: 12.5px;
}

/* Mientras se aplica un filtro (el enlace recarga la página) */
.oz-filtros.is-cargando { opacity: 0.55; pointer-events: none; transition: opacity 0.15s ease; }

@media (max-width: 767px) {
	.oz-filtro__opcion,
	.oz-filtro__cat { padding: 10px 6px; font-size: 14.5px; }
	.oz-filtro__lista.is-desplazable { max-height: none; }
}
