/**
 * t479u 2026-11-09 — checkout/cart sticky sidebar, coupon placement.
 * Does not touch Atomic/Geo widget styles or global classes.
 */

/* -------------------------------------------------------------------------
 * 1. Sticky sidebar: remove transform containing-block that breaks fixed.
 * Theme centers .woocommerce with left:50% + translateX(-50%). That makes
 * position:fixed descendants resolve against the transformed box, so the JS
 * fallback (rw-summary-is-fixed + left: sidebarRect.left) jumps to the far
 * right of the viewport. Prefer auto margins; keep sticky, disable fixed.
 * ---------------------------------------------------------------------- */
body.rw-commerce-page .woocommerce {
	left: auto !important;
	transform: none !important;
	margin-left: auto !important;
	margin-right: auto !important;
	width: min(1200px, calc(100vw - 48px)) !important;
}

/* Prefer native sticky; never use the fixed/bottomed JS states. */
@media (min-width: 981px) {
	body.rw-checkout-page .rw-checkout-layout__summary,
	body.rw-checkout-page .rw-checkout-layout__summary.rw-summary-is-fixed,
	body.rw-checkout-page .rw-checkout-layout__summary.rw-summary-is-bottomed,
	body.rw-cart-page .rw-cart-layout__summary,
	body.rw-cart-page .rw-cart-layout__summary.rw-summary-is-fixed,
	body.rw-cart-page .rw-cart-layout__summary.rw-summary-is-bottomed {
		position: sticky !important;
		top: 24px !important;
		right: auto !important;
		bottom: auto !important;
		left: auto !important;
		width: 100% !important;
		margin: 0 !important;
	}

	body.admin-bar.rw-checkout-page .rw-checkout-layout__summary,
	body.admin-bar.rw-checkout-page .rw-checkout-layout__summary.rw-summary-is-fixed,
	body.admin-bar.rw-cart-page .rw-cart-layout__summary,
	body.admin-bar.rw-cart-page .rw-cart-layout__summary.rw-summary-is-fixed {
		top: 56px !important;
	}

	/* Sidebar must stretch with the main column so sticky has travel room.
	 * align-self:start made the sidebar ~content-height and the summary scrolled away. */
	body.rw-checkout-page .rw-checkout-layout__sidebar,
	body.rw-cart-page .rw-cart-layout__sidebar {
		position: relative !important;
		align-self: stretch !important;
		height: auto !important;
		min-height: 100% !important;
		min-width: 0 !important;
		width: 100% !important;
	}
}

@media (max-width: 980px) {
	body.rw-checkout-page .rw-checkout-layout__summary,
	body.rw-cart-page .rw-cart-layout__summary,
	body.rw-checkout-page .rw-checkout-layout__summary.rw-summary-is-fixed,
	body.rw-cart-page .rw-cart-layout__summary.rw-summary-is-fixed,
	body.rw-checkout-page .rw-checkout-layout__summary.rw-summary-is-bottomed,
	body.rw-cart-page .rw-cart-layout__summary.rw-summary-is-bottomed {
		position: static !important;
		top: auto !important;
		left: auto !important;
		right: auto !important;
		width: 100% !important;
	}
}

/* -------------------------------------------------------------------------
 * 2. Coupon: hide the top "Have a coupon?" notice (Baymard / our article).
 * Collapsed promo UI is injected into the order summary by the PHP mu-plugin.
 * ---------------------------------------------------------------------- */
body.rw-checkout-page .woocommerce-form-coupon-toggle,
body.rw-checkout-page form.checkout_coupon.woocommerce-form-coupon {
	display: none !important;
}

/* Cart coupon row: keep usable, prefer trailing alignment in the actions grid. */
body.rw-cart-page .rw-cart-actions-row .coupon {
	justify-self: end;
	width: min(100%, 420px);
	margin-left: auto;
}

/* Promo block: right-aligned link; expanded panel full width of the summary. */
.rw-summary-promo-row > td {
	text-align: right !important;
}

.rw-summary-promo {
	display: block;
	width: 100%;
	margin: 14px 0 0;
	padding: 0;
	border: 0;
	text-align: right;
}

