/* hal.popconf — pop-up confirmation styling, ported from the old .qtip-content rules.

   Every rule is anchored under the root `.popconf` (and qualified with the element
   where it helps) so the library defaults clear typical theme rules like
   `.woocommerce button` or `#payment .button`. Specificity is kept at two classes
   (0,2,0) at most, so your per-call #id / .className overrides still win easily.

   Modal uses the browser top layer (<dialog>.showModal), so it needs no z-index.
   The non-modal popover is a normal DOM element (for logical tab order), so it
   DOES need a high z-index to sit above fixed widgets like the chat iframe.
   Floating UI sets its left/top inline; JS toggles visibility once placed. */

.popconf {
	--popconf-color-bg: #fcfcfc;
	--popconf-color-text: #333;
	--popconf-color-border: #d8d8d8;
	--popconf-color-title-bg: #f0f0f0;
	--popconf-color-title-border: #e2e2e2;
	--popconf-color-ok-bg: #677C22;
	--popconf-color-ok-text: #fff;
	--popconf-color-cancel-bg: #f2f2f2;   /* #333 on #f2f2f2 = 11.6:1 */
	--popconf-color-cancel-text: #333;
	--popconf-color-close-bg: #cf727680;
	--popconf-color-close-bg-hover: #cf7276;
	--popconf-color-focus: #1a73e8;
	--popconf-color-hover-border: #000;
	--popconf-inline-pad: 1em;
	padding: 0;
	inline-size: min(90vw, 23em);
	max-inline-size: 100%;
	font-size: 0.875rem;
	background: var(--popconf-color-bg);
	color: var(--popconf-color-text);
	border: 1px solid var(--popconf-color-border);
	border-radius: 10px;
	box-shadow: 0 5px 20px rgba(0, 0, 0, 0.25);
}

.popconf.popconf--popover,
.popconf > form {
	display: grid;
	row-gap: 1.6em;
}

/* Center the modal in the viewport. The UA centers a modal <dialog> with
   inset:0 + margin:auto; any inherited `margin: 0` (ours or a theme reset)
   overrides that and pins it top-left, so assert the centering here. */
dialog.popconf--modal {
	margin: auto;
}

dialog.popconf--modal::backdrop {
	background: rgba(0, 0, 0, 0.5);
}

.popconf.popconf--popover {
	position: fixed;
	inset: auto;
	left: 0;
	top: 0;
	z-index: 2147483647;	/* above the chat/badge widgets (no top layer here) */
}

.popconf .popconf__title {
	display: grid;
	grid-template-columns: 1fr auto 1fr;
	align-items: center;
	gap: 0.6em;
	margin: 0;
	padding: 0.36em;
	line-height: 1.2;
	font-weight: 700;
	text-align: center;
	background: var(--popconf-color-title-bg);
	border-block-end: 1px solid var(--popconf-color-title-border);
}

.popconf .popconf__title-text {
	grid-column: 2;
	min-width: 0;
}

.popconf .popconf__msg {
	margin: 0;
	padding-inline: var(--popconf-inline-pad);
	text-align: center;
	font-size: 1em;
	line-height: 1.4;
}

.popconf .popconf__menu {
	display: flex;
	gap: 2.15em;
	justify-content: center;
	margin: 0;
	padding-block-end: 1em;
	padding-inline: var(--popconf-inline-pad);
}

/* Flex-centred rather than relying on text-align + the theme's line-height: 20px, which left the label
   sitting off-centre in the box. line-height 1 lets the flex centring do the vertical work. */
.popconf .popconf__btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 0.83em 0.67em;
	min-inline-size: 5em;
	font-size: 0.86em;
	line-height: 1;
	letter-spacing: 0.08em;
	text-align: center;
	border: 1px solid var(--popconf-color-border);
	border-radius: var(--popconf-radius);
	cursor: pointer;
}

.popconf .popconf__ok {
	background: var(--popconf-color-ok-bg);
	color: var(--popconf-color-ok-text);
	border-width: 2px;
}

/* Cancel is the SECONDARY action and must look like one. It carries the theme's `.button` class, which
   paints it the same dark green as OK while popconf only sets a text colour on OK — so it rendered as
   black on #677C22, 4.48:1, under the 4.5:1 minimum and visually indistinguishable from the primary
   action. Give it its own surface and an explicit colour rather than inheriting either. */
.popconf .popconf__cancel {
	background: var(--popconf-color-cancel-bg);
	color: var(--popconf-color-cancel-text);
	font-weight: normal !important;
}

.popconf .popconf__ok:hover {
	color: var(--popconf-color-ok-text);
	border-color: var(--popconf-color-hover-border);
}

.popconf .popconf__cancel:hover {
	border-color: var(--popconf-color-hover-border);
}

/* Title-row close (×). It's a real <button>, so reset native/theme button chrome
   first, then size it from the title font. data-popconf="close" is valued as cancel in the JS. */
.popconf .popconf__close {
	grid-column: 3;
	justify-self: end;
	align-self: center;
	inline-size: 1.4em;
	block-size: 1.4em;
	padding: 0;
	margin: 0;
	border: 0;
	border-radius: var(--popconf-radius);
	line-height: 1;
	font-size: 1.1em;
	font-weight: 700;
	font-family: inherit;
	text-align: center;
	color: var(--popconf-color-ok-text);
	background-color: var(--popconf-color-close-bg);
	cursor: pointer;
	-webkit-appearance: none;
	appearance: none;
}

.popconf .popconf__close:hover {
	background-color: var(--popconf-color-close-bg-hover);	/* drop the alpha on hover */
}

/* Visible focus ring for keyboard users (do not remove). */
.popconf .popconf__btn:focus-visible,
.popconf .popconf__close:focus-visible {
	outline: 2px solid var(--popconf-color-focus);
	outline-offset: 2px;
}
