/**
 * 2G Vibe — Cart page styles
 * Location: woostify-child/assets/css/cart.css
 * Loaded only on is_cart() — see inc/cart-functions.php
 *
 * Naming: BEM-ish with a `tg-` prefix so nothing collides with Woostify or
 * WooCommerce core classes. Where we restyle a core class (.checkout-button,
 * .shop_table) it is scoped under .tg-cart so it cannot leak to other pages.
 *
 * All colours are defined once as custom properties below. If the client
 * rebrands, you change them here and nowhere else. Do not hardcode hex values
 * further down this file.
 */

:root {
	--tg-gold:          #d4a017; /* announcement + footer bars */
	--tg-amber:         #efba62; /* cart table header */
	--tg-brown:         #4a2317; /* primary buttons */
	--tg-brown-hover:   #351409;
	--tg-ink:           #2b2b2b;
	--tg-muted:         #6f6f6f;
	--tg-line:          #e6e6e6;
	--tg-line-soft:     #f0f0f0;
	--tg-bg-soft:       #f5f5f5;
	--tg-white:         #ffffff;
	--tg-danger:        #b3261e;

	--tg-radius:        4px;
	--tg-container:     1200px;
	--tg-ease:          .18s ease;
}

/* -------------------------------------------------------------------------
 * Layout scaffolding
 * ---------------------------------------------------------------------- */

/*
 * Full-bleed helper. The cart template renders inside Woostify's content
 * container, but the hero and badge strips need to span the viewport.
 *
 * NOTE: if you see a 1–2px horizontal scrollbar on Windows, add
 * `overflow-x: clip;` to your site wrapper — do NOT use overflow-x: hidden on
 * <body>, it breaks position:sticky further down this file.
 */
.tg-hero,
.tg-badges {
	width: 100vw;
	margin-left: calc(50% - 50vw);
	margin-right: calc(50% - 50vw);
}

.tg-hero__inner,
.tg-badges__inner,
.tg-cart {
	max-width: var(--tg-container);
	margin-inline: auto;
	padding-inline: 20px;
	box-sizing: border-box;
}

/* -------------------------------------------------------------------------
 * Hero banner
 * ---------------------------------------------------------------------- */

.tg-hero {
	position: relative;
	background-color: var(--tg-bg-soft);
	padding: 62px 0 58px;
	overflow: hidden;
	text-align: center;
}

/*
 * The scattered dots in the design are drawn with layered radial-gradients
 * rather than a background image — zero HTTP requests, scales on retina,
 * recolours with the palette.
 */
.tg-hero::before,
.tg-hero::after {
	content: "";
	position: absolute;
	width: 210px;
	height: 110px;
	background-image: radial-gradient(circle, #dcdcdc 2.2px, transparent 2.4px);
	background-size: 26px 26px;
	opacity: .85;
	pointer-events: none;
}

.tg-hero::before { top: 18px;    right: 6%; }
.tg-hero::after  { bottom: 12px; left:  8%; }

.tg-hero__title {
	margin: 0 0 12px;
	font-size: clamp(30px, 4.4vw, 46px);
	line-height: 1.15;
	font-weight: 600;
	color: var(--tg-ink) !important;
	letter-spacing: -.01em;
}

.tg-hero__crumbs {
	font-size: 15px;
	color: var(--tg-ink);
}

.tg-hero__crumbs a {
	color: var(--tg-ink);
	text-decoration: none;
	transition: color var(--tg-ease);
}

.tg-hero__crumbs a:hover,
.tg-hero__crumbs a:focus-visible { color: var(--tg-gold); }

.tg-hero__sep { margin: 0 10px; color: var(--tg-muted); }

/* -------------------------------------------------------------------------
 * Cart grid
 * ---------------------------------------------------------------------- */

.tg-cart {
	display: grid;
	grid-template-columns: minmax(0, 1fr) 380px;
	align-items: start;
	gap: 40px;
	padding-block: 56px 64px;
}

.tg-cart__form       { min-width: 0; }
.tg-cart__collaterals { min-width: 0; }

/* -------------------------------------------------------------------------
 * Cart table
 * ---------------------------------------------------------------------- */

.tg-cart .tg-cart__table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	background: transparent;
}

.tg-cart .tg-cart__table thead th {
	background: var(--tg-amber);
	color: var(--tg-ink);
	font-size: 15px;
	font-weight: 600;
	text-align: center;
	padding: 17px 14px;
	border: 0;
	white-space: nowrap;
}

