/* AG-COM Pop-ups — front end */
.agp-lock, .agp-lock body { overflow: hidden !important; }

.agp {
	--agp-bg: #fff; --agp-fg: #222; --agp-accent: #5c0000;
	position: relative; box-sizing: border-box;
	background: var(--agp-bg); color: var(--agp-fg);
	border-radius: 8px; box-shadow: 0 12px 40px rgba(0,0,0,.28);
	font-size: 15px; line-height: 1.5; text-align: left;
	opacity: 0; transition: opacity .22s ease, transform .22s ease;
	outline: none; pointer-events: auto;
}
.agp *, .agp *::before, .agp *::after { box-sizing: border-box; }
.agp.agp-in { opacity: 1; transform: none !important; }

.agp-body { padding: 22px 24px 20px; max-height: inherit; overflow: auto; }
.agp-content > :first-child { margin-top: 0; }
.agp-content > :last-child { margin-bottom: 0; }
.agp-content p { margin: 0 0 .8em; color: inherit; }
.agp-content img { max-width: 100%; height: auto; display: block; margin: 0 auto .8em; border-radius: 4px; }
.agp-content a:not(.agp-btn) { color: var(--agp-accent); text-decoration: underline; }
.agp-title { margin: 0 32px 10px 0; font-size: 1.35em; line-height: 1.25; font-weight: 700; color: inherit; text-transform: none; letter-spacing: 0; }

.agp .agp-x {
	position: absolute !important; top: 6px; right: 6px; z-index: 2;
	width: 34px !important; height: 34px !important; min-width: 0 !important; min-height: 0 !important; margin: 0 !important; padding: 0 !important;
	border: 0 !important; border-radius: 50% !important; background: transparent !important; box-shadow: none !important;
	color: inherit !important; opacity: .6; font: 400 26px/34px Arial, sans-serif !important; text-align: center; text-transform: none !important; cursor: pointer;
}
.agp .agp-x:hover, .agp .agp-x:focus-visible { opacity: 1; background: rgba(127,127,127,.15) !important; }

.agp .agp-btn {
	display: inline-block; margin: 14px 0 0; padding: 11px 22px !important; min-height: 0 !important; width: auto !important;
	border: 0 !important; border-radius: 4px !important; background: var(--agp-accent) !important; color: #fff !important;
	font-family: inherit !important; font-size: 14px !important; font-weight: 700 !important; line-height: 1.2 !important;
	text-transform: uppercase; letter-spacing: .03em; text-decoration: none !important; text-shadow: none !important;
	cursor: pointer; box-shadow: none !important;
}
.agp .agp-btn:hover, .agp .agp-btn:focus-visible { filter: brightness(1.15); }

/* centre (covers the page) */
.agp-overlay {
	position: fixed; inset: 0; z-index: 100000;
	display: flex; align-items: center; justify-content: center; padding: 16px;
	background: rgba(0,0,0,.55); opacity: 0; transition: opacity .22s ease;
}
.agp-overlay.agp-in { opacity: 1; }
.agp--center { width: 100%; max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); display: flex; flex-direction: column; transform: scale(.96) translateY(10px); }
.agp--center .agp-body { flex: 1 1 auto; text-align: center; }
.agp--center .agp-title { margin-left: 32px; }

.agp--small  { max-width: 360px; }
.agp--medium { max-width: 520px; }
.agp--large  { max-width: 760px; }
.agp--full   { max-width: 1100px; }
.agp--center.agp--full { height: calc(100vh - 32px); height: calc(100dvh - 32px); }

/* corners */
.agp-stack {
	position: fixed; z-index: 99990; display: flex; flex-direction: column; gap: 12px;
	max-width: calc(100vw - 32px); pointer-events: none;
}
.agp-stack--top-left     { top: 16px; left: 16px; align-items: flex-start; }
.agp-stack--top-right    { top: 16px; right: 16px; align-items: flex-end; }
.agp-stack--bottom-left  { bottom: 16px; left: 16px; align-items: flex-start; }
.agp-stack--bottom-right { bottom: 16px; right: 16px; align-items: flex-end; }
.agp-stack > .agp { width: calc(100vw - 32px); max-height: calc(100vh - 32px); }
.agp-stack > .agp .agp-body { max-height: calc(100vh - 32px); }
.agp-stack > .agp--full { max-width: 520px; }
.agp--top-left, .agp--bottom-left { transform: translateX(-24px); }
.agp--top-right, .agp--bottom-right { transform: translateX(24px); }
.admin-bar .agp-stack--top-left, .admin-bar .agp-stack--top-right { top: 48px; }

/* bars */
.agp-stack--top-bar, .agp-stack--bottom-bar { left: 0; right: 0; max-width: none; gap: 0; }
.agp-stack--top-bar { top: 0; }
.agp-stack--bottom-bar { bottom: 0; }
.admin-bar .agp-stack--top-bar { top: 32px; }
.agp-stack > .agp--top-bar, .agp-stack > .agp--bottom-bar { width: 100%; max-width: none; border-radius: 0; box-shadow: 0 2px 12px rgba(0,0,0,.2); }
.agp--top-bar { transform: translateY(-100%); }
.agp--bottom-bar { transform: translateY(100%); }
.agp--top-bar .agp-body, .agp--bottom-bar .agp-body {
	display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 6px 18px;
	padding: 10px 48px; text-align: center; max-height: 50vh;
}
.agp--top-bar .agp-title, .agp--bottom-bar .agp-title { margin: 0; font-size: 1.05em; }
.agp--top-bar .agp-content p, .agp--bottom-bar .agp-content p { margin: 0; }
.agp--top-bar .agp-btn, .agp--bottom-bar .agp-btn { margin: 0; padding: 8px 16px !important; }
.agp--top-bar .agp-x, .agp--bottom-bar .agp-x { top: 50%; margin-top: -17px; }

/* phones: corners go across the bottom */
@media (max-width: 600px) {
	.agp-stack--top-left, .agp-stack--top-right, .agp-stack--bottom-left, .agp-stack--bottom-right {
		left: 10px; right: 10px; max-width: none; align-items: stretch;
	}
	.agp-stack--bottom-left, .agp-stack--bottom-right { bottom: 10px; }
	.agp-stack--top-left, .agp-stack--top-right { top: auto; bottom: 10px; }
	.agp-stack > .agp { width: auto; max-width: none; max-height: 70vh; transform: translateY(24px); }
	.agp-stack > .agp .agp-body { max-height: 70vh; }
	.agp-body { padding: 18px 18px 16px; }
	.agp--top-bar .agp-body, .agp--bottom-bar .agp-body { padding: 10px 44px 10px 14px; }
	.admin-bar .agp-stack--top-bar { top: 46px; }
	.agp-overlay { padding: 10px; }
	.agp--center { max-height: calc(100vh - 20px); max-height: calc(100dvh - 20px); }
	.agp--center.agp--full { height: calc(100vh - 20px); height: calc(100dvh - 20px); }
}

@media (prefers-reduced-motion: reduce) {
	.agp, .agp-overlay { transition: none; }
	.agp { transform: none !important; }
}
@media print { .agp-overlay, .agp-stack { display: none !important; } }
