/* Moloney Initials — product page option.
   Follows the Moloney Sports style: flat, square corners, Big Shoulders labels,
   12px-radius fields with #bac1c9 border, green reserved for the CTA button.
   Sizes match the product form: 15px body text, 42px field height (same as the
   variation selects and quantity box). */

/* Make sure the option gets its own full-width row when the add-to-cart row is a flex row. */
form.cart:has(> .ms-initials),
.woocommerce-variation-add-to-cart:has(> .ms-initials) {
	flex-wrap: wrap;
}

.ms-initials {
	--msi-text: #363636;
	--msi-dark: #212121;
	--msi-line: #e0e0e0;
	--msi-field: #bac1c9;
	--msi-muted: #6b6b6b;
	--msi-label: #9e9e9e;
	--msi-error: #c62828;
	--msi-head: "Big Shoulders", "Big Shoulders Display", "Arial Narrow", sans-serif;

	flex: 1 0 100%;
	width: 100%;
	box-sizing: border-box;
	margin: 0 0 16px;
	padding: 12px 16px;
	background: #fff;
	border: 1px solid var(--msi-line);
	color: var(--msi-text);
	font-size: 15px;
	line-height: 1.5;
	text-align: left;
}

.ms-initials *,
.ms-initials *::before,
.ms-initials *::after {
	box-sizing: border-box;
}

/* Toggle row ---------------------------------------------------------- */

.ms-initials__toggle {
	position: relative;
	display: flex;
	align-items: center;
	gap: 12px;
	margin: 0;
	cursor: pointer;
	user-select: none;
}

.ms-initials__checkbox {
	position: absolute;
	opacity: 0;
	width: 22px;
	height: 22px;
	margin: 0;
	cursor: pointer;
}

.ms-initials__box {
	flex: 0 0 22px;
	width: 22px;
	height: 22px;
	border: 2px solid var(--msi-dark);
	background: #fff;
	position: relative;
	transition: background-color .15s ease;
}

.ms-initials__checkbox:checked + .ms-initials__box {
	background: var(--msi-dark);
}

.ms-initials__checkbox:checked + .ms-initials__box::after {
	content: "";
	position: absolute;
	left: 5px;
	top: 1px;
	width: 7px;
	height: 12px;
	border: solid #fff;
	border-width: 0 2.5px 2.5px 0;
	transform: rotate(45deg);
}

.ms-initials__checkbox:focus-visible + .ms-initials__box {
	outline: 2px solid var(--msi-dark);
	outline-offset: 3px;
}

.ms-initials__title,
.ms-initials__price {
	font-family: var(--msi-head);
	font-weight: 500;
	font-size: 16px;
	line-height: 1.2;
	text-transform: uppercase;
	color: var(--msi-dark);
}

.ms-initials__price {
	margin-left: auto;
	white-space: nowrap;
}

.ms-initials__price .woocommerce-Price-amount {
	font: inherit;
	color: inherit;
}

.ms-initials__sub {
	margin: 4px 0 0 34px;
	font-size: 13px;
	color: var(--msi-muted);
}

.ms-initials__sub .woocommerce-Price-amount {
	font-weight: 600;
}

/* Panel --------------------------------------------------------------- */

.ms-initials__panel {
	margin: 12px 0 0 34px;
}

.ms-initials__panel[hidden] {
	display: none;
}

.ms-initials__label {
	display: block;
	margin: 0 0 4px;
	font-size: 15px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--msi-label);
}

.ms-initials__field {
	position: relative;
	max-width: 200px;
}

.ms-initials input.ms-initials__input {
	display: block;
	width: 100%;
	height: 42px;
	margin: 0;
	padding: 0 48px 0 14px;
	border: 1px solid var(--msi-field);
	border-radius: 12px;
	background: #fff;
	font-family: inherit;
	font-size: 15px;
	font-weight: 600;
	line-height: 40px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: var(--msi-dark);
	box-shadow: none;
}

.ms-initials .ms-initials__input::placeholder {
	font-weight: 400;
	letter-spacing: .04em;
	color: #a7adb4;
}

.ms-initials input.ms-initials__input:focus {
	outline: none;
	background: #fff;
	border-color: var(--msi-dark);
	box-shadow: 0 0 0 1px var(--msi-dark);
}

.ms-initials.has-error input.ms-initials__input {
	border-color: var(--msi-error);
	box-shadow: 0 0 0 1px var(--msi-error);
}

.ms-initials__count {
	position: absolute;
	right: 14px;
	top: 50%;
	transform: translateY(-50%);
	font-size: 12px;
	color: var(--msi-muted);
	pointer-events: none;
	font-variant-numeric: tabular-nums;
}

.ms-initials__count.is-full {
	color: var(--msi-dark);
	font-weight: 600;
}

.ms-initials__error {
	margin: 6px 0 0;
	font-size: 13px;
	font-weight: 600;
	color: var(--msi-error);
}

.ms-initials__error[hidden] {
	display: none;
}

.ms-initials__hint,
.ms-initials__note {
	margin: 6px 0 0;
	font-size: 13px;
	line-height: 1.45;
	color: var(--msi-muted);
}

.ms-initials__note {
	margin-top: 2px;
}

/* Total --------------------------------------------------------------- */

.ms-initials__total {
	display: flex;
	justify-content: space-between;
	align-items: baseline;
	gap: 12px;
	margin: 12px 0 0;
	padding-top: 10px;
	border-top: 1px solid var(--msi-line);
	font-size: 13px;
	color: var(--msi-muted);
}

.ms-initials__total[hidden] {
	display: none;
}

.ms-initials__total-amount {
	font-family: var(--msi-head);
	font-size: 16px;
	font-weight: 600;
	line-height: 1.2;
	color: var(--msi-dark);
}

@media (max-width: 478px) {
	.ms-initials {
		padding: 12px;
	}
	.ms-initials__title,
	.ms-initials__price {
		font-size: 15px;
	}
	.ms-initials__panel,
	.ms-initials__sub {
		margin-left: 0;
	}
	.ms-initials__field {
		max-width: none;
	}
}

@media (prefers-reduced-motion: reduce) {
	.ms-initials__box {
		transition: none;
	}
}