.tg-cart .tg-cart__table thead th.product-name {
	text-align: left;
	padding-left: 58px; /* aligns "Product" past the remove + thumb columns */
}
.tg-cart .tg-cart__table tbody td.product-name a {
	white-space: nowrap !important;
    overflow: hidden !important;
    text-overflow: ellipsis !important;
	display: block;
}
.tg-cart .tg-cart__table tbody td {
	background: var(--tg-white);
	border: 0;
	border-bottom: 1px solid var(--tg-line-soft);
	padding: 22px 14px;
	vertical-align: middle;
	text-align: center;
	color: var(--tg-ink);
	font-size: 16px;
}

/* Remove (×) */
.tg-cart .product-remove {
	width: 44px;
	padding-inline: 8px 0;
}

.tg-cart .tg-cart__remove {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 26px;
	height: 26px;
	font-size: 21px;
	line-height: 1;
	color: var(--tg-muted);
	text-decoration: none;
	border-radius: 50%;
	transition: color var(--tg-ease), background var(--tg-ease);
}

.tg-cart .tg-cart__remove:hover,
.tg-cart .tg-cart__remove:focus-visible {
	color: var(--tg-danger);
	background: #faeceb;
}

/* Thumbnail */
.tg-cart .product-thumbnail {
	width: 108px;
	padding-inline: 0;
}

.tg-cart .product-thumbnail img {
	display: block;
	width: 88px;
	height: 108px;
	object-fit: cover;
	border-radius: var(--tg-radius);
	background: var(--tg-bg-soft);
}

/* Name */
.tg-cart .product-name {
	text-align: left;
	font-size: 17px;
	font-weight: 500;
	padding-left: 18px;
}

.tg-cart .product-name a {
	color: var(--tg-ink);
	text-decoration: none;
	transition: color var(--tg-ease);
}

.tg-cart .product-name a:hover,
.tg-cart .product-name a:focus-visible { color: var(--tg-gold); }

.tg-cart .product-name .variation,
.tg-cart .product-name dl.variation {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--tg-muted);
	font-weight: 400;
}

.tg-cart .backorder_notification {
	margin: 6px 0 0;
	font-size: 13px;
	color: var(--tg-danger);
}

.tg-cart .product-price,
.tg-cart .product-subtotal { white-space: nowrap; }

.tg-cart .product-subtotal { font-weight: 600; }

/* Strike-through on sale prices inside the cart */
.tg-cart del { color: var(--tg-muted); font-weight: 400; margin-right: 6px; }
.tg-cart ins { text-decoration: none; }

/* -------------------------------------------------------------------------
 * Quantity stepper
 * ---------------------------------------------------------------------- */

.tg-qty {
	display: inline-flex;
	align-items: stretch;
	border: 1px solid var(--tg-line);
	border-radius: var(--tg-radius);
	overflow: hidden;
	background: var(--tg-white);
}

.tg-qty__btn {
	width: 42px;
	min-height: 44px;          /* 44px = accessible tap target */
	border: 0;
	background: var(--tg-white);
	color: var(--tg-ink);
	font-size: 19px;
	line-height: 1;
	cursor: pointer;
	transition: background var(--tg-ease), color var(--tg-ease);
}

.tg-qty__btn:hover:not(:disabled) { background: var(--tg-bg-soft); }

.tg-qty__btn:disabled {
	color: #c4c4c4;
	cursor: not-allowed;
}

.tg-qty__btn--minus { border-right: 1px solid var(--tg-line); }
.tg-qty__btn--plus  { border-left:  1px solid var(--tg-line); }

/* WooCommerce's own .quantity wrapper + input */
.tg-qty .quantity { margin: 0; display: flex; }

.tg-qty input.qty {
	width: 54px;
	min-height: 44px;
	border: 0;
	padding: 0;
	text-align: center;
	font-size: 16px;
	color: var(--tg-ink);
	background: var(--tg-white);
	-moz-appearance: textfield;
	appearance: textfield;
}

.tg-qty input.qty::-webkit-outer-spin-button,
.tg-qty input.qty::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.tg-qty input.qty:focus-visible {
	outline: 2px solid var(--tg-gold);
	outline-offset: -2px;
}

/* Row-level loading state while the AJAX request is in flight */
.tg-cart .cart_item.is-updating { opacity: .5; pointer-events: none; }
.tg-cart .cart_item { transition: opacity var(--tg-ease); }

/* -------------------------------------------------------------------------
 * Actions row — coupon + clear
 * ---------------------------------------------------------------------- */

.tg-cart .tg-cart__actions-row td.actions {
	background: transparent;
	border-bottom: 0;
	padding: 30px 0 0;
	text-align: left;
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 18px;
}

.tg-cart__coupon {
	display: flex;
	align-items: stretch;
	gap: 14px;
	flex: 1 1 420px;
}

.tg-cart .tg-cart__coupon-input {
	flex: 1 1 auto;
	max-width: 310px;
	min-height: 52px;
	padding: 0 18px;
	border: 1px solid var(--tg-line);
	border-radius: var(--tg-radius);
	font-size: 15px;
	color: var(--tg-ink);
	background: var(--tg-white);
}

