/*
 * 3D Prints — the /3d-prints/ grid (blocks/print-card) and each item's
 * product page (blocks/print-product, assets/js/print-product.js).
 * Loaded only on those two views (functions.php).
 */

/* ---------- Product page ---------- */

.yp-print {
	padding-block: var(--wp--preset--spacing--md) var(--wp--preset--spacing--xl);
}

.yp-print__crumbs {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--charcoal);
	margin-bottom: var(--wp--preset--spacing--sm);
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
}

.yp-print__crumbs a {
	color: var(--wp--preset--color--cyan-deep);
	text-decoration: none;
}

.yp-print__layout {
	display: grid;
	grid-template-columns: minmax(0, 1.05fr) minmax(0, 1fr);
	gap: var(--wp--preset--spacing--lg);
	align-items: start;
}

@media (max-width: 900px) {
	.yp-print__layout {
		grid-template-columns: 1fr;
		gap: var(--wp--preset--spacing--md);
	}
}

.yp-print__media {
	position: sticky;
	top: 6rem;
}

@media (max-width: 900px) {
	.yp-print__media {
		position: static;
	}
}

.yp-print__photo {
	position: relative;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--light-gray);
	border-radius: var(--wp--custom--radius--card);
	overflow: hidden;
}

.yp-print__photo img {
	display: block;
	width: 100%;
	height: auto;
}

.yp-print__photo-empty {
	aspect-ratio: 4 / 3;
	background: var(--wp--preset--color--warm-white);
}

/* A size's own photo is showing: the dots were placed on the main photo. */
.yp-print__photo.is-size-photo .yp-print__dot {
	display: none;
}

.yp-print__dot {
	position: absolute;
	width: 30px;
	height: 30px;
	margin: -15px 0 0 -15px;
	border-radius: 50%;
	background: var(--wp--preset--color--near-black);
	color: var(--wp--preset--color--white);
	border: 3px solid var(--wp--preset--color--white);
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.25);
	font-size: 0.8rem;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
	transition: transform 150ms ease, box-shadow 150ms ease;
}

.yp-print__dot.is-active {
	transform: scale(1.2);
	box-shadow: 0 0 0 4px rgba(0, 174, 239, 0.35), 0 2px 8px rgba(0, 0, 0, 0.25);
}

/* The picked color, as a small badge on the dot's corner. */
.yp-print__dot-color {
	position: absolute;
	right: -8px;
	bottom: -6px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	border: 2px solid var(--wp--preset--color--white);
	box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.12);
}

.yp-print__caption {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--charcoal);
	margin: 0.6rem 0 0;
}

.yp-print__title {
	font-size: clamp(1.75rem, 3vw, 2.25rem);
	margin: 0 0 0.4rem;
}

.yp-print__price {
	font-family: var(--wp--preset--font-family--heading);
	font-size: 1.6rem;
	font-weight: 700;
	margin: 0;
}

.yp-print__price small {
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--wp--preset--font-size--small);
	font-weight: 500;
	color: var(--wp--preset--color--charcoal);
	margin-left: 0.35rem;
}

.yp-print__bubbles {
	list-style: none;
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
	margin: 0.8rem 0 1rem;
	padding: 0;
}

.yp-print__bubbles li {
	font-size: var(--wp--preset--font-size--small);
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--light-gray);
	border-radius: 999px;
	padding: 0.3rem 0.75rem;
}

.yp-print__description {
	font-size: var(--wp--preset--font-size--medium);
	color: var(--wp--preset--color--charcoal);
	line-height: 1.55;
	margin-bottom: var(--wp--preset--spacing--md);
}

.yp-print__description p {
	font-size: inherit;
	margin: 0 0 0.6rem;
}

.yp-print__section-title {
	font-size: 0.8125rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	margin: 0 0 0.6rem;
}

/* Size picker: one pill per size, above the color choices. */
.yp-print-sizes {
	border: 0;
	padding: 0;
	margin: 0 0 1.1rem;
	min-width: 0;
}

