/**
 * WooCommerce Product Builder widgets (sticky sidebar + compare).
 *
 * @since 2.4.3
 */

.ee-woo-sticky-sidebar {
	position: sticky;
	top: 20px;
	align-self: flex-start;
}

.ee-woo-sticky-sidebar--hc {
	position: relative;
	top: auto;
}

.ee-woo-sticky-sidebar__title + .ee-woo-sticky-sidebar__rating,
.ee-woo-sticky-sidebar__rating + .ee-woo-sticky-sidebar__price,
.ee-woo-sticky-sidebar__price + .ee-woo-sticky-sidebar__excerpt,
.ee-woo-sticky-sidebar__excerpt + .ee-woo-sticky-sidebar__cart,
.ee-woo-sticky-sidebar__cart + .ee-woo-sticky-sidebar__meta {
	margin-top: 0.75em;
}

@media (max-width: 767px) {
	.ee-woo-sticky-sidebar--mobile-off {
		position: static;
		top: auto;
	}
}

.ee-woo-compare-button {
	display: inline-flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.ee-woo-compare-button__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 1.5rem;
	height: 1.5rem;
	padding: 0 0.35rem;
	border-radius: 999px;
	background: #2271b1;
	color: #fff;
	font-size: 0.75rem;
	font-weight: 600;
	line-height: 1;
}

.ee-woo-compare-button__toggle[aria-pressed="true"] {
	opacity: 0.85;
}

.ee-woo-compare-button__view {
	/* Clears the 24px minimum in WCAG 2.5.8; at this type size the text alone is under it. */
	display: inline-flex;
	align-items: center;
	min-height: 24px;
	font-size: 0.875rem;
	text-decoration: underline;
}

.ee-woo-compare-table__actions {
	margin: 0 0 1rem;
}

.ee-woo-compare-table__scroll {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.ee-woo-compare-table__grid {
	width: 100%;
	border-collapse: collapse;
	min-width: 640px;
}

.ee-woo-compare-table__grid th,
.ee-woo-compare-table__grid td {
	border: 1px solid rgba(0, 0, 0, 0.08);
	padding: 0.75rem;
	vertical-align: top;
	text-align: left;
}

.ee-woo-compare-table__grid thead th {
	background: rgba(0, 0, 0, 0.03);
}

.ee-woo-compare-table__remove {
	float: right;
	/* A bare glyph button measures well under the 24px minimum in WCAG 2.5.8 on both axes,
	   so the box is floored at 24px square with the glyph centred inside it. */
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 24px;
	min-height: 24px;
	border: 0;
	background: transparent;
	font-size: 1.25rem;
	line-height: 1;
	cursor: pointer;
	color: inherit;
	padding: 0;
}

.ee-woo-compare-table__empty {
	margin: 0;
}

.ee-woo-compare-table.is-loading {
	opacity: 0.6;
	pointer-events: none;
}

/*
 * EE Related Products — Woo's default `.products.columns-N` reflow at small
 * viewports is theme-dependent (some themes drop to 1 column at ~600 px, some
 * stay at 4). Force a sensible baseline on phones so users always see 2 cards
 * side-by-side at <= 767 px and 1 full-width card at <= 480 px, regardless of
 * theme. Above 767 px the theme / Woo columns-N rule still applies.
 *
 * @since Premium 3.6.7
 */
@media (max-width: 767px) {
	.ee-woo-related-products .products {
		display: grid;
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 1rem;
	}
	.ee-woo-related-products .products li,
	.ee-woo-related-products .products .product {
		width: 100% !important;
		margin: 0 !important;
		float: none !important;
	}
}

@media (max-width: 480px) {
	.ee-woo-related-products .products {
		grid-template-columns: 1fr;
	}
}
