.pc-layout {
	display: flex;
	gap: 25px;
	align-items: flex-start;
}

.pc-filter {
	width: 260px;
	flex-shrink: 0;
}

.pc-filter-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	margin-bottom: 18px;
}

.pc-filter-head h3 {
	margin: 0;
	font-size: 16px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
}

.pc-reset-btn {
	background: #fff;
	border: 1px solid #ccc;
	border-radius: 3px;
	padding: 4px 10px;
	font-size: 11px;
	text-decoration: underline;
	text-transform: uppercase;
	cursor: pointer;
}

.pc-filter-group {
	margin-bottom: 16px;
	padding-bottom: 16px;
	border-bottom: 1px solid #eee;
}

.pc-filter-group:last-child {
	border-bottom: none;
}

.pc-filter-group h4 {
	margin: 0 0 10px;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.5px;
	text-transform: uppercase;
	opacity: 0.7;
}

.pc-filter-group label {
	display: block;
	margin-bottom: 8px;
	font-size: 14px;
}

.pc-group-search {
	width: 100%;
	padding: 7px 10px;
	margin-bottom: 10px;
	box-sizing: border-box;
	border: 1px solid #ddd;
	border-radius: 3px;
	background: #f7f7f7;
	font-size: 13px;
}

.pc-filter-scroll {
	max-height: 190px;
	overflow-y: auto;
	padding-right: 4px;
}

.pc-main {
	flex: 1;
	overflow-x: auto;
}

.pc-toolbar {
	display: flex;
	align-items: center;
	gap: 15px;
	margin-bottom: 15px;
	flex-wrap: wrap;
}

.pc-toolbar .pc-count {
	font-size: 14px;
	white-space: nowrap;
}

.pc-toolbar #pc-search {
	flex: 1;
	max-width: 320px;
	padding: 8px;
	box-sizing: border-box;
}

.pc-table {
	width: 100%;
	border-collapse: collapse;
}

.pc-table th,
.pc-table td {
	padding: 10px;
	border-bottom: 1px solid #eee;
	text-align: left;
	vertical-align: middle;
}

.pc-table th {
	text-transform: uppercase;
}

.pc-product-row {
	background: #fff;
	transition: background 0.15s ease, box-shadow 0.15s ease;
}

.pc-product-row td[data-label="Image"] img {
	width: 70px;
	height: auto;
}

.pc-name {
	display: block;
	font-weight: 600;
	color: inherit;
	text-decoration: none;
	margin-bottom: 4px;
}

.pc-name:hover {
	text-decoration: underline;
}

.pc-avail-badge {
	display: inline-block;
	min-width: 30px;
	padding: 3px 10px;
	border-radius: 12px;
	font-size: 12px;
	font-weight: 700;
	text-align: center;
}

.pc-avail-out {
	background: #fde2e2;
	color: #c0392b;
}

.pc-avail-ok {
	background: #d9f2e3;
	color: #1e8a4c;
}

.pc-avail-high {
	background: #ffc107;
	color: #6d4c00;
}

.pc-badges {
	margin-bottom: 4px;
}

.pc-badge {
	display: inline-block;
	color: #fff;
	font-size: 11px;
	font-weight: 700;
	padding: 2px 8px;
	border-radius: 3px;
	margin-right: 4px;
}

.pc-badge-sale {
	background: #e53935;
}

.pc-badge-highlight {
	background: #f0a500;
}

.pc-concentration-tag {
	display: inline-block;
	font-size: 11px;
	text-transform: uppercase;
	letter-spacing: 0.3px;
	color: #777;
	background: transparent;
	border: 1px solid #ddd;
	border-radius: 3px;
	padding: 2px 8px;
	margin-bottom: 4px;
}

.pc-detail-brand {
	display: block;
	font-weight: 700;
	text-transform: uppercase;
	font-size: 13px;
	color: #222;
	margin-bottom: 2px;
}

