/*
 * Size × colour table. Colours are neutral so the theme's type and palette show through.
 * Override the custom properties on .bmc-form to restyle.
 */
.bmc-form {
	--bmc-bg: #fff;
	--bmc-line: #e2e4e7;
	--bmc-muted: #6b7075;
	--bmc-disabled: #eceef0;
	--bmc-focus: currentColor;
	--bmc-cell: 3.4rem;
	--bmc-card: #f6f7f7;
	--bmc-accent: #13a89e;
	--bmc-danger: #b32d2e;

	clear: both;
	margin: 0 0 2em;
}

.bmc-header {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	justify-content: space-between;
	gap: 0.5em 1em;
	margin-bottom: 0.75em;
}

.bmc-title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.3;
	letter-spacing: 0.04em;
	text-transform: uppercase;
}

/* ---- Table --------------------------------------------------------------- */

.bmc-scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
	overscroll-behavior-x: contain;
}

.bmc-scroll:focus-visible {
	outline: 2px solid var(--bmc-focus);
	outline-offset: 2px;
}

.bmc-form .bmc-table {
	width: auto;
	margin: 0;
	border: 0;
	border-collapse: separate;
	border-spacing: 0.35rem;
	table-layout: auto;
}

.bmc-form .bmc-table th,
.bmc-form .bmc-table td {
	padding: 0;
	border: 0;
	background: none;
	text-align: center;
	vertical-align: middle;
}

.bmc-form .bmc-table thead th {
	padding-bottom: 0.4rem;
	border-bottom: 1px solid var(--bmc-line);
	font-weight: 400;
	line-height: 1.25;
	white-space: nowrap;
}

.bmc-size-label {
	display: block;
	color: var(--bmc-muted);
	font-size: 0.875em;
}

.bmc-size-price {
	display: block;
	font-size: 0.75em;
	font-weight: 600;
}

/* Colour column stays put while sizes scroll. */
.bmc-form .bmc-table .bmc-corner,
.bmc-form .bmc-table .bmc-colour {
	position: sticky;
	left: 0;
	z-index: 1;
	background: var(--bmc-bg);
	text-align: left;
}

.bmc-form .bmc-table .bmc-colour {
	min-width: 8rem;
	max-width: 10rem;
	padding-right: 0.5rem;
	font-weight: 400;
	font-size: 0.875em;
	line-height: 1.25;
}

.bmc-colour-inner {
	display: flex;
	align-items: center;
	gap: 0.6em;
}

.bmc-form .bmc-colour-show {
	all: unset;
	box-sizing: border-box;
	display: flex;
	align-items: center;
	gap: 0.6em;
	width: 100%;
	border-radius: 4px;
	cursor: pointer;
	-webkit-tap-highlight-color: transparent;
}

.bmc-form .bmc-colour-show:hover .bmc-colour-name {
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.bmc-form .bmc-colour-show:focus-visible {
	outline: 2px solid var(--bmc-focus);
	outline-offset: 2px;
}

.bmc-form .bmc-colour-show[aria-pressed="true"] .bmc-colour-name {
	font-weight: 600;
}

.bmc-form .bmc-colour-show[aria-pressed="true"] .bmc-colour-image {
	box-shadow: 0 0 0 1.5px currentColor;
	border-radius: 4px;
}

.bmc-colour-image {
	flex: none;
	width: 2.5rem;
	height: 2.5rem;
	margin: 0;
	object-fit: contain;
}

.bmc-swatch {
	flex: none;
	width: 1.75rem;
	height: 1.75rem;
	margin: 0.375rem; /* Same footprint as a colour image, so names line up. */
	border-radius: 50%;
	box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.18);
}

/* ---- Quantity cells ------------------------------------------------------ */

.bmc-form .bmc-qty {
	box-sizing: border-box;
	width: var(--bmc-cell);
	min-width: var(--bmc-cell);
	height: 2.5rem;
	margin: 0;
	padding: 0.25em;
	border: 1px solid var(--bmc-line);
	border-radius: 4px;
	background: var(--bmc-bg);
	color: inherit;
	font: inherit;
	text-align: center;
}

.bmc-form .bmc-qty::placeholder {
	color: var(--bmc-muted);
	opacity: 0.5;
}

.bmc-form .bmc-qty:focus {
	outline: 2px solid var(--bmc-focus);
	outline-offset: 0;
}

.bmc-form .bmc-qty:disabled {
	border-color: transparent;
	background: var(--bmc-disabled);
	cursor: not-allowed;
}

.bmc-form .bmc-has-qty .bmc-qty {
	border-color: currentColor;
	font-weight: 600;
}

/* ---- Footer -------------------------------------------------------------- */

.bmc-footer {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 1em;
	margin-top: 1em;
}

.bmc-totals {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5em 1.5em;
	margin: 0;
	font-weight: 600;
}

