#productlisting {
	display: flex; flex-wrap: wrap; justify-content: center; gap: 30px;
	width: 98%; max-width: 900px; z-index: 0;
	margin: 50px auto; position: relative;
}

#productlisting > h3:only-child {
	margin: 100px 0;
}

.listedproduct {
	width: 200px; /*height: 310px;*/
	padding-bottom: 5px;
	background-color: white;
	border-radius: 10px;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	box-shadow: 0 0 3px var(--color2), 0 0 6px 3px #BDF2;
	overflow: hidden;
	user-select: text;
	transition: translate .5s, opacity .5s, filter .2s;
	/*
	background: white;
	box-shadow: 1px 1px 8px #0003;
	*/
}
.listedproduct h4 { color: black; line-height: 1.25em; }
/*.listedproduct:has(.productlink:hover, .productlink:focus) { background-color: var(--coolcolorhover); }*/
.listedproduct:hover h4, .listedproduct:has(:hover, :focus) h4 { color: var(--mainblue); }
.listedproduct:has(.productlink:focus-visible) { box-shadow: 0 0 5px 1px var(--headericonsaccent); }
.listedproduct:hover .pegheadicon, .listedproduct:has(:hover, :focus) .pegheadicon,
.listedproduct:hover .instockicon, .listedproduct:has(:hover, :focus) .instockicon { filter: brightness(0.45) sepia(1) hue-rotate(165deg) saturate(2); }

.productlink { position: absolute; width: 100%; height: 100%; }

.mediarrows {
	position: absolute;
	left: 0;
	top: calc(28% - 20px);
	padding: 20px 15px;
	margin: 0 -10px;
	font-size: 28px;
	line-height: 1.25em;
	color: #999;
}
.mediarrows + .mediarrows {
	right: 0;
	left: unset;
}

.mediarrows:hover, .mediarrows:focus-visible {
	color: var(--mainblue);
	opacity: 1;
}

.mediarrows:has(~ .stocklore) {
	top: calc(28% - 20px);
}

/* Different style color buttons: */
/*.colorswap { position: absolute; top: 7px; padding: 0; left: 13px; }*/
/*.colorswap > div { border-radius: 5px; border: solid 1px #aab; height: 10px; width: 25px; }*/

.showonhover {
	opacity: 0;
	transition: opacity .5s;
}

.listedproduct:hover .showonhover, .listedproduct:focus-within .showonhover {
	opacity: 1;
	text-shadow: 0 0 4px white, 0 0 4px white, 0 0 4px white;
}

.colorswap {
	z-index: 1;
	display: flex;
	gap: 5px;
	margin: 5px 0;
}
.colorswap > div {
	width: 15px; aspect-ratio: 1/1;
	display: block;
	border-radius: 30px;
	border: solid 1px #9ab;
	position: relative;
}
.colorswap[value='1'] > .clryellow, .colorswap[value='2'] > .clrrose { z-index: 1; }
.colorswap[value='2'] > .clrrose ~ .clrwhite { z-index: -1; }
/*.colorswap:not(:has(:nth-child(3))) { padding: 17px 20px 20px 19px; }
.colorswap:not(:has(:nth-child(3))) > div { margin: -6px; }*/

.colorswap:focus-visible {
	background: var(--coolcolor);
	padding: 3px 10px;
	margin: 2px 0;
	border-radius: 100px;
}

.imgholder {
	width: 180px; height: 180px;
	border-radius: 7px 7px 3px 3px;
	overflow: hidden;
	margin: 10px 0 2.5px;
	user-select: none;
	background-position: center;
	background-size: 100%;
	background-repeat: no-repeat;
	background-color: white;
	position: relative;
	z-index: 0;
}
.imgholder > * {
	width: 100%;
	height: 100%;
	object-fit: scale-down;
	background: white;
	transition: opacity .15s, visibility .15s;
	position: absolute;
	display: none;
	top: 0;
	left: 0;
	opacity: 0;
}
.currentmedia {
	display: block;
	opacity: 1;
	z-index: 1;
} /* Preloads the adjacent images without making them visible: */
.currentmedia + img, img:has(+ .currentmedia), .currentmedia:first-child ~ img:last-child {
	display: block;
	z-index: -1;
}
.imgholder > *:first-child, .imgholder > *:only-child {
	display: block;
	opacity: 1;
	z-index: 2;
}
.listedproduct:hover .imgholder > img:first-child:has(~ .currentmedia),
.listedproduct:has(:focus-visible) .imgholder > img:first-child:has(~ .currentmedia) {
	opacity: 0;
	visibility: hidden;
}