.tg-cart .tg-cart__coupon-input::placeholder { color: #a5a5a5; }

.tg-cart .tg-cart__coupon-input:focus-visible {
	outline: 2px solid var(--tg-gold);
	outline-offset: 1px;
	border-color: var(--tg-gold);
}

.tg-cart__actions-right {
	display: flex;
	align-items: center;
	gap: 22px;
	margin-left: auto;
}

/* Shared button style */
.tg-cart .tg-btn,
.tg-cart .checkout-button,
.tg-cart-empty .tg-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 34px;
	border: 0;
	border-radius: var(--tg-radius);
	background: var(--tg-brown);
	color: var(--tg-white);
	font-size: 15px;
	font-weight: 600;
	letter-spacing: .01em;
	text-decoration: none;
	cursor: pointer;
	transition: background var(--tg-ease), transform var(--tg-ease);
}

.tg-cart .tg-btn:hover,
.tg-cart .checkout-button:hover,
.tg-cart-empty .tg-btn:hover {
	background: var(--tg-brown-hover);
	color: var(--tg-white);
}

.tg-cart .tg-btn:active,
.tg-cart .checkout-button:active { transform: translateY(1px); }

.tg-cart .tg-btn:focus-visible,
.tg-cart .checkout-button:focus-visible {
	outline: 2px solid var(--tg-gold);
	outline-offset: 2px;
}

/* Clear cart link */
.tg-cart__clear {
	font-size: 15px;
	font-weight: 500;
	color: var(--tg-ink);
	text-decoration: underline;
	text-underline-offset: 4px;
	transition: color var(--tg-ease);
	white-space: nowrap;
}

.tg-cart__clear:hover,
.tg-cart__clear:focus-visible { color: var(--tg-danger); }

/*
 * "Update cart" is the no-JS fallback. cart.js removes .is-js-hidden if AJAX
 * is unavailable, so it is never permanently unreachable.
 */
.tg-cart .tg-cart__update {
	position: absolute;
	width: 1px; height: 1px;
	overflow: hidden;
	clip: rect(0 0 0 0);
	clip-path: inset(50%);
	white-space: nowrap;
}

.tg-cart.no-ajax .tg-cart__update {
	position: static;
	width: auto; height: auto;
	overflow: visible;
	clip: auto;
	clip-path: none;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 52px;
	padding: 0 28px;
	border-radius: var(--tg-radius);
	background: var(--tg-brown);
	color: var(--tg-white);
	font-weight: 600;
	border: 0;
	cursor: pointer;
}

/* -------------------------------------------------------------------------
 * Order Summary panel
 * ---------------------------------------------------------------------- */

.tg-cart .tg-summary {
	position: sticky;
	top: 24px;
	background: var(--tg-white);
	border: 1px solid var(--tg-line);
	border-radius: var(--tg-radius);
	padding: 26px 28px 28px;
	float: none;
	width: auto;
}

.tg-summary__title {
	margin: 0 0 6px;
	font-size: 19px;
	font-weight: 600;
	color: var(--tg-ink);
}

.tg-cart .tg-summary__table {
	width: 100%;
	margin: 0;
	border: 0;
	border-collapse: collapse;
	background: transparent;
}

.tg-cart .tg-summary__table th,
.tg-cart .tg-summary__table td {
	border: 0;
	background: transparent;
	padding: 13px 0;
	font-size: 15px;
	font-weight: 400;
	vertical-align: top;
}

.tg-cart .tg-summary__table th {
	text-align: left;
	color: var(--tg-muted);
}

.tg-cart .tg-summary__table td {
	text-align: right;
	color: var(--tg-ink);
	white-space: nowrap;
}

.tg-cart .tg-summary__row--items th { padding-top: 18px; }

.tg-cart .tg-summary__row + .tg-summary__row th,
.tg-cart .tg-summary__row + .tg-summary__row td {
	border-top: 1px solid var(--tg-line-soft);
}

.tg-summary__muted { color: var(--tg-muted); font-size: 14px; }

.tg-summary__coupon-code {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	letter-spacing: .06em;
	text-transform: uppercase;
	color: var(--tg-gold);
}

.tg-cart .tg-summary__row--discount td { color: var(--tg-danger); }

.tg-cart .tg-summary__row--discount .woocommerce-remove-coupon {
	display: block;
	margin-top: 3px;
	font-size: 12px;
	color: var(--tg-muted);
	text-decoration: underline;
}

.tg-cart .tg-summary__row--total th,
.tg-cart .tg-summary__row--total td {
	border-top: 1px solid var(--tg-line);
	padding-top: 18px;
	font-size: 17px;
	font-weight: 700;
	color: var(--tg-ink);
}

