/**
 * Comparateur — habillage fonctionnel minimal.
 *
 * Le design final appartient à l'intégrateur (contrainte projet) : ce fichier
 * ne porte que ce sans quoi la fonctionnalité serait inutilisable — le tableau
 * lisible sur mobile, la barre visible, le bouton masqué sans JavaScript.
 */

.esc-compare--no-js .esc-compare-toggle {
	display: none !important;
}

.esc-compare-toggle {
	display: inline-flex;
	align-items: center;
	gap: 0.35em;
	background: none;
	border: 1px solid currentColor;
	border-radius: 3px;
	cursor: pointer;
	font-size: 0.85em;
	line-height: 1.4;
	padding: 0.35em 0.7em;
}

.esc-compare-toggle.is-active {
	background: currentColor;
}

.esc-compare-toggle.is-active .esc-compare-toggle__text {
	color: #fff;
	mix-blend-mode: difference;
}

/* ------------------------------------------------------------------ tableau */

.esc-compare__scroller {
	overflow-x: auto;
	-webkit-overflow-scrolling: touch;
}

.esc-compare__table {
	border-collapse: collapse;
	width: 100%;
}

.esc-compare__table th,
.esc-compare__table td {
	border: 1px solid rgba(0, 0, 0, 0.12);
	padding: 0.75em;
	text-align: left;
	vertical-align: top;
}

/* Colonne de libellés collante : sans elle, on ne sait plus quelle ligne on lit
   dès que le tableau défile horizontalement. */
.esc-compare__rowhead {
	background: #fff;
	left: 0;
	min-width: 9rem;
	position: sticky;
	z-index: 2;
}

.esc-compare__col {
	min-width: 12rem;
}

.esc-compare__product {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
	position: relative;
}

.esc-compare__thumb {
	height: auto;
	max-width: 100%;
}

.esc-compare__actions {
	display: flex;
	flex-direction: column;
	gap: 0.4em;
}

.esc-compare__stock--out {
	color: #b32d2e;
}

.esc-compare__stock--backorder {
	color: #996800;
}

.esc-compare__table.is-diff .esc-compare__row[data-identical="1"] {
	display: none;
}

@media (max-width: 782px) {
	.esc-compare__col {
		min-width: 40vw;
	}
}

/* --------------------------------------------------------------------- barre */

.esc-compare-bar {
	align-items: center;
	background: #fff;
	border-top: 1px solid rgba(0, 0, 0, 0.12);
	bottom: 0;
	box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.08);
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
	justify-content: space-between;
	left: 0;
	padding: 0.6em 1em;
	position: fixed;
	right: 0;
	z-index: 9999;
}

.esc-compare-bar[hidden] {
	display: none;
}

.esc-compare-bar__items {
	display: flex;
	flex-wrap: wrap;
	gap: 0.75em;
}

.esc-compare-bar__item {
	align-items: center;
	display: inline-flex;
	gap: 0.35em;
	max-width: 14rem;
}

.esc-compare-bar__item img {
	height: 40px;
	object-fit: cover;
	width: 40px;
}

.esc-compare-bar__name {
	font-size: 0.8em;
	overflow: hidden;
	text-overflow: ellipsis;
	white-space: nowrap;
}

.esc-compare-bar__actions {
	align-items: center;
	display: flex;
	gap: 0.75em;
}

.esc-compare-bar__compare.is-disabled {
	opacity: 0.5;
	pointer-events: none;
}

.esc-compare-remove {
	background: none;
	border: 0;
	cursor: pointer;
	font-size: 1.1em;
	line-height: 1;
	padding: 0 0.2em;
}

/* ------------------------------------------------------------------ messages */

.esc-compare-notice {
	background: #1d2327;
	border-radius: 3px;
	bottom: 6em;
	color: #fff;
	left: 50%;
	max-width: 90vw;
	opacity: 0;
	padding: 0.75em 1.25em;
	pointer-events: none;
	position: fixed;
	transform: translateX(-50%);
	transition: opacity 0.2s ease;
	z-index: 10000;
}

.esc-compare-notice.is-visible {
	opacity: 1;
}

.esc-compare__toolbar {
	align-items: center;
	display: flex;
	flex-wrap: wrap;
	gap: 1em;
	margin-bottom: 1em;
}

.esc-compare__toolbar[hidden] {
	display: none;
}

@media print {
	.esc-compare-bar,
	.esc-compare-notice,
	.esc-compare__toolbar,
	.esc-compare__actions,
	.esc-compare-remove {
		display: none !important;
	}
}
