/*! Simple Print Shop — front end
 * Override any of these variables in Semplice → Customize → CSS, e.g.
 * .sps-shop, .sps-overlay, .sps-fab { --sps-accent: #1a1a1a; --sps-tile: #eee; }
 */
.sps-shop,
.sps-overlay,
.sps-fab {
	--sps-text: #111;
	--sps-muted: #6f6f6f;
	--sps-bg: #fff;
	--sps-line: rgba(0, 0, 0, .12);
	--sps-accent: #111;
	--sps-accent-text: #fff;
	--sps-tile: #f2f2f0;
	--sps-radius: 0px;
	--sps-gap: 48px;
}

.sps-shop *, .sps-overlay *, .sps-fab * { box-sizing: border-box; }
.sps-shop { width: 100%; font: inherit; color: inherit; }
.sps-msg { margin: 0; padding: 24px 0; color: var(--sps-muted); }
.sps-shop .sps-msg { color: inherit; opacity: .6; }

/* ---------- grid ---------- */

.sps-grid {
	display: grid;
	grid-template-columns: repeat(var(--sps-cols, 3), minmax(0, 1fr));
	gap: var(--sps-gap) calc(var(--sps-gap) * .6);
}
.sps-grid.sps-natural { align-items: start; }

@media (max-width: 900px) {
	.sps-grid:not([data-cols="1"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 560px) {
	.sps-grid { grid-template-columns: minmax(0, 1fr); --sps-gap: 36px; }
	.sps-grid[data-mobile="2"]:not([data-cols="1"]) { grid-template-columns: repeat(2, minmax(0, 1fr)); --sps-gap: 28px; }
}

.sps-card {
	-webkit-appearance: none;
	appearance: none;
	display: flex;
	flex-direction: column;
	align-items: stretch;
	gap: 2px;
	width: 100%;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	box-shadow: none;
	color: inherit;
	font: inherit;
	letter-spacing: inherit;
	text-transform: none;
	text-align: left;
	line-height: 1.35;
	cursor: pointer;
}
.sps-card:focus { outline: none; }
.sps-card:focus-visible { outline: 2px solid currentColor; outline-offset: 6px; }

.sps-card-media {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-bottom: 14px;
	padding: 11%;
	background: var(--sps-tile);
	border-radius: var(--sps-radius);
	overflow: hidden;
}
.sps-card-media img {
	display: block;
	width: auto;
	height: auto;
	max-width: 100%;
	max-height: 100%;
	margin: 0;
	object-fit: contain;
	box-shadow: 0 1px 2px rgba(0, 0, 0, .08), 0 10px 28px rgba(0, 0, 0, .12);
	transition: transform .5s cubic-bezier(.2, .7, .2, 1);
}
.sps-card:hover .sps-card-media img { transform: translateY(-4px); }

.sps-natural .sps-card-media { padding: 0; background: none; }
.sps-natural .sps-card-media img { width: 100%; box-shadow: none; }
.sps-natural .sps-card:hover .sps-card-media img { transform: none; opacity: .88; }

.sps-card-title { font-weight: 500; }
.sps-card-price { opacity: .6; font-size: .92em; }
.sps-card.is-soldout .sps-card-media img { opacity: .55; }

/* ---------- overlays ---------- */

html.sps-lock, html.sps-lock body { overflow: hidden !important; }

.sps-overlay {
	position: fixed;
	inset: 0;
	z-index: 2147483000;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 32px;
	background: rgba(10, 10, 10, .5);
	opacity: 0;
	transition: opacity .22s ease;
	font-family: inherit;
	-webkit-font-smoothing: antialiased;
}
.sps-overlay[hidden] { display: none !important; }
.sps-overlay.is-open { opacity: 1; }

.sps-dialog {
	position: relative;
	max-height: calc(100vh - 64px);
	overflow: auto;
	overscroll-behavior: contain;
	background: var(--sps-bg);
	color: var(--sps-text);
	border-radius: var(--sps-radius);
	box-shadow: 0 30px 80px rgba(0, 0, 0, .3);
	font-size: 15px;
	line-height: 1.5;
	text-align: left;
}
.sps-dialog :is(h2, h3, p, fieldset, legend) { margin: 0; padding: 0; border: 0; text-transform: none; letter-spacing: normal; }
.sps-title { font-size: 24px; font-weight: 500; line-height: 1.2; color: inherit; }
.sps-label,
.sps-dialog .sps-label { display: block; font-size: 12px; font-weight: 500; letter-spacing: .06em; text-transform: uppercase; color: var(--sps-muted); margin-bottom: 10px; }
.sps-muted { color: var(--sps-muted); }

.sps-close {
	-webkit-appearance: none;
	appearance: none;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: transparent;
	color: inherit;
	font: inherit;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
}
.sps-close:hover { background: rgba(0, 0, 0, .06); }

.sps-btn {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	margin: 0;
	padding: 15px 20px;
	border: 1px solid var(--sps-accent);
	border-radius: var(--sps-radius);
	background: var(--sps-accent);
	color: var(--sps-accent-text);
	font: inherit;
	font-size: 15px;
	font-weight: 500;
	line-height: 1.2;
	text-align: center;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
	transition: opacity .15s ease;
}
.sps-btn:hover { opacity: .88; }
.sps-btn:disabled { opacity: .4; cursor: not-allowed; }
.sps-btn.is-added { opacity: .75; }
.sps-btn-ghost { background: transparent; color: var(--sps-accent); }

.sps-link {
	-webkit-appearance: none;
	appearance: none;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
	cursor: pointer;
}

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

.sps-product {
	display: grid;
	grid-template-columns: minmax(0, 1.5fr) minmax(300px, 1fr);
	width: min(1180px, 100%);
}
.sps-product > .sps-close { position: absolute; top: 10px; right: 10px; z-index: 2; }
.sps-product-media {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 420px;
	padding: 56px;
	background: var(--sps-tile);
}
.sps-product-media img {
	display: block;
	max-width: 100%;
	max-height: calc(100vh - 64px - 112px);
	width: auto;
	height: auto;
	box-shadow: 0 2px 4px rgba(0, 0, 0, .08), 0 16px 40px rgba(0, 0, 0, .16);
}
.sps-product-info { display: flex; flex-direction: column; padding: 56px 40px 40px; }
.sps-product-info .sps-title { padding-right: 32px; margin-bottom: 12px; }
.sps-desc { white-space: pre-line; color: var(--sps-muted); margin-bottom: 28px !important; }
.sps-desc[hidden] + .sps-sizes { margin-top: 16px; }

.sps-sizes { display: flex; flex-direction: column; gap: 8px; min-width: 0; margin-bottom: 24px !important; }
.sps-sizes legend { float: left; width: 100%; }
.sps-size {
	display: grid;
	grid-template-columns: auto 1fr auto;
	align-items: center;
	gap: 12px;
	margin: 0;
	padding: 13px 16px;
	border: 1px solid var(--sps-line);
	border-radius: var(--sps-radius);
	cursor: pointer;
	transition: border-color .15s ease;
}
.sps-size:hover { border-color: rgba(0, 0, 0, .35); }
.sps-size.is-selected { border-color: var(--sps-accent); box-shadow: inset 0 0 0 1px var(--sps-accent); }
/* Custom round radio, so themes that restyle inputs (like Semplice) can't turn it into an empty box */
.sps-overlay .sps-size input[type="radio"] {
	-webkit-appearance: none;
	appearance: none;
	flex: none;
	display: block;
	width: 18px;
	height: 18px;
	min-width: 18px;
	margin: 0;
	padding: 0;
	border: 1px solid rgba(0, 0, 0, .35);
	border-radius: 50%;
	background: var(--sps-bg);
	box-shadow: none;
	opacity: 1;
	position: static;
	cursor: pointer;
}
.sps-overlay .sps-size input[type="radio"]:checked {
	border-color: var(--sps-accent);
	background: var(--sps-accent);
	box-shadow: inset 0 0 0 4px var(--sps-bg);
}
.sps-overlay .sps-size input[type="radio"]:focus { outline: none; }
.sps-overlay .sps-size input[type="radio"]:focus-visible { outline: 2px solid var(--sps-accent); outline-offset: 2px; }
.sps-close:focus { outline: none; }
.sps-close:focus-visible { outline: 2px solid currentColor; outline-offset: 2px; }
.sps-size-text { display: flex; flex-direction: column; line-height: 1.3; }
.sps-size-name { font-weight: 500; }
.sps-size-detail { font-size: 13px; color: var(--sps-muted); }
.sps-size-price { white-space: nowrap; }

.sps-qty-row { display: flex; align-items: center; justify-content: space-between; margin-bottom: 20px; }
.sps-qty-row .sps-label { margin: 0; }
.sps-qty { display: inline-flex; align-items: center; border: 1px solid var(--sps-line); border-radius: var(--sps-radius); }
.sps-qty-btn {
	-webkit-appearance: none;
	appearance: none;
	width: 38px;
	height: 38px;
	margin: 0;
	padding: 0;
	border: 0;
	background: none;
	color: inherit;
	font: inherit;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
}
.sps-qty-btn:disabled { opacity: .3; cursor: default; }
.sps-qty-input, .sps-qty-val {
	width: 40px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	color: inherit;
	font: inherit;
	text-align: center;
	-moz-appearance: textfield;
}
.sps-qty-input::-webkit-outer-spin-button,
.sps-qty-input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.sps-qty-sm .sps-qty-btn { width: 30px; height: 30px; font-size: 16px; }
.sps-qty-sm .sps-qty-val { width: 28px; font-size: 14px; }

.sps-added { margin-top: 14px !important; font-size: 14px; color: var(--sps-muted); }

/* ---------- cart drawer ---------- */

.sps-overlay-cart { justify-content: flex-end; align-items: stretch; padding: 0; }
.sps-drawer {
	display: flex;
	flex-direction: column;
	width: min(500px, 100%);
	height: 100%;
	max-height: none;
	overflow: hidden;
	border-radius: 0;
	transform: translateX(32px);
	transition: transform .28s cubic-bezier(.2, .7, .2, 1);
}
.sps-overlay-cart.is-open .sps-drawer { transform: none; }
.sps-drawer-head {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 18px 20px 18px 28px;
	border-bottom: 1px solid var(--sps-line);
}
.sps-drawer-head .sps-title { font-size: 20px; }
.sps-drawer-body { flex: 1; overflow: auto; overscroll-behavior: contain; padding: 4px 28px 40px; }
.sps-drawer-body > [hidden] { display: none !important; }

.sps-line {
	display: grid;
	grid-template-columns: 68px minmax(0, 1fr) auto;
	gap: 16px;
	padding: 18px 0;
	border-bottom: 1px solid var(--sps-line);
}
.sps-line-media { display: flex; align-items: center; justify-content: center; width: 68px; height: 68px; padding: 7px; background: var(--sps-tile); }
.sps-line-media img { display: block; max-width: 100%; max-height: 100%; box-shadow: 0 1px 3px rgba(0, 0, 0, .15); }
.sps-line-title { font-weight: 500; line-height: 1.3; }
.sps-line-size { font-size: 13px; color: var(--sps-muted); margin: 2px 0 10px; }
.sps-line-end { display: flex; flex-direction: column; align-items: flex-end; justify-content: space-between; gap: 8px; }
.sps-line-price { white-space: nowrap; }
.sps-remove { font-size: 13px; color: var(--sps-muted); }

.sps-subtotal { display: flex; justify-content: space-between; padding: 18px 0 6px; font-size: 17px; font-weight: 500; }

.sps-form { display: flex; flex-wrap: wrap; gap: 14px 12px; margin-top: 18px; position: relative; }
.sps-note { flex: 1 1 100%; padding: 14px 16px !important; background: var(--sps-tile); font-size: 14px; line-height: 1.5; margin-bottom: 8px !important; }
.sps-form-title { flex: 1 1 100%; margin: 10px 0 0 !important; }
.sps-field { flex: 1 1 100%; display: flex; flex-direction: column; gap: 5px; min-width: 0; }
.sps-field.sps-half { flex: 1 1 calc(50% - 6px); }
.sps-field label { font-size: 13px; color: var(--sps-muted); margin: 0; text-transform: none; letter-spacing: normal; }
.sps-req { color: inherit; }
.sps-field input,
.sps-field textarea {
	-webkit-appearance: none;
	appearance: none;
	width: 100%;
	margin: 0;
	padding: 11px 13px;
	border: 1px solid var(--sps-line);
	border-radius: var(--sps-radius);
	background: var(--sps-bg);
	box-shadow: none;
	color: var(--sps-text);
	font: inherit;
	font-size: 16px;
	line-height: 1.35;
}
.sps-field textarea { resize: vertical; min-height: 80px; }
.sps-field input:focus,
.sps-field textarea:focus { outline: none; border-color: var(--sps-accent); box-shadow: inset 0 0 0 1px var(--sps-accent); }
.sps-form .sps-btn { flex: 1 1 100%; margin-top: 8px; }
.sps-error { flex: 1 1 100%; padding: 12px 14px !important; background: #fdecec; color: #8a1c1c; font-size: 14px; }
.sps-hp { position: absolute !important; left: -10000px !important; top: auto; width: 1px; height: 1px; overflow: hidden; }

.sps-empty { padding: 40px 0; text-align: center; }
.sps-empty p { margin-bottom: 20px; color: var(--sps-muted); }
.sps-done { padding: 48px 0 24px; }
.sps-done p { margin-bottom: 14px; }
.sps-done-title { font-size: 26px; font-weight: 500; line-height: 1.2; }
.sps-done .sps-btn { margin-top: 24px; }

/* ---------- floating cart button ---------- */

.sps-fab {
	position: fixed;
	right: 24px;
	bottom: 24px;
	z-index: 2147482000;
	display: inline-flex;
	align-items: center;
	gap: 10px;
	margin: 0;
	padding: 12px 14px 12px 20px;
	border: 0;
	border-radius: 999px;
	background: var(--sps-accent);
	color: var(--sps-accent-text);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .22);
	font: inherit;
	font-size: 14px;
	font-weight: 500;
	line-height: 1;
	text-transform: none;
	letter-spacing: normal;
	cursor: pointer;
}
.sps-fab[hidden] { display: none !important; }
.sps-fab-count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 22px;
	height: 22px;
	padding: 0 6px;
	border-radius: 11px;
	background: var(--sps-accent-text);
	color: var(--sps-accent);
	font-size: 12px;
	font-weight: 600;
}
.sps-fab.is-bump { animation: sps-bump .45s ease; }
@keyframes sps-bump { 0% { transform: scale(1); } 40% { transform: scale(1.12); } 100% { transform: scale(1); } }

/* ---------- small screens ---------- */

@media (max-width: 760px) {
	.sps-overlay-product { padding: 0; align-items: stretch; }
	/* Stack image and text as normal blocks so the image area can never shrink under the text */
	.sps-overlay .sps-product { display: block; width: 100%; max-height: none; height: 100%; height: 100dvh; border-radius: 0; }
	.sps-overlay .sps-product-media { display: block; height: auto; min-height: 0; padding: 56px 24px 32px; text-align: center; }
	.sps-overlay .sps-product-media img { display: inline-block; position: static; width: auto; height: auto; max-width: 100%; max-height: 55vh; object-fit: contain; vertical-align: top; transform: none; }
	.sps-product-info { padding: 24px 20px 32px; }
	.sps-product > .sps-close { background: rgba(255, 255, 255, .85); }
	.sps-drawer-body { padding: 4px 20px 32px; }
	.sps-drawer-head { padding-left: 20px; }
	.sps-fab { right: 16px; bottom: 16px; }
}

@media (prefers-reduced-motion: reduce) {
	.sps-overlay, .sps-drawer, .sps-card-media img, .sps-btn { transition: none !important; }
	.sps-fab.is-bump { animation: none; }
}

/* ---------- finishing options ---------- */

.sps-finishes { margin-top: -4px; }
.sps-size.is-disabled { opacity: .45; cursor: not-allowed; }
.sps-size.is-disabled:hover { border-color: var(--sps-line); }
.sps-overlay .sps-size.is-disabled input[type="radio"] { cursor: not-allowed; }
.sps-choice { margin: -8px 0 24px; }
.sps-select { position: relative; }
.sps-select::after {
	content: "";
	position: absolute;
	right: 16px;
	top: 50%;
	width: 7px;
	height: 7px;
	margin-top: -5px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	transform: rotate(45deg);
	pointer-events: none;
}
.sps-overlay .sps-choice select {
	-webkit-appearance: none;
	appearance: none;
	display: block;
	width: 100%;
	height: auto;
	margin: 0;
	padding: 12px 40px 12px 14px;
	border: 1px solid var(--sps-line);
	border-radius: var(--sps-radius);
	background: var(--sps-bg);
	color: var(--sps-text);
	font: inherit;
	font-size: 16px;
	line-height: 1.3;
	box-shadow: none;
	cursor: pointer;
}
.sps-overlay .sps-choice select:focus { outline: none; border-color: var(--sps-accent); box-shadow: inset 0 0 0 1px var(--sps-accent); }
.sps-line-fin { margin-top: -8px; }