.tg-cart .tg-summary__cta { margin-top: 22px; }

.tg-cart .tg-summary__cta .checkout-button {
	display: flex;
	width: 100%;
	margin: 0;
}

/* Shipping method radios, when zones eventually exist */
.tg-cart .tg-summary__table .woocommerce-shipping-methods {
	margin: 0;
	padding: 0;
	list-style: none;
	text-align: right;
}

.tg-cart .tg-summary__table .woocommerce-shipping-methods li { margin-bottom: 6px; }

.tg-cart .tg-summary__table .woocommerce-shipping-destination,
.tg-cart .tg-summary__table .shipping-calculator-button {
	display: block;
	margin-top: 6px;
	font-size: 13px;
	color: var(--tg-muted);
}

/* -------------------------------------------------------------------------
 * Empty cart
 * ---------------------------------------------------------------------- */

.tg-cart-empty {
	max-width: 520px;
	margin: 0 auto;
	padding: 76px 20px 90px;
	text-align: center;
}

.tg-cart-empty__icon { color: #cfcfcf; margin-bottom: 22px; }

.tg-cart-empty__title {
	margin: 0 0 12px;
	font-size: 26px;
	font-weight: 600;
	color: var(--tg-ink);
}

.tg-cart-empty__text {
	margin: 0 0 30px;
	font-size: 16px;
	line-height: 1.6;
	color: var(--tg-muted);
}

/* -------------------------------------------------------------------------
 * Trust badges
 * ---------------------------------------------------------------------- */

.tg-badges {
	background: var(--tg-bg-soft);
	padding: 46px 0 50px;
}

.tg-badges__inner {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 28px;
	text-align: center;
}

.tg-badges__icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 54px;
	height: 54px;
	margin-bottom: 14px;
	border-radius: 14px;
	background: #ebebeb;
	color: var(--tg-ink);
}

.tg-badges__title {
	margin: 0 0 6px;
	font-size: 17px;
	font-weight: 500;
	color: var(--tg-ink);
}

.tg-badges__text {
	margin: 0;
	font-size: 14px;
	color: var(--tg-muted);
}

/* -------------------------------------------------------------------------
 * WooCommerce notices, scoped to the cart page
 * ---------------------------------------------------------------------- */

.tg-cart-notices { max-width: var(--tg-container); margin: 24px auto 0; padding-inline: 20px; }

/* -------------------------------------------------------------------------
 * Responsive
 * ---------------------------------------------------------------------- */

@media (max-width: 1024px) {
	.tg-cart {
		grid-template-columns: 1fr;
		gap: 32px;
		padding-block: 40px 48px;
	}

	.tg-cart .tg-summary { position: static; }
}

@media (max-width: 782px) {

	.tg-hero { padding: 42px 0 40px; }
	.tg-hero::before,
	.tg-hero::after { display: none; }

	/* Table collapses to stacked cards */
	.tg-cart .tg-cart__table thead { display: none; }

	.tg-cart .tg-cart__table,
	.tg-cart .tg-cart__table tbody,
	.tg-cart .tg-cart__table tr,
	.tg-cart .tg-cart__table td { display: block; width: 100%; }

	.tg-cart .tg-cart__table tr.cart_item {
		position: relative;
		border: 1px solid var(--tg-line);
		border-radius: var(--tg-radius);
		padding: 18px 16px 16px 118px;
		margin-bottom: 14px;
		min-height: 132px;
		background: var(--tg-white);
	}

	.tg-cart .tg-cart__table tr.cart_item td {
		border-bottom: 0;
		padding: 4px 0;
		text-align: left;
	}

	.tg-cart .product-thumbnail {
		position: absolute;
		top: 18px;
		left: 16px;
		width: 88px;
	}

	.tg-cart .product-remove {
		position: absolute;
		top: 10px;
		right: 8px;
		width: auto;
	}

	.tg-cart .product-name { padding-left: 0; font-size: 16px; }

	/* Label each value, using the data-title from the template */
	.tg-cart .product-price::before,
	.tg-cart .product-subtotal::before {
		content: attr(data-title) ": ";
		color: var(--tg-muted);
		font-weight: 400;
	}

	.tg-cart .product-quantity { padding-top: 10px !important; }

	.tg-cart .tg-cart__actions-row td.actions {
		display: block;
		padding-top: 8px;
	}

	.tg-cart__coupon {
		flex-wrap: wrap;
		margin-bottom: 18px;
	}

	.tg-cart .tg-cart__coupon-input { max-width: none; flex: 1 1 100%; }
	.tg-cart .tg-cart__coupon .tg-btn { width: 100%; }

	.tg-cart__actions-right {
		justify-content: center;
		margin-left: 0;
	}

	.tg-badges__inner {
		grid-template-columns: 1fr;
		gap: 30px;
	}
}

