/**
 * Pure Query — Frontend Styles
 * Minimal styling for CPT cards and grid. WooCommerce products use theme styles.
 */

/* Query wrapper */
.pq-query-wrap {
	margin: 0 0 30px;
	position: relative;
}

/* Grid layout for CPT and Products */
.pq-grid {
	width: 100% !important;
	display: grid !important;
	box-sizing: border-box !important;
}

/* For WooCommerce product grids */
.pq-grid ul.products {
	display: grid !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 0 !important;
	list-style: none !important;
	float: none !important;
	clear: both !important;
}

/* Override theme column float properties */
.pq-grid ul.products::before,
.pq-grid ul.products::after {
	display: none !important;
}

.pq-grid .pq-card-item,
.pq-grid ul.products li.product,
.pq-swiper .swiper-slide .pq-card-item,
.pq-swiper .swiper-slide li.product {
	width: 100% !important;
	max-width: 100% !important;
	float: none !important;
	margin: 0 !important;
	padding: 0 !important;
	box-sizing: border-box !important;
	list-style: none !important;
}

/* CPT Card item */
.pq-card-item {
	position: relative;
	overflow: hidden;
	box-sizing: border-box;
}

.pq-card-item a {
	text-decoration: none;
	color: inherit;
}

.pq-card-item img {
	max-width: 100%;
	height: auto;
	display: block;
}

/* Default card elements */
.pq-card-thumb {
	display: block;
	overflow: hidden;
}

.pq-card-thumb img {
	width: 100%;
	height: auto;
	transition: transform 0.3s;
}

.pq-card-thumb:hover img {
	transform: scale(1.03);
}

.pq-card-title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	margin: 10px 0 5px;
}

.pq-card-excerpt {
	font-size: 13px;
	color: #666;
	line-height: 1.5;
}

.pq-card-excerpt p {
	margin: 0;
}

/* Field wrappers */
.pq-field-title {
	font-size: 16px;
	font-weight: 600;
	line-height: 1.4;
	margin: 0;
}

.pq-field-taxonomy a {
	text-decoration: none;
}

.pq-field-taxonomy a:hover {
	text-decoration: underline;
}

.pq-field-gallery {
	display: flex;
	gap: 4px;
	flex-wrap: wrap;
}

.pq-field-gallery img {
	width: 60px;
	height: 60px;
	object-fit: cover;
}

/* Pagination (reuses woocommerce-pagination class for theme compatibility) */
.pq-pagination {
	margin-top: 30px;
	text-align: center;
}

.pq-pagination .page-numbers {
	display: flex;
	justify-content: center;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.pq-pagination .page-numbers li {
	margin: 0;
}

.pq-pagination .page-numbers a,
.pq-pagination .page-numbers span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 36px;
	height: 36px;
	padding: 0 10px;
	border: 1px solid #ddd;
	text-decoration: none;
	font-size: 14px;
	color: #333;
	background: #fff;
	transition: all 0.2s;
}

.pq-pagination .page-numbers a:hover {
	background: #f5f5f5;
	border-color: #999;
}

.pq-pagination .page-numbers .current {
	background: #1d2327;
	color: #fff;
	border-color: #1d2327;
}

/* Progressive pagination for standalone grid queries. */
.pq-load-more-wrap {
	margin-top: 24px;
	text-align: center;
}

.pq-load-more-btn {
	display: inline-block;
	padding: 10px 20px;
	border: 1px solid currentColor;
	color: inherit;
	font-size: 12px;
	font-weight: 600;
	letter-spacing: .06em;
	text-decoration: none;
	text-transform: uppercase;
}

/* Sorting dropdown above grid */
.pq-sorting-wrap {
	display: flex;
	justify-content: flex-end;
	margin-bottom: 20px;
	width: 100%;
}

.pq-sorting-wrap .woocommerce-ordering {
	margin: 0 !important;
	float: none !important;
}

.pq-sorting-wrap select.pq-orderby-select {
	padding: 8px 30px 8px 12px !important;
	font-size: 14px;
	color: #333;
	background-color: #fff;
	border: 1px solid #ddd;
	border-radius: 4px;
	outline: none;
	cursor: pointer;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	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 12 12'%3E%3Cpath fill='%23666' d='M6 8.5L2 4.5h8z'/%3E%3C/svg%3E");
	background-repeat: no-repeat;
	background-position: right 10px center;
	background-size: 12px;
	min-width: 180px;
	transition: border-color 0.2s, box-shadow 0.2s;
}

.pq-sorting-wrap select.pq-orderby-select:focus {
	border-color: #999;
	box-shadow: 0 0 5px rgba(0, 0, 0, 0.05);
}
