/**
 * Cart page.
 *
 * Tokens mirror the account area (Figma "Purovitalis rebranding 2026",
 * frame 363:14487). They are redeclared here rather than shared because the
 * cart and account stylesheets load independently; they will collapse into
 * one token sheet when the global styles land.
 *
 * @package Purovitalis
 */

/* The recommendations row renders on woocommerce_after_cart — a sibling of the
   cart, not a descendant — so it has to carry the tokens too. */
.pv-cart,
.pv-recommendations {
	--pv-surface-card: #ffffff;
	--pv-surface-header: #f8f7f3;
	--pv-surface-muted: #efece5;
	--pv-surface-active: #564f78;
	--pv-border-default: #e3ded4;
	--pv-text: #000000;
	--pv-text-inverse: #ffffff;
	--pv-text-primary: #564f78;
	--pv-text-secondary: #ef7e3f;
	--pv-neutral-300: #727272;
	--pv-neutral-400: #3d3d3d;
	--pv-status-success-text: #4d7050;
	--pv-radius: 8px;
	--pv-radius-full: 99px;
	/* Type comes from main.css :root — one declaration, one place to change. */

	font-family: var(--pv-font-body);
	color: var(--pv-text);
}

.pv-cart {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 340px;
	gap: 40px;
	align-items: start;
	max-width: var(--pv-page-max); /* the header's lines */
	margin: 0 auto;
	padding: 40px 48px 64px;
}

/* The theme has no global box-sizing reset — and the two sections must include
   their own padding, or the cart's 1240 max-width would sit 24px wider on each
   side than the recommendations row below it. */
.pv-cart,
.pv-cart *,
.pv-cart *::before,
.pv-cart *::after,
.pv-recommendations,
.pv-recommendations *,
.pv-recommendations *::before,
.pv-recommendations *::after {
	box-sizing: border-box;
}

/* The cart carries its own "Your cart" heading. */
.woocommerce-cart .entry-header,
.woocommerce-cart .site-sidebar {
	display: none;
}

/* WooCommerce notices on the cart page ("… has been added to your cart"). */
.woocommerce-cart .woocommerce-notices-wrapper {
	max-width: var(--pv-page-max); /* the header's lines */
	margin: 0 auto;
	padding: 24px 48px 0;
}

.woocommerce-cart .woocommerce-message,
.woocommerce-cart .woocommerce-info,
.woocommerce-cart .woocommerce-error {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	list-style: none;
	margin: 0 0 12px;
	padding: 12px 20px;
	border: 0;
	border-radius: 8px;
	background: #eef4e9;
	color: #4d7050;
	font-family: "Public Sans", system-ui, sans-serif;
	font-size: 14px;
}

.woocommerce-cart .woocommerce-info {
	background: #eaf2fa;
	color: #385f83;
}

.woocommerce-cart .woocommerce-error {
	background: #f8e7ea;
	color: #a8364f;
}

.woocommerce-cart .woocommerce-message .button,
.woocommerce-cart .woocommerce-info .button {
	padding: 8px 18px;
	border: 1px solid currentColor;
	border-radius: 99px;
	color: inherit;
	font-size: 13px;
	font-weight: 600;
	text-decoration: none;
	white-space: nowrap;
}

/* ------------------------------------------------------------------ items */

.pv-cart__header {
	margin-bottom: 24px;
}

.pv-cart__title {
	margin: 0;
	font-family: var(--pv-font-heading);
	font-size: 32px;
	font-weight: 700;
	line-height: 1.1;
}

.pv-cart__count {
	margin: 4px 0 0;
	font-size: 14px;
	color: var(--pv-neutral-300);
}

.pv-cart__list {
	border: 1px solid var(--pv-border-default);
	border-radius: var(--pv-radius);
	background: var(--pv-surface-card);
	overflow: hidden;
}

.pv-cart-item {
	display: flex;
	align-items: center;
	gap: 20px;
	padding: 20px;
}

.pv-cart-item + .pv-cart-item {
	border-top: 1px solid var(--pv-border-default);
}

.pv-cart-item__image img {
	display: block;
	width: 72px;
	height: 72px;
	object-fit: contain;
	border: 1px solid var(--pv-border-default);
	border-radius: var(--pv-radius);
	background: var(--pv-surface-header);
}

.pv-cart-item__details {
	flex: 1 1 auto;
	min-width: 0;
	display: flex;
	flex-direction: column;
	gap: 6px;
}

