/* TG cart drawer (self-contained; harmonises with theme tokens when present). */
.tg-cart-drawer {
	position: fixed; top: 0; right: 0; bottom: 0; z-index: 210;
	width: min(92vw, 400px);
	background: var(--tg-white, #fff);
	color: var(--tg-ink, #141414);
	box-shadow: var(--tg-shadow-lg, 0 8px 28px rgba(0,0,0,.16));
	transform: translateX(100%);
	transition: transform 320ms cubic-bezier(.4,0,.2,1);
	display: flex; flex-direction: column;
	padding-bottom: env(safe-area-inset-bottom, 0px);
}
.tg-cart-drawer.is-open { transform: translateX(0); }
.tg-cart-drawer__head {
	display: flex; align-items: center; justify-content: space-between;
	padding: 16px 20px; border-bottom: 1px solid var(--tg-border, #e3e6e9);
	font-size: 1.05rem;
}
/* .tg-iconbtn is the header's button, which is white for the black bar: on
   this white panel the close cross was invisible. */
.tg-cart-drawer__head .tg-iconbtn { font-size: 26px; line-height: 1; width: 44px; height: 44px; background: none; border: 0; cursor: pointer; color: var(--tg-ink, #141414); }
.tg-cart-drawer__body { flex: 1; overflow-y: auto; padding: 16px 20px; }

/* Mini-cart list. Self-contained because WooCommerce's widget CSS is not
   enqueued off shop pages, so the drawer must style its own contents. */
.tg-cart-drawer .woocommerce-mini-cart,
.tg-cart-drawer ul.cart_list,
.tg-cart-drawer ul.product_list_widget { list-style: none; margin: 0; padding: 0; }
.tg-cart-drawer .mini_cart_item { position: relative; padding: 12px 0 12px 30px; border-bottom: 1px solid var(--tg-border, #e3e6e9); }
.tg-cart-drawer .mini_cart_item > a:not(.remove) {
	display: flex; align-items: center; gap: 12px;
	color: var(--tg-ink, #141414); font-weight: 600; text-decoration: none; font-size: 14px;
}
.tg-cart-drawer .mini_cart_item img {
	width: 56px !important; height: 56px !important; flex: 0 0 56px;
	object-fit: contain; float: none !important; margin: 0 !important;
	background: var(--tg-paper, #f6f6f4); border-radius: 8px;
}
.tg-cart-drawer .mini_cart_item .quantity { display: block; margin-top: 6px; font-size: 13px; color: var(--tg-text-muted, #565c63); }
.tg-cart-drawer .mini_cart_item a.remove,
.tg-cart-drawer .mini_cart_item .remove_from_cart_button {
	position: absolute; top: 14px; left: 0; width: 22px; height: 22px;
	display: inline-flex; align-items: center; justify-content: center;
	border-radius: 50%; background: var(--tg-paper, #f6f6f4);
	color: #cf3b2e !important; font-size: 15px; line-height: 1; text-decoration: none; font-weight: 700;
}
.tg-cart-drawer .woocommerce-mini-cart__total { display: flex; justify-content: space-between; align-items: baseline; margin: 14px 0 0; font-size: 15px; }
.tg-cart-drawer .woocommerce-mini-cart__empty-message { color: var(--tg-text-muted, #565c63); }

.tg-cart-drawer .woocommerce-mini-cart__buttons { display: flex; gap: 10px; margin: 14px 0 0; padding: 0; }
.tg-cart-drawer .woocommerce-mini-cart__buttons .button {
	flex: 1; display: inline-flex; align-items: center; justify-content: center;
	min-height: 48px; border-radius: 10px; font-weight: 600; text-decoration: none;
	background: var(--tg-paper, #f6f6f4); color: var(--tg-ink, #141414);
}
.tg-cart-drawer .woocommerce-mini-cart__buttons .checkout {
	/* The accessible green, as elsewhere: white on the brand green is 2.74:1. */
	background: var(--tg-green-fill, #43841e); color: #fff;
}

/* Cart overlay (distinct from the menu overlay). */
[data-tg-cart-overlay] {
	position: fixed; inset: 0; z-index: 205;
	background: rgba(0,0,0,.5); opacity: 0; visibility: hidden;
	transition: opacity 200ms ease, visibility 200ms ease;
}
[data-tg-cart-overlay].is-open { opacity: 1; visibility: visible; }

/* Free-delivery progress (persistent basket state + delivery threshold). */
.tg-cart-delivery { margin: 0 0 14px; padding: 10px 12px; background: var(--tg-paper, #f6f6f4); border-radius: 10px; }
.tg-cart-delivery__msg { margin: 0 0 8px; font-size: 13px; color: var(--tg-ink, #141414); }
/* As text rather than a fill, so the green that passes as text. */
.tg-cart-delivery__msg.is-met { color: var(--tg-green-text, #3f7d1d); font-weight: 600; }
.tg-cart-delivery__bar { display: block; height: 6px; border-radius: 999px; background: var(--tg-border, #e3e6e9); overflow: hidden; }
.tg-cart-delivery__bar > span { display: block; height: 100%; background: var(--tg-green, #5faf2d); border-radius: 999px; transition: width 250ms ease; }
