/* EZRA SHOP — Product Compare. RTL-aware, responsive. Accent via --ezra-compare-accent. */

:root {
	--ezra-compare-accent: #111;
}

/* ---------- Toggle: a switch + label (in the archive toolbar) ---------- */
.ezra-compare-toggle {
	display: inline-flex;
	align-items: center;
	gap: 9px;
	font-family: 'Assistant', sans-serif;
	font-size: 0.95rem;
	font-weight: 600;
	color: #111;
	background: none;
	border: 0;
	border-radius: 999px;
	padding: 7px 10px;
	cursor: pointer;
}
.ezra-compare-toggle:hover,
.ezra-compare-toggle:focus,
.ezra-compare-toggle:active {
	background: none; /* no theme pink on any state */
	color: #111;
	outline: none;
}
.ezra-compare-switch {
	position: relative;
	width: 40px;
	height: 23px;
	border-radius: 999px;
	background: #d4d4d4;
	transition: background 0.2s ease;
	flex: 0 0 auto;
	direction: ltr; /* knob left = off, right = on (like the reference) */
}
.ezra-compare-switch::after {
	content: "";
	position: absolute;
	top: 2.5px;
	left: 2.5px;
	width: 18px;
	height: 18px;
	border-radius: 50%;
	background: #fff;
	box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
	transition: left 0.2s ease;
}
body.ezra-compare-active .ezra-compare-switch {
	background: var(--ezra-compare-accent);
}
body.ezra-compare-active .ezra-compare-switch::after {
	left: 19.5px;
}

/* ---------- Per-product round checkbox (hidden until compare mode) ---------- */
.ezra-compare-cb {
	display: none;
}
body.ezra-compare-active .ezra-compare-cb {
	display: inline-flex;
	align-items: center;
	cursor: pointer;
	/* Stay INSIDE the card's visual layer: a high z-index here used to float the
	   checkboxes over the sticky toolbar text and the Elementor menu on scroll. */
	z-index: 6;
}
/* Auto-injected onto each product card (no Loop Item shortcode needed).
   Sits to the RIGHT of the wishlist heart (heart owns the corner at left:12) —
   they used to share the exact same spot and the checkbox hid the heart. */
.ezra-compare-cb--auto {
	position: absolute;
	top: 12px;
	left: 52px;
	z-index: 6;
}
.ezra-compare-cb input {
	position: absolute;
	opacity: 0;
	pointer-events: none;
}
.ezra-compare-box {
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #ececec; /* light gray */
	border: 1.5px solid #111; /* subtle black border */
	position: relative;
	transition: background 0.12s ease;
	box-shadow: 0 1px 4px rgba(0, 0, 0, 0.15);
}
.ezra-compare-cb input:checked + .ezra-compare-box {
	background: var(--ezra-compare-accent);
	border-color: var(--ezra-compare-accent);
}
.ezra-compare-cb input:checked + .ezra-compare-box::after {
	content: "";
	position: absolute;
	top: 5px;
	inset-inline-start: 8px;
	width: 5px;
	height: 10px;
	border-right: 2px solid #fff;
	border-bottom: 2px solid #fff;
	transform: rotate(45deg);
}

/* ---------- Sticky bottom bar ---------- */
.ezra-compare-bar {
	position: fixed;
	bottom: 0;
	inset-inline: 0;
	z-index: 100000;
	background: #fff;
	box-shadow: 0 -4px 24px rgba(0, 0, 0, 0.12);
	padding: 12px 18px;
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	flex-wrap: wrap;
	font-family: 'Assistant', sans-serif;
}
.ezra-compare-bar[hidden] {
	display: none;
}
.ezra-compare-items {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}
.ezra-compare-item {
	position: relative;
	width: 56px;
	height: 56px;
	border: 1px solid #e6e6e6;
	border-radius: 8px;
	overflow: hidden;
	background: #f7f7f7;
}
.ezra-compare-item img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}
.ezra-compare-item-remove {
	position: absolute;
	top: -1px;
	inset-inline-end: -1px;
	width: 18px;
	height: 18px;
	line-height: 16px;
	text-align: center;
	background: #111;
	color: #fff;
	border: 0;
	border-radius: 0 0 0 8px;
	cursor: pointer;
	font-size: 12px;
	padding: 0;
}
.ezra-compare-bar-actions {
	display: flex;
	align-items: center;
	gap: 12px;
}
.ezra-compare-go {
	font-family: inherit;
	font-size: 0.95rem;
	font-weight: 700;
	color: #fff;
	background: var(--ezra-compare-accent);
	border: 0;
	border-radius: 999px;
	padding: 11px 26px;
	cursor: pointer;
}
.ezra-compare-clear {
	font-family: inherit;
	font-size: 0.9rem;
	background: none;
	border: 0;
	color: #111;
	text-decoration: underline;
	cursor: pointer;
	opacity: 0.7;
}
.ezra-compare-clear:hover {
	opacity: 1;
}