.pc-qty-control {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid #e0ddd6;
	border-radius: 4px;
	overflow: hidden;
	background: #fff;
}

.pc-qty-control button {
	width: 32px;
	height: 32px;
	border: none;
	background: #fff;
	color: #333;
	font-size: 15px;
	line-height: 1;
	cursor: pointer;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 0;
}

.pc-qty-minus {
	border-right: 1px solid #ebe8e1;
}

.pc-qty-plus {
	background: #c5a059;
	color: #fff;
	border-left: 1px solid #b4915070;
}

.pc-qty-input {
	width: 42px;
	text-align: center;
	border: none;
	background: transparent;
	font-size: 14px;
	padding: 0;
	-moz-appearance: textfield;
}

.pc-qty-input:focus {
	outline: none;
}

.pc-qty-input::-webkit-outer-spin-button,
.pc-qty-input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.pc-view-btn {
	display: inline-block;
	padding: 6px 12px;
	border: 1px solid #ccc;
	border-radius: 3px;
}

.pc-export {
	display: inline-block;
	margin-left: auto;
	white-space: nowrap;
}

.pc-sticky-cart {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	background: #222;
	color: #fff;
	padding: 12px 20px;
	display: flex;
	justify-content: space-between;
	align-items: center;
	z-index: 999;
}

.pc-sticky-cart button {
	background: #4caf50;
	color: #fff;
	border: none;
	padding: 8px 18px;
	border-radius: 4px;
	cursor: pointer;
}

/* Filter toggle button: hidden on desktop, shown only on tablet/mobile (see media query below) */
.pc-filter-toggle {
	display: none;
}

/* Tablet + mobile: one breakpoint covers both, so the filter toggle and the
   card-style rows below kick in consistently across tablet widths too, while
   staying fully hidden/unchanged above 1024px (real desktop). */