.rw-summary-promo__toggle,
.rw-summary-promo__toggle:hover,
.rw-summary-promo__toggle:focus,
.rw-summary-promo__toggle:focus-visible,
.rw-summary-promo__toggle:active,
.rw-summary-promo.is-open .rw-summary-promo__toggle {
	display: inline-block !important;
	width: auto !important;
	max-width: 100% !important;
	min-height: 0 !important;
	margin: 0 0 0 auto !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	background-image: none !important;
	box-shadow: none !important;
	color: #5b6270 !important;
	font: inherit !important;
	font-size: 13px !important;
	font-weight: 400 !important;
	line-height: 1.4 !important;
	letter-spacing: 0 !important;
	text-decoration: underline !important;
	text-transform: none !important;
	cursor: pointer;
	text-align: right !important;
	appearance: none !important;
	-webkit-appearance: none !important;
	transform: none !important;
}

.rw-summary-promo__toggle:hover,
.rw-summary-promo__toggle:focus-visible {
	color: #11121a !important;
}

.rw-summary-promo__panel {
	display: none;
	margin-top: 10px;
	margin-left: auto;
	width: 100%;
	text-align: left; /* inputs read LTR; container stays full-width under the right-aligned link */
}

.rw-summary-promo.is-open .rw-summary-promo__panel {
	display: grid !important;
	grid-template-columns: minmax(0, 1fr) auto;
	gap: 8px;
	align-items: stretch;
	box-sizing: border-box;
	width: 100% !important;
	max-width: 100% !important;
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.rw-summary-promo__panel label {
	position: absolute;
	width: 1px;
	height: 1px;
	padding: 0;
	margin: -1px;
	overflow: hidden;
	clip: rect(0, 0, 0, 0);
	white-space: nowrap;
	border: 0;
}

.rw-summary-promo__panel input[type="text"] {
	box-sizing: border-box;
	width: 100%;
	min-height: 42px;
	margin: 0;
	padding: 10px 12px;
	border: 1px solid #e2e5eb;
	border-radius: 8px;
	background: #fff;
	font-size: 14px;
}

.rw-summary-promo__panel button,
.rw-summary-promo__panel button.rw-summary-promo__apply,
.rw-summary-promo__panel .rw-summary-promo__apply {
	box-sizing: border-box !important;
	display: inline-flex !important;
	align-items: center !important;
	justify-content: center !important;
	width: auto !important;
	min-width: 72px !important;
	min-height: 42px !important;
	margin: 0 !important;
	padding: 10px 14px !important;
	border: 1px solid #e2e5eb !important;
	border-radius: 8px !important;
	background: #fff !important;
	background-image: none !important;
	box-shadow: none !important;
	color: #11121a !important;
	font-size: 13px !important;
	font-weight: 600 !important;
	line-height: 1.2 !important;
	text-decoration: none !important;
	text-transform: none !important;
	cursor: pointer;
	white-space: nowrap !important;
	transform: none !important;
}

.rw-summary-promo__panel button:hover,
.rw-summary-promo__panel .rw-summary-promo__apply:hover {
	background: #f5f6f8 !important;
	background-image: none !important;
	color: #11121a !important;
}

.rw-summary-promo__msg {
	grid-column: 1 / -1;
	margin: 4px 0 0;
	font-size: 12px;
	color: #5b6270;
	text-align: right;
}

.rw-summary-promo__msg.is-error {
	color: #b42318;
}

.rw-summary-promo__msg.is-success {
	color: #067647;
}

/* Service website field: keep visible and distinct from licence domain. */
body.rw-checkout-page .rw-service-domain-field,
body.rw-checkout-page #reactwoo_domain_field {
	display: block !important;
	visibility: visible !important;
	margin-top: 12px;
}

body.rw-checkout-page .rw-service-website-cue {
	margin: 8px 0 4px;
	padding: 10px 12px;
	border-radius: 8px;
	background: #f3f0ff;
	color: #11121a;
	font-size: 13px;
	line-height: 1.45;
}