/* -------------------------------------------------------------------------
 * Motion preference
 * ---------------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
	.tg-cart *,
	.tg-cart *::before,
	.tg-cart *::after {
		transition-duration: .01ms !important;
		animation-duration: .01ms !important;
	}
}

/* -------------------------------------------------------------------------
 * Woostify layout overrides
 *
 * Woostify's WooCommerce stylesheet floats .woocommerce-cart-form left and
 * .cart-collaterals right with fixed percentage widths. Those floats fight the
 * CSS grid declared on .tg-cart further up this file and collapse the Order
 * Summary column to ~93px.
 *
 * The !important flags here are deliberate. Woostify's selectors are both more
 * specific than ours AND its stylesheet loads after ours, so specificity alone
 * cannot win. Every rule is scoped under .tg-cart so nothing leaks to other
 * WooCommerce pages -- do not remove that scoping.
 * ---------------------------------------------------------------------- */

.tg-cart > .tg-cart__form,
.tg-cart > .tg-cart__collaterals,
.tg-cart .cart-collaterals {
	float: none !important;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
	padding: 0 !important;
}

.tg-cart .cart-collaterals::before,
.tg-cart .cart-collaterals::after { content: none !important; }

.tg-cart .tg-summary {
	float: none !important;
	width: auto !important;
	max-width: none !important;
	margin: 0 !important;
}

/*
 * table-layout:fixed is what actually stops the table blowing past its grid
 * column. With auto layout the table cannot shrink below its min-content width
 * (~1030px here), so it overflowed the 710px column and slid under the Order
 * Summary. Fixed layout needs real column widths, which is why cart.php carries
 * a <colgroup> -- the colspan="3" "Product" header alone cannot define the
 * first three columns.
 */
.tg-cart .tg-cart__table {
	table-layout: fixed;
	width: 100% !important;
	max-width: 100% !important;
}

.tg-cart .tg-col-remove   { width: 46px; }
.tg-cart .tg-col-thumb    { width: 108px; }
.tg-cart .tg-col-name     { width: auto; }
.tg-cart .tg-col-price    { width: 108px; }
.tg-cart .tg-col-qty      { width: 158px; }
.tg-cart .tg-col-subtotal { width: 112px; }

/* Long product titles must wrap rather than force the column wider. */
.tg-cart .product-name,
.tg-cart .product-name a { overflow-wrap: anywhere; word-break: normal; }

/* Keep numeric columns tight so the product name gets the remaining space. */
.tg-cart .tg-cart__table thead th.product-price,
.tg-cart .tg-cart__table thead th.product-subtotal { width: 116px; }
.tg-cart .tg-cart__table thead th.product-quantity { width: 168px; }

@media (max-width: 1024px) {
	.tg-cart > .tg-cart__form,
	.tg-cart > .tg-cart__collaterals { width: auto !important; }
}

@media (max-width: 782px) {
	.tg-cart .tg-cart__table thead th.product-price,
	.tg-cart .tg-cart__table thead th.product-subtotal,
	.tg-cart .tg-cart__table thead th.product-quantity { width: auto; }
}


/* -------------------------------------------------------------------------
 * Woostify Pro quantity stepper conflict
 *
 * Woostify Pro injects its own +/- controls as <span class="product-qty">
 * either side of the quantity input, so the cart rendered two minus buttons.
 * Theirs are <span> elements: not keyboard focusable, no accessible name, and
 * not wired to our AJAX handler. We hide theirs and keep our <button> stepper,
 * which is focusable, labelled, and debounced.
 *
 * If Woostify ever stops injecting these, this rule becomes a harmless no-op.
 * ---------------------------------------------------------------------- */

.tg-cart .tg-qty .product-qty { display: none !important; }

/* Woostify widens the qty input to ~118px; hold it to the stepper design. */
.tg-cart .tg-qty input.qty {
	width: 54px !important;
	min-width: 0 !important;
	flex: 0 0 54px;
}

/*
 * Woostify also gives the .quantity wrapper a fixed ~120px width, which pushed
 * the whole stepper to 206px inside a 158px cell and clipped the plus button.
 * Collapse the wrapper to its content so the stepper is exactly
 * 42 + 54 + 42 = 138px.
 */
.tg-cart .tg-qty .quantity {
	width: auto !important;
	min-width: 0 !important;
	max-width: none !important;
	padding: 0 !important;
	margin: 0 !important;
	flex: 0 0 auto;
}

.tg-cart .tg-qty { flex-wrap: nowrap; }

