/**
 * Tannery Club Product Grid — frontend styles.
 *
 * Styled to echo the urbansocks.in "New Arrivals" collection look: a clean,
 * borderless product grid with a small uppercase top-left badge, a centred
 * title, a struck regular price followed by the sale price, and a red
 * "Save X%" label. Typography (font-family / base line-height) is left to
 * INHERIT from the active Astra theme so it blends with the rest of the site.
 */

.tcpg-wrapper {
	--tcpg-gap: 22px;
	--tcpg-radius: 2px;
	--tcpg-ink: #0f0f0f;          /* near-black, matches the reference accent */
	--tcpg-muted: #8a8a8a;        /* struck-through regular price */
	--tcpg-save: #d51a1a;         /* red discount label */
	--tcpg-img-bg: #f4f4f4;
	--tcpg-ease: cubic-bezier(0.22, 0.61, 0.36, 1);

	max-width: 100%;
	margin: 0 auto;
}

/* ------------------------------------------------------------------ */
/* Grid: 4 columns desktop · 3 tablet · 2 mobile                       */
/* ------------------------------------------------------------------ */
.tcpg-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: var(--tcpg-gap);
	margin: 0;
	padding: 0;
	list-style: none;
}

@media (max-width: 1024px) {
	.tcpg-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 600px) {
	.tcpg-grid {
		--tcpg-gap: 14px;
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

.tcpg-card {
	margin: 0;
	padding: 0;
	list-style: none;
}

/* Whole card is a single link → one click target, straight to the product. */
.tcpg-card-link,
.tcpg-card-link:hover,
.tcpg-card-link:focus {
	display: block;
	color: inherit;
	text-decoration: none;
	box-shadow: none;
}

.tcpg-card-link:focus-visible {
	outline: 2px solid var(--tcpg-ink);
	outline-offset: 3px;
}

/* ------------------------------------------------------------------ */
/* Image                                                               */
/* ------------------------------------------------------------------ */
.tcpg-image-wrap {
	position: relative;
	overflow: hidden;
	border-radius: var(--tcpg-radius);
	background: var(--tcpg-img-bg);
	aspect-ratio: 1 / 1;          /* square tiles, like the reference grid */
}

.tcpg-image-wrap img {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.6s var(--tcpg-ease);
}

.tcpg-card-link:hover .tcpg-image-wrap img {
	transform: scale(1.05);
}

/* Small uppercase badge, top-left. Background colour comes inline from meta. */
.tcpg-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	display: inline-block;
	padding: 4px 9px;
	color: #fff;
	font-size: 0.66em;
	font-weight: 700;
	letter-spacing: 0.06em;
	line-height: 1.25;
	text-transform: uppercase;
	border-radius: var(--tcpg-radius);
	white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Title — inherits Astra typography                                   */
/* ------------------------------------------------------------------ */
.tcpg-title {
	margin: 12px 0 6px;
	font-size: 0.92em;
	font-weight: 500;
	line-height: 1.35;
	color: var(--tcpg-ink);
	text-align: center;
	/* font-family intentionally omitted → inherit from Astra. */
}

/* ------------------------------------------------------------------ */
/* Price row: <del> regular </del>  sale  Save X%                      */
/* ------------------------------------------------------------------ */
.tcpg-price {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: center;
	gap: 7px;
	font-size: 0.9em;
	margin-bottom: 4px;
}

.tcpg-price .tcpg-price-sale,
.tcpg-price > .amount,
.tcpg-price ins .amount {
	font-weight: 600;
	color: var(--tcpg-ink);
	text-decoration: none;
}

.tcpg-price .tcpg-price-regular,
.tcpg-price del,
.tcpg-price del .amount {
	color: var(--tcpg-muted);
	font-weight: 400;
	text-decoration: line-through;
}

.tcpg-save {
	color: var(--tcpg-save);
	font-weight: 600;
	font-size: 0.85em;
	white-space: nowrap;
}

/* ------------------------------------------------------------------ */
/* Pagination — minimal, like "1 2 Next"                               */
/* ------------------------------------------------------------------ */
.tcpg-pagination {
	margin-top: 36px;
}

.tcpg-pagination .page-numbers {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 6px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.tcpg-pagination .page-numbers li {
	margin: 0;
	list-style: none;
}

.tcpg-pagination .page-numbers a,
.tcpg-pagination .page-numbers span {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	color: var(--tcpg-ink);
	text-decoration: none;
	border: 1px solid #e2e2e2;
	border-radius: var(--tcpg-radius);
	transition: background-color 0.2s var(--tcpg-ease), border-color 0.2s var(--tcpg-ease), color 0.2s var(--tcpg-ease);
}

.tcpg-pagination .page-numbers a:hover,
.tcpg-pagination .page-numbers .current {
	border-color: var(--tcpg-ink);
	background: var(--tcpg-ink);
	color: #fff;
}

.tcpg-pagination .page-numbers .dots {
	border-color: transparent;
	background: transparent;
}

.tcpg-empty {
	padding: 32px 0;
	color: var(--tcpg-muted);
	text-align: center;
}

/* Results container + AJAX loading state (driven by the filter plugin). */
.tcpg-results {
	position: relative;
	min-height: 120px;
}

.tcpg-wrapper.tcpg-loading .tcpg-results {
	opacity: 0.45;
	pointer-events: none;
	transition: opacity 0.15s linear;
}