.bmc-total output {
	display: inline-block;
	min-width: 2em;
	margin-left: 0.25em;
	padding: 0.1em 0.5em;
	border-radius: 4px;
	background: var(--bmc-disabled);
	text-align: center;
}

.bmc-form .bmc-submit:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.bmc-in-cart {
	margin: 0.75em 0 0;
	color: var(--bmc-muted);
	font-size: 0.875em;
}

/*
 * Volume pricing table under the product price. Override the custom properties on
 * .bmc-bulk-pricing to restyle.
 */
.bmc-bulk-pricing {
	--bmc-line: #e2e4e7;
	--bmc-active: #f1f2f4;
	--bmc-focus: currentColor;

	margin: 0 0 1.5em;
}

.bmc-bulk-pricing .bmc-bulk-scroll {
	overflow-x: auto;
}

.bmc-bulk-pricing .bmc-bulk-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.6em;
	padding: 0.65em 1.1em;
	border: 1px solid currentColor;
	border-radius: 4px;
	font-size: 0.8125rem;
	font-weight: 600;
	letter-spacing: 0.06em;
	line-height: 1.2;
	text-transform: uppercase;
	list-style: none;
	cursor: pointer;
	user-select: none;
}

.bmc-bulk-pricing .bmc-bulk-toggle::-webkit-details-marker {
	display: none;
}

/* Chevron: down when closed, up when open. */
.bmc-bulk-pricing .bmc-bulk-toggle::after {
	content: "";
	width: 0.45em;
	height: 0.45em;
	border-right: 2px solid;
	border-bottom: 2px solid;
	transform: translateY(-0.15em) rotate(45deg);
	transition: transform 0.15s ease;
}

.bmc-bulk-pricing[open] .bmc-bulk-toggle::after {
	transform: translateY(0.15em) rotate(-135deg);
}

.bmc-bulk-pricing .bmc-bulk-toggle:focus-visible {
	outline: 2px solid var(--bmc-focus);
	outline-offset: 2px;
}

.bmc-bulk-pricing:not([open]) .bmc-bulk-hide,
.bmc-bulk-pricing[open] .bmc-bulk-show {
	display: none;
}

.bmc-bulk-pricing .bmc-bulk-table {
	width: auto;
	min-width: min(100%, 22rem);
	margin: 0.75em 0 0;
	border: 0;
	border-collapse: collapse;
	font-variant-numeric: tabular-nums;
}

.bmc-bulk-pricing .bmc-bulk-table th,
.bmc-bulk-pricing .bmc-bulk-table td {
	padding: 0.55em 1em;
	border: 1px solid var(--bmc-line);
	background: none;
	text-align: right;
}

.bmc-bulk-pricing .bmc-bulk-table thead th {
	font-weight: 600;
	text-align: center;
}

.bmc-bulk-pricing .bmc-bulk-table tbody th {
	font-weight: 400;
}

.bmc-bulk-pricing .bmc-bulk-table tr.bmc-active > * {
	background: var(--bmc-active);
	font-weight: 600;
}

@media (prefers-reduced-motion: reduce) {
	.bmc-bulk-pricing .bmc-bulk-toggle::after {
		transition: none;
	}
}

.bmc-bulk-pricing .bmc-bulk-table .bmc-bulk-unavailable {
	background: var(--bmc-active);
	color: #6b7075;
	font-size: 0.875em;
}

.bmc-bulk-pricing .bmc-bulk-note {
	margin: 0.5em 0 0;
	color: #6b7075;
	font-size: 0.8125em;
}

/* ---- Decoration ----------------------------------------------------------- */

/* Some rules below set display; keep the hidden attribute working. */
.bmc-form [hidden] {
	display: none !important;
}

.bmc-decoration {
	margin: 1em 0 0;
	padding: 0.75em 1em;
	border: 1px solid var(--bmc-line);
	border-radius: 6px;
}

.bmc-decoration-bar {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.5em 1em;
}

.bmc-decoration-text {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.25em 0.6em;
	margin: 0;
}

.bmc-decoration-heading {
	font-weight: 600;
}

.bmc-decoration-summary {
	color: var(--bmc-muted);
	overflow-wrap: anywhere;
}

.bmc-decoration-actions {
	display: flex;
	align-items: center;
	gap: 0.75em;
}

.bmc-form .bmc-decoration-open:disabled {
	opacity: 0.5;
	cursor: not-allowed;
}

.bmc-form .bmc-decoration-remove,
.bmc-form .bmc-artwork-clear {
	all: unset;
	font-size: 0.875em;
	text-decoration: underline;
	text-underline-offset: 0.2em;
	cursor: pointer;
}

.bmc-form .bmc-decoration-remove:focus-visible,
.bmc-form .bmc-artwork-clear:focus-visible {
	outline: 2px solid var(--bmc-focus);
	outline-offset: 2px;
}

.bmc-decoration-note {
	margin: 0.5em 0 0;
	color: var(--bmc-muted);
	font-size: 0.875em;
}

.bmc-decoration-note.bmc-warning {
	color: var(--bmc-danger);
	font-weight: 600;
}

