/* ------------------------------------------------------------ *\
	Biovancia v3 — WooCommerce shared layer (cart / checkout / thank-you)
	Gated behind BVA_V3_CHECKOUT. Restyles the untouched V2 WooCommerce
	markup with the v3 tokens; anything specific to one view lives in
	cart.css / checkout.css / thankyou.css. The legacy dist/main.css is
	not loaded on these views (main.js still is), so the few structural
	rules its JS relies on (swiper core, overlay toggles) are ported here.
\* ------------------------------------------------------------ */

/* --- Page shell -------------------------------------------------- */

/* The v3 normalize doesn't force border-box everywhere; width:100% +
   padding on CTAs/tables otherwise overflows the cards. Scoped to the
   Woo containers so the body-appended popups keep their own model. */
.v3 .woocommerce__inner,
.v3 .woocommerce__inner *,
.v3 .woocommerce__inner *::before,
.v3 .woocommerce__inner *::after,
.v3 .woocommerce-order,
.v3 .woocommerce-order *,
.v3 .checkout_coupon.woocommerce-form-coupon,
.v3 .checkout_coupon.woocommerce-form-coupon * {
	box-sizing: border-box;
}

/* Desktop: the fixed v3 header (~80px) is not compensated by .main's
   margin (which only offsets the topbar) — same fix as confirmation.css. */
.v3.woocommerce-cart .main,
.v3.woocommerce-checkout .main {
	padding-top: 80px;
}

.v3 .woocommerce__inner {
	padding-block: 48px 96px;
}

.v3 .woocommerce__inner h1 {
	margin: 0 0 40px;
	font: var(--bva-t-header-xl);
	color: var(--bva-black);
}

/* --- Cards (recap, payment, product rows…) ----------------------- */

.v3 .wc-v3-card,
.v3 .cart_totals,
.v3 .coupon-holder,
.v3 .woocommerce-checkout-review-order-table,
.v3 #payment,
.v3 .product-row,
.v3 .cart-coupon,
.v3 .section__aside,
.v3 .section__content {
	background: #fbf9f7;
	border: 1px solid rgba(21, 20, 18, 0.12);
	border-radius: 8px;
}

/* --- Buttons ------------------------------------------------------ */

/* Primary conversion CTA (Passer ma commande / Commander / Valider). */
.v3 .btn-design,
.v3 .checkout-button,
.v3 button#place_order,
.v3 .cart-coupon .coupon button,
.v3 .checkout_coupon button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 24px;
	background: var(--bva-black);
	color: var(--bva-white);
	border: 1px solid var(--bva-black);
	border-radius: 2px;
	font-family: var(--bva-font-sans);
	font-size: 13px;
	font-weight: 600;
	line-height: 1.1;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: background 0.15s ease, color 0.15s ease, opacity 0.15s ease;
}

.v3 .btn-design:hover,
.v3 .checkout-button:hover,
.v3 button#place_order:hover,
.v3 .cart-coupon .coupon button:hover,
.v3 .checkout_coupon button:hover {
	background: var(--bva-espresso);
	border-color: var(--bva-espresso);
	color: var(--bva-white);
}

.v3 button#place_order:disabled {
	opacity: 0.35;
	cursor: not-allowed;
}

/* Secondary / ghost action (Retour à la boutique, Modifier…). */
.v3 .btn-empty,
.v3 .product-subtotal .edit,
.v3 .remove-overlay .edit-alt {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 13px 24px;
	background: transparent;
	color: var(--bva-black);
	border: 1px solid rgba(21, 20, 18, 0.16);
	border-radius: 2px;
	font-family: var(--bva-font-sans);
	font-size: 13px;
	font-weight: 500;
	text-transform: uppercase;
	text-decoration: none;
	cursor: pointer;
	transition: all 0.15s ease;
}

.v3 .btn-empty:hover,
.v3 .product-subtotal .edit:hover,
.v3 .remove-overlay .edit-alt:hover {
	background: var(--bva-black);
	border-color: var(--bva-black);
	color: var(--bva-white);
}

/* --- WooCommerce notices ------------------------------------------ */

/* Full-width top banners, prod-style: colored top bar + round glyph badge
   (replaces the plugin's icon-font, which rendered as a tofu box). */
.v3 .woocommerce-error,
.v3 .woocommerce-message,
.v3 .woocommerce-info {
	position: relative;
	margin: 0 0 32px;
	padding: 16px 20px 16px 52px;
	list-style: none;
	background: var(--bva-cream-light);
	border: 0;
	border-top: 3px solid var(--bva-canelle-400);
	border-radius: 0 0 4px 4px;
	font-family: var(--bva-font-sans);
	font-size: 15px;
	line-height: 1.5;
	color: var(--bva-black);
}

.v3 .woocommerce-error::before,
.v3 .woocommerce-message::before,
.v3 .woocommerce-info::before {
	content: '!';
	position: absolute;
	top: 16px;
	left: 20px;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 20px;
	height: 20px;
	margin: 0;
	padding: 0;
	border-radius: 50%;
	background: var(--bva-canelle-400);
	color: var(--bva-white);
	font-family: var(--bva-font-sans);
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	animation: none;
}

