/* Product Catalog – front end.
   Inherits your theme's fonts. Change the accent color under Catalog > Settings. */

.pcat,
.pcat-single {
	--pcat-accent: #0b6bcb;
	--pcat-text: #1d2330;
	--pcat-muted: #5f6878;
	--pcat-line: #e3e6ec;
	--pcat-soft: #f4f6f9;
	--pcat-radius: 10px;
	--pcat-cols: 3;
	color: var(--pcat-text);
	box-sizing: border-box;
}
.pcat *, .pcat *::before, .pcat *::after,
.pcat-single *, .pcat-single *::before, .pcat-single *::after { box-sizing: border-box; }

/* Let the catalog use the theme's wide width when it has one. */
.pcat { max-width: var(--wp--style--global--wide-size, 1280px); margin-inline: auto; }
.pcat-single { max-width: var(--wp--style--global--wide-size, 1200px); margin-inline: auto; }

.pcat ul, .pcat-single .pcat-gallery-thumbs, .pcat-single .pcat-grid { list-style: none; margin: 0; padding: 0; }
.pcat li, .pcat-gallery-thumbs li, .pcat-single .pcat-grid li { margin: 0; }

/* ---------- Layout ---------- */

.pcat {
	display: grid;
	grid-template-columns: 250px minmax(0, 1fr);
	gap: 40px;
	align-items: start;
	margin-block: 8px 48px;
}
.pcat--no-filters { grid-template-columns: minmax(0, 1fr); }

/* ---------- Sidebar ---------- */

.pcat-sidebar { position: sticky; top: 24px; }
.admin-bar .pcat-sidebar { top: 56px; }

.pcat-filter-toggle { display: none; }

.pcat-search { position: relative; margin-bottom: 24px; }
.pcat-search input[type="search"] {
	width: 100%;
	margin: 0;
	padding: 10px 42px 10px 14px;
	border: 1px solid var(--pcat-line);
	border-radius: 999px;
	background: #fff;
	font: inherit;
	font-size: 15px;
	color: inherit;
	-webkit-appearance: none;
}
.pcat-search input[type="search"]:focus { outline: 2px solid var(--pcat-accent); outline-offset: 1px; border-color: transparent; }
.pcat-search button {
	position: absolute; right: 4px; top: 50%; transform: translateY(-50%);
	display: grid; place-items: center;
	width: 34px; height: 34px; padding: 0; margin: 0;
	border: 0; border-radius: 50%; background: transparent; color: var(--pcat-muted); cursor: pointer;
}
.pcat-search button:hover { color: var(--pcat-accent); background: var(--pcat-soft); }

.pcat-facet { border: 0; margin: 0 0 24px; padding: 0 0 20px; border-bottom: 1px solid var(--pcat-line); min-width: 0; }
.pcat-facet:last-of-type { border-bottom: 0; }
.pcat-facet legend {
	padding: 0; margin-bottom: 10px;
	font-size: 12px; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--pcat-muted);
}
.pcat-facet li.pcat-sub { padding-left: calc(var(--pcat-depth, 1) * 20px); }

.pcat-option {
	display: flex; align-items: center; gap: 10px;
	padding: 5px 6px; margin: 0 -6px;
	border-radius: 6px;
	font-size: 15px; line-height: 1.35;
	cursor: pointer;
}
.pcat-option:hover { background: var(--pcat-soft); }
.pcat-option input { margin: 0; flex: none; width: 16px; height: 16px; accent-color: var(--pcat-accent); cursor: pointer; }
.pcat-option span:first-of-type { flex: 1; }
.pcat-option input:checked + span { font-weight: 600; color: var(--pcat-accent); }
.pcat-option input[type="checkbox"] { border-radius: 4px; }
.pcat-n { font-size: 12px; color: var(--pcat-muted); font-variant-numeric: tabular-nums; }

.pcat-filter-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.pcat-apply {
	padding: 9px 18px; margin: 0;
	border: 0; border-radius: 999px;
	background: var(--pcat-accent); color: #fff;
	font: inherit; font-size: 14px; font-weight: 600; cursor: pointer;
}
.pcat-js .pcat-apply { display: none; } /* Filters apply instantly when JavaScript is on. */
.pcat-reset { font-size: 14px; color: var(--pcat-muted); }
.pcat-reset:hover { color: var(--pcat-accent); }

/* ---------- Main column ---------- */

.pcat-heading { margin-bottom: 8px; }
.pcat-heading h2 { margin: 0 0 6px; }
.pcat-term-desc { color: var(--pcat-muted); max-width: 70ch; }
.pcat-term-desc p { margin: 0 0 8px; }