.productname, .productnumber { width: 100%; text-align: center; margin: 2.5px; font-weight: 300; }
.productnumber:has(.pegheadicon):not(:has(.instockicon)) { margin-left: 23px; }
.productnumber:has(.instockicon):not(:has(.pegheadicon)) { margin-right: 23px; }
.pegheadicon, .instockicon {
	display: inline-block;
	position: absolute;
	height: 24px; width: 24px;
	margin: -4px -28px;
	background: url(/static/img/icons/header/ER_Heads.svg) center 60% / 120% no-repeat;
	filter: brightness(0);
	border-radius: 100%;
	box-shadow: 0 0 0px 1px #0003;
}
.instockicon { margin: -4px 5px; background: url(/static/img/icons/instock.png) center 60% / 74% no-repeat; }

.invbottom {
	display: flex;
	width: 100%;
	margin: 5px 0 0;
	text-align: center;
	z-index: 1;
}
.invcartholder {
	display: flex;
	flex-grow: 1;
	justify-content: flex-end;
	margin-right: -30px;
	z-index: 1;
}
.cartandprice {
	border: solid 1px var(--mainblue);
	border-radius: 5px 0 0 5px;
	padding: 0 5px;
	font-size: 14px;
	line-height: 1.25em;
	min-width: 94px;
	color: black;
}
.cartandprice:has(.cartqty[data-outstocked]) { font-size: 13px; }
.cartandprice > span {
	border-bottom: solid 1px #055c8e66;
	display: block;
	margin-bottom: 2px;
	padding-bottom: 1px;
	text-wrap: nowrap;
}
.cartandprice + div {
	display: flex;
	flex-direction: column;
	font-size: 23px;
	line-height: 20px;
	border: solid 1px var(--mainblue);
	border-radius: 0 5px 5px 0;
	border-left: unset;
	background-color: white;
}
.cartandprice + div > button {
	font-size: 23px;
	line-height: 23.5px;
	padding: 0 4px;
	color: black;
}
.cartandprice + div > button:first-child { border-bottom: inherit; }
.cartandprice:hover, .cartandprice:focus-visible,
.cartandprice + div > button:hover, .cartandprice + div > button:focus-visible { background: #055c8e33; }

.cartandprice:has(.cartqty[data-max="1"]), .cartandprice:only-child {
	padding: 3px 17px;
	border-radius: 5px;
}
.cartandprice:has(.cartqty[data-max="1"]) + div { display: none; }
.cartandprice[inert] {
	background: #BBB1;
	opacity: 0.75;
	border-radius: 5px;
	border-color: #055c8e66;
}

.solocap {
	display: flex;
	justify-content: center;
	z-index: 1;
}

.invcorner {
	font-size: 25px;
	font-weight: 600;
	opacity: .5;
	color: black;
	margin: -5px 5px -5px 0;
	text-align: right;
	text-wrap: nowrap;
	flex-grow: 1;
	align-content: flex-end;
	min-height: 60px;
	line-height: 1.25em;
}
.invcorner > div {
	width: 19px;
	height: 19px;
	background: url(/static/img/icons/instock.png) center / 100% no-repeat;
	display: inline-block;
	filter: invert(1);
	margin: 0 2px -2px 0;
}
.invcorner > .incart {
	background: url(/static/img/icons/header/nav_cart_modified.svg) top / cover no-repeat;
	height: 26px;
	width: 24px;
	color: black;
	text-align: center;
	padding-left: 6px;
	font-size: 15px;
	font-weight: 600;
	margin: -5px 5px -5px 0;
	transform: translateY(-4px);
}
.incart:after {
	content: "";
	border-bottom: solid white 1px;
	width: calc(100% + 8px);
	height: 10px;
	margin-left: -4px;
	display: block;
}
/*[data-theme="dark"] .pegheadicon { filter: brightness(0) invert(1); }*/
.productnumber > span, .imgshow, .shoutLG > span + span { display: none; }
.productname {
	font-weight: normal; margin: 0;
	white-space: nowrap; text-overflow: ellipsis; overflow: hidden;
	@supports (-webkit-line-clamp: 2) {
		overflow: hidden; text-overflow: ellipsis; white-space: initial;
		display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
	}
}
.productvars {
	position: absolute; top: 158px;
	font-size: 13px; color: var(--mainblue);
	pointer-events: none;
}
.productvars > span { position: relative; }
.productvars:before {
	content: "Variations Available";
	position: absolute;
	filter: blur(2px);
	-webkit-text-stroke: 8px white;
}
.productsetting {
	position: absolute;
	top: 4px;
	color: black;
	font-size: 15px;
	background: #EEE9;
	border-radius: 25px;
	padding: 1px 5px 2px;
	opacity: .9;
	font-style: italic;
}

.galleryfav {
	position: absolute;
	top: 0; right: 0;
	padding: 8px 8px 10px 13px;
	font-size: 16px;
	z-index: 1;
	border-bottom-left-radius: 19px;
	opacity: .25;
	color: black;
	display: none;
}
.productprice { margin: auto 0 5px; font-weight: normal; }

.galleryfav:hover, .galleryfav:focus, .galleryfav.favorite { opacity: 1; }
.colorswap:hover > div, .colorswap:focus > div { border-color: #777; }

/*@property --a {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
.colorswap > div:before {
	--a: 0deg;
	content: "";
	background-image: conic-gradient(from 0deg at 50% 50%, #0003 0%, #0003 var(--a), #0000 var(--a));
	width: 100%;
	height: 100%;
	display: block;
	border-radius: inherit;
	transition: --a .2s ease;
}
.colorswap > div:hover:before {
	--a: 360deg;
}

.favorite { color: #fcc; }
.favorite:hover, .favorite:focus { color: #f99; }
.favorite {
	-webkit-text-stroke: 1px #9ab;
	font-size: 18px;
	top: -1px;
	right: -1px;
}
.favorite:hover, .favorite:focus {
	-webkit-text-stroke: 1px #777;
}*/

#productlisting.nonames .productname, .samplerbtn ~ .productname, .samplerbtn ~ .productprice, .productprice:empty { display: none !important; }
/*#productlisting.nonames .listedproduct { height: 270px; }*/
.samplerbtn ~ .productprice { margin: unset; }
.samplerbtn {
	border-radius: 5px;
	padding: 6px;
	order: 1;
	margin: 2px auto 8px;
	line-height: 1.25em;
	opacity: 0.9;
	transition: color .15s;
}
.samplerbtn:hover, .samplerbtn:focus-visible { filter: brightness(0.9); opacity: 1; }

#productlisting.loadingtable:after {
	content: "";
	width: 100vw; height: calc(100% + 20px);
	position: absolute; top: -10px;
	background: black;
	box-shadow: 0 0 8px 10px black;
	opacity: .2;
}

.loadingtable > .listedproduct {
	filter: brightness(0.85);
	opacity: .9;
}

/*.loadingtable > .listedproduct > div:only-child { aspect-ratio: 1 / 1; }*/

.loadingtable .imgholder:after, .loadingtable .imgholder:before {
	content: "";
	width: 100%; height: 100%;
	position: absolute; top: 0; left: 0;
	opacity: .55; filter: invert(1);
	background: black url(/static/img/icons/loading.svg) center 55px/70% no-repeat;
}

.imgholder:has(img[onload]):before {
	content: "";
	background: #FFF2 url(/static/img/icons/loading.svg) center / 55% no-repeat;
	width: 90%;
	height: 70%;
	border-radius: 7px;
	position: absolute;
	filter: invert(1);
	opacity: .5;
	left: 6%;
	top: 15%;
}

.loadingtable > .listedproduct:not(:has(:nth-child(3))) {
	min-height: 245px;
}

.colorpreference > label {
	position: absolute;
	left: 10px;
	top: 37px;
	cursor: pointer;
	display: none; /*Removes the "Show names" option */
}
.colorpreference > label > input { transform: translateY(1px); cursor: pointer; }
.colorpreference > label:focus-within { padding: 0 5px 3px 0; border-radius: 5px; box-shadow: 0 0 5px 1.25px var(--headertextcolor); }

.listedproduct .stocklore {
	font-size: 13px;
	flex-grow: 1;
	align-content: center;
	overflow: visible;
	color: black;
}
.listedproduct p { margin: 3px 0; }

.stocklore .shoutLG {
	position: absolute;
	top: 7px;
	left: 13px;
	font-size: 14px;
	background: #00a770;
	padding: 2px 8px 3px 0;
	border-radius: 20px;
	font-weight: 500;
	color: white;
	font-style: italic;
}

.stocklore img {
	height: 29px;
	margin: -11px 2px -9px -9px;
}

.listedproduct:has(.shoutLG) .productsetting { right: 6px; }

@media (max-width: 1200px) { .invcartholder:has([data-outstocked], .widecorner) { margin-right: 0; } }
@media (max-width: 1000px) { #productlisting { gap: 3vw; } }
@media (max-width: 500px) {
	#productlisting { gap: 2vw; }
	.listedproduct { width: 176px; }
	.imgholder { width: 150px; height: 150px; }
	.showonhover { opacity: 1; }
	.productvars { top: 138px; }
	.invcartholder { margin-right: 0; }
	.widecorner {
		padding: 0 4px;
		font-size: 13px;
		min-width: unset;
	}
	.widecorner.wider {
		padding: 0 3px;
		font-size: 12px;
	}
	.invcartholder:has(.widecorner) + .invcorner { font-size: 21px; }
	.invcartholder:has(.widecorner) + .invcorner > div:not(.incart) {
		width: 17px;
		height: 17px;
		margin-right: 0;
	}
	.listedproduct:has(.productsetting) .shoutLG { left: 8px; padding-right: 4px; }
	.listedproduct:has(.productsetting) .stocklore img { margin: -4px 0 -4px -6px; }
}
@media (max-width: 400px) {
	.listedproduct { width: 160px; }
	.imgholder { width: 130px; height: 130px; }
	.productvars { top: 125px; font-size: 12px; }
}

#productlisting:not(:has(div:nth-child(5))) + #mirrorSOD { display: none; }