/*
 * Print ordering page: a photo list with size / paper / quantity lines on the
 * left and a sticky order card on the right. Colours come from the same theme
 * variables as the gallery, so a studio's accent carries through here too.
 */

/* ------------------------------------------------------------------- Header */

.wpgal-prints-head {
	margin: 0 0 1.5rem;
}

.wpgal-prints-head__back {
	margin: 0 0 0.75rem;
	font-size: 0.85rem;
}

.wpgal-prints-head__row {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	justify-content: space-between;
	gap: 1rem 1.5rem;
}

.wpgal-prints-head__title {
	min-width: 0;
}

.wpgal-prints-page .wpgal-title {
	margin: 0 0 0.3rem;
	letter-spacing: -0.015em;
}

.wpgal-prints-head__intro {
	max-width: 46rem;
	margin: 0.9rem 0 0;
	font-size: 0.9rem;
	line-height: 1.55;
	opacity: 0.8;
}

/* Two steps, said as pills rather than "Step 2 of 2". */
.wpgal-prints-steps {
	display: flex;
	flex-wrap: wrap;
	gap: 0.4rem;
	margin: 0;
	padding: 0;
	list-style: none;
}

.wpgal-prints-steps li {
	display: inline-flex;
	align-items: center;
	gap: 0.45rem;
	padding: 0.32rem 0.75rem 0.32rem 0.35rem;
	border: 1px solid color-mix(in srgb, currentColor 16%, transparent);
	border-radius: 999px;
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.01em;
	opacity: 0.6;
	transition: opacity 0.15s ease, background 0.15s ease;
}

.wpgal-prints-steps__num {
	display: grid;
	place-items: center;
	width: 1.35rem;
	height: 1.35rem;
	border-radius: 50%;
	background: color-mix(in srgb, currentColor 10%, transparent);
	font-size: 0.72rem;
	font-variant-numeric: tabular-nums;
}

.wpgal-prints-steps .is-done {
	opacity: 0.85;
}

