/* ── Product Tag Grid ──────────────────────────────── */

.rdhb-tag-grid {
	--rdhb-tag-grid-gap: 16px;
	--rdhb-tag-grid-columns: 4;
	width: 100%;
	max-width: 100%;
}

.rdhb-tag-grid *,
.rdhb-tag-grid *::before,
.rdhb-tag-grid *::after {
	box-sizing: border-box;
}

/* Product list – grid (targets WC's <ul class="products columns-X">) */
.rdhb-tag-grid .products {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: var(--rdhb-tag-grid-gap);
	grid-template-columns: repeat(var(--rdhb-tag-grid-columns), minmax(0, 1fr));
}

/* Grid items */
.rdhb-tag-grid .products > li {
	min-width: 0;
}

/* ── Tag cards (separate row) ─────────────────────── */

.rdhb-tag-cards {
	display: flex;
	gap: var(--rdhb-tag-grid-gap, 16px);
	margin: 32px 0;
}

/* Single card → full width */
.rdhb-tag-cards--single .rdhb-tag-card {
	flex: 0 0 100%;
	max-width: 100%;
}

/* Two cards → 50% each */
.rdhb-tag-cards--double .rdhb-tag-card {
	flex: 0 0 calc(50% - var(--rdhb-tag-grid-gap, 16px) / 2);
	max-width: calc(50% - var(--rdhb-tag-grid-gap, 16px) / 2);
}

.rdhb-tag-card {
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
}

.rdhb-tag-card:hover {
	text-decoration: none;
}

.rdhb-tag-card:hover .rdhb-tag-card__image img {
	transform: scale(1.08);
}

.rdhb-tag-card__image {
	background-color: rgba(232, 233, 225, 0.5);
	display: flex;
	align-items: center;
	justify-content: center;
	overflow: hidden;
	aspect-ratio: 16 / 9;
	margin-bottom: 12px;
}

.rdhb-tag-card__image img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.rdhb-tag-card__name {
	font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
	font-size: 16px;
	font-weight: 500;
	color: #000;
	text-align: left;
}

/* ── Pagination ───────────────────────────────────── */

.rdhb-tag-grid__pagination {
	margin-top: 2rem;
	text-align: center;
}

.rdhb-tag-grid__pagination .page-numbers {
	display: inline-block;
	padding: 6px 12px;
	margin: 0 2px;
	text-decoration: none;
	color: #333;
	border: 1px solid #ddd;
	border-radius: 3px;
	transition: background-color 0.2s, color 0.2s;
}

.rdhb-tag-grid__pagination .page-numbers.current,
.rdhb-tag-grid__pagination .page-numbers:hover {
	background-color: #000;
	color: #fff;
	border-color: #000;
}

/* ── Responsive ───────────────────────────────────── */

@media (max-width: 1024px) {
	.rdhb-tag-card__name {
		font-size: 14px;
	}
}

@media (max-width: 767px) {
	.rdhb-tag-grid {
		max-width: 100vw;
	}

	/* Stack tag cards on mobile */
	.rdhb-tag-cards {
		flex-direction: column;
	}

	.rdhb-tag-cards--double .rdhb-tag-card {
		flex: 0 0 100%;
		max-width: 100%;
	}
}
