/* SoriaVie – Produits liés : barre collée en bas de l'écran sur les articles. */

.svpl {
	--svpl-accent: var(--main-color, #23803f);
	--svpl-accent-dark: #1a5e2e;
	--svpl-pv: 1.5;          /* nombre de produits visibles (mobile) */
	--svpl-gap: 10px;
	--svpl-img: 56px;
	position: fixed;
	left: 0;
	right: 0;
	bottom: 0;
	z-index: 9990;
	background: #fff;
	color: #222;
	border-top: 3px solid var(--svpl-accent);
	box-shadow: 0 -4px 18px rgba(0, 0, 0, .12);
	font-size: 14px;
	line-height: 1.3;
	padding-bottom: env(safe-area-inset-bottom, 0);
	transform: translateY(115%);
	transition: transform .3s ease;
}
.svpl.is-visible { transform: none; }
.svpl[hidden] { display: none !important; }

.svpl *, .svpl *::before, .svpl *::after { box-sizing: border-box; }

/* Remise à zéro des styles de boutons du thème */
.svpl button {
	background: none;
	border: 0;
	border-radius: 0;
	box-shadow: none;
	margin: 0;
	padding: 0;
	min-height: 0;
	min-width: 0;
	width: auto;
	height: auto;
	font: inherit;
	line-height: inherit;
	letter-spacing: normal;
	text-transform: none;
	color: inherit;
	cursor: pointer;
}
.svpl button:focus-visible,
.svpl a:focus-visible { outline: 2px solid var(--svpl-accent); outline-offset: 2px; }

.svpl__inner { max-width: 1240px; margin: 0 auto; padding: 0 10px; }

/* ---- En-tête (toujours visible) ---- */
.svpl__head { display: flex; align-items: center; gap: 6px; height: 46px; }
.svpl .svpl__toggle {
	flex: 1 1 auto;
	display: flex;
	align-items: center;
	gap: 10px;
	height: 100%;
	text-align: left;
	min-width: 0;
}
.svpl__thumbs { display: flex; flex: 0 0 auto; padding-left: 8px; }
.svpl__thumbs img {
	width: 32px !important;
	height: 32px !important;
	object-fit: contain;
	border-radius: 50%;
	background: #fff;
	border: 2px solid #fff;
	box-shadow: 0 0 0 1px #e2e2e2;
	margin: 0 0 0 -8px !important;
}
.svpl__label { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.svpl__title { font-weight: 700; }
.svpl__count { color: #666; margin-left: 2px; }
.svpl__chev {
	flex: 0 0 auto;
	width: 9px;
	height: 9px;
	margin: 0 6px;
	border-left: 2px solid currentColor;
	border-top: 2px solid currentColor;
	transform: translateY(2px) rotate(45deg);   /* pointe vers le haut = « ouvrir » */
	transition: transform .2s ease;
}
.svpl.is-open .svpl__chev { transform: translateY(-2px) rotate(225deg); }
.svpl .svpl__close {
	flex: 0 0 40px;
	width: 40px;
	height: 40px;
	font-size: 26px;
	line-height: 40px;
	text-align: center;
	color: #777;
}
.svpl .svpl__close:hover { color: #222; }
.screen-reader-text.svpl__sr-toggle {
	position: absolute !important;
	width: 1px; height: 1px; overflow: hidden;
	clip: rect(1px, 1px, 1px, 1px); white-space: nowrap;
}

/* ---- Panneau des produits (ouvert) ---- */
.svpl__panel { display: none; align-items: center; gap: 6px; padding: 0 0 10px; min-width: 0; }
.svpl.is-open .svpl__panel { display: flex; }
.svpl.is-open .svpl__thumbs { display: none; }

.svpl__track {
	flex: 1 1 auto;
	display: flex;
	gap: var(--svpl-gap);
	margin: 0 !important;
	padding: 2px !important;
	list-style: none !important;
	overflow-x: auto;
	overflow-y: hidden;
	scroll-snap-type: x mandatory;
	scroll-behavior: smooth;
	overscroll-behavior-x: contain;
	-webkit-overflow-scrolling: touch;
	scrollbar-width: none;
	min-width: 0;
}
.svpl__track::-webkit-scrollbar { display: none; }

.svpl__card {
	flex: 0 0 calc((100% - var(--svpl-gap) * (var(--svpl-pv) - 1)) / var(--svpl-pv));
	scroll-snap-align: start;
	display: flex;
	align-items: center;
	gap: 10px;
	margin: 0 !important;
	padding: 7px 8px !important;
	border: 1px solid #e8e8e8;
	border-radius: 8px;
	background: #fff;
	min-width: 0;
}
.svpl__card::before { display: none !important; }
.svpl__img { flex: 0 0 var(--svpl-img); display: block; }
.svpl__img img {
	display: block;
	width: var(--svpl-img) !important;
	height: var(--svpl-img) !important;
	object-fit: contain;
	margin: 0 !important;
}
.svpl__body { display: flex; flex-direction: column; gap: 2px; min-width: 0; flex: 1 1 auto; }
.svpl__name {
	font-weight: 600;
	font-size: 13px;
	line-height: 1.25;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}
.svpl__price { font-size: 13px; font-weight: 700; color: var(--svpl-accent); }
.svpl__price del { color: #999; font-weight: 400; margin-right: 4px; }
.svpl__price ins { text-decoration: none; }
.svpl__actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 2px; }

.svpl a.svpl__link {
	font-size: 13px;
	font-weight: 600;
	color: var(--svpl-accent);
	text-decoration: underline;
	text-underline-offset: 2px;
	white-space: nowrap;
}
.svpl a.svpl__link:hover { color: var(--svpl-accent-dark); }

/* Bulle panier (sans texte) */
.svpl a.svpl__cart,
.svpl a.svpl__cart.add_to_cart_button {
	position: relative;
	flex: 0 0 34px;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	min-width: 0;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 50%;
	background: var(--svpl-accent);
	color: #fff;
	font-size: 0;
	line-height: 0;
	text-indent: 0;
	box-shadow: none;
	transition: background .2s ease, transform .2s ease;
}
.svpl a.svpl__cart::before { content: none !important; display: none !important; }
.svpl a.svpl__cart:hover { background: var(--svpl-accent-dark); color: #fff; transform: scale(1.06); }
.svpl a.svpl__cart svg { width: 18px; height: 18px; }
.svpl a.svpl__cart.loading { opacity: .55; pointer-events: none; }
.svpl a.svpl__cart.added::after {
	content: "✓";
	position: absolute;
	top: -4px;
	right: -4px;
	width: 16px;
	height: 16px;
	border-radius: 50%;
	background: #fff;
	color: var(--svpl-accent);
	border: 1px solid var(--svpl-accent);
	font-size: 11px;
	line-height: 14px;
	font-weight: 700;
	text-align: center;
}
.svpl .added_to_cart { display: none !important; }   /* lien « Voir le panier » ajouté par WooCommerce */

/* Flèches */
.svpl .svpl__nav {
	flex: 0 0 32px;
	width: 32px;
	height: 32px;
	border: 1px solid #dcdcdc;
	border-radius: 50%;
	background: #fff;
	position: relative;
	display: none;
}
.svpl .svpl__nav::before {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 8px;
	height: 8px;
	border-left: 2px solid #444;
	border-bottom: 2px solid #444;
	transform: translate(-30%, -50%) rotate(45deg);
}
.svpl .svpl__nav--next::before { transform: translate(-70%, -50%) rotate(-135deg); }
.svpl .svpl__nav:hover:not(:disabled) { border-color: var(--svpl-accent); }
.svpl .svpl__nav:disabled { opacity: .3; cursor: default; }
.svpl.no-overflow .svpl__nav { visibility: hidden; }

/* ---- Tablette ---- */
@media (min-width: 768px) {
	.svpl { --svpl-pv: 2.5; --svpl-img: 60px; }
	.svpl .svpl__nav { display: block; }
}

/* ---- PC ---- */
@media (min-width: 992px) {
	.svpl { --svpl-pv: 3; --svpl-img: 64px; }
	.svpl.is-open .svpl__inner {
		display: grid;
		grid-template-columns: 180px minmax(0, 1fr);
		align-items: center;
		gap: 12px;
		padding-top: 10px;
		padding-bottom: 10px;
	}
	.svpl.is-open .svpl__head { height: auto; align-items: flex-start; }
	.svpl.is-open .svpl__toggle { align-items: center; }
	.svpl.is-open .svpl__label { white-space: normal; }
	.svpl.is-open .svpl__title { font-size: 15px; }
	.svpl.is-open .svpl__panel { padding: 0; }
}

/* ---- Grand écran PC ---- */
@media (min-width: 1280px) {
	.svpl { --svpl-pv: 4; }
}

@media (prefers-reduced-motion: reduce) {
	.svpl, .svpl__chev, .svpl a.svpl__cart { transition: none; }
	.svpl__track { scroll-behavior: auto; }
}

/* Fenêtre « Informations » du thème : remontée au-dessus de la barre */
body.svpl-on .popup-informations,
body.svpl-on .wll-launcher-button-container {
	translate: 0 calc(-1 * var(--svpl-h, 0px)) !important;
	transition: translate .3s ease;
}

@media print { .svpl { display: none !important; } }