/* Inline "up to N products" notice (replaces the browser alert) */
.ezra-compare-max {
	position: fixed;
	bottom: 96px;
	left: 50%;
	transform: translate(-50%, 12px);
	z-index: 100003;
	background: #111;
	color: #fff;
	font-family: 'Assistant', sans-serif;
	font-size: 0.9rem;
	font-weight: 600;
	padding: 11px 20px;
	border-radius: 999px;
	box-shadow: 0 8px 24px rgba(0, 0, 0, 0.25);
	opacity: 0;
	transition: opacity 0.3s ease, transform 0.3s ease;
	pointer-events: none;
}
.ezra-compare-max.is-visible {
	opacity: 1;
	transform: translate(-50%, 0);
}

/* ---------- Popup ---------- */
.ezra-compare-modal {
	position: fixed;
	inset: 0;
	z-index: 100001;
	display: flex;
	align-items: center;
	justify-content: center;
}
.ezra-compare-modal[hidden] {
	display: none;
}
.ezra-compare-overlay {
	position: absolute;
	inset: 0;
	background: rgba(0, 0, 0, 0.5);
}
.ezra-compare-dialog {
	position: relative;
	background: #fff;
	border-radius: 18px;
	width: min(940px, 94vw);
	max-height: 88vh;
	overflow: auto;
	padding: 26px 24px;
	font-family: 'Assistant', sans-serif;
}
.ezra-compare-close {
	position: absolute;
	top: 14px;
	inset-inline-start: 18px;
	background: none;
	border: 0;
	font-size: 30px;
	line-height: 1;
	cursor: pointer;
	color: #111;
}
.ezra-compare-heading {
	text-align: center;
	margin: 0 0 22px;
	font-size: 1.5rem;
	font-weight: 800;
	color: #111;
}

/* ---------- Table ---------- */
.ezra-compare-table {
	width: 100%;
	border-collapse: collapse;
}
.ezra-compare-table th,
.ezra-compare-table td {
	padding: 16px 14px;
	border-bottom: 1px solid #eee;
	text-align: center;
	vertical-align: top;
	color: #111;
	font-size: 0.92rem;
	line-height: 1.5;
}
.ezra-compare-table tbody th {
	text-align: start;
	font-weight: 700;
	background: #fafafa;
	white-space: nowrap;
}
.ezra-compare-col {
	position: relative;
	min-width: 160px;
}
.ezra-compare-img img {
	max-width: 130px;
	height: auto;
	border-radius: 10px;
}
.ezra-compare-name {
	font-weight: 700;
	margin: 10px 0;
	line-height: 1.35;
}
.ezra-compare-link {
	display: inline-block;
	background: #111;
	color: #fff;
	padding: 8px 18px;
	border-radius: 8px;
	font-weight: 700;
	font-size: 0.85rem;
	text-decoration: none;
}
.ezra-compare-link:hover {
	color: #fff;
	opacity: 0.9;
}
.ezra-compare-remove {
	position: absolute;
	top: 2px;
	inset-inline-start: 2px;
	width: 26px;
	height: 26px;
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 6px;
	font-size: 16px;
	line-height: 1;
	cursor: pointer;
	color: #111;
}

@media (max-width: 600px) {
	.ezra-compare-dialog {
		padding: 20px 14px;
	}
	.ezra-compare-table th,
	.ezra-compare-table td {
		padding: 12px 8px;
		font-size: 0.85rem;
	}
	.ezra-compare-col {
		min-width: 120px;
	}
	.ezra-compare-img img {
		max-width: 90px;
	}
	.ezra-compare-bar {
		padding: 10px 12px;
	}
	.ezra-compare-go {
		padding: 10px 18px;
	}
}
