/* Waiver for WooCommerce — checkout notice + modal */

.waiver-wp-wrap {
	margin: 0;
}

/* ---------------------------------------------------------------------------
   Checkout notice — intentionally small/subtle: the full detail lives in the
   waiver modal itself.
--------------------------------------------------------------------------- */
.waiver-wp-check {
	margin: 1.1em 0 0;
	padding-top: 0.2em;
	font-size: 0.8em;
	line-height: 1.45;
	color: #6b7280;
}

.waiver-wp-check p {
	margin: 0;
}

/* Terms line: checkbox + text + link share one line.
   The text and link live in one inline span (flex item) so they wrap as a
   unit and never split onto separate lines. Theme label styles are overridden
   so the size matches the privacy paragraph; the link keeps the theme color. */
.waiver-wp-check .waiver-wp-terms {
	display: flex;
	align-items: center;
	gap: 6px;
	margin-top: 0.5em;
}

/* The text + link form one inline run inside this span. !important is needed
   because checkout themes force labels to display:block, bold, and a larger
   font — which would otherwise push the link onto its own line. */
.waiver-wp-check .waiver-wp-cb-text {
	display: inline !important;
	font-size: inherit !important;
	line-height: inherit !important;
}

.waiver-wp-check .waiver-wp-terms label,
.waiver-wp-check .waiver-wp-terms .waiver-wp-open {
	display: inline !important;
	margin: 0 !important;
	padding: 0 !important;
	float: none !important;
	font-size: inherit !important;
	font-weight: 400 !important;
	line-height: inherit !important;
	vertical-align: baseline !important;
}

.waiver-wp-check .waiver-wp-terms label {
	color: inherit;
}

/* Link keeps the theme link color; just sized to match and underlined. */
.waiver-wp-check .waiver-wp-open {
	cursor: pointer;
	text-decoration: underline;
	text-underline-offset: 2px;
}

/* Notice checkbox: sized to match the small text it sits beside */
.waiver-wp-checkbox {
	width: 14px;
	height: 14px;
	margin: 0 !important;
	flex: 0 0 auto;
	cursor: pointer;
}

/* ---------------------------------------------------------------------------
   Modal shell
--------------------------------------------------------------------------- */
.waiver-wp-modal {
	position: fixed;
	inset: 0;
	z-index: 99999;
	display: none;
}

.waiver-wp-modal.is-open {
	display: block;
}

.waiver-wp-modal__backdrop {
	position: absolute;
	inset: 0;
	background: rgba( 0, 0, 0, 0.55 );
	animation: waiver-fade 160ms ease-out;
}

.waiver-wp-modal__dialog {
	position: relative;
	z-index: 1;
	width: min( 640px, 92vw );
	max-height: 86vh;
	margin: 6vh auto 0;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 18px 50px rgba( 0, 0, 0, 0.35 );
	display: flex;
	flex-direction: column;
	overflow: hidden;
	transform-origin: center top;
	animation: waiver-pop 200ms cubic-bezier( 0.2, 0.8, 0.25, 1 );
}

@keyframes waiver-fade {
	from { opacity: 0; }
	to   { opacity: 1; }
}

@keyframes waiver-pop {
	from { opacity: 0; transform: translateY( 8px ) scale( 0.98 ); }
	to   { opacity: 1; transform: translateY( 0 ) scale( 1 ); }
}

/* Header */
.waiver-wp-modal__head {
	flex: 0 0 auto;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	padding: 16px 20px;
	border-bottom: 1px solid #e8e8e8;
	font-size: 1.05em;
}

/* EN/ID language toggle (segmented control in the footer, far left) */
.waiver-wp-langtoggle {
	display: inline-flex;
	margin-right: auto;
	border: 1px solid #d0d0d0;
	border-radius: 8px;
	overflow: hidden;
}

.waiver-wp-lang {
	min-width: 44px;
	min-height: 32px;
	padding: 4px 10px;
	background: #fff;
	border: 0;
	font-size: 0.85em;
	font-weight: 600;
	line-height: 1;
	color: #555;
	cursor: pointer;
	transition: background-color 150ms ease, color 150ms ease;
}