.v3 .woocommerce-message::before {
	content: '✓';
}

.v3 .woocommerce-error {
	border-top-color: #b3401f;
}

.v3 .woocommerce-error::before {
	background: #b3401f;
}

.v3 .woocommerce-error li + li {
	margin-top: 8px;
}

/* Woo focuses the banner on render (role=alert) — keep it, without the ring. */
.v3 .woocommerce-error:focus,
.v3 .woocommerce-message:focus,
.v3 .woocommerce-info:focus {
	outline: none;
	box-shadow: none;
}

/* Inline actions ("Annuler ?" after a cart removal) must read as links. */
.v3 .woocommerce-error a,
.v3 .woocommerce-message a,
.v3 .woocommerce-info a {
	color: inherit;
	font-weight: 600;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.v3 .woocommerce-error a:hover,
.v3 .woocommerce-message a:hover,
.v3 .woocommerce-info a:hover {
	color: var(--bva-canelle-400);
}

/* Success/info banners are transient: fade out after 20s (errors stay).
   The undo link stays clickable until the fade completes. */
.v3 .woocommerce-message {
	animation: bva-notice-out 0.5s ease 20s forwards;
}

@keyframes bva-notice-out {
	0% {
		opacity: 1;
		max-height: 200px;
	}
	60% {
		opacity: 0;
		max-height: 200px;
	}
	100% {
		opacity: 0;
		max-height: 0;
		margin: 0;
		padding-block: 0;
		border-width: 0;
		overflow: hidden;
		visibility: hidden;
	}
}

/* --- Services (Les services Biovancia) ---------------------------- */

.v3 .section-services .section__head h2,
.v3 .section-payment-logos h3,
.v3 .section-slider-alt .section__head h2 {
	margin: 0 0 32px;
	font: var(--bva-t-header-l);
	font-weight: 500;
	color: var(--bva-black);
}

.v3 .section-services {
	margin-top: 48px;
}

.v3 .services {
	display: flex;
	flex-direction: column;
	gap: 24px;
}

.v3 .service {
	display: flex;
	align-items: flex-start;
	gap: 16px;
}

.v3 .service__img {
	flex-shrink: 0;
	width: 48px;
	height: 48px;
	background-size: contain;
	background-repeat: no-repeat;
	background-position: center;
	/* Legacy pictos are vitamine-orange line icons — mute them to the
	   v3 ink so they stop fighting the palette. */
	filter: grayscale(1) brightness(0.35);
	opacity: 0.85;
}

.v3 .service__text h4 {
	margin: 0 0 6px;
	font-family: var(--bva-font-sans);
	font-size: 17px;
	font-weight: 600;
	line-height: 1.25;
	color: var(--bva-black);
}

.v3 .service__text p {
	margin: 0;
	font-family: var(--bva-font-sans);
	font-size: 14px;
	font-weight: 400;
	line-height: 1.5;
	color: var(--bva-text-60);
}

/* Checkout variant (full-width strip): centered, one row of four,
   icon above its text. */
.v3 .section-services--alt {
	padding: 24px 0 8px;
}

.v3 .section-services--alt .section__head h2 {
	text-align: center;
}

.v3 .section-services--alt .services {
	flex-direction: row;
	align-items: stretch;
	justify-content: center;
	gap: 40px;
}

.v3 .section-services--alt .service {
	flex: 1 1 0;
	max-width: 300px;
	flex-direction: column;
	align-items: center;
	text-align: center;
}

.v3 .section-services--alt .service__img {
	width: 56px;
	height: 56px;
	margin-bottom: 4px;
}

/* --- Payment logos strip ------------------------------------------ */

.v3 .section-payment-logos {
	padding: 64px 0 48px;
	text-align: center;
}

.v3 .section-payment-logos p {
	margin: 0 auto 24px;
	max-width: 560px;
	font: var(--bva-t-paragraphe);
	font-weight: 400;
	font-size: 15px;
	color: var(--bva-text-60);
}

.v3 .section-payment-logos ul {
	display: flex;
	flex-wrap: wrap;
	justify-content: center;
	align-items: center;
	gap: 24px 32px;
	margin: 0;
	padding: 0;
	list-style: none;
}

.v3 .section-payment-logos ul li img {
	display: block;
	max-height: 32px;
	width: auto;
}

/* --- Testimonials slider (swiper core ported from the bundle) ----- */

.v3 .section-slider-alt {
	padding: 72px 0 96px;
}

.v3 .swiper {
	position: relative;
	overflow: hidden;
	z-index: 1;
}

.v3 .swiper-wrapper {
	position: relative;
	display: flex;
	width: 100%;
	box-sizing: content-box;
	transition-property: transform;
}

.v3 .swiper-slide {
	position: relative;
	flex-shrink: 0;
}

.v3 .testimonial-alt {
	display: flex;
	align-items: center;
	gap: 36px;
	padding: 32px 40px;
	background: #fbf9f7;
	border: 1px solid rgba(21, 20, 18, 0.12);
	border-radius: 8px;
}

.v3 .testimonial__image {
	flex-shrink: 0;
	width: 200px;
}

.v3 .testimonial__image img {
	display: block;
	width: 100%;
	aspect-ratio: 1;
	object-fit: cover;
	border-radius: 8px;
	background: var(--bva-img-bg);
}

.v3 .testimonial__content {
	flex: 1;
	min-width: 0;
}

.v3 .testimonial__content-title {
	display: flex;
	align-items: center;
	justify-content: flex-start;
	gap: 14px;
	margin-bottom: 8px;
}

.v3 .testimonial__content-title h3 {
	margin: 0;
	font-family: var(--bva-font-sans);
	font-size: 20px;
	font-weight: 600;
	color: var(--bva-black);
}

.v3 .testimonial__content p {
	margin: 0;
	max-width: 860px;
	font-family: var(--bva-font-sans);
	font-size: 17px;
	font-weight: 400;
	line-height: 1.55;
	color: var(--bva-text-60);
}

.v3 .testimonial__content p + p {
	margin-top: 8px;
}

.v3 .rating {
	display: inline-flex;
	align-items: center;
	gap: 3px;
}

.v3 .rating svg,
.v3 .rating img {
	width: 18px;
	height: 18px;
}

.v3 .swiper-buttons {
	display: flex;
	justify-content: flex-end;
	gap: 12px;
	margin-top: 20px;
}

.v3 .swiper-button-prev,
.v3 .swiper-button-next {
	position: relative;
	width: 44px;
	height: 44px;
	border: 1px solid rgba(21, 20, 18, 0.16);
	border-radius: 50%;
	background: transparent;
	cursor: pointer;
	transition: all 0.15s ease;
}

.v3 .swiper-button-prev::after,
.v3 .swiper-button-next::after {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: 9px;
	height: 9px;
	border-right: 1.5px solid currentColor;
	border-bottom: 1.5px solid currentColor;
	color: var(--bva-black);
}

.v3 .swiper-button-prev::after {
	transform: translate(-30%, -50%) rotate(135deg);
}

.v3 .swiper-button-next::after {
	transform: translate(-70%, -50%) rotate(-45deg);
}

.v3 .swiper-button-prev:hover,
.v3 .swiper-button-next:hover {
	background: var(--bva-black);
	border-color: var(--bva-black);
}

.v3 .swiper-button-prev:hover::after,
.v3 .swiper-button-next:hover::after {
	color: var(--bva-white);
}

.v3 .swiper-button-disabled {
	opacity: 0.3;
	pointer-events: none;
}

.v3 .swiper-button-prev:focus,
.v3 .swiper-button-next:focus {
	outline: none;
}

.v3 .swiper-button-prev:focus-visible,
.v3 .swiper-button-next:focus-visible {
	outline: 2px solid var(--bva-canelle-400);
	outline-offset: 2px;
}

/* --- Snackbar (duplicate-product toast) --------------------------- */

.v3 .snackbar {
	position: fixed;
	z-index: 1001;
	bottom: 24px;
	left: 50%;
	transform: translateX(-50%);
	width: 90vw;
	max-width: 560px;
	padding: 16px 24px;
	background: var(--bva-ink);
	border-radius: 4px;
	box-shadow: 0 4px 16px rgba(0, 0, 0, 0.24);
}

.v3 .snackbar__inner {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
}

.v3 .snackbar__inner p {
	margin: 0;
	font-family: var(--bva-font-sans);
	font-size: 15px;
	color: var(--bva-white);
}

.v3 .snackbar__inner a {
	color: var(--bva-white);
	font-family: var(--bva-font-sans);
	font-size: 13px;
	font-weight: 600;
	text-transform: uppercase;
	text-decoration: underline;
}

/* --- Responsive ---------------------------------------------------- */

@media (max-width: 835px) {
	/* .main's mobile margin already clears the mobile header. */
	.v3.woocommerce-cart .main,
	.v3.woocommerce-checkout .main {
		padding-top: 0;
	}

	.v3 .woocommerce__inner {
		padding-block: 32px 64px;
	}

	.v3 .woocommerce__inner h1 {
		margin-bottom: 28px;
		font-size: 32px;
	}

	.v3 .testimonial-alt {
		flex-direction: column;
		padding: 24px;
	}

	.v3 .testimonial__image {
		width: 100%;
		max-width: 280px;
	}

	.v3 .section-slider-alt {
		padding: 48px 0 64px;
	}

	.v3 .section-payment-logos {
		padding: 48px 0 32px;
	}

	.v3 .section-payment-logos ul {
		gap: 16px 20px;
	}

	.v3 .section-payment-logos ul li img {
		max-height: 24px;
	}

	.v3 .section-services--alt .services {
		flex-wrap: wrap;
		gap: 24px;
	}

	.v3 .section-services--alt .service {
		flex: 1 1 40%;
		max-width: none;
	}
}
