/**
 * Cart page — Figma "VATALY — Cart" (Cart-desktop.md, Cart-mobile.md,
 * cart-states.md). See inc/cart.php.
 *
 * Loaded after css/checkout.css: the page wrapper is `.vco.vcart`, so the
 * checkout line item (.vco-item), stepper (.vco-qty), totals (.vco-totals)
 * and button (.vco-btn) rules apply unchanged. This file holds the page
 * layout, the Figma notices and the cart-only differences. Columns use their
 * own classes (.vcart-cols) because .vco-cols / .vco-aside carry checkout
 * mobile rules (collapsible bag bar).
 *
 * Tokens (style.css :root): --ink_text, --bg_clr1, --bg_clr2, --b_clr,
 * --h_clr, --rare_clr (warning), --msg_red / --msg_red_tint (error),
 * --msg_green (success), --space_*, --font1, --font2.
 *
 * Desktop (1440 frame): 1134 container, 720 items / 348 summary.
 * ≤991px: one column. ≤767.98px (Figma 402): 20px gutters, 72×90 images,
 * Title 30 and CHECKOUT in a sticky bottom bar.
 */

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

.vataly-cart .site-content,
.vataly-cart .site-main {
	background: var(--bg_clr1);
}

/* The theme's "Cart" title: the template prints YOUR BAG. */
.vataly-cart .page-header,
.vataly-cart .entry-header {
	display: none;
}

/* Figma Content padding 48 (the theme's 60px + .entry-content margin). */
.vataly-cart .site-content {
	padding-top: 48px;
}

.vataly-cart .entry-content {
	margin-top: 0;
}

.vcart.vco {
	padding-bottom: 48px;
}

/* ---------------------------------------------------------------------------
 * Page header — Title 40 + item count (Body 14, taupe)
 * ------------------------------------------------------------------------ */

.vcart-header {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-end;
	gap: var(--space_12);
}

.vco .vcart-title {
	margin: 0;
	color: var(--ink_text);
	font-family: var(--font1), serif !important;
	font-size: 40px;
	font-weight: 500;
	line-height: 1;
	letter-spacing: 0;
	text-transform: uppercase;
}

.vcart-count {
	color: var(--h_clr);
	font-size: 14px;
	font-weight: 300;
	line-height: 1.36;
}

/* ---------------------------------------------------------------------------
 * Banners — core notices + Figma P3 / P4, 32px under the title. Hidden when
 * nothing printed (the core wrapper is always there, often empty).
 * ------------------------------------------------------------------------ */

.vcart-banners {
	display: flex;
	flex-direction: column;
	gap: var(--space_12);
	margin-top: 32px;
}

.vcart-banners:not(:has(> :not(.woocommerce-notices-wrapper:empty))) {
	display: none;
}

.vco .vcart-banners .woocommerce-notices-wrapper:not(:empty) {
	display: flex;
	flex-direction: column;
	gap: var(--space_12);
	margin: 0;
}

.vco .vcart-banners .woocommerce-message a,
.vco .vcart-banners .woocommerce-info a,
.vco .vcart-banners .woocommerce-error a {
	color: var(--ink_text);
	font-size: 12px;
	font-weight: 700;
	line-height: 1.36;
	text-decoration: none;
	text-transform: uppercase;
}