.pv-cart-item__name {
	margin: 0;
	font-family: var(--pv-font-heading);
	font-size: 17px;
	font-weight: 700;
	line-height: 1.2;
}

.pv-cart-item__name a {
	color: inherit;
	text-decoration: none;
}

/* WooCommerce prints variation data as a definition list. */
.pv-cart-item__details .variation {
	display: flex;
	flex-wrap: wrap;
	gap: 0 6px;
	margin: 0;
	font-size: 13px;
	color: var(--pv-neutral-300);
}

.pv-cart-item__details .variation dt,
.pv-cart-item__details .variation dd {
	margin: 0;
	font-weight: 400;
}

.pv-cart-item__details .variation dd p {
	margin: 0;
}

.pv-cart-item__badges {
	display: flex;
	align-items: center;
	gap: 8px;
}

.pv-type-badge {
	padding: 2px 8px;
	border-radius: 4px;
	background: var(--pv-surface-active);
	color: var(--pv-text-inverse);
	font-size: 10px;
	font-weight: 600;
	letter-spacing: 0.02em;
}

.pv-type-badge--once {
	background: var(--pv-surface-muted);
	color: var(--pv-neutral-400);
}

.pv-cart-item__delivery {
	font-size: 12px;
	color: var(--pv-neutral-300);
}

.pv-cart-item__controls {
	display: flex;
	align-items: center;
	gap: 14px;
	margin-top: 2px;
}

.pv-stepper {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 2px 6px;
	border-radius: 4px;
	background: var(--pv-surface-muted);
	font-size: 13px;
	font-weight: 700;
}

.pv-stepper__btn {
	padding: 2px 6px;
	border: 0;
	background: none;
	font: inherit;
	color: var(--pv-neutral-300);
	cursor: pointer;
	line-height: 1;
}

.pv-stepper__btn:hover {
	color: var(--pv-text);
}

.pv-stepper__input {
	width: 34px;
	padding: 2px 0;
	border: 0;
	background: none;
	font: inherit;
	text-align: center;
	color: var(--pv-text);
	-moz-appearance: textfield;
}

.pv-stepper__input::-webkit-outer-spin-button,
.pv-stepper__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.pv-link-btn {
	padding: 0;
	border: 0;
	background: none;
	font-family: var(--pv-font-body);
	font-size: 13px;
	font-weight: 600;
	color: var(--pv-text-secondary);
	text-decoration: underline;
	cursor: pointer;
}

.pv-cart-item__price {
	font-size: 17px;
	font-weight: 700;
	white-space: nowrap;
}

.pv-cart-item__price .subscription-details {
	display: block;
	font-size: 12px;
	font-weight: 400;
	color: var(--pv-neutral-300);
}

/* With JS the steppers update the cart, so the manual button is redundant. */
.pv-cart__update {
	margin-top: 16px;
	padding: 10px 20px;
	border: 1px solid var(--pv-text);
	border-radius: var(--pv-radius-full);
	background: none;
	font-family: var(--pv-font-body);
	font-size: 14px;
	font-weight: 600;
	cursor: pointer;
}

.pv-cart-form--live .pv-cart__update {
	position: absolute;
	width: 1px;
	height: 1px;
	margin: -1px;
	padding: 0;
	overflow: hidden;
	clip: rect(0 0 0 0);
	white-space: nowrap;
	border: 0;
}

/* ---------------------------------------------------------------- summary */

.pv-cart__summary {
	position: sticky;
	top: 24px;
}

.pv-summary {
	display: flex;
	flex-direction: column;
	gap: 16px;
	padding: 24px;
	border: 1px solid var(--pv-border-default);
	border-radius: var(--pv-radius);
	background: var(--pv-surface-card);
}

.pv-summary__title {
	margin: 0;
	font-family: var(--pv-font-heading);
	font-size: 20px;
	font-weight: 700;
}

.pv-summary__rows {
	display: flex;
	flex-direction: column;
	gap: 10px;
	font-size: 14px;
}

.pv-summary__row {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
}

.pv-summary__row span:first-child {
	color: var(--pv-neutral-400);
}

.pv-summary__row--discount {
	color: var(--pv-status-success-text);
}

.pv-summary__row--discount a {
	font-size: 12px;
	color: var(--pv-neutral-300);
}

.pv-summary__total {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 16px;
	padding-top: 14px;
	border-top: 1px solid var(--pv-border-default);
	font-size: 18px;
	font-weight: 700;
}

