/* Popups: overlay, card, actions, floating reopen button.
   Colours come from the themes' --om-* variables, so light/dark mode follows the theme toggle;
   the fallbacks are for other themes. */

.omc-popups[hidden],
.omc-popup[hidden],
.omc-popups-fab[hidden],
.omc-popups-menu[hidden] {
	display: none !important;
}

.omc-popups {
	position: fixed;
	inset: 0;
	z-index: 999999;
	display: flex;
	align-items: center;
	justify-content: center;
	padding: 16px;
	background: rgba(0, 0, 0, .55);
}

.omc-popup {
	position: relative;
	box-sizing: border-box;
	width: min(560px, 100%);
	max-height: 90vh;
	overflow: auto;
	padding: 28px 24px 20px;
	border: 1px solid var(--om-border, transparent);
	border-radius: 14px;
	background: var(--om-surface-raised, #fff);
	color: var(--om-text, #222);
	box-shadow: 0 20px 60px rgba(0, 0, 0, .3);
	text-align: center;
}

.omc-popup-x {
	position: absolute;
	top: 8px;
	right: 10px;
	padding: 4px 8px;
	border: 0;
	background: none;
	color: var(--om-text-muted, #666);
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
}

/* Doubled class: beats the themes' own heading colours. */
.omc-popup .omc-popup-title {
	margin: 0 0 12px;
	color: var(--om-text, #111);
	font-size: 20px;
	line-height: 1.25;
}

.omc-popup .omc-popup-title--hidden {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

.omc-popup-body {
	font-size: 15px;
	line-height: 1.5;
	text-align: left;
}

.omc-popup-body .aligncenter {
	text-align: center;
}

.omc-popup-body img {
	max-width: 100%;
	height: auto;
}

.omc-popup-body table {
	width: 100%;
}

.omc-popup-actions {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 12px;
	margin-top: 20px;
}

.omc-popup-cta,
.omc-popup-dismiss {
	display: inline-block;
	padding: 10px 18px;
	border: 0;
	border-radius: 10px;
	font-weight: 600;
	line-height: 1.3;
	text-decoration: none;
	cursor: pointer;
}

/* Theme accent by default (like Add to Cart); a popup's own colours come in as
   --omc-cta-* on the link. Doubled class + :hover/:focus/:visited so theme link colours never win. */
.omc-popup .omc-popup-cta,
.omc-popup .omc-popup-cta:hover,
.omc-popup .omc-popup-cta:focus,
.omc-popup .omc-popup-cta:visited {
	background: var(--omc-cta-bg, var(--om-accent, #111));
	color: var(--omc-cta-color, var(--om-on-accent, #fff));
}

.omc-popup .omc-popup-cta:hover,
.omc-popup .omc-popup-cta:focus {
	filter: brightness(1.1);
}

.omc-popup .omc-popup-dismiss {
	background: var(--om-surface-alt, #eee);
	color: var(--om-text, #222);
}

/* With a more-info link: link on the left, buttons on the right. */
.omc-popup-actions:has(.omc-popup-more) {
	justify-content: flex-end;
}

.omc-popup-more {
	margin-right: auto;
	color: inherit;
	font-size: 14px;
}

.omc-popups-fab {
	position: fixed;
	bottom: 16px;
	left: 16px;
	z-index: 99998;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 48px;
	height: 48px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--om-accent, #111);
	color: var(--om-on-accent, #fff);
	box-shadow: 0 4px 14px rgba(0, 0, 0, .25);
	cursor: pointer;
}

.omc-popups-menu {
	position: fixed;
	bottom: 72px;
	left: 16px;
	z-index: 99998;
	display: flex;
	flex-direction: column;
	max-width: calc(100vw - 32px);
	padding: 6px;
	border: 1px solid var(--om-border, transparent);
	border-radius: 10px;
	background: var(--om-surface-raised, #fff);
	box-shadow: 0 8px 24px rgba(0, 0, 0, .2);
}

.omc-popups-menu button {
	padding: 10px 14px;
	border: 0;
	border-radius: 6px;
	background: none;
	color: var(--om-text, #222);
	text-align: left;
	cursor: pointer;
}

.omc-popups-menu button:hover,
.omc-popups-menu button:focus {
	background: var(--om-surface-alt, #f2f2f2);
}