.yp-print-sizes__options {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.yp-print-sizes__error {
	margin: 0 0 0.6rem;
	font-size: 0.875rem;
	font-weight: 600;
	color: var(--wp--preset--color--magenta-deep);
}

.yp-print-sizes.is-missing .yp-print-size span {
	border-color: var(--wp--preset--color--magenta-deep);
}

.yp-print-size {
	position: relative;
	cursor: pointer;
}

.yp-print-size input {
	position: absolute;
	opacity: 0;
	width: 1px;
	height: 1px;
}

.yp-print-size span {
	display: inline-block;
	padding: 0.55rem 1rem;
	border: 1px solid var(--wp--preset--color--light-gray);
	border-radius: var(--wp--custom--radius--input);
	background: var(--wp--preset--color--white);
	font-size: 0.9rem;
	font-weight: 600;
	transition: border-color 120ms ease, box-shadow 120ms ease;
}

.yp-print-size:hover span {
	border-color: var(--wp--preset--color--charcoal);
}

.yp-print-size input:checked + span {
	border-color: var(--wp--preset--color--near-black);
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--near-black);
}

.yp-print-size input:focus-visible + span {
	outline: 2px solid var(--wp--custom--focus-ring);
	outline-offset: 2px;
}

/* A size's own price, under its name, when sizes cost different amounts. */
.yp-print-size span small {
	display: block;
	font-size: 0.8rem;
	font-weight: 500;
	color: var(--wp--preset--color--charcoal);
}

/* Optional paid lid text / lid image, below the colors. */
.yp-print-addons {
	margin: 1.1rem 0 0.4rem;
}

.yp-print-addons__optional {
	margin-left: 0.4rem;
	font-weight: 500;
	letter-spacing: 0;
	text-transform: none;
	color: var(--wp--preset--color--charcoal);
}

.yp-print-addon {
	border: 1px solid var(--wp--preset--color--light-gray);
	border-radius: var(--wp--custom--radius--input);
	background: var(--wp--preset--color--white);
	padding: 0.75rem 1rem;
	margin: 0 0 0.65rem;
}

.yp-print-addon.is-on {
	border-color: var(--wp--preset--color--near-black);
}

.yp-print-addon__toggle {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	cursor: pointer;
}

.yp-print-addon__toggle input {
	width: 18px;
	height: 18px;
	flex-shrink: 0;
	accent-color: var(--wp--preset--color--near-black);
}

.yp-print-addon__toggle span {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.2rem 0.6rem;
	width: 100%;
}

.yp-print-addon__toggle em {
	margin-left: auto;
	font-style: normal;
	font-weight: 600;
	font-size: var(--wp--preset--font-size--small);
}

.yp-print-addon__body {
	margin-top: 0.7rem;
}

.yp-print-addon__body input[type="text"] {
	width: 100%;
	box-sizing: border-box;
	padding: 0.6rem 0.75rem;
	border: 1px solid var(--wp--preset--color--light-gray);
	border-radius: var(--wp--custom--radius--input);
	font: inherit;
}

.yp-print-addon__hint {
	margin: 0.4rem 0 0;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--charcoal);
}

.yp-print-addon__file {
	position: relative;
	display: block;
	padding: 0.7rem 0.9rem;
	border: 1px dashed var(--wp--preset--color--charcoal);
	border-radius: var(--wp--custom--radius--input);
	font-weight: 600;
	font-size: 0.9rem;
	cursor: pointer;
	overflow-wrap: anywhere;
}

.yp-print-addon__file input {
	position: absolute;
	inset: 0;
	opacity: 0;
	cursor: pointer;
}

.yp-print-addon__file:focus-within {
	outline: 2px solid var(--wp--custom--focus-ring);
	outline-offset: 2px;
}

.yp-print-addon.is-error .yp-print-addon__file {
	border-color: var(--wp--preset--color--magenta-deep);
	color: var(--wp--preset--color--magenta-deep);
}

.yp-print-slot {
	border: 1px solid var(--wp--preset--color--light-gray);
	border-radius: var(--wp--custom--radius--input);
	background: var(--wp--preset--color--white);
	padding: 0.85rem 1rem 1rem;
	margin: 0 0 0.65rem;
	min-width: 0;
}

/* Gradient ring on the part being picked, same brand ring as the
   label designer's selected tiles. */
.yp-print-slot:focus-within {
	border: 2px solid transparent;
	background: linear-gradient(var(--wp--preset--color--white), var(--wp--preset--color--white)) padding-box, linear-gradient(90deg, var(--wp--preset--color--cyan), var(--wp--preset--color--magenta) 55%, var(--wp--preset--color--yellow)) border-box;
	padding: calc(0.85rem - 1px) calc(1rem - 1px) calc(1rem - 1px);
}

.yp-print-slot__head {
	display: flex;
	align-items: center;
	gap: 0.65rem;
	width: 100%;
	padding: 0;
	margin-bottom: 0.7rem;
	float: left; /* Lets a <legend> lay out as a normal flex row inside its fieldset. */
}

