/**
 * Cart drawer (Astra flyout + WooCommerce mini-cart).
 * Slides from the right; 420px on desktop, full width on phones (inc/astra-options.php).
 */

.astra-mobile-cart-overlay {
	background-color: var(--lpz-overlay);
	-webkit-backdrop-filter: blur(4px);
	backdrop-filter: blur(4px);
}

.astra-cart-drawer {
	background-color: var(--lpz-bg);
	border-left: 1px solid var(--lpz-border);
	color: var(--lpz-text);
	box-shadow: -24px 0 48px rgb(0 0 0 / 0.4);
}

.astra-cart-drawer .astra-cart-drawer-header {
	display: flex;
	flex-direction: row-reverse;
	align-items: center;
	justify-content: space-between;
	padding: var(--lpz-space-4) var(--lpz-space-5);
	border-bottom: 1px solid var(--lpz-border);
	background: transparent;
}

.astra-cart-drawer .astra-cart-drawer-title {
	color: var(--lpz-text);
	font-size: var(--lpz-text-lg);
	font-weight: 700;
	letter-spacing: var(--lpz-tracking-tight);
}

.astra-cart-drawer .astra-cart-drawer-close {
	position: static;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: var(--lpz-touch);
	min-height: var(--lpz-touch);
	padding: 0;
	background: transparent;
	border: 0;
	border-radius: var(--lpz-radius-sm);
	color: var(--lpz-text);
}

.astra-cart-drawer .astra-cart-drawer-close:hover {
	background-color: rgb(255 255 255 / 0.06);
}

.astra-cart-drawer .astra-cart-drawer-close .ast-close-svg {
	width: 18px;
	height: 18px;
	fill: currentColor;
}

/* Astra positions the header absolutely: the content starts below it (the first item used to sit under
   the header and its close button). */
.astra-cart-drawer {
	--lpz-drawer-header: 56px;
}

.astra-cart-drawer .astra-cart-drawer-header {
	min-height: var(--lpz-drawer-header);
	box-sizing: border-box;
}

.astra-cart-drawer .astra-cart-drawer-content {
	padding: var(--lpz-drawer-header) var(--lpz-space-5) var(--lpz-space-5);
}

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

