/* Cart Relay v1.3.0 - Module 3: grid-enhance overlay, styled to blend with
   the n9d Supreme-mono LIGHT grid: white surfaces, 1px #111 hairlines, no
   radius anywhere, font inherited from the theme. Override surface (same vars
   as the quick-shop module):
     --cartrelay-border   hairline color        (default #111)
     --cartrelay-btn-bg   solid button fill     (default #111)
     --cartrelay-btn-fg   solid button text     (default #fff)
   !important on button background / color / border / radius - Elementor
   global element styles out-rank plain class rules. Added flip = inverted
   button. Errors = bold text, no red. */

.cartrelay-ge-bar,
.cartrelay-ge-panel,
.cartrelay-ge-media {
	--cr-ge-border: var(--cartrelay-border, #111);
	--cr-ge-btn-bg: var(--cartrelay-btn-bg, #111);
	--cr-ge-btn-fg: var(--cartrelay-btn-fg, #fff);
	font-family: inherit;
	color: inherit;
	box-sizing: border-box;
}

.cartrelay-ge-bar *,
.cartrelay-ge-panel *,
.cartrelay-ge-media * {
	box-sizing: border-box;
	font-family: inherit;
}

/* ---------- media wrapper: video preview + badge overlay ---------- */

/* Wraps the card's existing img in place (inside its link), so sizing keeps
   following the builder's own image rules. */
.cartrelay-ge-media {
	position: relative;
	display: block;
	overflow: hidden;
}

.cartrelay-ge-media img {
	display: block;
	max-width: 100%;
}

.cartrelay-ge-video {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	opacity: 0;
	transition: opacity 0.25s ease;
	pointer-events: none; /* clicks fall through to the product link */
}

.cartrelay-ge-media.cartrelay-ge-playing .cartrelay-ge-video {
	opacity: 1;
}

.cartrelay-ge-badge {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	padding: 3px 7px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: #111;
	background: #fff;
	border: 1px solid var(--cr-ge-border);
	pointer-events: none;
}

/* ---------- control bar (appended at the bottom of each card) ---------- */

.cartrelay-ge-bar {
	display: flex;
	align-items: stretch;
	gap: 8px;
	width: 100%;
	margin-top: 8px;
	padding: 10px 0 0;
	background: #fff;
	border-top: 1px solid var(--cr-ge-border);
}

/* Boxed stepper: minus / qty / plus. */
.cartrelay-ge-step {
	display: flex;
	align-items: stretch;
	flex: none;
	background: #fff;
	border: 1px solid var(--cr-ge-border);
	border-radius: 0;
}

.cartrelay-ge-step button {
	width: 28px;
	margin: 0;
	padding: 0;
	font: inherit;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	cursor: pointer;
	color: #111 !important;
	background: none !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.cartrelay-ge-step button:focus-visible {
	outline: 2px solid var(--cr-ge-border);
	outline-offset: -2px;
}

.cartrelay-ge-qty {
	width: 28px;
	align-self: center;
	padding: 7px 0;
	font-size: 12px;
	text-align: center;
	font-variant-numeric: tabular-nums;
	border-left: 1px solid var(--cr-ge-border);
	border-right: 1px solid var(--cr-ge-border);
}

/* Solid Add button. !important on bg/color/border/radius - Elementor globals
   fight back. */
.cartrelay-ge-add {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	min-height: 34px;
	margin: 0;
	padding: 0 14px;
	font: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	line-height: normal;
	white-space: nowrap;
	cursor: pointer;
	color: var(--cr-ge-btn-fg) !important;
	background: var(--cr-ge-btn-bg) !important;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.cartrelay-ge-add:hover:not(:disabled) {
	opacity: 0.85;
}

.cartrelay-ge-add:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

.cartrelay-ge-add:focus-visible {
	outline: 2px solid var(--cr-ge-border);
	outline-offset: 2px;
}

/* "Added xN" flip: inverted button, outline keeps the edge visible on white. */
.cartrelay-ge-add.cartrelay-ge-flipped {
	color: var(--cr-ge-btn-bg) !important;
	background: var(--cr-ge-btn-fg) !important;
	outline: 1px solid var(--cr-ge-border);
	outline-offset: -1px;
}

/* Options toggle: outlined twin of Add; inverts while the panel is open. */
.cartrelay-ge-options {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex: 1;
	min-height: 34px;
	margin: 0;
	padding: 0 14px;
	font: inherit;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	line-height: normal;
	white-space: nowrap;
	cursor: pointer;
	color: var(--cr-ge-btn-bg) !important;
	background: var(--cr-ge-btn-fg) !important;
	border: 1px solid var(--cr-ge-border) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.cartrelay-ge-options:hover {
	opacity: 0.85;
}

.cartrelay-ge-options:focus-visible {
	outline: 2px solid var(--cr-ge-border);
	outline-offset: 2px;
}

.cartrelay-ge-options[aria-expanded="true"] {
	color: var(--cr-ge-btn-fg) !important;
	background: var(--cr-ge-btn-bg) !important;
}

/* Out-of-stock: static label, no controls. */
.cartrelay-ge-soldout {
	display: inline-block;
	padding: 8px 0;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.1em;
	text-transform: uppercase;
	opacity: 0.55;
}

/* ---------- inline options panel (variable products) ---------- */

.cartrelay-ge-panel {
	display: none;
	width: 100%;
	margin-top: 8px;
	padding: 10px;
	color: #111 !important;
	background: #fff !important;
	border: 1px solid var(--cr-ge-border) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
	text-align: left;
}

.cartrelay-ge-panel.cartrelay-ge-open {
	display: block;
}

.cartrelay-ge-attr {
	display: block;
	width: 100%;
	margin: 0 0 8px;
	float: none;
}

.cartrelay-ge-attr-label {
	display: block;
	margin: 0 0 3px;
	font-size: 10px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	opacity: 0.7;
}

/* Minimal selects: 1px hairline, no radius, native arrow kept. */
.cartrelay-ge-select {
	display: block;
	width: 100%;
	margin: 0;
	padding: 7px 8px;
	font: inherit;
	font-size: 12px;
	line-height: 1.4;
	color: #111 !important;
	background-color: #fff !important;
	border: 1px solid var(--cr-ge-border) !important;
	border-radius: 0 !important;
	box-shadow: none !important;
}

.cartrelay-ge-select:focus-visible {
	outline: 2px solid var(--cr-ge-border);
	outline-offset: 1px;
}

.cartrelay-ge-price {
	margin: 2px 0 8px;
	font-size: 13px;
	font-weight: 800;
	font-variant-numeric: tabular-nums;
}

.cartrelay-ge-price del {
	opacity: 0.5;
	font-weight: 400;
}

.cartrelay-ge-price ins {
	text-decoration: none;
	background: none;
}

.cartrelay-ge-panel-row {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
}

.cartrelay-ge-panel-row .cartrelay-ge-step,
.cartrelay-ge-panel-row .cartrelay-ge-add {
	align-self: center;
	height: auto;
}

/* Woo injects its own "View cart" link after an AJAX add; our button
   already confirms the add, so the raw theme link never renders here. */
.cartrelay-ge-bar .added_to_cart,
.cartrelay-ge-panel .added_to_cart {
	display: none !important;
}

/* Failure text near the button: bold, no red (module convention). */
.cartrelay-ge-msg {
	align-self: center;
	font-size: 11px;
	line-height: 1.4;
}

.cartrelay-ge-msg.cartrelay-ge-error {
	display: block;
	font-weight: 700;
}

.cartrelay-ge-panel .cartrelay-ge-msg.cartrelay-ge-error {
	margin-top: 8px;
}

@media (prefers-reduced-motion: reduce) {
	.cartrelay-ge-video,
	.cartrelay-ge-bar *,
	.cartrelay-ge-panel * {
		transition: none !important;
		animation: none !important;
	}
}
