/* WooCommerce Size Chart Manager — frontend */

/* Trigger ------------------------------------------------------------- */
.wcscm-trigger-wrap {
	margin: 0 0 1em;
}

.wcscm-trigger-wrap .wcscm-trigger {
	display: inline-flex;
	align-items: center;
	gap: 0.45em;
	cursor: pointer;
	font: inherit;
	line-height: 1.3;
	text-transform: none;
	letter-spacing: normal;
}

.wcscm-trigger-wrap .wcscm-trigger--link {
	background: none !important;
	border: 0 !important;
	box-shadow: none !important;
	padding: 0 !important;
	min-height: 0;
	color: inherit;
	text-decoration: underline;
	text-decoration-thickness: 1px;
	text-underline-offset: 3px;
}

.wcscm-trigger-wrap .wcscm-trigger--link:hover {
	text-decoration-thickness: 2px;
}

.wcscm-trigger-wrap .wcscm-trigger--button {
	background: var(--wcscm-btn-bg, #222);
	color: var(--wcscm-btn-color, #fff);
	border: 0;
	border-radius: 4px;
	padding: 0.6em 1.1em;
	font-size: 0.95em;
}

.wcscm-trigger-wrap .wcscm-trigger--button:hover {
	filter: brightness(1.15);
}

.wcscm-trigger-wrap .wcscm-trigger:focus-visible {
	outline: 2px solid currentColor;
	outline-offset: 3px;
}

.wcscm-trigger__icon {
	flex: none;
}

/* Modal --------------------------------------------------------------- */
html.wcscm-modal-open,
html.wcscm-modal-open body {
	overflow: hidden;
}

.wcscm-modal[hidden] {
	display: none !important;
}

.wcscm-modal {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	box-sizing: border-box;
}

.wcscm-modal *,
.wcscm-modal *::before,
.wcscm-modal *::after {
	box-sizing: border-box;
}

.wcscm-modal__overlay {
	position: absolute;
	inset: 0;
	background: rgba(17, 17, 20, 0.62);
	opacity: 0;
	transition: opacity 0.2s ease;
}

.wcscm-modal__dialog {
	position: relative;
	display: flex;
	flex-direction: column;
	width: 100%;
	max-width: min(var(--wcscm-popup-width, 800px), 100%);
	max-height: calc(100vh - 32px);
	max-height: calc(100dvh - 32px);
	background: #fff;
	color: #1d1d1f;
	border-radius: 10px;
	box-shadow: 0 24px 64px rgba(0, 0, 0, 0.28);
	overflow: hidden;
	outline: none;
	opacity: 0;
	transform: translateY(12px) scale(0.985);
	transition: opacity 0.2s ease, transform 0.2s ease;
}

.wcscm-modal.is-open .wcscm-modal__overlay {
	opacity: 1;
}

.wcscm-modal.is-open .wcscm-modal__dialog {
	opacity: 1;
	transform: none;
}

.wcscm-modal__header {
	display: flex;
	align-items: center;
	gap: 12px;
	padding: 12px 12px 12px 20px;
	border-bottom: 1px solid rgba(0, 0, 0, 0.08);
	flex: none;
}

.wcscm-modal__header--bare {
	border-bottom: 0;
	padding-bottom: 0;
}

.wcscm-modal .wcscm-modal__title {
	margin: 0;
	padding: 0;
	font-size: 1.1rem;
	line-height: 1.3;
	font-weight: 600;
	color: inherit;
}

.wcscm-modal .wcscm-modal__close {
	flex: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 38px;
	height: 38px;
	min-height: 0;
	margin: 0 0 0 auto;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50%;
	background: transparent !important;
	box-shadow: none !important;
	color: inherit !important;
	font-size: 28px;
	line-height: 1;
	cursor: pointer;
}

.wcscm-modal .wcscm-modal__close:hover {
	background: rgba(0, 0, 0, 0.06) !important;
}

.wcscm-modal .wcscm-modal__close:focus-visible {
	outline: 2px solid #2271b1;
	outline-offset: 1px;
}

.wcscm-modal__body {
	flex: 1 1 auto;
	overflow: auto;
	padding: 16px 20px 20px;
	overscroll-behavior: contain;
	-webkit-overflow-scrolling: touch;
}

.wcscm-modal .wcscm-modal__image {
	display: block;
	max-width: 100%;
	height: auto;
	margin: 0 auto;
	cursor: zoom-in;
}

.wcscm-modal.is-zoomed .wcscm-modal__image {
	max-width: none;
	cursor: zoom-out;
}

.wcscm-modal__hint {
	display: none;
	margin: 0;
	padding: 0 16px 12px;
	font-size: 0.8rem;
	text-align: center;
	opacity: 0.6;
	flex: none;
}

.wcscm-sr-only {
	position: absolute !important;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

/* Inline (tab / display="image") -------------------------------------- */
.wcscm-inline {
	margin: 0 0 1.5em;
	overflow-x: auto;
}

.wcscm-inline .wcscm-inline__image {
	display: block;
	max-width: 100%;
	height: auto;
}

/* Mobile -------------------------------------------------------------- */
@media (max-width: 600px) {
	.wcscm-modal {
		padding: 8px;
	}

	.wcscm-modal__dialog {
		max-height: calc(100vh - 16px);
		max-height: calc(100dvh - 16px);
		border-radius: 8px;
	}

	.wcscm-modal__header {
		padding: 8px 8px 8px 16px;
	}

	.wcscm-modal__body {
		padding: 10px;
	}

	.wcscm-modal__hint {
		display: block;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wcscm-modal__overlay,
	.wcscm-modal__dialog {
		transition: none;
	}
}