.yp-print-slot__head + * {
	clear: both;
}

.yp-print-slot__num {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: var(--wp--preset--color--near-black);
	color: var(--wp--preset--color--white);
	font-size: 0.75rem;
	font-weight: 700;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.yp-print-slot__label {
	display: flex;
	flex-direction: column;
	line-height: 1.3;
}

.yp-print-slot__label span {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--charcoal);
}

.yp-print__dot-color.is-silk,
.yp-print-card .is-silk,
.yp-fil__tile.is-silk {
	background-image: linear-gradient(135deg, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 45%, rgba(255, 255, 255, 0.35) 70%, rgba(255, 255, 255, 0));
}

/* ---------- Filament picker (render.php $filament_picker) ---------- */

.yp-fil-picker {
	border: 1px solid var(--wp--preset--color--light-gray);
	border-radius: 12px;
	background: #fcfbf9;
}

.yp-fil-picker__chosen {
	display: flex;
	align-items: center;
	gap: 0.7rem;
	padding: 0.45rem 0.8rem 0.45rem 0.45rem;
	cursor: pointer;
	list-style: none;
	border-radius: 12px;
}

.yp-fil-picker__chosen::-webkit-details-marker {
	display: none;
}

.yp-fil-picker__chosen:focus-visible {
	outline: 2px solid var(--wp--custom--focus-ring);
	outline-offset: 2px;
}

.yp-fil-picker__chosen .yp-fil__tile {
	width: 44px;
	height: 44px;
}

.yp-fil-picker__chosen .yp-fil__text b {
	font-size: 0.95rem;
}

.yp-fil-picker__toggle {
	margin-left: auto;
	font-size: var(--wp--preset--font-size--small);
	font-weight: 600;
	color: var(--wp--preset--color--cyan-deep);
	white-space: nowrap;
}

.yp-fil-picker__close-label,
.yp-fil-picker[open] .yp-fil-picker__open-label {
	display: none;
}

.yp-fil-picker[open] .yp-fil-picker__close-label {
	display: inline;
}

.yp-fil-picker[open] .yp-fil-picker__close-label::after {
	content: " \2303";
}

.yp-fil-picker__panel {
	border-top: 1px solid var(--wp--preset--color--light-gray);
	padding: 0.75rem;
}

.yp-fil-picker__tools {
	margin-bottom: 0.4rem;
}

.yp-fil-picker__search {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	border: 1px solid var(--wp--preset--color--light-gray);
	border-radius: 10px;
	background: var(--wp--preset--color--white);
	padding: 0 0.75rem;
	color: var(--wp--preset--color--charcoal);
}

.yp-print .yp-fil-picker__search input[type="search"] {
	flex: 1;
	min-width: 0;
	border: 0;
	background: none;
	padding: 0.55rem 0;
	font-size: 0.9rem;
	box-shadow: none;
	outline: none;
}

.yp-fil-picker__search:focus-within {
	outline: 2px solid var(--wp--custom--focus-ring);
	outline-offset: 1px;
}

.yp-fil-picker__chips {
	display: flex;
	gap: 0.35rem;
	margin-top: 0.55rem;
	overflow-x: auto;
	scrollbar-width: none;
}

.yp-fil-picker__chips button {
	flex: none;
	border: 1px solid var(--wp--preset--color--light-gray);
	background: var(--wp--preset--color--white);
	color: var(--wp--preset--color--near-black);
	border-radius: 999px;
	padding: 0.3rem 0.7rem;
	font: inherit;
	font-size: 0.8rem;
	cursor: pointer;
}

.yp-fil-picker__chips button em {
	font-style: normal;
	color: var(--wp--preset--color--charcoal);
	margin-left: 0.15rem;
}

.yp-fil-picker__chips button.is-on {
	background: var(--wp--preset--color--near-black);
	border-color: var(--wp--preset--color--near-black);
	color: var(--wp--preset--color--white);
}

.yp-fil-picker__chips button.is-on em {
	color: rgba(255, 255, 255, 0.65);
}

/* A long list scrolls inside the panel, not the page. */
.yp-fil-picker.has-tools .yp-fil-picker__list {
	max-height: 372px;
	overflow-y: auto;
	overscroll-behavior: contain;
	margin: 0 -0.4rem;
	padding: 0 0.4rem 0.3rem;
	scrollbar-width: thin;
}

