/* Exhibit RSGDX — custom-modal.css — v3
   v3: .exhibitrsgdx-modal__html-holder — card-style sizing for arbitrary
       HTML content (My Account's "View" order modal), separate from the
       image-lightbox sizing on .exhibitrsgdx-modal__content img. Only
       applied while the modal has the "has-html" class (see custom-modal.js
       openHTML()).
   v2: display: none gets !important — Astra's stylesheet can override the
       ID rule without it, causing the modal to appear as text at the footer
       on page load.
   v1: Generic reusable modal/lightbox. Currently used for image enlargement
       (see custom-modal.js) but the overlay/close mechanism is intentionally
       generic so future popups can reuse it rather than each building their
       own from scratch. */

#exhibitrsgdx-modal {
	position: fixed;
	inset: 0;
	z-index: 9000;
	display: none !important;
	align-items: center;
	justify-content: center;
	padding: var(--exhibitrsgdx-space-5);
}

#exhibitrsgdx-modal.is-open {
	display: flex !important;
}

#exhibitrsgdx-modal .exhibitrsgdx-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba(0,0,0,0.85);
}

#exhibitrsgdx-modal .exhibitrsgdx-modal__content {
	position: relative;
	z-index: 1;
	max-width: 90vw;
	max-height: 90vh;
}

#exhibitrsgdx-modal .exhibitrsgdx-modal__content img {
	display: block;
	max-width: 90vw;
	max-height: 90vh;
	width: auto;
	height: auto;
	object-fit: contain;
}

#exhibitrsgdx-modal.has-html .exhibitrsgdx-modal__content {
	max-width: min(640px, 90vw);
}

#exhibitrsgdx-modal .exhibitrsgdx-modal__html-holder {
	display: none;
	background: var(--exhibitrsgdx-color-surface);
	border: 1px solid var(--exhibitrsgdx-color-border);
	border-radius: var(--exhibitrsgdx-radius-md);
	padding: var(--exhibitrsgdx-space-5);
	max-height: 85vh;
	overflow-y: auto;
	color: var(--exhibitrsgdx-color-text);
	font-family: var(--exhibitrsgdx-font-sans);
	text-align: left;
}

#exhibitrsgdx-modal .exhibitrsgdx-modal__html-holder .exhibitrsgdx-myaccount-modal-loading,
#exhibitrsgdx-modal .exhibitrsgdx-modal__html-holder .exhibitrsgdx-myaccount-modal-error {
	margin: 0;
	color: var(--exhibitrsgdx-color-text-muted);
	text-align: center;
}

#exhibitrsgdx-modal.has-html .exhibitrsgdx-modal__html-holder {
	display: block;
}

#exhibitrsgdx-modal .exhibitrsgdx-modal__html-holder table {
	width: 100%;
	border-collapse: collapse;
}

#exhibitrsgdx-modal .exhibitrsgdx-modal__html-holder th,
#exhibitrsgdx-modal .exhibitrsgdx-modal__html-holder td {
	padding: var(--exhibitrsgdx-space-2);
	border-bottom: 1px solid var(--exhibitrsgdx-color-border);
	text-align: left;
}

#exhibitrsgdx-modal .exhibitrsgdx-modal__close {
	position: absolute;
	top: -18px;
	right: -18px;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background: var(--exhibitrsgdx-color-primary);
	color: #fff;
	border: none;
	font-size: 16px;
	display: flex;
	align-items: center;
	justify-content: center;
	cursor: pointer;
	z-index: 2;
}

#exhibitrsgdx-modal .exhibitrsgdx-modal__close:hover {
	background: var(--exhibitrsgdx-color-primary-hover);
}

@media (max-width: 500px) {
#exhibitrsgdx-modal .exhibitrsgdx-modal__close {
		top: -14px;
		right: 0;
		width: 30px;
		height: 30px;
		font-size: 13px;
	}
}