/*
 * Each item: thumbnail top-left, title + details + quantity in the middle, remove button in its own
 * column on the right (WooCommerce/Astra position the image and the remove link absolutely; the item's
 * padding reserves their space so long titles and notes never run under them). The item list keeps
 * Astra's own scrolling; subtotal and buttons stay below it.
 */
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart {
	padding-top: var(--lpz-space-2);
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item {
	position: relative;
	min-height: calc(64px + 2 * var(--lpz-space-4));
	margin: 0;
	padding: var(--lpz-space-4) calc(var(--lpz-touch) - 4px + var(--lpz-space-1)) var(--lpz-space-4) calc(64px + var(--lpz-space-4));
	border-bottom: 1px solid var(--lpz-border);
	color: var(--lpz-text);
	font-size: var(--lpz-text-sm);
	line-height: var(--lpz-leading-snug);
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item:last-child {
	border-bottom: 0;
}

/* WooCommerce's float clearfix is not needed (no floats left) and widened the item by a few pixels. */
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item::before,
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item::after {
	content: none;
}

/* Title (the link also holds the thumbnail). */
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item a:not(.remove) {
	display: block;
	margin: 0;
	padding: 0;
	color: var(--lpz-text);
	font-weight: 600;
	text-decoration: none;
	overflow-wrap: break-word;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item a:not(.remove):hover {
	color: var(--lpz-accent-hover);
}

/* Product photos have light studio backgrounds: keep them on a light tile, uncropped. */
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item img {
	position: absolute;
	top: var(--lpz-space-4);
	left: 0;
	width: 64px;
	height: 64px;
	max-width: none;
	margin: 0;
	transform: none;
	object-fit: contain;
	background-color: #f5f5f7;
	border-radius: var(--lpz-radius-sm);
}

/* Personalisation and variation details: "Label: value", one pair per line; long values (Napomena)
   wrap across the item's full width instead of a narrow value column. */
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item dl.variation {
	display: block;
	margin: var(--lpz-space-2) 0 0;
	padding: 0;
	border: 0;
	font-size: var(--lpz-text-xs);
	line-height: 1.5;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item dl.variation::before,
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item dl.variation::after {
	content: none;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item dl.variation dt,
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item dl.variation dd {
	display: inline;
	float: none;
	clear: none;
	margin: 0;
	padding: 0;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item dl.variation dt {
	margin-right: 0.3em;
	color: var(--lpz-text-muted);
	font-weight: 500;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item dl.variation dd {
	color: var(--lpz-text);
	overflow-wrap: break-word;
}

/* A line break after each value: the next label starts on a new line. */
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item dl.variation dd::after {
	content: "\A";
	white-space: pre;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item dl.variation dd p {
	display: inline;
	margin: 0;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item .quantity {
	display: block;
	margin-top: var(--lpz-space-2);
	color: var(--lpz-text-muted);
	font-size: var(--lpz-text-sm);
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item .quantity .amount {
	color: var(--lpz-text);
	font-weight: 600;
}

/* Quantity stepper (luksplayz-core mini-cart-qty.php + Astra's -/+ buttons): field, buttons, then "× unit price". */
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item .lpz-mini-qty {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: var(--lpz-space-2);
	margin-top: var(--lpz-space-2);
	color: var(--lpz-text-muted);
	font-size: var(--lpz-text-sm);
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item .lpz-mini-qty .quantity {
	display: inline-flex;
	align-items: stretch;
	margin: 0;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item .lpz-mini-qty .qty {
	width: 2.5rem;
	min-height: 36px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--lpz-border-strong);
	border-inline: 0;
	border-radius: 0;
	background-color: var(--lpz-bg);
	color: var(--lpz-text);
	font-size: var(--lpz-text-sm);
	font-variant-numeric: tabular-nums;
	text-align: center;
	-moz-appearance: textfield;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item .lpz-mini-qty .qty::-webkit-inner-spin-button,
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item .lpz-mini-qty .qty::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item .lpz-mini-qty .minus,
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item .lpz-mini-qty .plus {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	min-height: 36px;
	margin: 0;
	padding: 0;
	border: 1px solid var(--lpz-border-strong);
	background-color: var(--lpz-surface-raised);
	color: var(--lpz-text);
	font-size: var(--lpz-text-base);
	line-height: 1;
	text-decoration: none;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item .lpz-mini-qty .minus {
	border-radius: var(--lpz-radius-sm) 0 0 var(--lpz-radius-sm);
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item .lpz-mini-qty .plus {
	border-radius: 0 var(--lpz-radius-sm) var(--lpz-radius-sm) 0;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item .lpz-mini-qty .minus:hover,
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item .lpz-mini-qty .plus:hover {
	border-color: var(--lpz-accent);
	color: var(--lpz-accent-hover);
}

/* While the new quantity is saved; WooCommerce's fresh drawer markup replaces this. */
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart.lpz-mini-qty-busy .lpz-mini-qty {
	opacity: 0.6;
	pointer-events: none;
}

/* Remove: its own column top-right, a 40px target around a 28px circle. */
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item a.remove {
	position: absolute;
	top: calc(var(--lpz-space-4) - 6px);
	right: 0;
	left: auto;
	display: flex;
	align-items: center;
	justify-content: center;
	width: calc(var(--lpz-touch) - 4px);
	height: calc(var(--lpz-touch) - 4px);
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: var(--lpz-radius-pill);
	background: transparent;
	color: #c5cad3 !important; /* Between text and muted: clearly visible. WooCommerce sets it with !important. */
	line-height: 1;
	overflow: hidden; /* Astra's icon rules leave invisible extra width that widened the item. */
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item a.remove::before {
	content: "";
	position: absolute;
	inset: 6px;
	/* Astra's ring sets width/height: 100%; with the inset that drew it 6px off-centre and clipped. */
	width: auto;
	height: auto;
	border: 1px solid rgb(156 163 175 / 0.75);
	background-color: rgb(255 255 255 / 0.04);
	border-radius: var(--lpz-radius-pill);
}

/* Astra's icon wrapper carries its own spacing; keep the icon centred inside the button. */
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item a.remove .ahfb-svg-iconset {
	display: flex;
	margin: 0;
	padding: 0;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item a.remove svg {
	width: 18px;
	height: 18px;
	margin: 0;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item a.remove:hover,
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item a.remove:focus-visible {
	background: transparent;
	color: var(--lpz-danger) !important;
}

.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item a.remove:hover::before,
.astra-cart-drawer .widget_shopping_cart .woocommerce-mini-cart li.woocommerce-mini-cart-item a.remove:focus-visible::before {
	border-color: var(--lpz-danger);
}

/* --------------------------------------------------------- Total & actions */

.woocommerce-js .astra-cart-drawer .astra-cart-drawer-content .woocommerce-mini-cart__total {
	display: flex;
	justify-content: space-between;
	margin: 0;
	padding-block: var(--lpz-space-4) var(--lpz-space-2);
	border-top: 0;
	border-bottom: 0;
	color: var(--lpz-text);
	font-size: var(--lpz-text-lg);
}

.lpz-drawer__note {
	margin: 0 0 var(--lpz-space-4);
	color: var(--lpz-text-muted);
	font-size: var(--lpz-text-xs);
}

body .astra-cart-drawer .woocommerce-mini-cart__buttons {
	display: grid;
	gap: var(--lpz-space-3);
	margin: 0;
}

body .astra-cart-drawer .woocommerce-mini-cart__buttons .button {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 48px;
	margin: 0;
	letter-spacing: 0.06em;
}

body .astra-cart-drawer .woocommerce-mini-cart__buttons .button.lpz-drawer__continue {
	background-color: transparent;
	border: 1px solid var(--lpz-border-strong);
	color: var(--lpz-text);
}

body .astra-cart-drawer .woocommerce-mini-cart__buttons .button.lpz-drawer__continue:hover,
body .astra-cart-drawer .woocommerce-mini-cart__buttons .button.lpz-drawer__continue:focus-visible {
	background-color: var(--lpz-surface-raised);
	border-color: var(--lpz-accent);
	color: var(--lpz-text);
}

.lpz-drawer__view-cart {
	display: block;
	margin-top: var(--lpz-space-4);
	color: var(--lpz-text-muted);
	font-size: var(--lpz-text-sm);
	text-align: center;
	text-decoration: underline;
	text-underline-offset: 0.2em;
}

.lpz-drawer__view-cart:hover {
	color: var(--lpz-accent-hover);
}

.astra-cart-drawer .woocommerce-mini-cart__empty-message {
	padding-block: var(--lpz-space-7);
	color: var(--lpz-text-muted);
	text-align: center;
}