/* -------------------------------------------------------------------------
 * Woostify button conflict
 *
 * Woostify styles `.woocommerce .button` with its own blue accent and a fixed
 * width, which rendered "Apply Coupon" blue and clipped its label, and forced
 * the actions row to wrap so "Clear Shopping Cart" dropped to a second line.
 * Scoped under .tg-cart so the rest of the site keeps Woostify's buttons.
 * ---------------------------------------------------------------------- */

.tg-cart .tg-btn,
.tg-cart button.tg-btn,
.tg-cart .tg-summary__cta .checkout-button {
	background-color: var(--tg-brown) !important;
	border: 0 !important;
	color: var(--tg-white) !important;
	width: auto !important;
	min-width: 0 !important;
	max-width: none !important;
	line-height: 1.2 !important;
	white-space: nowrap;
	flex: 0 0 auto;
}

.tg-cart .tg-btn:hover,
.tg-cart button.tg-btn:hover,
.tg-cart .tg-summary__cta .checkout-button:hover {
	background-color: var(--tg-brown-hover) !important;
	color: var(--tg-white) !important;
}

.tg-cart .tg-summary__cta .checkout-button { width: 100% !important; }

/*
 * Keep the coupon group and "Clear Shopping Cart" on one row. flex:1 1 420px
 * let the coupon group grow until it pushed the clear link onto a second line.
 */
.tg-cart .tg-cart__coupon { flex: 0 1 auto; }

@media (max-width: 782px) {
	.tg-cart .tg-cart__coupon { flex: 1 1 100%; }
}

/* -------------------------------------------------------------------------
 * Inline cart notice
 *
 * Replaces the window.alert() the first build used. A modal dialog for a
 * transient cart problem blocks the page and reads as a crash; this sits above
 * the cart, announces politely to screen readers, and clears itself on the next
 * successful update.
 * ---------------------------------------------------------------------- */

.tg-cart__notice {
	display: none;
	grid-column: 1 / -1;
	margin: 0 0 4px;
	padding: 13px 18px;
	border: 1px solid #f0d9a8;
	border-left: 3px solid var(--tg-gold);
	border-radius: var(--tg-radius);
	background: #fdf6e7;
	color: var(--tg-ink);
	font-size: 15px;
}

.tg-cart__notice.is-visible { display: block; }

/* ==========================================================================
   MOBILE + TABLET CART CARD  (<= 991px)   -- authoritative layout

   WHY THIS BLOCK EXISTS
   Woostify pins BOTH .product-remove and .product-thumbnail to
   position:absolute; top:0; right:0 below 991px. They land in the same
   corner, stretch to the full row width, and paint over the product name,
   price and quantity. That is the overlap you see on a phone.

   The earlier <=782px rules tried to work with that by reserving a 118px
   left gutter, but they never overrode top/right, so the image stayed in the
   top-right corner. Depending on a parent theme's absolute positioning is
   fragile anyway: any Woostify update silently moves our layout.

   So this block owns the layout outright. Every cell is reset to static and
   placed by an explicit grid area, which means the card renders the same
   regardless of what the parent theme does next.

   Breakpoint is 991px, not 782px, to match Woostify's own. At 783-991px
   (tablet portrait) Woostify's absolute rules applied while our old mobile
   rules did not - that band was the worst-looking of the lot.

   Card anatomy:
     [ image ]  Product name              (x)
     [ image ]  Price: 699
     [ image ]  [ - 2 + ]           1,398.00
   ========================================================================== */
