/* ====================================================================
 * Vehicle Comparator — styles
 * Variables surchargeables dans le thème (ex. :root { --vc-accent: ... })
 * ================================================================== */

:root {
	--vc-accent: var(--main-color);
	--vc-accent-contrast: #ffffff;
	--vc-bg: #ffffff;
	--vc-border: #e2e4e8;
	--vc-text: #1a1a1a;
	--vc-muted: #6b7280;
	--vc-radius: 8px;
	--vc-shadow: 0 -2px 16px rgba(0, 0, 0, 0.12);
}

.vc-add-btn{
	cursor: pointer;
}

.vc-add-btn i{
	font-size: 14px;
}

/* ----- Icônes STM dans le bouton ----- */
/* Par défaut (état actif au repos) : on montre "added" + "Ajouté",
   on cache l'icône et le label "remove". */
.vc-add-btn.is-active .stm-icon-remove{
	display: none;
}

/* Au survol d'un bouton actif : on bascule vers "remove" + "Retirer". */
.vc-add-btn.is-active:hover .stm-unhover,
.vc-add-btn.is-active:hover .vc-label--unhover {
	display: none;
}

.vc-add-btn.is-active:hover .stm-icon-remove {
	display: inline-flex;
}

.vc-add-btn.is-active:hover .vc-label--hover {
	display: inline;
}

/* ---------- Barre flottante ---------- */

.vc-bar {
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9999;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 0.75rem;
	padding: 0.75rem 1rem;
	background: var(--vc-bg);
	border-top: 1px solid var(--vc-border);
	box-shadow: var(--vc-shadow);
	color: var(--vc-text);
}

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

.vc-bar__items {
	display: flex;
	flex-wrap: wrap;
	gap: 0.5rem;
}

.vc-bar__item {
	display: flex;
	align-items: center;
	gap: 0.5rem;
	padding: 0.3rem 0.5rem;
	background: rgba(0, 0, 0, 0.04);
	border-radius: var(--vc-radius);
	max-width: 220px;
}

.vc-bar__item img {
	width: 34px;
	height: 34px;
	object-fit: cover;
	border-radius: 4px;
	flex: 0 0 auto;
}

.vc-bar__title {
	font-size: 0.85rem;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	width: 25ch;
}

.vc-bar__remove,
.vc-remove-col {
	border: 0;
	background: transparent;
	color: var(--vc-muted) !important;
	font-size: 1.1rem;
	line-height: 1;
	cursor: pointer;
	padding: 0 0.2em;
	border: none !important;
    box-shadow: none !important;
}

.vc-bar__remove:hover,
.vc-remove-col:hover {
	color: #c0392b;
}

.vc-bar__actions {
	display: flex;
	align-items: center;
	gap: 0.5rem;
}

.vc-bar__compare {
	display: inline-block;
	padding: 0.6em 1.2em;
	font-weight: 600;
	text-decoration: none;
	color: var(--vc-accent-contrast) !important;
	background: var(--vc-accent);
	border: 0;
	border-radius: var(--vc-radius);
	cursor: pointer;
}

.vc-bar__compare[disabled] {
	opacity: 0.5;
	cursor: not-allowed;
}

.vc-bar__clear {
	border: 0;
	background: transparent;
	color: var(--vc-muted) !important;
	text-decoration: underline;
	cursor: pointer;
	font-size: 0.85rem;
}

/* ---------- Tableau comparatif ---------- */

.vc-comparator {
	margin: 1.5rem 0;
}

.vc-table-wrap {
	overflow-x: auto;
}

.vc-table {
	width: 100%;
	border-collapse: collapse;
	min-width: 480px;
	color: var(--vc-text);
}

.vc-table th,
.vc-table td {
	padding: 0.75rem 1rem;
	border: 1px solid var(--vc-border);
	text-align: left;
	vertical-align: middle;
}

.vc-table tbody th[scope='row'] {
	background: rgba(0, 0, 0, 0.03);
	font-weight: 600;
	white-space: nowrap;
}

.vc-table tbody tr:nth-child(even) td {
	background: rgba(0, 0, 0, 0.015);
}

.vc-col-head {
	text-align: center;
	background: rgba(0, 0, 0, 0.02);
}

.vc-th {
	display: flex;
	flex-direction: column;
	align-items: center;
	gap: 0.4rem;
	position: relative;
}

.vc-th img {
	width: 100%;
	max-width: 140px;
	aspect-ratio: 4 / 3;
	object-fit: cover;
	border-radius: var(--vc-radius);
}

.vc-th__title {
	font-weight: 700;
	text-align: center;
	text-decoration: none;
	color: var(--vc-accent);
}

.vc-remove-col {
	position: absolute;
	top: -0.25rem;
	right: -0.25rem;
	font-size: 1.25rem;
}

.vc-empty,
.vc-loading {
	color: var(--vc-muted);
	font-style: italic;
	padding: 1rem 0;
}

@media (max-width: 600px) {
	.vc-bar {
		flex-direction: column;
		align-items: stretch;
	}
	.vc-bar__item {
		max-width: none;
	}
}