/*
Card redesign pilot for the lab grown studs pages (studlist.html only).

Self-contained replacement for the productboxes.css + studs.css pair on this
page: studlist.html no longer loads either, so nothing here can affect the
other listing pages that still share the legacy card component. When the
redesigned card rolls out site-wide, this file is the reference.

Hierarchy: size is the headline, price second, gold as swatch dots with a
stock pill, and the style number demoted to a small copyable footer.

Colors follow the design company's "Option 1" guideline (July 2026):
Slate Blue Gray #466587 primary, Midnight Navy #1D2940 text/accent,
Silver Blue #9CA3AF interactive outlines, Cool Gray #E8EAEC hairlines,
white backgrounds; flat components, no gradients. Muted text uses alpha
tints of Midnight Navy because pure Silver Blue fails WCAG contrast at
small sizes. The green stock pill is a deliberate semantic exception
(in-stock = green, matching the site's existing in-stock iconography).
*/

.galleryintro > p, #productlisting p {
	text-align: center;
	font-size: 16px;
}
.galleryintro > p > br { display: none; }
@media (max-width: 775px) {
	.galleryintro > p > br { display: block; }
}

/* Hidden by default; the template's inline style block reveals both for anonymous visitors. */
.retailtext, .signintext { display: none; }

#productlisting {
	display: grid;
	/* Fluid columns: cards share each row evenly and grow with the viewport,
	   never shrinking below 255px. The 1360px cap is deliberately below the
	   1387px a fifth column would need, so the grid tops out at 4 per row and
	   the twelve sizes always land as a clean 4 x 3 on desktop. */
	grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
	gap: 28px;
	width: 94%;
	max-width: 1360px;
	margin: 40px auto 60px;
	position: relative;
}

#productlisting > h2 {
	grid-column: 1 / -1;
	text-align: center;
	font-weight: 400;
	margin: 0 0 10px;
}

#productlisting > h2 > .stockicon {
	width: 28px;
	height: 28px;
	background: url(/static/img/icons/instock.png) center 80% / 80% no-repeat;
	display: inline-block;
	filter: var(--dayinvert);
	opacity: .85;
	box-shadow: 0 0 1px 2px #FFF9;
	border-radius: 100px;
	margin-bottom: -8px;
	animation: blinkload 1.5s infinite;
}

@keyframes blinkload {
	0%, 100% { opacity: .85; }
	50% { opacity: .25; }
}

.listedproduct {
	/* The site does not set a global border-box; without this, padding + border
	   push the card past its grid cell. */
	box-sizing: border-box;
	background: #fff;
	border: 1px solid #E8EAEC;
	border-radius: 12px;
	padding: 14px 14px 16px;
	position: relative;
	display: flex;
	flex-direction: column;
	align-items: center;
	color: #1D2940;
	transition: transform .18s ease, box-shadow .18s ease;
}
.listedproduct:hover {
	transform: translateY(-3px);
	box-shadow: 0 10px 24px rgba(29, 41, 64, .12);
}

.cardtopline {
	display: flex;
	justify-content: space-between;
	align-items: center;
	width: 100%;
	min-height: 21px;
	/* A "Yellow out of stock" pill can outgrow a narrow phone-grid card;
	   wrapping beats clipping. */
	flex-wrap: wrap;
	gap: 4px;
}

.stockpill {
	font-size: 11px;
	font-weight: 700;
	color: #0e7d55;
	background: #e5f4ee;
	border-radius: 20px;
	padding: 2px 9px;
	margin-left: auto;
}
.stockpill[hidden] { display: none; }
/* Zero stock for the selected gold only — the pill names the color
   ("White out of stock") so it doesn't read as the whole style being out. */
.stockpill.outofstock {
	color: #a13c32;
	background: #f7eae8;
}

.imgholder { width: 100%; margin: 8px 0 2px; }
.imgholder > img {
	width: 100%;
	height: auto;
	display: block;
	/* The S3 photos have an off-white background; multiply blends it into the card. */
	mix-blend-mode: multiply;
}

.cardsize {
	font-size: 23px;
	font-weight: 800;
	color: #1D2940;
	letter-spacing: -.01em;
	text-align: center;
	margin: 6px 0 0;
	line-height: 1.15;
}
.cardsize > small {
	display: block;
	font-size: 12px;
	font-weight: 600;
	color: rgba(29, 41, 64, .65);
	letter-spacing: .02em;
	margin-top: 2px;
}