/* Dialog */

.bmc-dialog {
	box-sizing: border-box;
	width: min(46rem, calc(100vw - 1rem));
	max-height: calc(100vh - 1rem);
	margin: auto;
	padding: 1.25rem;
	overflow: auto;
	border: 0;
	border-radius: 8px;
	background: var(--bmc-bg);
	color: inherit;
	box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}

.bmc-dialog::backdrop {
	background: rgba(0, 0, 0, 0.45);
}

.bmc-dialog-header {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 1rem;
	margin-bottom: 1rem;
}

.bmc-dialog .bmc-dialog-title {
	margin: 0;
	font-size: 1.25rem;
	line-height: 1.3;
}

.bmc-dialog .bmc-dialog-close {
	all: unset;
	box-sizing: border-box;
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 2rem;
	height: 2rem;
	border-radius: 4px;
	font-size: 1.5rem;
	line-height: 1;
	cursor: pointer;
}

.bmc-dialog .bmc-dialog-close:hover {
	background: var(--bmc-card);
}

.bmc-dialog .bmc-dialog-close:focus-visible,
.bmc-dialog .bmc-method:focus-visible,
.bmc-dialog .bmc-location:focus-visible {
	outline: 2px solid var(--bmc-focus);
	outline-offset: 2px;
}

/* Step 1: method cards */

.bmc-method-grid {
	display: grid;
	grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
	gap: 0.75rem;
}

.bmc-dialog .bmc-method {
	all: unset;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	justify-content: space-between;
	gap: 0.85rem;
	padding: 1rem;
	border: 1px solid var(--bmc-line);
	border-radius: 8px;
	background: var(--bmc-card);
	text-align: left;
	cursor: pointer;
}

.bmc-dialog .bmc-method:hover,
.bmc-dialog .bmc-method[aria-pressed="true"] {
	border-color: currentColor;
}

.bmc-method-top {
	display: flex;
	align-items: flex-start;
	gap: 0.85rem;
}

.bmc-method-icon {
	display: inline-flex;
	flex: none;
	align-items: center;
	justify-content: center;
	width: 3rem;
	height: 3rem;
	border-radius: 6px;
	background: #1d1d1f;
	color: #fff;
}

.bmc-method-icon svg {
	width: 1.75rem;
	height: 1.75rem;
}

.bmc-method-info {
	display: flex;
	flex-direction: column;
	gap: 0.15rem;
	line-height: 1.35;
}

.bmc-method-name {
	font-size: 1.1rem;
	font-weight: 700;
}

.bmc-method-line {
	font-size: 0.9rem;
}

.bmc-method-from {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 1rem;
	padding-top: 0.75rem;
	border-top: 1px solid var(--bmc-line);
}

.bmc-method-from-label {
	color: var(--bmc-muted);
	font-size: 0.75rem;
	letter-spacing: 0.05em;
	line-height: 1.4;
	text-transform: uppercase;
}

.bmc-method-from-price {
	font-weight: 700;
	white-space: nowrap;
}

/* Step 2: locations */

.bmc-location-grid {
	display: grid;
	grid-template-columns: repeat(auto-fill, minmax(8.5rem, 1fr));
	gap: 0.6rem;
}

.bmc-dialog .bmc-location {
	all: unset;
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	padding: 0.75rem 0.5rem;
	border: 1px solid var(--bmc-line);
	border-radius: 8px;
	font-size: 0.8125rem;
	font-weight: 600;
	line-height: 1.25;
	text-align: center;
	cursor: pointer;
}

.bmc-dialog .bmc-location:hover {
	border-color: currentColor;
}

.bmc-dialog .bmc-location[aria-pressed="true"] {
	border-color: currentColor;
	box-shadow: inset 0 0 0 1px currentColor;
}

.bmc-garment {
	width: 4rem;
	height: 4rem;
}

.bmc-garment-mark {
	fill: var(--bmc-accent);
}

/* Step 3: artwork */

.bmc-artwork-choice {
	margin: 0 0 1rem;
	font-weight: 600;
}

.bmc-artwork-label {
	display: block;
	margin-bottom: 0.4rem;
	font-weight: 600;
}

.bmc-artwork-input {
	display: block;
	max-width: 100%;
}

.bmc-artwork-help {
	margin: 0.4rem 0 0;
	color: var(--bmc-muted);
	font-size: 0.875em;
}

.bmc-artwork-current {
	display: flex;
	flex-wrap: wrap;
	align-items: baseline;
	gap: 0.5em;
	margin: 0.75rem 0 0;
	overflow-wrap: anywhere;
}

.bmc-artwork-error {
	margin: 0.75rem 0 0;
	color: var(--bmc-danger);
	font-weight: 600;
}

.bmc-dialog-footer {
	display: flex;
	flex-wrap: wrap;
	justify-content: space-between;
	gap: 0.75rem;
	margin-top: 1.5rem;
}