.pv-summary__total .includes_tax {
	display: block;
	font-size: 11px;
	font-weight: 400;
	color: var(--pv-neutral-300);
}

.pv-summary__note {
	margin: -8px 0 0;
	font-size: 11px;
	color: var(--pv-neutral-300);
}

/* Loyalty redemption block — the same dress as the checkout sidebar (Rein,
   2026-09-07): no box, no heading; the balance line, then the reward picker
   and Apply on one row. Yotpo's wrappers are flattened first. */
.pv-summary__loyalty {
	margin-top: 4px;
}

.pv-summary__loyalty .yotpo-point-balance-text {
	margin: 0 0 8px !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	color: var(--pv-text-secondary) !important;
}

.pv-summary__loyalty .yotpo-not-enough-points-text {
	margin-top: 4px !important;
	font-size: 12px !important;
	color: var(--pv-neutral-300) !important;
}

.pv-summary__loyalty .yotpo-widget-checkout-redemptions-widget,
.pv-summary__loyalty .margin-top,
.pv-summary__loyalty .yotpo-widget-clear,
.pv-summary__loyalty .yotpo-checkout-widget-content,
.pv-summary__loyalty .yotpo-background,
.pv-summary__loyalty .yotpo-widget-container,
.pv-summary__loyalty .yotpo-dropdown-widget-container {
	padding: 0 !important;
	margin: 0 !important;
	background: none !important;
	overflow: visible !important;
}

/* Yotpo's own row (picker + Apply) stays as it is on the checkout; only the
   balance line is forced onto its own line above it. */
.pv-summary__loyalty .yotpo-widget-redemption {
	overflow: visible !important;
}

.pv-summary__loyalty .yotpo-point-balance-text {
	display: block !important;
	width: 100% !important;
}

.pv-summary__loyalty .yotpo-dropdown-widget-container {
	display: flex !important;
	align-items: center !important;
	gap: 8px !important;
	overflow: visible !important;
}

.pv-summary__loyalty select,
.pv-summary__loyalty .vs__dropdown-toggle,
.pv-summary__loyalty .yotpo-dropdown-widget-container > :not(button.yotpo-button-style) {
	flex: 1 1 auto !important;
	min-width: 0 !important;
}

.pv-summary__loyalty select,
.pv-summary__loyalty .vs__dropdown-toggle,
.pv-summary__loyalty .yotpo-dropdown-widget-container > button {
	height: 40px !important;
	min-height: 40px !important;
	max-height: 40px !important;
	padding: 0 12px !important;
	border: 1.5px solid var(--pv-border-default) !important;
	border-radius: 10px !important;
	background: var(--pv-surface-card) !important;
	font-family: var(--pv-font-body) !important;
	font-size: 14px !important;
	font-weight: 400 !important;
	color: var(--pv-text) !important;
	line-height: normal !important;
	text-align: left !important;
}

.pv-summary__loyalty .vs__dropdown-menu {
	border-radius: 10px;
	border-color: var(--pv-border-default);
}

.pv-summary__loyalty .yotpo-button-style,
.pv-summary__loyalty button.yotpo-button-style {
	flex: 0 0 auto !important;
	width: auto !important;
	height: 40px !important;
	min-height: 0 !important;
	max-height: 40px !important;
	padding: 0 20px !important;
	border: 0 !important;
	border-radius: var(--pv-radius-full) !important;
	background: var(--pv-text) !important;
	color: var(--pv-text-inverse) !important;
	font-family: var(--pv-font-body) !important;
	font-size: 14px !important;
	font-weight: 600 !important;
	line-height: 40px !important;
	cursor: pointer;
}

.pv-summary__redeeming {
	margin: 10px 0 0;
	font-size: 12px;
	color: var(--pv-status-success-text);
}

/* The disclosure only opens on request — display:flex would otherwise beat
   the hidden attribute and leave the field permanently visible. */
.pv-promo-form[hidden] {
	display: none;
}

.pv-promo-form {
	display: flex;
	gap: 8px;
	margin-top: 10px;
}

.pv-promo-form__input {
	flex: 1 1 auto;
	min-width: 0;
	height: 40px;
	padding: 0 12px;
	border: 1.5px solid var(--pv-border-default);
	border-radius: 10px;
	font-family: var(--pv-font-body);
	font-size: 14px;
}

.pv-promo-form .pv-btn {
	height: 40px;
	padding: 0 20px;
	font-size: 14px;
}