.pcat-toolbar {
	display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
	padding-bottom: 14px; margin-bottom: 18px;
	border-bottom: 1px solid var(--pcat-line);
}
.pcat-count { margin: 0; font-size: 14px; color: var(--pcat-muted); }
.pcat-sort { display: flex; align-items: center; gap: 8px; font-size: 14px; }
.pcat-sort label { color: var(--pcat-muted); white-space: nowrap; }
.pcat-sort select {
	margin: 0; padding: 8px 34px 8px 12px;
	border: 1px solid var(--pcat-line); border-radius: 8px;
	background: #fff url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24'%3E%3Cpath d='m6 9 6 6 6-6' fill='none' stroke='%235f6878' stroke-width='2.5'/%3E%3C/svg%3E") no-repeat right 12px center;
	font: inherit; font-size: 14px; color: inherit; cursor: pointer;
	-webkit-appearance: none; appearance: none;
}
.pcat-sort noscript a { margin-left: 8px; }

.pcat-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: -4px 0 18px !important; }
.pcat-chips a {
	display: inline-flex; align-items: center; gap: 8px;
	padding: 5px 8px 5px 12px;
	border-radius: 999px;
	background: color-mix(in srgb, var(--pcat-accent) 10%, #fff);
	color: var(--pcat-accent);
	font-size: 13px; font-weight: 600; text-decoration: none;
}
.pcat-chips a span {
	display: grid; place-items: center; width: 18px; height: 18px; border-radius: 50%;
	font-size: 14px; line-height: 1;
}
.pcat-chips a:hover span { background: var(--pcat-accent); color: #fff; }

.pcat-loading .pcat-grid { opacity: .45; transition: opacity .15s; }

/* ---------- Product grid & cards ---------- */

.pcat-grid {
	display: grid;
	grid-template-columns: repeat(var(--pcat-cols), minmax(0, 1fr));
	gap: 24px;
}

.pcat-card a {
	display: flex; flex-direction: column; height: 100%;
	border: 1px solid var(--pcat-line); border-radius: var(--pcat-radius);
	background: #fff; overflow: hidden;
	color: inherit; text-decoration: none;
	transition: box-shadow .2s, transform .2s, border-color .2s;
}
.pcat-card a:hover, .pcat-card a:focus-visible {
	border-color: transparent;
	box-shadow: 0 10px 28px rgba(16, 24, 40, .12);
	transform: translateY(-2px);
}
.pcat-card a:focus-visible { outline: 2px solid var(--pcat-accent); outline-offset: 2px; }

.pcat-card-img { aspect-ratio: 4 / 3; background: var(--pcat-soft); overflow: hidden; }
.pcat-card-img img { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform .4s; }
.pcat-card a:hover .pcat-card-img img { transform: scale(1.04); }
.pcat-card-noimg { display: grid; place-items: center; width: 100%; height: 100%; color: #b5bcc8; }

.pcat-card-body { display: flex; flex-direction: column; gap: 4px; padding: 14px 16px 16px; }
.pcat-card-cat { font-size: 11px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--pcat-accent); }
.pcat-card-title { margin: 0; font-size: 17px; line-height: 1.3; font-weight: 600; }
.pcat-card-model { font-size: 13px; color: var(--pcat-muted); }

.pcat-empty { padding: 48px 24px; text-align: center; background: var(--pcat-soft); border-radius: var(--pcat-radius); }
.pcat-empty p { margin: 0 0 6px; }

/* ---------- Pagination ---------- */

.pcat-pagination { margin-top: 36px; }
.pcat-pagination ul.page-numbers { display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; min-width: 0; height: auto; padding: 0; border: 0; }
.pcat-pagination li .page-numbers {
	display: inline-grid; place-items: center;
	min-width: 40px; height: 40px; padding: 0 12px;
	border: 1px solid var(--pcat-line); border-radius: 8px;
	font-size: 14px; color: inherit; text-decoration: none;
}
.pcat-pagination li a.page-numbers:hover { border-color: var(--pcat-accent); color: var(--pcat-accent); }
.pcat-pagination li .page-numbers.current { background: var(--pcat-accent); border-color: var(--pcat-accent); color: #fff; font-weight: 600; }
.pcat-pagination li .page-numbers.dots { border: 0; min-width: 20px; padding: 0; }

/* ---------- Single product ---------- */

.pcat-single { margin-block: 0 48px; }
.pcat-breadcrumb { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 20px; font-size: 14px; color: var(--pcat-muted); }
.pcat-breadcrumb a { color: var(--pcat-muted); text-decoration: none; }
.pcat-breadcrumb a:hover { color: var(--pcat-accent); text-decoration: underline; }

.pcat-single-top { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: 40px; align-items: start; }
.pcat-single-top--noimg { grid-template-columns: minmax(0, 1fr); }

.pcat-gallery-main {
	display: block; width: 100%; padding: 0; margin: 0;
	border: 1px solid var(--pcat-line); border-radius: var(--pcat-radius);
	background: var(--pcat-soft); overflow: hidden; cursor: zoom-in;
	aspect-ratio: 4 / 3;
}
.pcat-gallery-main img { width: 100%; height: 100%; object-fit: contain; display: block; }
.pcat-gallery-thumbs { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 12px !important; }
.pcat-gallery-thumbs button {
	display: block; width: 76px; height: 76px; padding: 0; margin: 0;
	border: 2px solid transparent; border-radius: 8px; overflow: hidden;
	background: var(--pcat-soft); cursor: pointer; opacity: .75;
}
.pcat-gallery-thumbs button:hover { opacity: 1; }
.pcat-gallery-thumbs button.is-active { border-color: var(--pcat-accent); opacity: 1; }
.pcat-gallery-thumbs img { width: 100%; height: 100%; object-fit: cover; display: block; }

.pcat-single-info { display: flex; flex-direction: column; gap: 18px; }
.pcat-model { margin: 0; font-size: 15px; }
.pcat-model span { font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--pcat-muted); margin-right: 6px; }
.pcat-summary { font-size: 17px; line-height: 1.6; }
.pcat-summary p { margin: 0 0 10px; }

.pcat-specs { margin: 0; border-top: 1px solid var(--pcat-line); }
.pcat-specs > div { display: grid; grid-template-columns: 110px 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--pcat-line); }
.pcat-specs dt { margin: 0; font-size: 12px; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--pcat-muted); padding-top: 2px; }
.pcat-specs dd { margin: 0; }
.pcat-specs a { color: var(--pcat-accent); text-decoration: none; }
.pcat-specs a:hover { text-decoration: underline; }

