/**
 * Bag drawer — Figma "VATALY — Cart", Drawer canvas (cart-drawer.md). See
 * inc/cart-drawer.php and woocommerce/cart/mini-cart.php.
 *
 * Desktop: Overlay/Drawer Right, 400 × full height, 32px padding (content
 * 334), 1px sand border, square corners; Header / Content / Footer 24px apart;
 * the content scrolls, header and footer stay put (S9). Mobile (≤767.98px,
 * Figma 402): Right Mobile, viewport − 26px (the page peeks under the scrim),
 * 20px padding. Scrim: ink at 40%.
 *
 * Konte's off-canvas rules (.offscreen-panel …, .cart-panel …) still apply to
 * the shell and its slide-in transition; everything here is scoped to
 * #cart-panel.vdrawer so it wins without !important. The line items, buttons
 * and empty state come from css/bag.css.
 */

#cart-panel.vdrawer .backdrop {
	background: color-mix(in srgb, var(--ink_text) 40%, transparent);
	touch-action: none; /* a swipe on the scrim never scrolls the page behind */
}

#cart-panel.vdrawer .panel {
	box-sizing: border-box;
	display: flex;
	flex-direction: column;
	gap: var(--space_24);
	width: 400px;
	max-width: 100%;
	padding: 32px;
	border: 1px solid var(--b_clr);
	border-radius: 0;
	background: var(--bg_clr1);
	box-shadow: none;
	color: var(--ink_text);
	font-family: var(--font2), sans-serif;
}

#cart-panel.vdrawer .panel *,
#cart-panel.vdrawer .panel *::before,
#cart-panel.vdrawer .panel *::after {
	box-sizing: border-box;
}

/* Header — YOUR BAG (n), Header 18, + 16px close. */
#cart-panel.vdrawer .panel-header {
	display: flex;
	flex: none;
	align-items: center;
	justify-content: space-between;
	gap: var(--space_16);
	padding: 0;
}

#cart-panel.vdrawer .vdrawer__title {
	margin: 0;
	color: var(--ink_text);
	font-family: var(--font2), sans-serif !important; /* css/typography.css: h2 → Cormorant !important */
	font-size: 18px;
	font-weight: 700;
	line-height: 1.36;
	letter-spacing: 0;
	text-transform: uppercase;
}

#cart-panel.vdrawer .cart-panel-counter {
	margin-left: 0;
}

/* 16px icon, 24px tap area without moving it. */
#cart-panel.vdrawer .vdrawer__close {
	position: static;
	display: flex;
	flex: none;
	align-items: center;
	justify-content: center;
	margin: -4px;
	padding: 4px;
	border: 0;
	border-radius: 0;
	background: transparent;
	color: var(--ink_text);
	cursor: pointer;
}

#cart-panel.vdrawer .vdrawer__close:hover,
#cart-panel.vdrawer .vdrawer__close:focus {
	background: transparent;
	color: var(--ink_text);
}

#cart-panel.vdrawer .vdrawer__close:focus-visible {
	outline: 2px solid var(--ink_text);
	outline-offset: 0;
}

/* Body = the mini-cart fragment: scrolling content + pinned footer. */
#cart-panel.vdrawer .panel-content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	min-height: 0;
	padding: 0;
	overflow: hidden;
}

#cart-panel.vdrawer .widget_shopping_cart_content {
	display: flex;
	flex: 1 1 auto;
	flex-direction: column;
	gap: var(--space_24);
	height: 100%;
	min-height: 0;
}

#cart-panel.vdrawer .vdrawer__content {
	flex: 1 1 auto;
	min-height: 0;
	overflow-y: auto;
	overscroll-behavior: contain; /* the list's end doesn't chain to the page */
	scrollbar-width: thin;
	scrollbar-color: var(--h_clr) transparent;
}

#cart-panel.vdrawer .vdrawer__content::-webkit-scrollbar {
	width: 4px;
}

#cart-panel.vdrawer .vdrawer__content::-webkit-scrollbar-thumb {
	background: var(--h_clr);
}

#cart-panel.vdrawer .vdrawer__items {
	margin: 0;
}

/* REMOVE is an underlined text link (as on the cart page); muted on an
 * unavailable line, still clickable (S4). */
#cart-panel.vdrawer .vco-item__remove {
	display: inline-block;
	border: 0;
	text-decoration: underline;
	text-underline-offset: 3px;
}

#cart-panel.vdrawer .vco-item.is-unavailable .vco-item__remove {
	color: var(--h_clr);
}

/* Notice slot at the top of the content (S1 new line, S5, S6, S7): 16px
 * below. Notices inside a line (S1 for a line already in the bag, S3 max,
 * price / stock changes) are full width at its bottom: css/bag.css. */
#cart-panel.vdrawer .vdrawer__content > .vcart-notice {
	margin-bottom: var(--space_16);
}

/* Footer — SUBTOTAL (Header 14), VIEW BAG, CHECKOUT, 12px apart. */
#cart-panel.vdrawer .vdrawer__footer {
	display: flex;
	flex: none;
	flex-direction: column;
	gap: var(--space_12);
}

#cart-panel.vdrawer .vdrawer__subtotal {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: var(--space_16);
	margin: 0;
	color: var(--ink_text);
	font-size: 14px;
	font-weight: 700;
	line-height: 1.36;
	text-transform: uppercase;
}

#cart-panel.vdrawer .vdrawer__btn {
	width: 100%;
	height: 55px;
	text-decoration: none;
}

/* Prices follow their row (a PDP rule sets the ₹ symbol to 16px). */
#cart-panel.vdrawer .woocommerce-Price-amount,
#cart-panel.vdrawer .woocommerce-Price-currencySymbol {
	font-size: inherit;
	line-height: inherit;
}

/* Empty: the state sits at the top of the content, no footer. */
#cart-panel.vdrawer .vdrawer__content--empty .vcart-empty {
	width: 100%;
}

@media (max-width: 767.98px) {
	#cart-panel.vdrawer .panel {
		width: calc(100% - 26px);
		padding: var(--space_20);
	}
}