/* "Add coupons": the checkout's purple accordion trigger, chevron flips when open. */
.pv-summary__promo {
	margin-top: 14px;
	padding-top: 14px;
	border-top: 1px solid var(--pv-border-default);
}

.pv-summary__coupon-toggle {
	display: flex;
	align-items: center;
	justify-content: space-between;
	width: 100%;
	padding: 0;
	border: 0;
	background: none;
	font-family: var(--pv-font-body);
	font-size: 14px;
	font-weight: 600;
	color: var(--pv-text-primary);
	cursor: pointer;
}

.pv-summary__coupon-toggle svg {
	transition: transform 0.2s ease;
}

.pv-summary__coupon-toggle[aria-expanded="true"] svg {
	transform: rotate(180deg);
}

/* "Make it a routine" under the cart table: one flat orange block on the static
   LifeCells artwork (no inner card, no moving discs — Rein, 2026-09-07). */
.pv-cart .pv-bump--cart {
	position: relative;
	max-width: none;
	margin-top: 20px;
	padding: 24px 28px;
	border-radius: 16px;
	color: var(--pv-text);
	background: #ef7e3f url('../img/lifecells/lifecells-orange.webp') center / cover no-repeat;
}

.pv-cart .pv-bump--cart .pv-bump__heading {
	margin-bottom: 16px;
	padding-right: 120px;
	font-family: var(--pv-font-heading);
	font-size: 20px;
	font-weight: 700;
}

/* The saving sits in the card's top-right corner, not inline with the name. */
.pv-cart .pv-bump--cart .pv-bump__label {
	position: absolute;
	top: 20px;
	right: 24px;
	margin: 0;
	padding: 7px 14px;
	font-size: 13px;
	background: var(--pv-text);
	color: var(--pv-text-inverse);
}

.pv-cart .pv-bump--cart .pv-drawer-addon {
	padding: 0;
	border: 0;
	background: none;
	gap: 18px;
}

.pv-cart .pv-bump--cart .pv-drawer-addon__thumb {
	width: 64px;
	height: 64px;
	border-radius: 12px;
	background: #fff;
}

.pv-cart .pv-bump--cart .pv-drawer-addon__text {
	flex: 1 1 auto;
	min-width: 0;
}

.pv-cart .pv-bump--cart .pv-drawer-addon__name {
	font-size: 17px;
}

.pv-cart .pv-bump--cart .pv-bump__text {
	margin-top: 4px;
	font-size: 14px;
	line-height: 1.45;
	color: var(--pv-text);
	opacity: 0.85;
}

.pv-cart .pv-bump--cart .pv-drawer-addon__toggle {
	flex: 0 0 auto;
	padding: 12px 24px;
	border: 0;
	background: var(--pv-text);
	color: var(--pv-text-inverse);
	font-size: 14px;
}

@media (max-width: 640px) {
	.pv-cart .pv-bump--cart .pv-drawer-addon { flex-wrap: wrap; }
	.pv-cart .pv-bump--cart .pv-drawer-addon__toggle { width: 100%; }
}

.pv-summary__actions {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.pv-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	padding: 13px 24px;
	border-radius: var(--pv-radius-full);
	font-family: var(--pv-font-body);
	font-size: 15px;
	font-weight: 600;
	line-height: 1;
	text-decoration: none;
	cursor: pointer;
}

.pv-btn--primary {
	background: var(--pv-text);
	border: 1px solid var(--pv-text);
	color: var(--pv-text-inverse);
}

.pv-btn--outline {
	background: transparent;
	border: 1px solid var(--pv-text);
	color: var(--pv-text);
}

/* Continue shopping is a way back, not a second call to action. */
.pv-summary__continue {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 4px;
	font-size: 14px;
	font-weight: 600;
	color: var(--pv-text-primary);
	text-decoration: none;
}

.pv-summary__continue:hover {
	text-decoration: underline;
}

.pv-payment-icons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding-top: 16px;
	border-top: 1px solid var(--pv-border-default);
}

.pv-payment-icons img {
	height: 24px;
	width: auto;
	max-width: 46px;
	object-fit: contain;
}

/* ------------------------------------------------------- recommendations */

.pv-recommendations {
	max-width: var(--pv-page-max); /* the header's lines */
	margin: 0 auto;
	padding: 8px 48px 64px;
}

.pv-recommendations__title {
	margin: 0;
	font-family: var(--pv-font-heading);
	font-size: 24px;
	font-weight: 700;
}