.vco .vcart-banners .woocommerce-message a:hover,
.vco .vcart-banners .woocommerce-info a:hover,
.vco .vcart-banners .woocommerce-error a:hover {
	color: var(--ink_text);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Core / Konte notices (woocommerce/notices/*.php in the parent) drawn as the
 * Figma banners: success + info → Info, error → Error. Not dismissible. The
 * markup is icon + text + link + close icon with no wrapper around the text,
 * so the icon sits in the left padding (16 + 16 + 12) and the link follows
 * the text inline. */
.vco .vcart-banners .woocommerce-message,
.vco .vcart-banners .woocommerce-info,
.vco .vcart-banners .woocommerce-error {
	position: relative;
	display: block;
	margin: 0;
	padding: var(--space_16) var(--space_16) var(--space_16) 44px !important;
	border: 1px solid var(--h_clr);
	background: var(--bg_clr1) !important;
	color: var(--ink_text) !important;
	font-family: var(--font2), sans-serif;
	font-size: 14px;
	font-weight: 300;
	line-height: 1.36;
	list-style: none;
}

.vco .vcart-banners .woocommerce-error {
	border-color: var(--msg_red);
	background: var(--msg_red_tint) !important;
}

.vco .vcart-banners .woocommerce-error li {
	margin: 0;
	padding: 0;
}

.vco .vcart-banners .woocommerce-message a,
.vco .vcart-banners .woocommerce-info a,
.vco .vcart-banners .woocommerce-error a {
	display: inline;
	float: none;
	margin-left: var(--space_12);
	padding: 0;
	border: 0;
}

.vco .vcart-banners .message-icon {
	position: absolute;
	top: 18px;
	left: var(--space_16);
	width: 16px;
	height: 16px;
	margin: 0;
	transform: none;
	color: var(--rare_clr);
	line-height: 0;
}

.vco .vcart-banners .woocommerce-error .message-icon {
	color: var(--msg_red);
}

.vco .vcart-banners .message-icon svg {
	width: 16px;
	height: 16px;
}

.vco .vcart-banners .close-message {
	display: none;
}

/* ---------------------------------------------------------------------------
 * Columns — 720 items / 348 summary, space-between (66px at 1134)
 * ------------------------------------------------------------------------ */

.vcart-cols {
	display: flex;
	align-items: flex-start;
	justify-content: space-between;
	gap: 32px;
	margin-top: 32px;
}

.vcart-main {
	flex: 0 1 720px;
	min-width: 0;
}

.vcart-aside {
	display: flex;
	flex: 0 0 348px;
	flex-direction: column;
	gap: var(--space_24);
	min-width: 0;
}

/* ---------------------------------------------------------------------------
 * Line items — Figma Cart/Line Item, Desktop layout (96×120 image). The rest
 * (row, stepper, unavailable state) is the checkout .vco-item.
 * ------------------------------------------------------------------------ */

.vco .vcart-items {
	margin: 0;
}

.vcart-items .vco-item__image {
	flex-basis: 96px;
	width: 96px;
	height: 120px;
}

/* P3: "Item unavailable" is Body 14 on the cart page. */
.vcart-items .vco-item__notice {
	gap: var(--space_8);
	font-size: 14px;
}

/* REMOVE is an underlined text link (a real link here: core remove URL). */
.vco .vcart-items .vco-item__remove {
	display: inline-block;
	border: 0;
	text-decoration: underline;
	text-underline-offset: 3px;
}

.vco .vcart-items .vco-item.is-unavailable .vco-item__remove {
	color: var(--h_clr);
}

/* ---------------------------------------------------------------------------
 * Discount Code — the checkout promo field (css/checkout.css .vco-promo) with
 * the cart frame's Collapsed row: 1px taupe border, 12px padding, Header 14
 * label "Discount Code" (45 tall). Applied notice is Body 14 (P8).
 * ------------------------------------------------------------------------ */

.vcart .vco-promo {
	margin-top: 0;
}

.vco .vcart-aside .vco-promo__toggle {
	height: auto;
	padding: var(--space_12);
	border: 1px solid var(--h_clr);
	background: var(--bg_clr1);
	font-weight: 700;
}

.vcart .vco-promo__notice {
	font-size: 14px;
}

/* ---------------------------------------------------------------------------
 * Order Summary (Header 16 title + the checkout totals rows) + CHECKOUT
 * ------------------------------------------------------------------------ */

.vco .vcart-summary__title {
	margin: 0;
	color: var(--ink_text);
	font-size: 16px;
	font-weight: 700;
	line-height: 1.36;
	letter-spacing: 0;
	text-transform: uppercase;
}

.vcart-summary .vco-totals-wrap {
	margin-top: var(--space_16);
}

.vcart-checkout {
	display: flex;
	flex-direction: column;
	gap: var(--space_12);
}

.vco .vcart-checkout .vco-btn {
	width: 100%;
	text-decoration: none;
}

/* ---------------------------------------------------------------------------
 * Empty state — Title 30, Body 14, CONTINUE SHOPPING 280 × 55
 * ------------------------------------------------------------------------ */

.vcart--empty .vcart-banners {
	margin-top: 0;
}

/* ---------------------------------------------------------------------------
 * Tablet: one column
 * ------------------------------------------------------------------------ */

@media (max-width: 991px) {
	/* The theme container already pads 20px each side (Figma 402 − 2 × 20). */
	.vcart.vco {
		padding: 0 0 48px;
	}

	.vcart-cols {
		flex-direction: column;
		align-items: stretch;
		gap: var(--space_24);
	}

	.vcart-main,
	.vcart-aside {
		flex: 1 1 auto;
		width: 100%;
	}
}

/* ---------------------------------------------------------------------------
 * Mobile (Figma 402): body padding 24 / 20, gaps 24, Title 30, 72×90 images,
 * CHECKOUT in the Sticky Action Bar (1px sand rule, 16 / 20 padding, safe
 * area). The body gets the bar's height as bottom padding so the footer's
 * last line is never under it. No bar on the empty bag.
 * ------------------------------------------------------------------------ */

@media (max-width: 767.98px) {
	.vataly-cart .site-content {
		padding-top: var(--space_24);
	}

	.vco .vcart-title {
		font-size: 30px;
	}

	.vcart-banners,
	.vcart-cols {
		margin-top: var(--space_24);
	}

	.vcart-items .vco-item__image {
		flex-basis: 72px;
		width: 72px;
		height: 90px;
	}

	.vataly-cart--filled {
		padding-bottom: calc(88px + env(safe-area-inset-bottom));
	}

	.vataly-cart--filled .vcart-checkout {
		position: fixed;
		right: 0;
		bottom: 0;
		left: 0;
		z-index: 90;
		padding: var(--space_16) var(--space_20) calc(var(--space_16) + env(safe-area-inset-bottom));
		border-top: 1px solid var(--b_clr);
		background: var(--bg_clr1);
	}
}
