/**
 * Winchesters storefront product grid — card layout matching the Winchester's catalog design.
 */

.winchesters-grid-wrap {
	--wcf-card-border: #d9d9d9;
	--wcf-card-bg: transparent;
	--wcf-text: #111;
	--wcf-text-muted: #555;
	--wcf-price: #000000;
	--wcf-btn-details: #3d1702;
	--wcf-btn-details-hover: #2a1001;
	--wcf-btn-cart: #a77e52;
	--wcf-btn-cart-hover: #8f6842;
	margin: 0 0 2rem;
	padding: 1.25rem;
	background: #fff;
	overflow-x: clip;
	box-sizing: border-box;
}

.winchesters-grid-title {
	font-family: inherit;
	font-size: 1.75rem;
	font-weight: 600;
	margin: 0 0 1.25rem;
	text-align: center;
	color: var(--wcf-text);
}

.winchesters-product-grid {
	display: grid;
	grid-template-columns: repeat(var(--winchesters-grid-cols, 4), minmax(0, 1fr));
	gap: 1.25rem;
	list-style: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: #fff;
}

.winchesters-product-grid.columns-1 { --winchesters-grid-cols: 1; }
.winchesters-product-grid.columns-2 { --winchesters-grid-cols: 2; }
.winchesters-product-grid.columns-3 { --winchesters-grid-cols: 3; }
.winchesters-product-grid.columns-4 { --winchesters-grid-cols: 4; }
.winchesters-product-grid.columns-5 { --winchesters-grid-cols: 5; }
.winchesters-product-grid.columns-6 { --winchesters-grid-cols: 6; }

.winchesters-grid-item {
	margin: 0;
	padding: 0;
	border: 0;
	list-style: none;
	min-width: 0;
}

.winchesters-grid-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	min-width: 0;
	padding: 1rem 1rem 0.85rem;
	text-align: center;
	background: var(--wcf-card-bg);
	border: 1px solid var(--wcf-card-border);
	box-sizing: border-box;
	overflow: hidden;
}

.winchesters-grid-image-link {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 200px;
	margin: 0 0 0.85rem;
	padding: 0.5rem;
	text-decoration: none;
	background: transparent;
}

.winchesters-grid-image {
	display: block;
	max-height: 180px;
	max-width: 100%;
	width: auto;
	height: auto;
	margin: 0 auto;
	object-fit: contain;
}

.winchesters-grid-image-placeholder {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 180px;
	padding: 1rem;
	font-family: inherit;
	font-size: clamp(0.95rem, 2.5vw, 1.15rem);
	font-weight: 700;
	line-height: 1.25;
	color: var(--wcf-text);
	text-align: center;
	text-transform: none;
	background: transparent;
	border: 0;
}

.winchesters-grid-name {
	font-family: inherit;
	font-size: 1rem;
	font-weight: 500;
	line-height: 1.35;
	margin: 0 0 0.35rem;
	overflow-wrap: anywhere;
	word-break: break-word;
}

.winchesters-grid-name a {
	color: var(--wcf-text);
	text-decoration: none;
}

.winchesters-grid-name a:hover,
.winchesters-grid-name a:focus {
	color: var(--wcf-btn-details);
	text-decoration: underline;
}

.winchesters-grid-code {
	margin: 0 0 0.75rem;
	font-size: 0.8125rem;
	font-weight: 400;
	color: var(--wcf-text-muted);
	letter-spacing: 0.01em;
}

.winchesters-grid-meta {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 0.75rem;
	margin: 0 0 0.85rem;
	padding: 0 0.15rem;
}

.winchesters-grid-price {
	flex: 1 1 auto;
	font-size: 1.5rem;
	font-weight: 700;
	line-height: 1.1;
	color: var(--wcf-price);
	text-align: left;
}

.winchesters-grid-price .amount,
.winchesters-grid-price ins,
.winchesters-grid-price bdi {
	font-weight: inherit;
	color: var(--wcf-price);
	text-decoration: none;
}