@media (max-width: 991px) {

	.tg-cart .tg-cart__table tr.cart_item {
		display: grid;
		grid-template-columns: 72px minmax(0, 1fr) auto;
		grid-template-areas:
			"thumb name     remove"
			"thumb price    price"
			"thumb quantity subtotal";
		align-items: center;
		column-gap: 10px;
		row-gap: 8px;
		padding: 16px;
		min-height: 0;
	}

	/* Undo the parent theme's absolute positioning so grid can place these. */
	.tg-cart .tg-cart__table tr.cart_item td {
		position: static;
		inset: auto;
		float: none;
		width: auto;
		min-width: 0;
		max-width: none;
		margin: 0;
		padding: 0;
		border: 0;
		text-align: left;
	}

	.tg-cart .tg-cart__table tr.cart_item td.product-thumbnail {
		grid-area: thumb;
		align-self: start;
	}

	/* contain, not cover. These are tall wind chimes; a square crop would cut
	   the top and bottom off the very product the customer is buying. */
	.tg-cart .tg-cart__table tr.cart_item td.product-thumbnail img {
		display: block;
		width: 72px;
		height: 80px;
		object-fit: contain;
		background: #faf8f2;
		border-radius: 10px;
	}

	.tg-cart .tg-cart__table tr.cart_item td.product-name {
		grid-area: name;
		font-size: 15.5px;
		font-weight: 600;
		line-height: 1.35;
	}

	/* Long names clamp at two lines instead of pushing the card tall. */
	.tg-cart .tg-cart__table tr.cart_item td.product-name a {
		display: -webkit-box;
		-webkit-line-clamp: 2;
		-webkit-box-orient: vertical;
		overflow: hidden;
	}

	.tg-cart .tg-cart__table tr.cart_item td.product-price {
		grid-area: price;
		font-size: 13.5px;
		color: var(--tg-muted);
	}

	.tg-cart .tg-cart__table tr.cart_item td.product-quantity {
		grid-area: quantity;
		padding-top: 0 !important;
	}

	.tg-cart .tg-cart__table tr.cart_item td.product-subtotal {
		grid-area: subtotal;
		justify-self: end;
		font-size: 15px;
		font-weight: 700;
		white-space: nowrap;
	}

	/* The bold amount sitting beside the stepper reads as the line total
	   without a label; the label only added clutter on a 360px screen. */
	.tg-cart .tg-cart__table tr.cart_item td.product-subtotal::before {
		display: none;
	}

	.tg-cart .tg-cart__table tr.cart_item td.product-remove {
		grid-area: remove;
		align-self: start;
		justify-self: end;
	}

	/* 44px is the WCAG 2.5.5 / iOS HIG minimum touch target. Remove was 29px
	   and the qty buttons were 20px wide - hard to hit on purpose, easy to hit
	   by accident. */
	.tg-cart .tg-cart__table tr.cart_item td.product-remove a.remove {
		display: flex;
		align-items: center;
		justify-content: center;
		width: 40px;
		height: 40px;
		margin: -6px -6px 0 0;
	}

	.tg-cart .tg-cart__table tr.cart_item .tg-qty {
		display: inline-flex;
		align-items: center;
		height: 44px;
	}

	.tg-cart .tg-cart__table tr.cart_item .tg-qty__btn {
		min-width: 44px;
		height: 44px;
	}

	/* The inner .quantity box was 30px tall around a 44px input, so the input
	   spilled out of its own container. */
	.tg-cart .tg-cart__table tr.cart_item .tg-qty .quantity {
		display: flex;
		align-items: center;
		height: 44px;
	}

	.tg-cart .tg-cart__table tr.cart_item .tg-qty input.qty {
		width: 46px;
		height: 44px;
		text-align: center;
	}

	/* Page gutters were eating 70px of a 360px screen: 15px from Woostify's
	   container plus 20px from .tg-cart on each side. Giving the inner one back
	   returns that width to the product name, which was truncating to three
	   characters. The container's 15px still keeps content off the bezel. */
	.tg-cart {
		padding-inline: 0;
	}

	/* Woostify labels every responsive table cell from its data-title. On the
	   quantity cell the word "Quantity" was taking 55px of a 70px column and
	   squeezing the stepper down to a 15px sliver. */
	.tg-cart .tg-cart__table tr.cart_item td.product-quantity::before {
		display: none;
	}

	/* A flex item will not shrink below its longest word without min-width:0,
	   so the two-line clamp never engaged and the name truncated instead. */
	/* Woostify sets white-space:nowrap and display:flow-root on cart links, so
	   the two-line clamp never engaged and the name cut off after one line.
	   Both need overriding for the clamp to do its job. */
	.tg-cart .tg-cart__table tr.cart_item td.product-name a {
		flex: 1 1 auto;
		min-width: 0;
		display: -webkit-box !important;
		white-space: normal !important;
	}

	/* The stepper needs 132px; it was being crushed into 126px, clipping the
	   plus button. flex:none stops the children shrinking below tap size. */
	.tg-cart .tg-cart__table tr.cart_item .tg-qty__btn {
		flex: 0 0 44px;
	}

	.tg-cart .tg-cart__table tr.cart_item .tg-qty .quantity {
		flex: 0 0 44px;
	}

	.tg-cart .tg-cart__table tr.cart_item .tg-qty input.qty {
		width: 44px;
	}

	/* Label on the left, amount on the right. */
	.tg-cart .tg-cart__table tr.cart_item td.product-price {
		justify-content: space-between;
	}
}

/* ==========================================================================
   TABLET BAND (601-991px)

   The phone card leaves a 72px image marooned beside a name column that grows
   to ~780px at 980px wide, with the stepper and total stranded far right. A
   tablet has room for a single-line row much closer to the desktop table, so
   use it rather than stretching a layout designed for 360px.
   ========================================================================== */