.yp-fil-picker__group-title {
	position: sticky;
	top: 0;
	z-index: 1;
	margin: 0;
	padding: 0.55rem 0 0.4rem;
	background: #fcfbf9;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	color: var(--wp--preset--color--charcoal);
}

.yp-fil-picker__grid {
	display: grid;
	grid-template-columns: repeat(2, minmax(0, 1fr));
	gap: 0.4rem;
	margin-bottom: 0.3rem;
}

.yp-fil {
	position: relative;
	margin: 0;
	display: flex;
	align-items: center;
	gap: 0.6rem;
	min-width: 0;
	padding: 0.3rem 1.9rem 0.3rem 0.3rem;
	border: 1px solid var(--wp--preset--color--light-gray);
	border-radius: 10px;
	background: var(--wp--preset--color--white);
	cursor: pointer;
	transition: border-color 120ms ease;
}

.yp-fil:hover {
	border-color: var(--wp--preset--color--charcoal);
}

.yp-fil[hidden] {
	display: none;
}

.yp-fil:has(input:checked) {
	border-color: var(--wp--preset--color--near-black);
	box-shadow: 0 0 0 1px var(--wp--preset--color--near-black);
}

.yp-fil:has(input:checked)::after {
	content: "\2713";
	position: absolute;
	right: 0.45rem;
	top: 50%;
	transform: translateY(-50%);
	width: 20px;
	height: 20px;
	border-radius: 50%;
	background: var(--wp--preset--color--near-black);
	color: var(--wp--preset--color--white);
	font-size: 0.7rem;
	display: grid;
	place-items: center;
}

.yp-fil:has(input:focus-visible) {
	outline: 2px solid var(--wp--custom--focus-ring);
	outline-offset: 2px;
}

.yp-fil.is-out {
	cursor: not-allowed;
	opacity: 0.5;
}

.yp-fil.is-out .yp-fil__tile {
	filter: grayscale(0.8);
}

.yp-fil__tile {
	position: relative;
	display: block;
	width: 42px;
	height: 42px;
	flex: none;
	border-radius: 8px;
	overflow: hidden;
	border: 1px solid rgba(0, 0, 0, 0.08);
}

.yp-fil__tile img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
}

.yp-fil__tile.is-empty {
	background: repeating-linear-gradient(45deg, #f1efeb 0 6px, #e6e3dd 6px 12px);
}

.yp-fil__text {
	display: flex;
	flex-direction: column;
	min-width: 0;
	line-height: 1.25;
}

.yp-fil__text b {
	font-size: 0.85rem;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.yp-fil__text b.is-missing {
	color: var(--wp--preset--color--magenta-deep);
}

.yp-fil__text small {
	font-size: 0.74rem;
	color: var(--wp--preset--color--charcoal);
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.yp-fil__extra {
	position: absolute;
	right: 0.55rem;
	top: 50%;
	transform: translateY(-50%);
	font-size: 0.7rem;
	font-weight: 700;
	color: var(--wp--preset--color--magenta-deep);
}

.yp-fil:has(input:checked) .yp-fil__extra {
	display: none;
}

.yp-fil-picker__empty {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--charcoal);
	margin: 0.6rem 0;
}

/* The bigger photo on hover (desktop) or press-and-hold (phone). */
.yp-fil-zoom {
	position: fixed;
	z-index: 1000;
	width: 200px;
	padding: 0.5rem;
	border: 1px solid var(--wp--preset--color--light-gray);
	border-radius: 12px;
	background: var(--wp--preset--color--white);
	box-shadow: 0 12px 32px rgba(0, 0, 0, 0.18);
	pointer-events: none;
}

.yp-fil-zoom[hidden] {
	display: none;
}

.yp-fil-zoom img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 8px;
}

.yp-fil-zoom b {
	display: block;
	margin-top: 0.4rem;
	font-size: 0.85rem;
}

.yp-fil-zoom small {
	font-size: 0.75rem;
	color: var(--wp--preset--color--charcoal);
}

@media (max-width: 600px) {
	.yp-fil-picker__panel {
		padding: 0.6rem;
	}

	.yp-fil {
		gap: 0.45rem;
		padding-right: 0.4rem;
		align-items: flex-start;
	}

	.yp-fil__tile {
		width: 38px;
		height: 38px;
	}

	.yp-fil__text b {
		font-size: 0.8rem;
		white-space: normal;
	}

	.yp-fil__extra {
		position: static;
		transform: none;
		display: block;
	}

	.yp-fil__text + .yp-fil__extra {
		position: absolute;
		right: 0.4rem;
		bottom: 0.25rem;
		top: auto;
	}

	.yp-fil:has(input:checked)::after {
		top: 0.4rem;
		transform: none;
		right: 0.35rem;
		width: 18px;
		height: 18px;
	}

	.yp-fil-picker.has-tools .yp-fil-picker__list {
		max-height: 330px;
	}

	.yp-fil-zoom {
		width: 170px;
	}
}

.yp-print__note {
	font-size: 0.8rem;
	color: var(--wp--preset--color--charcoal);
	margin: 0.8rem 0 1.1rem;
}

.yp-print__buy {
	display: flex;
	gap: 0.75rem;
	align-items: stretch;
}

.yp-print__qty {
	display: flex;
	align-items: center;
	border: 1px solid var(--wp--preset--color--light-gray);
	border-radius: var(--wp--custom--radius--input);
	background: var(--wp--preset--color--white);
}

.yp-print__qty button {
	border: 0;
	background: none;
	font-size: 1.15rem;
	font-weight: 600;
	padding: 0 0.9rem;
	height: 100%;
	cursor: pointer;
}

.yp-print .yp-print__buy .yp-print__qty input[type="number"] {
	width: 3rem;
	border: 0;
	padding: 0;
	text-align: center;
	font: inherit;
	font-weight: 600;
	-moz-appearance: textfield;
	appearance: textfield;
}

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

.yp-print__add {
	flex: 1;
	justify-content: center;
	font-size: 1rem;
	padding-block: 0.95rem;
}

.yp-print__add:disabled {
	opacity: 0.6;
	cursor: wait;
}

.yp-print__status {
	font-size: var(--wp--preset--font-size--small);
	margin: 0.6rem 0 0;
	min-height: 1.2em;
}

.yp-print__status.is-error {
	color: var(--wp--preset--color--magenta-deep);
	font-weight: 600;
}

.yp-print__summary {
	background: var(--wp--preset--color--warm-white);
	border: 1px solid var(--wp--preset--color--light-gray);
	border-radius: var(--wp--custom--radius--input);
	padding: 0.75rem 0.9rem;
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--charcoal);
	line-height: 1.5;
	margin: 0.6rem 0 0;
}