@media (max-width: 1024px) {
	.pc-layout {
		display: block;
	}

	.pc-filter-toggle {
		display: inline-flex;
		align-items: center;
		gap: 8px;
		width: fit-content;
		margin-bottom: 15px;
		padding: 10px 16px;
		background: #fff;
		border: 1px solid #ddd;
		border-radius: 4px;
		font-size: 14px;
		font-weight: 600;
		color: #333;
		cursor: pointer;
	}

	.pc-filter-toggle:hover {
		background: #f7f7f7;
	}

	.pc-filter-toggle svg {
		flex-shrink: 0;
	}

	/* Collapsed by default on tablet/mobile; JS toggles .pc-filter-open to expand */
	.pc-filter {
		display: none;
		width: 100%;
		margin-bottom: 20px;
	}

	.pc-filter.pc-filter-open {
		display: block;
	}

	.pc-toolbar {
		flex-direction: column;
		align-items: stretch;
	}

	.pc-toolbar #pc-search {
		max-width: none;
	}

	.pc-toolbar .pc-export {
		margin-left: 0;
	}

	.pc-table thead {
		display: none;
	}

	.pc-table,
	.pc-table tbody,
	.pc-table tr,
	.pc-table td {
		display: block;
		width: 100%;
	}

	.pc-table tr {
		border: 1px solid #eee;
		margin-bottom: 15px;
		padding: 10px;
	}

	.pc-table td {
		border: none;
		padding: 6px 0;
	}

	/* --- Product row becomes a card (matches the reference screenshot) --- */
	.pc-table tr.pc-product-row {
		display: grid;
		grid-template-columns: 72px 1fr auto;
		grid-template-areas:
			"image details avail"
			"image ean     ean"
			"image price   price"
			"divider divider divider"
			"qty   qty     total";
		column-gap: 14px;
		row-gap: 6px;
		align-items: start;
		background: #fff;
		border: 1px solid #eee;
		border-radius: 8px;
		padding: 14px;
		margin-bottom: 12px;
	}

	.pc-product-row td {
		padding: 0;
	}

	/* Default "Label: value" prefix is only used by other row types (e.g. the
	   "no results" row); the card layout below replaces it with positioning. */
	.pc-product-row td[data-label]::before {
		content: none;
	}

	.pc-product-row td[data-label="Image"] {
		grid-area: image;
	}

	.pc-product-row td[data-label="Details"] {
		grid-area: details;
		min-width: 0;
		display: flex;
		flex-direction: column;
		align-items: flex-start; /* don't stretch children full-width - size to content */
	}

	/* Visual order inside the details block, independent of markup order,
	   to match the screenshot: badge, brand, name, then concentration tag. */
	.pc-product-row td[data-label="Details"] .pc-badges           { order: 1; }
	.pc-product-row td[data-label="Details"] .pc-detail-brand     { order: 2; }
	.pc-product-row td[data-label="Details"] .pc-name              { order: 3; margin-bottom: 4px; }
	.pc-product-row td[data-label="Details"] .pc-concentration-tag { order: 4; }

	.pc-product-row td[data-label="EAN/UPC"] {
		grid-area: ean;
		font-size: 13px;
		color: #888;
	}

	.pc-product-row td[data-label="EAN/UPC"]::before {
		content: "EAN ";
	}

	.pc-product-row td[data-label="Availability"] {
		grid-area: avail;
		justify-self: end;
	}

	/* Gender/Volume are secondary attributes - skipped in the compact card to
	   match the screenshot; still shown in the full table on desktop and on
	   the product's own page. Nothing is removed, just hidden here. */
	.pc-product-row td[data-label="Gender"],
	.pc-product-row td[data-label="Volume"] {
		display: none;
	}

	/* Price: only the logged-out "log in to see prices" prompt (a bare link)
	   is hidden, since the View button already covers that case. A logged-in
	   user's real price - wrapped in WooCommerce's own markup, not a link -
	   still shows normally, so pricing is never hidden for someone who can buy. */
	.pc-product-row td[data-label="Price"]:has(> a) {
		display: none;
	}

	.pc-product-row td[data-label="Price"]:not(:has(> a)) {
		grid-area: price;
		font-weight: 700;
	}

	.pc-product-row::before {
		content: "";
		grid-area: divider;
		border-top: 1px dashed #e5e2da;
	}

	.pc-product-row td[data-label="Quantity"] {
		grid-area: qty;
		align-self: center;
	}

	.pc-product-row td[data-label="Total"] {
		grid-area: total;
		text-align: right;
	}

	.pc-product-row td[data-label="Total"]::before {
		content: attr(data-label);
		display: block;
		font-size: 11px;
		font-weight: 700;
		letter-spacing: 0.5px;
		text-transform: uppercase;
		opacity: 0.6;
		margin-bottom: 2px;
	}
}

/* ------------------------------------------------------------------
   Theme override: the active theme's stylesheet applies a striped
   background to odd table rows, and uses the accent color #c36 on
   some elements. Both leak into this plugin's table markup. These
   rules are scoped to .pc-layout (this plugin's own wrapper) so
   nothing else on the site is affected, and use !important because
   the theme's CSS loads with equal/higher specificity.
   ------------------------------------------------------------------ */
.pc-layout table tbody > tr:nth-child(odd) > td,
.pc-layout table tbody > tr:nth-child(odd) > th,
.pc-layout table tbody > tr,
.pc-layout table thead > tr {
	background-color: transparent !important;
}

/* Theme sets #c36 (and its #cc3366 longhand) as a background/text/border
   color via inline style on some elements that end up inside this
   plugin's table rows — force it off without touching this plugin's
   own intentional colors (badges, buttons, etc.) elsewhere in .pc-layout. */
.pc-layout table [style*="#c36" i],
.pc-layout table [style*="#cc3366" i] {
	background-color: transparent !important;
	color: inherit !important;
	border-color: inherit !important;
}