.pv-recommendations__intro {
	margin: 4px 0 24px;
	font-size: 14px;
	color: var(--pv-neutral-300);
}

.pv-recommendations__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 20px;
}

@media (max-width: 1200px) {
	.pv-recommendations__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
	/* Three across: the fourth card would sit alone on a second row. */
	.pv-recommendations__grid > :nth-child(4) { display: none; }
}

@media (max-width: 900px) {
	.pv-recommendations__grid > :nth-child(4) { display: flex; }
}

@media (max-width: 900px) {
	.pv-recommendations__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
	.pv-recommendations__grid { grid-template-columns: 1fr; }
}

/* ------------------------------------------------------------- empty cart */

.pv-cart--empty {
	display: block;
	padding-bottom: 24px;
}

.pv-cart-empty {
	max-width: 520px;
	padding: 40px 0 8px;
}

.pv-cart-empty__text {
	margin: 8px 0 24px;
	font-size: 15px;
	line-height: 1.5;
	color: var(--pv-neutral-400);
}

/* --------------------------------------------------------- you may also like */

.woocommerce .cross-sells {
	max-width: var(--pv-page-max); /* the header's lines */
	margin: 0 auto;
	padding: 0 48px 64px;
}

.woocommerce .cross-sells > h2 {
	font-family: var(--pv-font-heading);
	font-size: 24px;
	font-weight: 700;
}

/* ------------------------------------------------------------- responsive */

/* Desktop has the summary in view the whole way down, so the sticky bar is
   phone-only — see the media query below, which is what turns it on. */
.pv-cart-sticky {
	display: none;
}

@media ( max-width: 900px ) {
	.pv-cart {
		grid-template-columns: 1fr;
		gap: 24px;
		/* Room for the sticky bar, so the last line is never underneath it. */
		padding: 24px 16px 96px;
	}

	.pv-cart__summary {
		position: static;
	}

	.pv-cart-item {
		flex-wrap: wrap;
		gap: 14px;
		padding: 16px;
	}

	.pv-cart-item__image img {
		width: 56px;
		height: 56px;
	}

	.pv-cart-item__price {
		width: 100%;
		padding-left: 70px;
		font-size: 15px;
	}

	.pv-cart__title {
		font-size: 26px;
	}

	.pv-cart-sticky {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		z-index: 90;
		display: flex;
		align-items: center;
		gap: 12px;
		padding: 12px 16px calc( 12px + env( safe-area-inset-bottom ) );
		border-top: 1px solid var(--pv-border-default);
		background: var(--pv-surface-card);
		box-shadow: 0 -2px 12px rgba( 86, 79, 120, 0.08 );
	}

	.pv-cart-sticky[aria-hidden="true"] {
		/* Visible, but skipped by assistive technology: it repeats the real
		   checkout button rather than adding an action. */
		display: flex;
	}

	.pv-cart-sticky__total {
		flex: 1 1 auto;
		font-size: 16px;
		font-weight: 700;
	}

	.pv-cart-sticky .pv-btn {
		flex: 0 0 auto;
		padding: 12px 28px;
	}

	.pv-recommendations {
		padding: 8px 16px 48px;
	}

	.pv-recommendations__grid {
		grid-template-columns: repeat( 2, minmax( 0, 1fr ) );
		gap: 12px;
	}
}

/* The gift line: priced at nothing and not the customer's to change. */
.pv-cart-item--gift .pv-cart-item__price {
	color: var(--pv-text-secondary);
}

.pv-type-badge--gift {
	background: var(--pv-text-secondary);
	color: var(--pv-text-inverse);
}

.pv-cart-item__controls[hidden] {
	display: none;
}

/* Payment marks in the summary: flat, no panel and no rounded corners (Rein, 2026-09-08) */
.pv-payment-icons__marks { background: transparent !important; border: 0 !important; padding: 0; gap: 14px; justify-content: center; min-height: 0; }
.pv-payment-icons__marks img { height: 15px !important; width: auto !important; max-width: none !important; border-radius: 0 !important; background: transparent !important; }
.pv-payment-icons__marks img[src*='ideal'], .pv-payment-icons__marks img[src*='wero'], .pv-payment-icons__marks img[src*='mobilepay'] { height: 18px !important; }

/* Size chip next to the type badge */
.pv-type-badge--size { background: var(--pv-surface-muted); color: var(--pv-text); }
