/* Weight Limit Manager — modal styles. Fully namespaced under .wlm- */

.wlm-modal-open,
.wlm-modal-open body {
	overflow: hidden;
}

.wlm-overlay {
	position: fixed;
	inset: 0;
	z-index: 999999;
	background: rgba( 0, 0, 0, 0.55 );
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 1rem;
}

.wlm-overlay[hidden] {
	display: none;
}

.wlm-modal {
	position: relative;
	background: #fff;
	color: #1f1f1f;
	border-radius: 8px;
	box-shadow: 0 10px 40px rgba( 0, 0, 0, 0.3 );
	max-width: 34rem;
	width: calc( 100vw - 2rem );
	max-height: 85vh;
	display: flex;
	flex-direction: column;
	padding: 1.5rem;
	font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Oxygen-Sans,
		Ubuntu, Cantarell, "Helvetica Neue", sans-serif;
	font-size: 15px;
	line-height: 1.5;
	box-sizing: border-box;
}

.wlm-modal *,
.wlm-modal *::before,
.wlm-modal *::after {
	box-sizing: inherit;
}

.wlm-title {
	margin: 0 2rem 0.5rem 0;
	font-size: 1.25rem;
	line-height: 1.3;
	outline: none;
}

.wlm-message {
	margin-bottom: 1rem;
}

.wlm-message p {
	margin: 0 0 0.5em;
}

.wlm-meter {
	height: 10px;
	border-radius: 5px;
	background: #e6e6e6;
	overflow: hidden;
	margin-bottom: 0.5rem;
}

.wlm-meter-fill {
	height: 100%;
	width: 0;
	border-radius: 5px;
	background: #1e7e34;
	transition: width 0.25s ease;
}

.wlm-meter-fill.wlm-over {
	background: #b32d2e;
}

.wlm-totals {
	display: flex;
	flex-wrap: wrap;
	gap: 0.35rem;
	align-items: baseline;
	margin: 0 0 1rem;
}

.wlm-badge {
	display: inline-block;
	padding: 0.15rem 0.6rem;
	border-radius: 999px;
	font-size: 0.85em;
	font-weight: 600;
	margin-inline-start: auto;
}

.wlm-badge.wlm-over {
	background: #fbeaea;
	color: #b32d2e;
}

.wlm-badge.wlm-under {
	background: #e8f5ec;
	color: #1e7e34;
}

.wlm-items {
	list-style: none;
	margin: 0 0 0.75rem;
	padding: 0;
	overflow-y: auto;
	flex: 1 1 auto;
	min-height: 0;
	border-top: 1px solid #ececec;
}

.wlm-item {
	display: flex;
	align-items: center;
	gap: 0.6rem;
	padding: 0.6rem 0;
	border-bottom: 1px solid #ececec;
}

.wlm-item-name {
	flex: 1 1 auto;
	min-width: 8rem;
	font-weight: 600;
}

.wlm-item-meta {
	color: #555;
	white-space: nowrap;
}

.wlm-item-meta.wlm-item-missing {
	color: #996800;
	font-style: italic;
}

.wlm-item-strict {
	background: #fdf6e7;
}

.wlm-item-line {
	white-space: nowrap;
	font-variant-numeric: tabular-nums;
}

.wlm-remove,
.wlm-decrease {
	appearance: none;
	border: 1px solid #c8c8c8;
	background: #fff;
	color: #1f1f1f;
	border-radius: 4px;
	padding: 0.45rem 0.8rem;
	min-height: 44px;
	min-width: 44px;
	cursor: pointer;
	font-size: 0.9em;
}

.wlm-remove:hover:not([disabled]),
.wlm-decrease:hover:not([disabled]) {
	border-color: #b32d2e;
	color: #b32d2e;
}

.wlm-remove[disabled],
.wlm-decrease[disabled],
.wlm-continue[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

.wlm-missing-note {
	color: #996800;
	font-size: 0.85em;
	margin: 0 0 0.75rem;
}

.wlm-error {
	color: #b32d2e;
	font-size: 0.9em;
	margin: 0 0 0.75rem;
}

.wlm-actions {
	display: flex;
	flex-wrap: wrap;
	gap: 0.6rem;
	align-items: center;
	margin-top: 0.25rem;
}

.wlm-goto-cart {
	margin-inline-end: auto;
	color: inherit;
	text-decoration: underline;
	min-height: 44px;
	display: inline-flex;
	align-items: center;
}

.wlm-edit-address {
	appearance: none;
	border: 1px solid #c8c8c8;
	background: #fff;
	color: #1f1f1f;
	border-radius: 4px;
	padding: 0.55rem 1rem;
	min-height: 44px;
	cursor: pointer;
}

.wlm-continue {
	appearance: none;
	border: none;
	background: #1e7e34;
	color: #fff;
	border-radius: 4px;
	padding: 0.55rem 1.2rem;
	min-height: 44px;
	font-weight: 600;
	cursor: pointer;
}

.wlm-continue:hover:not([disabled]) {
	background: #17662a;
}

.wlm-close {
	position: absolute;
	top: 0.75rem;
	inset-inline-end: 0.75rem;
	appearance: none;
	border: none;
	background: transparent;
	font-size: 1.6rem;
	line-height: 1;
	width: 44px;
	height: 44px;
	cursor: pointer;
	color: #555;
}

.wlm-close[disabled] {
	opacity: 0.35;
	cursor: not-allowed;
}

.wlm-busy .wlm-items {
	opacity: 0.6;
}

.wlm-shake {
	animation: wlm-shake 0.3s ease;
}

@keyframes wlm-shake {
	0%, 100% { transform: translateX( 0 ); }
	25% { transform: translateX( -6px ); }
	75% { transform: translateX( 6px ); }
}

.wlm-modal .screen-reader-text {
	border: 0;
	clip: rect( 1px, 1px, 1px, 1px );
	clip-path: inset( 50% );
	height: 1px;
	width: 1px;
	margin: -1px;
	overflow: hidden;
	padding: 0;
	position: absolute;
}

@media ( prefers-reduced-motion: reduce ) {
	.wlm-meter-fill {
		transition: none;
	}
	.wlm-shake {
		animation: none;
	}
}

@media ( max-width: 480px ) {
	.wlm-modal {
		padding: 1rem;
	}
	.wlm-item {
		flex-wrap: wrap;
	}
	.wlm-item-name {
		flex-basis: 100%;
	}
}
