/**
 * Category Product widget styles (category buttons + panels).
 * Product cards and grid come from product.css (homepage "GPS Product" look).
 * Loaded in <head> by gps-necessery.php (handle: gps-necessery-category-product).
 */

.gps-catprod {
	--gps-catprod-accent: #DC2626;
	padding: 48px 20px;
	box-sizing: border-box;
	width: 100%;
}
.gps-catprod__container {
	max-width: 1200px;
	margin: 0 auto;
}
.gps-catprod__header {
	margin-bottom: 28px;
}

/* Category buttons */
.gps-catprod__tabs {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
	justify-content: center;
	margin: 0 0 32px;
	padding: 0;
}
/* Without JavaScript the buttons do nothing, so they stay hidden and every category is listed. */
.gps-catprod:not(.is-ready) .gps-catprod__tabs {
	display: none;
}
.gps-catprod .gps-catprod__tab {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	margin: 0;
	padding: 10px 18px;
	border: 1px solid #E5E7EB;
	border-radius: 999px;
	background: #FFFFFF;
	color: #374151;
	font: inherit;
	font-size: 14px;
	font-weight: 700;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: normal;
	white-space: nowrap;
	cursor: pointer;
	box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
	transition: background 0.2s, color 0.2s, border-color 0.2s, box-shadow 0.2s;
}
.gps-catprod .gps-catprod__tab:hover {
	border-color: var(--gps-catprod-accent);
	color: var(--gps-catprod-accent);
	background: #FFFFFF;
}
.gps-catprod .gps-catprod__tab.is-active {
	background: var(--gps-catprod-accent);
	border-color: var(--gps-catprod-accent);
	color: #FFFFFF;
	box-shadow: 0 6px 16px rgba(220, 38, 38, 0.25);
}
.gps-catprod .gps-catprod__tab:focus-visible {
	outline: 3px solid rgba(220, 38, 38, 0.35);
	outline-offset: 2px;
}
.gps-catprod__count {
	min-width: 22px;
	padding: 1px 7px;
	border-radius: 999px;
	background: #F3F4F6;
	color: #6B7280;
	font-size: 12px;
	text-align: center;
}
.gps-catprod__tab.is-active .gps-catprod__count {
	background: rgba(255, 255, 255, 0.22);
	color: #FFFFFF;
}

/* Panels */
.gps-catprod__panel[hidden] {
	display: none !important;
}
.gps-catprod__panel + .gps-catprod__panel {
	margin-top: 48px;
}
.gps-catprod__panel-title {
	margin: 0 0 20px;
	font-size: 24px;
	font-weight: 700;
	color: #111827;
}
/* One category chosen: its title is already on the active button. */
.gps-catprod.is-ready:not(.is-all) .gps-catprod__panel-title {
	display: none;
}
.gps-catprod.is-ready:not(.is-all) .gps-catprod__panel + .gps-catprod__panel {
	margin-top: 0;
}
.gps-catprod .gps-product-grid {
	gap: 24px;
}

/* ---------- "Category Product" (one category, all products) ---------- */
.gps-catone {
	padding: 40px 0;
	box-sizing: border-box;
	width: 100%;
}
.gps-catone__container {
	max-width: 1200px;
	margin: 0 auto;
}
.gps-catone .gps-catone__title {
	margin: 0 0 24px;
	font-size: 28px;
	font-weight: 700;
	line-height: 1.3;
	color: #111827;
}
.gps-catone .gps-product-grid {
	gap: 24px;
}
.gps-catone__empty {
	margin: 0;
	padding: 24px;
	text-align: center;
	color: #6B7280;
	border: 1px dashed #D1D5DB;
	border-radius: 12px;
}
@media (max-width: 767px) {
	.gps-catone {
		padding: 28px 0;
	}
	.gps-catone .gps-catone__title {
		font-size: 22px;
		margin-bottom: 18px;
	}
}

/* Phones: one scrollable row of buttons */
@media (max-width: 767px) {
	.gps-catprod {
		padding: 32px 16px;
	}
	.gps-catprod__tabs {
		flex-wrap: nowrap;
		justify-content: flex-start;
		overflow-x: auto;
		-webkit-overflow-scrolling: touch;
		scrollbar-width: none;
		margin: 0 -16px 24px;
		padding: 2px 16px 6px;
	}
	.gps-catprod__tabs::-webkit-scrollbar {
		display: none;
	}
	.gps-catprod__panel-title {
		font-size: 20px;
	}
}