.pcat-cta {
	align-self: flex-start;
	display: inline-block; padding: 13px 26px;
	border-radius: 999px; background: var(--pcat-accent); color: #fff !important;
	font-weight: 600; text-decoration: none !important;
	transition: filter .15s;
}
.pcat-cta:hover { filter: brightness(1.1); }

.pcat-description { margin-top: 48px; max-width: 78ch; }
.pcat-description > h2, .pcat-related > h2 { font-size: 1.4em; margin: 0 0 14px; }

.pcat-related { margin-top: 56px; padding-top: 32px; border-top: 1px solid var(--pcat-line); }

.pcat-lightbox { padding: 0; border: 0; background: transparent; max-width: 94vw; max-height: 94vh; overflow: visible; }
.pcat-lightbox::backdrop { background: rgba(10, 14, 22, .86); }
.pcat-lightbox img { display: block; max-width: 94vw; max-height: 90vh; object-fit: contain; border-radius: 6px; }
.pcat-lightbox form { position: absolute; top: -14px; right: -14px; margin: 0; }
.pcat-lightbox-close {
	width: 40px; height: 40px; padding: 0; border: 0; border-radius: 50%;
	background: #fff; color: #111; font-size: 24px; line-height: 1; cursor: pointer;
	box-shadow: 0 4px 14px rgba(0,0,0,.3);
}

/* ---------- Responsive ---------- */

@media (max-width: 1100px) {
	.pcat-grid { grid-template-columns: repeat(min(var(--pcat-cols), 3), minmax(0, 1fr)); }
	.pcat { grid-template-columns: 220px minmax(0, 1fr); gap: 28px; }
}

@media (max-width: 860px) {
	.pcat { grid-template-columns: minmax(0, 1fr); gap: 16px; }
	.pcat-sidebar { position: static; }
	.pcat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
	.pcat-single-top { grid-template-columns: minmax(0, 1fr); gap: 24px; }

	.pcat-filter-toggle {
		display: inline-flex; align-items: center; gap: 8px;
		padding: 10px 16px; margin: 0;
		border: 1px solid var(--pcat-line); border-radius: 999px;
		background: #fff; color: inherit; font: inherit; font-size: 15px; font-weight: 600; cursor: pointer;
	}
	.pcat-badge {
		display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px;
		border-radius: 999px; background: var(--pcat-accent); color: #fff; font-size: 12px;
	}
	.pcat-js .pcat-filters { display: none; margin-top: 16px; padding: 18px; border: 1px solid var(--pcat-line); border-radius: var(--pcat-radius); background: #fff; }
	.pcat-js.pcat-filters-open .pcat-filters { display: block; }
	.pcat-facet ul { max-height: none; }
}

@media (max-width: 520px) {
	.pcat-grid { grid-template-columns: minmax(0, 1fr); }
	.pcat-card-img { aspect-ratio: 16 / 10; }
	.pcat-toolbar { flex-direction: column; align-items: flex-start; }
	.pcat-sort { width: 100%; }
	.pcat-sort select { flex: 1; }
	.pcat-related .pcat-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
	.pcat-related .pcat-card-body { padding: 10px 12px 12px; }
	.pcat-related .pcat-card-title { font-size: 15px; }
}

@media (prefers-reduced-motion: reduce) {
	.pcat-card a, .pcat-card-img img { transition: none; }
	.pcat-card a:hover { transform: none; }
	.pcat-card a:hover .pcat-card-img img { transform: none; }
}