.waiver-wp-lang + .waiver-wp-lang {
	border-left: 1px solid #d0d0d0;
}

.waiver-wp-lang.is-active {
	background: #1f2d3d;
	color: #fff;
}

.waiver-wp-lang:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: -2px;
}

/* Only the active language body is shown */
.waiver-wp-langbody {
	display: none;
}

.waiver-wp-langbody.is-active {
	display: block;
}

.waiver-wp-governing {
	margin-top: 16px;
	font-style: italic;
	color: #555;
}

.waiver-wp-modal__x {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 44px;
	height: 44px;
	margin: -10px -10px -10px 0;
	background: none;
	border: 0;
	border-radius: 8px;
	font-size: 26px;
	line-height: 1;
	cursor: pointer;
	color: #666;
	transition: background-color 150ms ease, color 150ms ease;
}

.waiver-wp-modal__x:hover {
	background: #f1f1f1;
	color: #111;
}

/* Scrollable body — the part the customer must read.
   The inset bottom shadow is a scroll affordance: it hints there is more
   content below the fold until the reader reaches the end. */
.waiver-wp-modal__body {
	flex: 1 1 auto;
	overflow-y: auto;
	-webkit-overflow-scrolling: touch;
	scroll-behavior: smooth;
	padding: 20px;
	line-height: 1.6;
	box-shadow: inset 0 -22px 18px -18px rgba( 0, 0, 0, 0.14 );
}

.waiver-wp-modal__body p:first-child {
	margin-top: 0;
}

.waiver-wp-modal__body :where( h1, h2, h3, h4, strong ) {
	color: #111;
}

.waiver-wp-eof {
	height: 1px;
}

/* Optional typed-name field */
.waiver-wp-modal__name {
	flex: 0 0 auto;
	padding: 12px 20px 0;
}

.waiver-wp-modal__name input {
	display: block;
	width: 100%;
	margin-top: 6px;
	padding: 10px 12px;
	border: 1px solid #cfcfcf;
	border-radius: 8px;
}

/* Footer: agree row + actions */
.waiver-wp-modal__foot {
	flex: 0 0 auto;
	display: flex;
	flex-direction: column;
	gap: 12px;
	padding: 16px 20px;
	border-top: 1px solid #e8e8e8;
	background: #fafafa;
}

/* In-modal agree checkbox: lives at the END of the scrollable text, so it is
   only reachable after reading through the whole waiver. */
.waiver-wp-agree {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-top: 24px;
	padding-top: 16px;
	border-top: 1px solid #e8e8e8;
	font-weight: 600;
	cursor: pointer;
	user-select: none;
}

.waiver-wp-agree input {
	width: 18px;
	height: 18px;
	margin-top: 2px;
	flex: 0 0 auto;
	cursor: pointer;
}

.waiver-wp-modal__actions {
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 12px;
}

.waiver-wp-confirm {
	min-height: 44px;
	transition: opacity 180ms ease, filter 150ms ease;
}

.waiver-wp-confirm[disabled] {
	opacity: 0.45;
	cursor: not-allowed;
}

/* Visible keyboard focus on every interactive element */
.waiver-wp-open:focus-visible,
.waiver-wp-modal__x:focus-visible,
.waiver-wp-confirm:focus-visible,
.waiver-wp-agree input:focus-visible,
.waiver-wp-modal__name input:focus-visible,
.waiver-wp-modal__body:focus-visible {
	outline: 2px solid #2563eb;
	outline-offset: 2px;
	border-radius: 4px;
}

/* Prevent background scroll while modal open */
body.waiver-wp-lock {
	overflow: hidden;
}

/* Admin order screen block */
.waiver-wp-admin h3 {
	margin-bottom: 4px;
}

/* Respect users who prefer reduced motion */
@media ( prefers-reduced-motion: reduce ) {
	.waiver-wp-modal__backdrop,
	.waiver-wp-modal__dialog {
		animation: none;
	}

	.waiver-wp-modal__body {
		scroll-behavior: auto;
	}
}