.winchesters-grid-price del {
	display: block;
	font-size: 0.75rem;
	font-weight: 400;
	color: var(--wcf-text-muted);
}

.winchesters-grid-stock {
	flex: 0 0 auto;
	font-size: 0.6875rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	text-align: right;
	color: var(--wcf-text);
	white-space: nowrap;
}

.winchesters-grid-stock.is-outofstock {
	color: var(--wcf-text-muted);
}

.winchesters-grid-actions {
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 0.45rem;
	margin-top: auto;
	width: 100%;
	min-width: 0;
}

.winchesters-grid-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	min-width: 0;
	padding: 0.6rem 0.5rem;
	font-family: inherit;
	font-size: 0.75rem;
	font-weight: 700;
	line-height: 1.2;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	border: 0;
	border-radius: 0;
	cursor: pointer;
	white-space: normal;
	text-align: center;
	hyphens: auto;
}

.winchesters-grid-btn-details {
	background: var(--wcf-btn-details);
	color: #fff;
}

.winchesters-grid-btn-details:hover,
.winchesters-grid-btn-details:focus {
	background: var(--wcf-btn-details-hover);
	color: #fff;
}

.winchesters-grid-btn-cart {
	background: var(--wcf-btn-cart);
	color: #fff;
}

.winchesters-grid-btn-cart:hover,
.winchesters-grid-btn-cart:focus {
	background: var(--wcf-btn-cart-hover);
	color: #fff;
}

.winchesters-grid-btn-cart.is-disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

.winchesters-grid-empty {
	grid-column: 1 / -1;
	padding: 2rem 1rem;
	text-align: center;
}

.winchesters-grid-pagination {
	margin: 1.5rem 0 0;
	text-align: center;
}

.winchesters-grid-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 2.5rem;
	min-height: 2.5rem;
	margin: 0 0.15rem;
	padding: 0 0.5rem;
	border: 1px solid var(--wcf-card-border);
	text-decoration: none;
	color: var(--wcf-text);
}

.winchesters-grid-pagination .current {
	background: #faf6ec;
	font-weight: 700;
}

.winchesters-products-loading.winchesters-product-grid {
	opacity: 0.55;
	transition: opacity 0.2s ease;
}

@media (max-width: 1024px) and (min-width: 783px) {
	.winchesters-product-grid.columns-4,
	.winchesters-product-grid.columns-5,
	.winchesters-product-grid.columns-6 {
		--winchesters-grid-cols: 3;
	}
}

@media (max-width: 782px) {
	.winchesters-grid-wrap {
		padding: 0.75rem 0.5rem;
		max-width: 100%;
	}

	.winchesters-product-grid,
	.winchesters-product-grid.columns-1,
	.winchesters-product-grid.columns-2,
	.winchesters-product-grid.columns-3,
	.winchesters-product-grid.columns-4,
	.winchesters-product-grid.columns-5,
	.winchesters-product-grid.columns-6 {
		--winchesters-grid-cols: 2;
		gap: 0.75rem;
	}

	.winchesters-grid-card {
		padding: 0.85rem 0.65rem 0.75rem;
	}

	.winchesters-grid-image-link {
		min-height: 140px;
	}

	.winchesters-grid-image {
		max-height: 130px;
	}

	.winchesters-grid-image-placeholder {
		min-height: 120px;
		font-size: 0.875rem;
	}

	.winchesters-grid-name {
		font-size: 0.9375rem;
	}

	.winchesters-grid-meta {
		flex-direction: column;
		align-items: stretch;
		gap: 0.35rem;
	}

	.winchesters-grid-price {
		font-size: 1.25rem;
		text-align: center;
	}

	.winchesters-grid-stock {
		text-align: center;
		white-space: normal;
	}

	.winchesters-grid-actions {
		grid-template-columns: 1fr;
		gap: 0.5rem;
	}

	.winchesters-grid-btn {
		font-size: 0.8125rem;
		padding: 0.65rem 0.75rem;
		letter-spacing: 0.03em;
	}

	.winchesters-grid-pagination .page-numbers {
		min-width: 2.75rem;
		min-height: 2.75rem;
	}
}