/* ------------------------------------------------------------------
   Custom skin overrides (supplied by site owner)
   ------------------------------------------------------------------ */
button#pc-filter-reset {
	background-color: transparent !important;
	border: 1px solid #d1d5db !important;
	border-radius: initial !important;
	color: #333333 !important;
	font-size: 12px !important;
	font-weight: initial !important;
	padding: 4px 8px !important;
	text-decoration: none !important;
}

aside#pc-filter-panel {
	padding: 12px;
	border: 1px solid #d1d5db !important;
}

.pc-toolbar {
	padding: 12px;
	border: 1px solid #d1d5db !important;
}

.pc-product-row {
	border: initial;
}

.pc-product-row:hover {
	background-color: #faf3e3 !important;
	box-shadow: inset 3px 0 0 #c5a059;
}

.pc-table thead {
	background: #222222;
}

.pc-table th {
	color: #F5EFE0;
	font-weight: 500 !important;
}

a.pc-view-btn {
	color: #1C1C1C;
	font-weight: 600;
}

input.pc-qty-input {
	padding: 0px !important;
	width: 50px !important;
}

.pc-qty-control button {
	width: 24px !important;
}

.pc-qty-control button:hover,
.pc-qty-control button:focus {
	background: #c5a059 !important;
}

input#pc-search {
	outline: none !important;
}

input#pc-search:focus {
	border-color: #c5a059 !important;
}

.pc-toolbar {
	justify-content: space-between;
}

.pc-export {
	margin-left: initial !important;
}

.pc-toolbar #pc-search {
	max-width: 450px !important;
}

button#pc-filter-toggle {
	background: #fff !important;
	border: 1px solid #e5e7eb !important;
	color: #374151 !important;
	border-radius: 3px !important;
	padding: 12px !important;
	font-weight: 500 !important;
	font-size: 0.875rem !important;
}

a.pc-export {
	background: #fff !important;
	border: 1px solid #e5e7eb !important;
	color: #374151 !important;
	border-radius: 3px !important;
	padding: 9px 16px !important;
	font-weight: 500 !important;
	font-size: 0.875rem !important;
	text-align: center !important;
}

span#pc-count-number {
	color: #000 !important;
	font-weight: 600 !important;
}

@media (min-width: 1025px) {
	button#pc-filter-toggle {
		display: none !important;
	}
}

@media (max-width: 1025px) {
	.pc-toolbar #pc-search {
		max-width: 100% !important;
	}
}

/* ------------------------------------------------------------------
   Pagination (shown only when there's more than one page, i.e. more
   than 15 products - PC_Products::pagination_html() returns an empty
   string otherwise, so #pc-pagination stays empty and takes no space).
   ------------------------------------------------------------------ */
.pc-pagination-wrap {
	margin-top: 18px;
}

.pc-pagination {
	display: flex;
	align-items: center;
	justify-content: center;
	flex-wrap: wrap;
	gap: 6px;
}

.pc-page-btn {
	min-width: 34px;
	height: 34px;
	padding: 0 10px;
	border: 1px solid #e0ddd6;
	border-radius: 4px;
	background: #fff;
	color: #333;
	font-size: 13px;
	cursor: pointer;
	transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.pc-page-btn:hover:not(:disabled) {
	background: #faf3e3;
	border-color: #c5a059;
}

.pc-page-btn.pc-page-current {
	background: #c5a059;
	border-color: #c5a059;
	color: #fff;
	cursor: default;
}

.pc-page-btn:disabled {
	opacity: 0.4;
	cursor: not-allowed;
}

.pc-page-ellipsis {
	padding: 0 4px;
	color: #999;
	font-size: 13px;
}

@media (max-width: 1024px) {
	.pc-page-btn {
		min-width: 30px;
		height: 30px;
		padding: 0 8px;
		font-size: 12px;
	}
}