.swatches {
	display: flex;
	gap: 10px;
	justify-content: center;
	margin: 10px 0 12px;
}
.swatch {
	width: 22px;
	height: 22px;
	border-radius: 50%;
	cursor: pointer;
	border: 2px solid transparent;
	outline: 1px solid #c4c9d1;
	padding: 0;
}
/* Same metal icons the product pages use (product_page_v2.html swatchMap), so
   gold colors read identically site-wide. */
.swatch-white { background: url("/static/assets/image/icon/white.svg") center / cover no-repeat; }
.swatch-yellow { background: url("/static/assets/image/icon/yellow.svg") center / cover no-repeat; }
.swatch.selectedcolor { outline-color: #466587; }
.swatch:hover, .swatch:focus-visible { outline-color: #466587; }

.productprice {
	font-size: 18px;
	font-weight: 400;
	color: #1D2940;
	text-align: center;
	margin: 0 0 12px;
}
.productprice > .retailtext {
	font-weight: 600;
	color: rgba(29, 41, 64, .65);
	font-size: 13px;
}

/* Show only the price for the selected gold when both have been populated. */
.listedproduct.White:has(.trueprice:not(:empty)) .yellowprice,
.listedproduct.Yellow:has(.yellowprice:not(:empty)) .trueprice {
	display: none;
}

.productprice.placeholderBG {
	color: transparent !important;
	border-radius: 5px;
	background-size: 30%;
}

/* Two classes on purpose: legacy-header.css's `.legacy-content a` (0-1-1)
   outranks a lone `.cartbtn` (0-1-0) and would force Manrope over Lato. */
.listedproduct .cartbtn {
	display: flex;
	/* sharedelements_new.css sets .cartbtn to column; the standard button lays
	   the label and cart icon out side by side. */
	flex-direction: row;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	height: 44px;
	text-align: center;
	/* Site-standard add-to-cart, matching product_page_v2 and the Bridal
	   Builder: flat Slate Blue, square corners, Lato Bold, hover fades to
	   Midnight Navy. No radius, shadow, or lift. */
	background: #466587;
	color: #fff;
	font-family: 'Lato', sans-serif;
	font-weight: 700;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	transition: background .3s ease;
}
.listedproduct .cartbtn:hover, .listedproduct .cartbtn:focus-visible {
	color: #fff;
	background: #1D2940;
}
/* The button carries the `tailwind` class: legacy-header.css applies
   `all: revert` to everything under .legacy-content EXCEPT `.tailwind` and
   its descendants, and that revert strips the icon SVG's presentation
   attributes — including the paths' `d` geometry — leaving it invisible.
   Do not remove `tailwind` from the button's class list in studs.js. */
.listedproduct .cartbtn > svg { flex-shrink: 0; }

.cardsku {
	font-size: 12px;
	color: rgba(29, 41, 64, .55);
	margin-top: 10px;
	cursor: copy;
	text-wrap: nowrap;
	transition: color .15s;
}
.cardsku:hover, .cardsku:focus-visible { color: #466587; }
.cardsku:after {
	/* FontAwesome copy glyph, matching the old style-number pill affordance. */
	content: " \f0c5";
	font: normal normal normal 12px / 1 FontAwesome;
	opacity: .6;
	margin-left: 3px;
}

/* Martini page: the 1/4 cttw pair is not offered; the overlay says so. */
.listedproduct[inert] .productlink {
	position: absolute;
	inset: 0;
	z-index: 2;
	display: flex;
	align-items: center;
	justify-content: center;
	text-align: center;
	background: #FFFC;
	backdrop-filter: blur(2px);
	border-radius: 12px;
	color: #1D2940;
	font-size: 16px;
	font-weight: 600;
}

@media (max-width: 635px) {
	.listedproduct[inert] { display: none; }
}

@media (max-width: 520px) {
	#productlisting { gap: 12px; grid-template-columns: repeat(2, 1fr); }
	.listedproduct { padding: 10px 10px 12px; }
	.cardsize { font-size: 19px; }
	.cardsize > small { font-size: 11px; }
	.productprice { font-size: 16px; }
	/* Matches the Bridal Builder's mobile scale (text-sm); height stays 44px
	   like the product page button. */
	.listedproduct .cartbtn { font-size: 14px; gap: 6px; }
}