.super-modal-backdrop {
	position: fixed;
	inset: 0;
	background: rgba(0, 0, 0, 0.35);
	opacity: 0;
	visibility: hidden;
	transition: opacity 0.25s ease, visibility 0.25s ease;
	z-index: calc(var(--super-modal-z-index, 9999) - 1);
}

.super-modal-backdrop.is-open {
	opacity: 1;
	visibility: visible;
}

.super-modal {
	position: fixed;
	z-index: var(--super-modal-z-index, 9999);
	background: var(--super-modal-bg, #fff);
	padding: var(--super-modal-padding, 24px);
	margin: var(--super-modal-margin, 0);
	box-sizing: border-box;
	overflow: auto;
	transition: transform 0.3s ease, opacity 0.3s ease, visibility 0.3s ease;
	visibility: hidden;
	will-change: transform, opacity;
}

.super-modal.is-open {
	visibility: visible;
}

/* Side panels */
.super-modal--right,
.super-modal--left {
	top: 0;
	height: var(--super-modal-height, 100%);
	width: var(--super-modal-width, 400px);
	max-width: calc(100vw - var(--super-modal-margin-left, 0px) - var(--super-modal-margin-right, 0px));
}

.super-modal--right {
	right: 0;
	transform: translateX(100%);
}

.super-modal--left {
	left: 0;
	transform: translateX(-100%);
}

/* Full-width top / bottom */
.super-modal--top,
.super-modal--bottom {
	left: 0;
	width: var(--super-modal-width, 100%);
	height: var(--super-modal-height, 300px);
	max-height: calc(100vh - var(--super-modal-margin-top, 0px) - var(--super-modal-margin-bottom, 0px));
}

.super-modal--top {
	top: 0;
	transform: translateY(-100%);
}

.super-modal--bottom {
	bottom: 0;
	transform: translateY(100%);
}

/* Centered top / bottom */
.super-modal--top-center,
.super-modal--bottom-center {
	left: 50%;
	width: var(--super-modal-width, 400px);
	max-width: calc(100vw - var(--super-modal-margin-left, 0px) - var(--super-modal-margin-right, 0px));
	height: var(--super-modal-height, auto);
	max-height: calc(100vh - var(--super-modal-margin-top, 0px) - var(--super-modal-margin-bottom, 0px));
	transform: translateX(-50%);
}

.super-modal--top-center {
	top: 0;
	transform: translate(-50%, -100%);
}

.super-modal--bottom-center {
	bottom: 0;
	transform: translate(-50%, 100%);
}

/* Center modal */
.super-modal--center-center {
	top: 50%;
	left: 50%;
	width: var(--super-modal-width, 400px);
	height: var(--super-modal-height, auto);
	max-width: calc(100vw - var(--super-modal-margin-left, 0px) - var(--super-modal-margin-right, 0px));
	max-height: calc(100vh - var(--super-modal-margin-top, 0px) - var(--super-modal-margin-bottom, 0px));
	transform: translate(-50%, -50%) scale(0.96);
	opacity: 0;
}

.super-modal--center-center.is-open {
	transform: translate(-50%, -50%) scale(1);
	opacity: 1;
}

/* Open states */
.super-modal--right.is-open,
.super-modal--left.is-open {
	transform: translate(0, 0);
}

.super-modal--top.is-open,
.super-modal--bottom.is-open {
	transform: translateY(0);
}

.super-modal--top-center.is-open {
	transform: translate(-50%, 0);
}

.super-modal--bottom-center.is-open {
	transform: translate(-50%, 0);
}

.super-modal > button.super-modal__close {
	position: absolute;
	top: 12px;
	right: 12px;
	left: auto;
	width: 36px;
	height: 36px;
	min-width: 36px;
	min-height: 36px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: rgba(0, 0, 0, 0.06);
	color: inherit;
	font: inherit;
	line-height: 1;
	cursor: pointer;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
	flex-shrink: 0;
	z-index: var(--super-modal-close-z-index, 1000);
}

.super-modal.is-open > button.super-modal__close {
	pointer-events: auto;
}

/* Theme button styles (e.g. Kadence global buttons) must not affect the close control. */
.super-modal > button.super-modal__close {
	padding: 0 !important;
	margin: 0 !important;
	min-width: 36px !important;
	min-height: 36px !important;
	width: 36px !important;
	height: 36px !important;
	border-width: 0 !important;
	border-radius: 50% !important;
	box-shadow: none !important;
	transform: none;
}

.super-modal > button.super-modal__close .super-modal__close-icon {
	display: block;
	width: 16px;
	height: 16px;
	flex-shrink: 0;
	pointer-events: none;
}

.super-modal > button.super-modal__close--left {
	right: auto;
	left: 12px;
}

.super-modal > button.super-modal__close:hover,
.super-modal > button.super-modal__close:focus {
	background: rgba(0, 0, 0, 0.12);
	outline: 2px solid currentColor;
	outline-offset: 2px;
	box-shadow: none !important;
}

.super-modal__content {
	position: relative;
	z-index: 0;
	isolation: isolate;
}

/* When the WooCommerce mini-cart is closed, its overlay must not keep intercepting clicks. */
body.super-modal-open
	.wc-block-components-drawer__screen-overlay--is-hidden {
	pointer-events: none !important;
}

.super-modal__content > :first-child {
	margin-top: 0;
}

/*
 * WooCommerce variable-product variations tables rely on display:block/flex
 * rules scoped to .woocommerce div.product (block themes, Greenshift Woo, etc.).
 * Panels are appended to body outside .product, so those rules do not apply.
 */
.super-modal__content table.variations {
	display: block;
	width: 100%;
}

.super-modal__content table.variations tbody {
	display: block;
}

.super-modal__content table.variations tr {
	display: flex;
	flex-wrap: wrap;
}

.super-modal__content table.variations th,
.super-modal__content table.variations td {
	display: block;
	flex: 0 1 100%;
	flex-basis: 100%;
	width: 100%;
	max-width: 100%;
	box-sizing: border-box;
	text-align: left;
	vertical-align: top;
	padding-bottom: var(--wp--style--block-gap, 1em);
	border: 0;
	line-height: 1.4;
}

/*
 * Core WooCommerce styles the variation <select> with appearance:none only
 * inside .woocommerce div.product. Block themes still apply height:3em +
 * padding:.9em outside that scope, which clips native select text.
 */
.super-modal__content table.variations select {
	max-width: 100%;
	display: inline-block;
	box-sizing: border-box;
	appearance: none;
	-webkit-appearance: none;
	-moz-appearance: none;
	padding-right: 3em;
	background-image: url("data:image/svg+xml;base64,PHN2ZyB4bWxucz0iaHR0cDovL3d3dy53My5vcmcvMjAwMC9zdmciIHZpZXdCb3g9IjAgMCAyNCAyNCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSJibGFjayIgc3Ryb2tlLXdpZHRoPSIyIiBzdHJva2UtbGluZWNhcD0icm91bmQiIHN0cm9rZS1saW5lam9pbj0icm91bmQiPjxwb2x5bGluZSBwb2ludHM9IjYgOSAxMiAxNSAxOCA5Ij48L3BvbHlsaW5lPjwvc3ZnPg==");
	background-repeat: no-repeat;
	background-size: 16px;
	background-position: calc(100% - 12px) 50%;
}

body.super-modal-open {
	overflow: hidden;
}

@media (max-width: 1024px) {
	.super-modal--right,
	.super-modal--left,
	.super-modal--top,
	.super-modal--bottom,
	.super-modal--top-center,
	.super-modal--bottom-center,
	.super-modal--center-center {
		width: var(--super-modal-width-tablet, var(--super-modal-width));
	}
}

@media (max-width: 767px) {
	.super-modal--right,
	.super-modal--left,
	.super-modal--top,
	.super-modal--bottom,
	.super-modal--top-center,
	.super-modal--bottom-center,
	.super-modal--center-center {
		width: var(
			--super-modal-width-mobile,
			var(--super-modal-width-tablet, var(--super-modal-width))
		);
	}
}

.super-modal__demo {
	padding-top: 30px;
}

.super-modal__demo-title {
	margin: 0 0 0.5em;
	font-size: 1.25em;
	line-height: 1.3;
	color: #0551fe;
}

.super-modal__demo-text {
	margin: 0 0 0.75em;
	font-size: 0.95em;
	line-height: 1.45;
}

.super-modal__demo-link {
	margin: 0;
	font-size: 0.9em;
}

@media (prefers-reduced-motion: reduce) {
	.super-modal,
	.super-modal-backdrop {
		transition: none;
	}
}