@media (max-width: 480px) {
	.winchesters-grid-wrap {
		padding: 0.5rem 0.25rem;
	}

	.winchesters-product-grid,
	.winchesters-product-grid.columns-1,
	.winchesters-product-grid.columns-2,
	.winchesters-product-grid.columns-3,
	.winchesters-product-grid.columns-4,
	.winchesters-product-grid.columns-5,
	.winchesters-product-grid.columns-6 {
		--winchesters-grid-cols: 1;
		gap: 1rem;
	}

	.winchesters-grid-actions {
		grid-template-columns: 1fr 1fr;
		gap: 0.5rem;
	}

	.winchesters-grid-btn {
		font-size: 0.75rem;
		padding: 0.7rem 0.5rem;
	}
}

/* Category index (Master Shop landing) */

.winchesters-category-index-wrap {
	margin: 0 0 2rem;
}

.winchesters-category-index-title {
	font-family: inherit;
	font-size: 1.75rem;
	font-weight: 600;
	margin: 0 0 1.25rem;
	text-align: center;
	color: var(--wcf-text, #111);
}

.winchesters-category-index {
	display: grid;
	grid-template-columns: repeat(var(--winchesters-index-cols, 4), minmax(0, 1fr));
	gap: 1rem;
	list-style: none;
	margin: 0;
	padding: 0;
}

.winchesters-category-index.columns-1 { --winchesters-index-cols: 1; }
.winchesters-category-index.columns-2 { --winchesters-index-cols: 2; }
.winchesters-category-index.columns-3 { --winchesters-index-cols: 3; }
.winchesters-category-index.columns-4 { --winchesters-index-cols: 4; }
.winchesters-category-index.columns-5 { --winchesters-index-cols: 5; }
.winchesters-category-index.columns-6 { --winchesters-index-cols: 6; }

.winchesters-category-index-item {
	margin: 0;
	padding: 0;
	list-style: none;
}

.winchesters-category-index-card {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 100px;
	padding: 1.25rem 1rem;
	text-align: center;
	background: var(--wcf-card-bg, #fff);
	border: 1px solid var(--wcf-card-border, #e8d8e8);
	cursor: pointer;
	font-family: inherit;
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.winchesters-category-index-card:hover,
.winchesters-category-index-card:focus,
.winchesters-category-index-card.is-active {
	border-color: var(--wcf-btn-cart, #a77e52);
	box-shadow: 0 0 0 1px var(--wcf-btn-cart, #a77e52);
	outline: none;
}

.winchesters-category-index-name {
	font-size: 1rem;
	font-weight: 600;
	line-height: 1.35;
	color: var(--wcf-text, #111);
}

.winchesters-category-index-count {
	margin-top: 0.35rem;
	font-size: 0.8125rem;
	font-weight: 400;
	color: var(--wcf-text-muted, #555);
}

.winchesters-category-index-empty {
	text-align: center;
	color: var(--wcf-text-muted, #555);
}

@media (max-width: 782px) {
	.winchesters-category-index-wrap {
		margin-bottom: 1.25rem;
		overflow-x: clip;
	}

	.winchesters-category-index,
	.winchesters-category-index.columns-1,
	.winchesters-category-index.columns-2,
	.winchesters-category-index.columns-3,
	.winchesters-category-index.columns-4,
	.winchesters-category-index.columns-5,
	.winchesters-category-index.columns-6 {
		--winchesters-index-cols: 2;
		gap: 0.75rem;
	}

	.winchesters-category-index-card {
		min-height: 110px;
		padding: 1.35rem 0.85rem;
	}

	.winchesters-category-index-name {
		font-size: 0.9375rem;
	}
}

@media (max-width: 480px) {
	.winchesters-category-index,
	.winchesters-category-index.columns-1,
	.winchesters-category-index.columns-2,
	.winchesters-category-index.columns-3,
	.winchesters-category-index.columns-4,
	.winchesters-category-index.columns-5,
	.winchesters-category-index.columns-6 {
		--winchesters-index-cols: 1;
	}
}