@media (min-width: 601px) and (max-width: 991px) {

	.tg-cart .tg-cart__table tr.cart_item {
		grid-template-columns: 110px minmax(0, 1fr) auto auto 44px;
		grid-template-areas:
			"thumb name  quantity subtotal remove"
			"thumb price quantity subtotal remove";
		column-gap: 18px;
		row-gap: 4px;
		padding: 18px;
	}

	.tg-cart .tg-cart__table tr.cart_item td.product-thumbnail img {
		width: 110px;
		height: 120px;
	}

	.tg-cart .tg-cart__table tr.cart_item td.product-name {
		font-size: 16.5px;
		align-self: end;
	}

	/* On the narrow card the label and amount sat at opposite edges; with this
	   much width that reads as two unrelated values, so group them. */
	.tg-cart .tg-cart__table tr.cart_item td.product-price {
		align-self: start;
		justify-content: flex-start;
		gap: 6px;
	}

	.tg-cart .tg-cart__table tr.cart_item td.product-subtotal {
		font-size: 16px;
	}
}

/* ==========================================================================
   SMALL-SCREEN OVERLAP + TAP TARGETS
   ========================================================================== */
@media (max-width: 991px) {

	/* Woostify's sale-notification box sits at bottom:30px, which puts it
	   directly over the sticky Proceed to Checkout bar (52px tall, bottom:0).
	   The bar has the higher z-index so it still draws on top, but the box
	   crowds the one control this entire page exists to serve. Lift it clear. */
	.woostify-sale-notification-box {
		bottom: 76px;
	}

	/* Clearing the cart is destructive and was a 24px-tall line of text.
	   44px is the WCAG 2.5.5 minimum target size. */
	.tg-cart .tg-cart__clear {
		display: inline-flex;
		align-items: center;
		min-height: 44px;
	}
}

/* ==========================================================================
   COUPON ROW + SCROLL LENGTH  (<= 991px)
   ========================================================================== */
@media (max-width: 991px) {

	/* Input left, button right. The input carried flex:1 1 100%, so it claimed
	   a full row on its own and pushed the button onto a second line - 128px of
	   height to collect one short code. nowrap keeps them on one line. */
	/* wrap, not nowrap: WooCommerce prints the coupon error as a third child
	   of this same flex row. With nowrap it became a 115px column wedged
	   between the input and the button. Wrapping lets it take its own line,
	   while the input and button still share the first. */
	.tg-cart .tg-cart__coupon {
		flex-wrap: wrap;
		gap: 10px;
	}

	.tg-cart .tg-cart__coupon .coupon-error-notice {
		flex: 0 0 100%;
		margin: 0;
		font-size: 13px;
		color: #b3261e;
	}

	/* basis 0, not auto. A text input reports an intrinsic width of roughly
	   210px, so with wrapping enabled the line broke and the button dropped
	   below. Zero basis lets the input grow into whatever the button leaves. */
	.tg-cart .tg-cart__coupon-input {
		flex: 1 1 0;
		width: auto;
		min-width: 0;
	}

	.tg-cart .tg-cart__coupon .tg-btn {
		flex: 0 0 auto;
		white-space: nowrap;
		padding-inline: 16px;
	}

	/* --- Scroll length ---
	   One item produced a 3112px page. Every block below costs the customer
	   another thumb-flick before they reach anything actionable. */

	.tg-hero {
		padding: 22px 0 20px;
	}

	/* Three reassurance panels stacked cost 443px. Across in a row they carry
	   the same message in about a quarter of the height - and a trust strip is
	   scanned, not read. */
	.tg-badges__inner {
		grid-template-columns: repeat(3, 1fr);
		gap: 10px;
	}

	.tg-badges__item {
		text-align: center;
	}

	.tg-badges__icon {
		width: 34px;
		height: 34px;
	}

	.tg-badges__icon svg {
		width: 17px;
		height: 17px;
	}

	.tg-badges__title {
		font-size: 12.5px;
		line-height: 1.3;
	}

	.tg-badges__text {
		font-size: 11px;
		line-height: 1.3;
	}

	.tg-cart .tg-cart__table tr.cart_item {
		padding: 14px;
		row-gap: 6px;
		margin-bottom: 10px;
	}
}

/* ==========================================================================
   DEAD SPACE BETWEEN SECTIONS  (<= 991px)

   Measured on a real phone viewport, one item in the cart: the page ran
   2643px. Roughly 180px of that was empty padding and margin between
   blocks - scrolling that shows the customer nothing at all.

   Scoped to this stylesheet, which only loads on the cart, so no other
   page changes until we look at it deliberately.
   ========================================================================== */
@media (max-width: 991px) {

	/* A flat 100px of empty margin sat above the footer. */
	.site-footer {
		margin-top: 24px;
	}

	.tg-cart {
		padding-top: 22px;
		padding-bottom: 24px;
	}

	/* 96px of padding wrapped around 115px of content. */
	.tg-badges {
		padding-top: 26px;
		padding-bottom: 28px;
	}

	.tg-cart .tg-summary,
	.tg-cart .cart_totals {
		padding-top: 18px;
		padding-bottom: 20px;
	}
}