.wpgal-prints-steps .is-current {
	opacity: 1;
	border-color: transparent;
	background: var(--wpgal-accent, #2c3e50);
	color: var(--wpgal-accent-contrast, #fff);
}

.wpgal-prints-steps .is-current .wpgal-prints-steps__num {
	background: color-mix(in srgb, #fff 22%, transparent);
}

/* -------------------------------------------------------------------- Cards */

.wpgal-print-card {
	padding: 1.35rem;
	border: 1px solid color-mix(in srgb, currentColor 13%, transparent);
	border-radius: calc(var(--wpgal-radius, 10px) * 1.3);
	background: color-mix(in srgb, currentColor 2.5%, transparent);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.wpgal-print-card__title {
	margin: 0 0 0.35rem;
	font-size: 1.1rem;
	letter-spacing: -0.01em;
}

.wpgal-print-card__hint {
	margin: 0 0 1.25rem;
	font-size: 0.85rem;
	line-height: 1.5;
	opacity: 0.72;
}

.wpgal-print-card + .wpgal-print-card,
.wpgal-print-order {
	margin-bottom: 1.5rem;
}

/* ------------------------------------------------------------------ Notices */

.wpgal-prints-notice {
	margin: 0 0 1.25rem;
	padding: 0.8rem 1rem;
	border-radius: calc(var(--wpgal-radius, 10px) * 0.9);
	border-left: 3px solid color-mix(in srgb, var(--wpgal-accent, #2c3e50) 70%, transparent);
	background: color-mix(in srgb, var(--wpgal-accent, #2c3e50) 8%, transparent);
	font-size: 0.88rem;
	line-height: 1.5;
}

.wpgal-prints-notice--warn {
	border-left-color: #b32d2e;
	background: color-mix(in srgb, #b32d2e 9%, transparent);
}

/* ------------------------------------------------------------------- Layout */

/*
 * The checkout sizes itself from the room it is actually given, not from the
 * window: themes that cap page bodies at prose width were being handed a
 * two-column split on a wide screen, which left no room for a print row.
 */
.wpgal-prints-form {
	container-type: inline-size;
	container-name: wpgal-prints;
}

/* A print row needs its width, so the page is allowed the theme's full column. */
.entry:has(.wpgal-prints-page),
.entry-content:has(.wpgal-prints-page) {
	max-width: none;
}

.wpgal-prints-layout {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
	gap: 1.75rem;
	align-items: start;
}

.wpgal-prints-main {
	min-width: 0;
}

.wpgal-prints-side {
	position: sticky;
	/*
	 * Whatever sits at the top of the page — the WordPress admin bar and the
	 * theme's own sticky header — stays above the order card instead of over
	 * it, so the card's heading and first totals cannot be covered. That height
	 * is not ours to know, so assets/js/prints.js measures it and writes the
	 * offset here; the rem value is only the fallback for a page where the
	 * script never runs.
	 */
	top: var(--wpgal-sticky-offset, 4.5rem);
	min-width: 0;
}

/* --------------------------------------------------------------- Photo list */

.wpgal-print-section {
	margin: 0 0 2rem;
}

.wpgal-print-section:last-child {
	margin-bottom: 0;
}

.wpgal-print-section__title {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5rem;
	margin: 0 0 0.85rem;
	font-size: 1.05rem;
	line-height: 1.3;
	letter-spacing: -0.01em;
}

.wpgal-print-section__heart {
	color: var(--wpgal-accent, #b32d2e);
}

.wpgal-print-section__hint {
	font-size: 0.78rem;
	font-weight: 400;
	opacity: 0.62;
}

.wpgal-print-rows {
	display: grid;
	gap: 0.6rem;
}

.wpgal-print-row {
	display: flex;
	align-items: flex-start;
	gap: 0.9rem;
	padding: 0.7rem;
	border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
	border-radius: calc(var(--wpgal-radius, 10px) * 1.1);
	background: color-mix(in srgb, currentColor 3%, transparent);
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05);
	transition: border-color 0.18s ease, background 0.18s ease, box-shadow 0.18s ease;
}

.wpgal-print-row:hover {
	border-color: color-mix(in srgb, currentColor 24%, transparent);
	background: color-mix(in srgb, currentColor 5%, transparent);
	box-shadow: 0 4px 14px rgba(15, 23, 42, 0.07);
}

.wpgal-print-row.is-chosen {
	border-color: color-mix(in srgb, var(--wpgal-accent, #2c3e50) 45%, transparent);
	background: color-mix(in srgb, var(--wpgal-accent, #2c3e50) 6%, transparent);
	box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--wpgal-accent, #2c3e50) 32%, transparent),
		0 4px 14px rgba(15, 23, 42, 0.06);
}

.wpgal-print-row__media {
	flex: 0 0 auto;
}

.wpgal-print-row__thumb {
	display: block;
	width: 82px;
	height: 82px;
	object-fit: cover;
	border-radius: calc(var(--wpgal-radius, 10px) - 2px);
	background: rgba(127, 127, 127, 0.12);
	box-shadow: 0 1px 3px rgba(15, 23, 42, 0.14);
}

.wpgal-print-row__body {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 0.5rem;
}

.wpgal-print-row__name {
	margin: 0.15rem 0 0;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	opacity: 0.6;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.wpgal-print-row__lines {
	display: flex;
	flex-direction: column;
	gap: 0.4rem;
}

/* -------------------------------------------------------------- Print lines */

.wpgal-print-line {
	position: relative;
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: 0.5rem;
	padding: 0.45rem 2rem 0.45rem 0.55rem;
	border-radius: 10px;
	background: color-mix(in srgb, currentColor 3.5%, Canvas);
	transition: background 0.15s ease;
}

.wpgal-print-line.is-chosen {
	background: color-mix(in srgb, var(--wpgal-accent, #2c3e50) 9%, Canvas);
}

.wpgal-print-line__field {
	display: flex;
	flex-direction: column;
	gap: 0.2rem;
	min-width: 0;
	font-size: 0.66rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.9;
}

.wpgal-print-line__field > span {
	opacity: 0.7;
	padding-left: 0.1rem;
}

.wpgal-print-line__field select,
.wpgal-print-line__field input {
	font: inherit;
	font-size: 0.85rem;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	color: inherit;
	background: color-mix(in srgb, Canvas 92%, currentColor);
	border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
	border-radius: 8px;
	padding: 0.34rem 0.45rem;
	box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wpgal-print-line__field select:focus,
.wpgal-print-line__field input:focus {
	border-color: var(--wpgal-accent, currentColor);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wpgal-accent, currentColor) 18%, transparent);
	outline: none;
}

.wpgal-print-line__field--product {
	flex: 1 1 12rem;
}

.wpgal-print-line__field--product select {
	width: 100%;
}

.wpgal-print-line__field--option {
	flex: 0 1 11rem;
}

.wpgal-print-line__field--option[hidden] {
	display: none;
}

.wpgal-print-line__field--qty {
	flex: 0 0 5.2rem;
}

/*
 * The native up and down arrows stay: nudging a quantity by one should not mean
 * reaching for the keyboard. They are drawn inside the box, so the field leaves
 * room for three digits beside them.
 */
.wpgal-print-line__field--qty input {
	width: 100%;
	padding-right: 0.1rem;
	text-align: center;
}

.wpgal-print-line__total {
	flex: 0 0 auto;
	min-width: 4.5rem;
	margin-left: auto;
	padding-bottom: 0.45rem;
	font-size: 0.9rem;
	font-weight: 700;
	text-align: right;
	font-variant-numeric: tabular-nums;
}

.wpgal-print-line.is-chosen .wpgal-print-line__total {
	color: var(--wpgal-accent, inherit);
}

.wpgal-print-line__remove {
	appearance: none;
	position: absolute;
	top: 0.35rem;
	right: 0.35rem;
	padding: 0.15rem 0.3rem;
	border: 0;
	border-radius: 6px;
	background: none;
	font: inherit;
	font-size: 1.15rem;
	line-height: 1;
	color: #b32d2e;
	cursor: pointer;
	transition: background 0.15s ease;
}

.wpgal-print-line__remove:hover,
.wpgal-print-line__remove:focus-visible {
	background: color-mix(in srgb, #b32d2e 12%, transparent);
}

.wpgal-print-line__remove[hidden] {
	display: none;
}

/* -------------------------------------------------------------- Paper guide */

.wpgal-print-guide {
	margin: 0 0 1.75rem;
	padding: 0.9rem 1.1rem;
	border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
	border-radius: calc(var(--wpgal-radius, 10px) * 1.2);
	background: color-mix(in srgb, Canvas 96%, currentColor);
	font-size: 0.88rem;
}

.wpgal-print-guide > summary {
	cursor: pointer;
	font-weight: 600;
	line-height: 1.45;
}

.wpgal-print-guide[open] > summary {
	margin-bottom: 0.45rem;
}

.wpgal-print-guide__hint {
	margin: 0 0 0.8rem;
	opacity: 0.72;
}

.wpgal-print-guide__list {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr));
	gap: 0.85rem 1.5rem;
	margin: 0;
}

.wpgal-print-guide__list dt {
	margin: 0;
	font-weight: 700;
}

.wpgal-print-guide__list dd {
	margin: 0.15rem 0 0;
	opacity: 0.9;
}

.wpgal-print-guide__example {
	display: block;
	margin-top: 0.1rem;
	font-style: italic;
	opacity: 0.68;
}

/* ------------------------------------------------------------------ Totals */

.wpgal-print-totals {
	margin: 0 0 1rem;
}

.wpgal-print-totals > div {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 1rem;
	padding: 0.28rem 0;
	font-size: 0.88rem;
}

.wpgal-print-totals dt {
	opacity: 0.75;
}

.wpgal-print-totals dd {
	margin: 0;
	font-weight: 600;
	font-variant-numeric: tabular-nums;
}

.wpgal-print-totals .is-total {
	margin-top: 0.35rem;
	padding-top: 0.6rem;
	border-top: 1px solid color-mix(in srgb, currentColor 15%, transparent);
	font-size: 1.02rem;
}

.wpgal-print-totals .is-total dt {
	opacity: 1;
	font-weight: 600;
}

.wpgal-print-totals .is-total dd {
	font-size: 1.15rem;
	font-weight: 700;
}

.wpgal-prints-totals__warn {
	margin: 0 0 0.85rem;
	padding: 0.5rem 0.65rem;
	border-radius: 8px;
	border-left: 3px solid #b32d2e;
	background: color-mix(in srgb, #b32d2e 9%, transparent);
	font-size: 0.78rem;
	line-height: 1.45;
}

.wpgal-prints-totals__warn[hidden] {
	display: none !important;
}

.wpgal-prints-totals__note {
	margin: 0 0 1.1rem;
	font-size: 0.76rem;
	line-height: 1.45;
	opacity: 0.65;
}

/* --------------------------------------------------------------- Order card */

.wpgal-print-summary {
	padding: 1.35rem;
}

.wpgal-print-ship {
	padding-top: 1rem;
	margin-top: 0.35rem;
	border-top: 1px solid color-mix(in srgb, currentColor 12%, transparent);
}

.wpgal-print-ship h3 {
	margin: 0 0 0.5rem;
	font-size: 0.72rem;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	opacity: 0.65;
}

.wpgal-prints-address {
	margin: 0 0 0.5rem;
	font-style: normal;
	font-size: 0.85rem;
	line-height: 1.55;
}

.wpgal-prints-address span,
.wpgal-prints-address strong {
	display: block;
}

.wpgal-prints-note {
	margin: 0 0 1rem;
	font-size: 0.8rem;
	opacity: 0.7;
}

.wpgal-prints-actions {
	display: flex;
	flex-direction: column;
	gap: 0.6rem;
	margin-top: 1.1rem;
}

.wpgal-prints-actions__hint {
	font-size: 0.78rem;
	opacity: 0.6;
}

.wpgal-btn--block {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	text-align: center;
}

.wpgal-prints-form .wpgal-btn:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.wpgal-prints-checkout {
	margin: 0 0 0.5rem;
}

.wpgal-print-order .wpgal-print-totals {
	max-width: 24rem;
	margin-left: auto;
}

.wpgal-print-order__table-wrap {
	margin: 0 0 1rem;
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.wpgal-print-order__option {
	display: inline-block;
	margin-left: 0.35rem;
	padding: 0.05rem 0.4rem;
	border-radius: 999px;
	background: color-mix(in srgb, currentColor 9%, transparent);
	font-size: 0.72rem;
	opacity: 0.85;
}

.wpgal-prints-table {
	width: 100%;
	border-collapse: collapse;
	font-size: 0.88rem;
}

.wpgal-prints-table th,
.wpgal-prints-table td {
	padding: 0.55rem 0.4rem;
	text-align: left;
	border-bottom: 1px solid color-mix(in srgb, currentColor 10%, transparent);
	vertical-align: top;
}

.wpgal-prints-table th {
	font-size: 0.68rem;
	font-weight: 700;
	letter-spacing: 0.07em;
	text-transform: uppercase;
	opacity: 0.65;
}

.wpgal-prints-table td:last-child,
.wpgal-prints-table th:last-child {
	text-align: right;
	font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------ Address step */

.wpgal-prints-field--wide {
	grid-column: 1 / -1;
}

.wpgal-prints-fields {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
	gap: 0.85rem 1rem;
	margin: 0 0 0.5rem;
}

.wpgal-prints-fields p {
	margin: 0;
}

.wpgal-prints-fields label {
	display: flex;
	flex-direction: column;
	gap: 0.28rem;
	font-size: 0.7rem;
	font-weight: 700;
	letter-spacing: 0.05em;
	text-transform: uppercase;
	opacity: 0.9;
}

.wpgal-prints-fields input,
.wpgal-prints-fields select,
.wpgal-prints-fields textarea {
	font: inherit;
	font-size: 0.9rem;
	font-weight: 400;
	letter-spacing: 0;
	text-transform: none;
	color: inherit;
	background: color-mix(in srgb, Canvas 92%, currentColor);
	border: 1px solid color-mix(in srgb, currentColor 22%, transparent);
	border-radius: 8px;
	padding: 0.45rem 0.55rem;
	width: 100%;
	box-shadow: inset 0 1px 2px rgba(15, 23, 42, 0.04);
	transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.wpgal-prints-fields input:focus,
.wpgal-prints-fields select:focus,
.wpgal-prints-fields textarea:focus {
	border-color: var(--wpgal-accent, currentColor);
	box-shadow: 0 0 0 3px color-mix(in srgb, var(--wpgal-accent, currentColor) 18%, transparent);
	outline: none;
}

/* -------------------------------------------- Running total while choosing */

/*
 * The order card sits beside the list on wide screens, so the running total only
 * needs pinning under the list on narrower ones, where the card scrolls away.
 */
.wpgal-print-live {
	display: none;
}

.wpgal-print-live[hidden] {
	display: none !important;
}

.wpgal-print-live__count {
	font-weight: 700;
	font-variant-numeric: tabular-nums;
	letter-spacing: 0.01em;
}

.wpgal-print-live__amounts {
	display: flex;
	align-items: baseline;
	gap: 1rem;
	font-size: 0.8rem;
}

.wpgal-print-live__amounts > span {
	display: inline-flex;
	align-items: baseline;
	gap: 0.35rem;
}

.wpgal-print-live__amounts > span > span {
	opacity: 0.65;
}

.wpgal-print-live__amounts strong {
	font-size: 0.95rem;
	font-variant-numeric: tabular-nums;
}

.wpgal-empty {
	margin: 0;
	font-size: 0.9rem;
	opacity: 0.65;
}

/* --------------------------------------------------------------- Responsive */

/* Wide enough for a print row on one line, with the order card beside it. */
@container wpgal-prints (min-width: 52rem) {
	.wpgal-prints-layout {
		grid-template-columns: minmax(0, 1fr) 21rem;
		gap: 1.75rem;
	}
}

@container wpgal-prints (max-width: 51.99rem) {
	.wpgal-prints-side {
		position: static;
	}

	/*
	 * The card is now below the list, so the total that was always in view drops
	 * to a slim bar pinned to the bottom of the form, where a thumb can watch it.
	 */
	.wpgal-print-live {
		position: sticky;
		bottom: 0;
		z-index: 20;
		display: flex;
		flex-wrap: wrap;
		align-items: baseline;
		justify-content: space-between;
		gap: 0.35rem 1rem;
		margin: 1rem 0 0;
		padding: 0.7rem 0.9rem;
		border: 1px solid color-mix(in srgb, currentColor 14%, transparent);
		border-radius: calc(var(--wpgal-radius, 10px) * 1.1);
		background: color-mix(in srgb, Canvas 94%, currentColor);
		box-shadow: 0 -2px 18px rgba(15, 23, 42, 0.1);
		-webkit-backdrop-filter: blur(6px);
		backdrop-filter: blur(6px);
		font-size: 0.85rem;
	}

	.wpgal-print-live__only-wide {
		display: none;
	}
}

@media (max-width: 600px) {
	.wpgal-print-card {
		padding: 1rem;
	}

	.wpgal-print-row {
		gap: 0.6rem;
	}

	.wpgal-print-row__thumb {
		width: 56px;
		height: 56px;
	}

	.wpgal-print-line__field--product,
	.wpgal-print-line__field--option {
		flex: 1 1 100%;
	}

	.wpgal-print-line__field--qty {
		flex: 0 0 4.8rem;
	}

	.wpgal-print-line__total {
		min-width: 0;
		font-size: 0.85rem;
	}

	.wpgal-prints-head__row {
		align-items: flex-start;
	}

	.wpgal-print-order .wpgal-print-totals {
		max-width: none;
		margin-left: 0;
	}
}

/* ----------------------------------------------------------------- Print */

@media print {
	.wpgal-prints-steps,
	.wpgal-print-live,
	.wpgal-print-line__remove,
	.wpgal-prints-actions {
		display: none !important;
	}

	.wpgal-print-card,
	.wpgal-print-row {
		box-shadow: none;
		background: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wpgal-print-row,
	.wpgal-print-row:hover,
	.wpgal-print-line,
	.wpgal-prints-steps li,
	.wpgal-print-line__field select,
	.wpgal-print-line__field input {
		transition: none;
	}
}