.yp-print__summary strong {
	color: var(--wp--preset--color--near-black);
}

/* ---------- /3d-prints/ grid ---------- */

.yp-print-query {
	padding-bottom: var(--wp--preset--spacing--xl);
}

.yp-print-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
	gap: var(--wp--preset--spacing--md);
	padding: 0;
	margin-bottom: var(--wp--preset--spacing--xl);
}

@media (max-width: 600px) {
	.yp-print-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 0.75rem;
	}
}

.yp-print-grid > li {
	list-style: none;
	margin: 0;
}

.yp-print-card {
	display: flex;
	flex-direction: column;
	height: 100%;
	background: var(--wp--preset--color--white);
	border: 1px solid var(--wp--preset--color--light-gray);
	border-radius: var(--wp--custom--radius--card);
	overflow: hidden;
	text-decoration: none;
	color: inherit;
	transition: box-shadow 150ms ease, transform 150ms ease;
}

.yp-print-card:hover {
	box-shadow: var(--wp--custom--shadow-elevation--medium);
	transform: translateY(-2px);
}

.yp-print-card__media {
	display: block;
	aspect-ratio: 1;
	background: var(--wp--preset--color--white);
}

.yp-print-card__media img {
	width: 100%;
	height: 100%;
	object-fit: contain;
	display: block;
}

.yp-print-card__body {
	display: flex;
	flex-direction: column;
	gap: 0.25rem;
	padding: 0.85rem 1rem 1rem;
}

.yp-print-card__title {
	font-family: var(--wp--preset--font-family--heading);
	font-weight: 700;
	font-size: 1.05rem;
}

.yp-print-card__meta {
	font-size: var(--wp--preset--font-size--small);
	color: var(--wp--preset--color--charcoal);
}

/* Lid text / image color, inside the add-on once it's ticked. */
.yp-print-addon__colors {
	margin-top: 0.8rem;
}

.yp-print-addon__colors-head {
	display: flex;
	align-items: baseline;
	gap: 0.6rem;
	margin: 0 0 0.5rem;
	font-size: 0.9rem;
}

.yp-print-addon__toggle small {
	font-size: 0.8rem;
	color: var(--wp--preset--color--charcoal);
}
