/* Cart — the line items, the "Not sure it fits?" panel, the empty state and
   the mobile sticky checkout bar (design.md §Cart & checkout). Shared page /
   summary / control styling is in cart-checkout.css.

   WooCommerce renders the items as a table: image | product | total, with
   the quantity selector inside the product cell. The design has a separate
   QUANTITY column, so each row is a grid and the selector is lifted into
   its column (absolutely, in the product cell's reserved right padding).
   The badges, fits and hand lines are cart item data (tt_cart_item_data()),
   which WooCommerce prints as one span per entry,
   `.wc-block-components-product-details__{key}` — those, the name, the unit
   price and the stock line are reordered with flex `order`. */

/* ---- Items table ----------------------------------------------------------- */
.tt-cart .wc-block-cart-items {
	display: block;
	width: 100%;
	margin: 0 !important;
	border: 0 !important;
	border-collapse: collapse;
}

.tt-cart .wc-block-cart-items thead,
.tt-cart .wc-block-cart-items tbody {
	display: block;
}

.tt-cart .wc-block-cart-items__header,
.tt-cart .wc-block-cart-items__row {
	position: relative;
	display: grid !important;
	grid-template-columns: 180px minmax(0, 1fr) 150px !important;
	grid-template-rows: auto !important;
	gap: 32px !important;
	align-items: start;
	border: 0 !important;
	border-bottom: 1px solid #3c3c3a !important;
}

.tt-cart .wc-block-cart-items th,
.tt-cart .wc-block-cart-items td {
	display: block;
	min-width: 0;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	vertical-align: top;
}

/* Column labels: PRODUCT · QUANTITY · TOTAL (13px, 0.12em, grey). */
.tt-cart .wc-block-cart-items__header {
	padding: 0 0 14px !important;
	font-family: var(--wp--preset--font-family--base-model, "Base Model", sans-serif) !important;
	font-weight: 400 !important;
	font-size: 13px !important;
	line-height: 1.45;
	letter-spacing: 1.56px;
	text-transform: uppercase !important;
	color: var(--wp--preset--color--grey-light, #adadad) !important;
}

.tt-cart .wc-block-cart-items__header th {
	font: inherit !important;
	letter-spacing: inherit !important;
	text-transform: inherit !important;
	color: inherit !important;
	text-align: left;
}

.tt-cart .wc-block-cart-items__header-product {
	display: flex !important;
	justify-content: flex-end;
	visibility: visible !important;
}

.tt-cart .wc-block-cart-items__header-product > span {
	position: absolute;
	width: 1px;
	height: 1px;
	overflow: hidden;
	clip-path: inset(50%);
}

.tt-cart .wc-block-cart-items__header-product::after {
	content: "Quantity";
	width: 132px;
}

.tt-cart .wc-block-cart-items__header-total {
	text-align: right !important;
}

.tt-cart .wc-block-cart-items__row {
	padding: 32px 0 !important;
}

/* WooCommerce pins the cells with grid-column/row starts of its own (made
   for its 3-track layout, the product spanning two); place them outright. */
.tt-cart .wc-block-cart-items .wc-block-cart-item__image {
	grid-column: 1 !important;
	grid-row: 1 !important;
	padding-right: 0 !important;
}

.tt-cart .wc-block-cart-items .wc-block-cart-item__product {
	grid-column: 2 !important;
	grid-row: 1 !important;
}

.tt-cart .wc-block-cart-items .wc-block-cart-item__total {
	grid-column: 3 !important;
	grid-row: 1 !important;
}

.tt-cart .wc-block-cart-items__row.is-disabled {
	opacity: 0.5;
}

/* Photo: 180 square on a white plate, top-anchored (the line badge printed on
   the product shot sits top-left), zooming on row hover. */
.tt-cart .wc-block-cart-item__image {
	position: relative;
	width: 180px;
	height: 180px;
	overflow: hidden;
	background: #fff !important;
}

.tt-cart .wc-block-cart-item__image a {
	display: block;
	height: 100%;
}

.tt-cart .wc-block-cart-item__image img {
	position: absolute;
	inset: 0;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	object-fit: cover;
	object-position: 50% 0;
	transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.tt-cart .wc-block-cart-items__row:hover .wc-block-cart-item__image img {
	transform: scale(1.05);
}

/* Product cell: room on the right for the quantity column (132 + 32 gap). */
.tt-cart .wc-block-cart-items td.wc-block-cart-item__product {
	padding-right: 164px !important;
}

.tt-cart .wc-block-cart-item__wrap {
	display: flex !important;
	flex-direction: row !important;
	flex-wrap: wrap;
	align-items: center;
	gap: 0 8px;
}

.tt-cart .wc-block-cart-item__wrap > * {
	flex: 0 0 100%;
	margin: 0 !important;
}

/* Let each detail span take part in the wrap's flex directly. */
.tt-cart .wc-block-cart-item__wrap .wc-block-components-product-metadata,
.tt-cart .wc-block-cart-item__wrap .wc-block-components-product-details {
	display: contents;
}

.tt-cart .wc-block-components-product-metadata__description,
.tt-cart .wc-block-components-product-details [aria-hidden="true"] {
	display: none !important;
}

.tt-cart .wc-block-components-product-details > span {
	flex: 0 0 100%;
	order: 4;
	margin: 2px 0 0;
	font-family: var(--wp--preset--font-family--encode-sans, "Encode Sans", sans-serif);
	font-size: 14px;
	line-height: 1.35;
	color: var(--wp--preset--color--grey-light, #adadad);
}

/* Model + Trigger Action chips, first. */
.tt-cart .wc-block-components-product-details .wc-block-components-product-details__model,
.tt-cart .wc-block-components-product-details .wc-block-components-product-details__action {
	flex: 0 0 auto;
	order: 1;
	margin: 0 0 12px;
}

.tt-cart .wc-block-components-product-details__model .wc-block-components-product-details__name,
.tt-cart .wc-block-components-product-details__action .wc-block-components-product-details__name,
.tt-cart .wc-block-components-product-details__stock .wc-block-components-product-details__name {
	display: none;
}

.tt-cart-chip {
	display: inline-block;
	padding: 3px 10px;
	background: #878787;
	font-family: var(--wp--preset--font-family--base-model, "Base Model", sans-serif);
	font-size: 12px;
	line-height: 1.45;
	letter-spacing: 0.96px;
	text-transform: uppercase;
	color: #fff;
}

/* Model colours: tt_model_colors() in functions.php. */
.tt-cart-chip--diamond { background: #4a8c3e; }
.tt-cart-chip--special { background: #566274; }
.tt-cart-chip--primary { background: #3c3c3a; }
.tt-cart-chip--field { background: #967846; }
.tt-cart-chip--duty { background: #878787; }
.tt-cart-chip--competitive,
.tt-cart-chip--adaptable { background: #282826; }

/* Name: 24px Base Model, red underline drawing in on hover. */
/* WooCommerce caps the name at max-width: max-content; lifted, or a short
   name leaves room for the unit price to ride up beside it. */
.tt-cart .wc-block-cart-item__wrap .wc-block-components-product-name {
	order: 2;
	max-width: none !important;
	font-family: var(--wp--preset--font-family--base-model, "Base Model", sans-serif) !important;
	font-weight: 400 !important;
	font-size: 24px !important;
	line-height: 1.25 !important;
	text-wrap: balance;
	color: #fff !important;
	text-decoration: none !important;
}

/* Full row width (so it never shares a line with the chips); the underline
   still hugs the text. */
.tt-cart .wc-block-cart-item__wrap a.wc-block-components-product-name {
	text-decoration: underline !important;
	text-decoration-color: transparent !important;
	text-decoration-thickness: 1px !important;
	text-underline-offset: 4px;
	transition: color 0.25s ease, text-decoration-color 0.25s ease;
}

.tt-cart .wc-block-cart-item__wrap a.wc-block-components-product-name:hover {
	color: var(--wp--preset--color--red-bright, #ff4349) !important;
	text-decoration-color: currentColor !important;
}

.tt-cart .wc-block-components-product-details .wc-block-components-product-details__fits {
	order: 3;
	margin: 12px 0 0;
}

/* Unit price ("$344.99 each") and the stock line share a row, 4px lower. */
.tt-cart .wc-block-cart-item__prices {
	flex: 0 0 auto !important;
	order: 5;
	margin-top: 16px !important;
	margin-right: 12px !important;
	font-family: var(--wp--preset--font-family--encode-sans, "Encode Sans", sans-serif);
	font-size: 14px !important;
	color: #8c8c88;
}

.tt-cart .wc-block-cart-item__prices .wc-block-components-product-price__value,
.tt-cart .wc-block-cart-item__prices .wc-block-formatted-money-amount {
	font-family: var(--wp--preset--font-family--base-model, "Base Model", sans-serif);
	font-size: 17px;
	color: #fff;
}

.tt-cart .wc-block-cart-item__prices del,
.tt-cart .wc-block-cart-item__prices .wc-block-components-product-price__regular {
	margin-right: 6px;
	font-size: 14px !important;
	color: #73736f !important;
}

.tt-cart .wc-block-cart-item__prices ins {
	text-decoration: none;
}

.tt-cart .wc-block-components-product-details .wc-block-components-product-details__stock {
	flex: 0 0 auto;
	order: 5;
	margin: 16px 0 0;
}

.tt-cart-stock {
	display: inline-flex;
	align-items: center;
	gap: 8px;
}

.tt-cart-stock::before {
	content: "";
	width: 8px;
	height: 8px;
	background: var(--wp--preset--color--lime, #b0e33a);
}

/* WooCommerce's own low-stock / backorder badge sits where "In stock" would. */
.tt-cart .wc-block-cart-item__wrap .wc-block-components-product-badge {
	flex: 0 0 auto;
	order: 5;
	margin-top: 16px !important;
	padding: 2px 8px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: #30302e !important;
	font-family: var(--wp--preset--font-family--base-model, "Base Model", sans-serif) !important;
	font-size: 12px !important;
	letter-spacing: 0.96px;
	text-transform: uppercase;
	color: #fff !important;
}

/* Quantity column: the −/+ stepper (48px, grey hairline) and REMOVE under it. */
.tt-cart .wc-block-cart-item__quantity {
	position: absolute;
	top: 32px;
	right: 182px;
	display: flex !important;
	flex-direction: column;
	align-items: flex-start;
	gap: 12px;
	width: 132px;
	margin: 0 !important;
}

.tt-cart .wc-block-components-quantity-selector {
	display: flex !important;
	align-items: center;
	width: auto !important;
	height: 48px;
	margin: 0 !important;
	padding: 1px;
	box-sizing: border-box;
	border: 0 !important;
	border-radius: 0 !important;
	box-shadow: inset 0 0 0 1px var(--wp--preset--color--grey, #73736f);
	background: transparent !important;
}

.tt-cart .wc-block-components-quantity-selector::after {
	display: none !important;
}

.tt-cart .wc-block-components-quantity-selector__button {
	flex: 0 0 44px;
	width: 44px !important;
	min-width: 44px !important;
	height: 46px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	font-family: var(--wp--preset--font-family--encode-sans, "Encode Sans", sans-serif) !important;
	font-size: 20px !important;
	line-height: 1 !important;
	color: #fff !important;
	opacity: 1 !important;
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
}

.tt-cart .wc-block-components-quantity-selector__button:hover:not(:disabled) {
	background: #30302e !important;
}

.tt-cart .wc-block-components-quantity-selector__button:disabled {
	opacity: 0.35 !important;
	cursor: default;
}

.tt-cart .wc-block-components-quantity-selector__input {
	flex: 0 0 40px;
	width: 40px !important;
	min-width: 0 !important;
	height: 46px !important;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: transparent !important;
	box-shadow: none !important;
	font-family: var(--wp--preset--font-family--base-model, "Base Model", sans-serif) !important;
	font-size: 17px !important;
	text-align: center;
	color: #fff !important;
	-moz-appearance: textfield;
	appearance: textfield;
}

.tt-cart .wc-block-components-quantity-selector__input::-webkit-inner-spin-button,
.tt-cart .wc-block-components-quantity-selector__input::-webkit-outer-spin-button {
	margin: 0;
	-webkit-appearance: none;
}

.tt-cart .wc-block-components-quantity-selector__input:focus-visible {
	outline: 2px solid var(--wp--preset--color--red, #cf2026) !important;
	outline-offset: -2px;
}

/* WooCommerce's remove control is a bin icon; the design spells it out. */
.tt-cart .wc-block-cart-items .wc-block-cart-item__remove-link {
	width: auto !important;
	height: auto !important;
	display: inline-flex !important;
	align-items: center;
	margin: 0 !important;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	font-family: var(--wp--preset--font-family--base-model, "Base Model", sans-serif) !important;
	font-size: 13px !important;
	line-height: 1.45 !important;
	letter-spacing: 1.04px;
	text-transform: uppercase !important;
	text-decoration: none !important;
	color: var(--wp--preset--color--grey-light, #adadad) !important;
	cursor: pointer;
	transition: color 0.25s ease;
}

.tt-cart .wc-block-cart-item__remove-link svg {
	display: none;
}

.tt-cart .wc-block-cart-item__remove-link::before {
	content: "Remove";
}

.tt-cart .wc-block-cart-item__remove-link:hover {
	color: var(--wp--preset--color--red-bright, #ff4349) !important;
}

/* Line total: 22px, centred on the stepper's 48px line. */
.tt-cart .wc-block-cart-item__total {
	text-align: right;
}

.tt-cart .wc-block-cart-item__total-price-and-sale-badge-wrapper {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 6px;
}

.tt-cart .wc-block-cart-item__total .wc-block-components-product-price,
.tt-cart .wc-block-cart-item__total .wc-block-formatted-money-amount {
	font-family: var(--wp--preset--font-family--base-model, "Base Model", sans-serif) !important;
	font-weight: 400 !important;
	font-size: 22px !important;
	line-height: 48px !important;
	color: #fff !important;
}

.tt-cart .wc-block-cart-item__total .wc-block-components-sale-badge {
	margin: 0 !important;
	padding: 2px 8px !important;
	border: 0 !important;
	border-radius: 0 !important;
	background: var(--wp--preset--color--lime, #b0e33a) !important;
	font-family: var(--wp--preset--font-family--base-model, "Base Model", sans-serif) !important;
	font-size: 12px !important;
	letter-spacing: 0.96px;
	text-transform: uppercase;
	color: #000 !important;
}

.tt-cart .wc-block-cart-item__total .wc-block-components-sale-badge .wc-block-formatted-money-amount {
	font-size: inherit !important;
	line-height: inherit !important;
	color: inherit !important;
}

/* ---- Not sure it fits? ---------------------------------------------------- */
.tt-cart-help {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 14px;
	margin: 36px 0 0 !important;
	padding: 28px;
	background: var(--wp--preset--color--ink, #141412);
}

.tt-cart-help > * {
	margin: 0 !important;
}

.tt-cart-help__label {
	font-family: var(--wp--preset--font-family--base-model, "Base Model", sans-serif);
	font-size: 13px;
	letter-spacing: 1.95px;
	text-transform: uppercase;
	color: var(--wp--preset--color--red-bright, #ff4349);
}

.tt-cart-help__text {
	max-width: 640px;
	font-family: var(--wp--preset--font-family--encode-sans, "Encode Sans", sans-serif);
	font-size: 15px;
	line-height: 1.55;
	text-wrap: pretty;
	color: var(--wp--preset--color--grey-light, #adadad);
}

.tt-cart-help__phone {
	color: #fff !important;
	text-decoration: none !important;
}

.tt-cart-help__link {
	color: #fff !important;
}

/* ---- Empty cart ------------------------------------------------------------- */
.tt-cart .wp-block-woocommerce-empty-cart-block {
	max-width: 956px;
	margin: 0 !important;
}

.tt-cart-empty {
	display: flex;
	flex-direction: column;
	gap: 36px;
}

.tt-cart-empty > * {
	margin-block: 0 !important;
}

.tt-cart-empty__panel {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	gap: 22px;
	padding: 64px;
	background: var(--wp--preset--color--ink, #141412);
}

.tt-cart-empty__panel > * {
	margin: 0 !important;
}

.tt-cart-empty__title {
	font-family: var(--wp--preset--font-family--base-model, "Base Model", sans-serif) !important;
	font-weight: 400 !important;
	font-size: 38px !important;
	line-height: 1.15 !important;
	text-transform: none !important;
	color: #fff !important;
}

.tt-cart-empty__text {
	max-width: 520px;
	font-family: var(--wp--preset--font-family--encode-sans, "Encode Sans", sans-serif);
	font-size: 17px;
	line-height: 1.6;
	color: var(--wp--preset--color--grey-light, #adadad);
}

.tt-cart-empty__actions {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
}

.tt-cart-empty__btn {
	box-sizing: border-box;
	height: 52px;
	padding: 0 24px !important;
	font-size: 16px !important;
	letter-spacing: 0.8px !important;
}

/* ---- Mobile ----------------------------------------------------------------- */
@media (max-width: 1099px) {
	/* Rows: 96px photo + details, then stepper / REMOVE left and the line
	   total right on a second line. No column labels — a hairline on top. */
	.tt-cart .wc-block-cart-items {
		box-shadow: inset 0 1px 0 #3c3c3a;
	}

	.tt-cart .wc-block-cart-items__header {
		display: none !important;
	}

	.tt-cart .wc-block-cart-items__row {
		grid-template-columns: 96px minmax(0, 1fr) !important;
		grid-template-rows: auto auto !important;
		gap: 16px !important;
		padding: 20px 0 !important;
	}

	.tt-cart .wc-block-cart-item__image {
		width: 96px;
		height: 96px;
	}

	.tt-cart .wc-block-cart-items td.wc-block-cart-item__product {
		padding-right: 0 !important;
	}

	.tt-cart .wc-block-cart-items .wc-block-cart-item__total {
		grid-column: 1 / -1 !important;
		grid-row: 2 !important;
		display: flex !important;
		justify-content: flex-end;
		align-items: center;
		min-height: 46px;
	}

	.tt-cart .wc-block-cart-item__total-price-and-sale-badge-wrapper {
		flex-direction: row-reverse;
		align-items: center;
		gap: 10px;
	}

	.tt-cart .wc-block-cart-item__total .wc-block-components-product-price,
	.tt-cart .wc-block-cart-item__total .wc-block-formatted-money-amount {
		font-size: 19px !important;
		line-height: 1.2 !important;
	}

	.tt-cart .wc-block-cart-item__quantity {
		top: auto;
		right: auto;
		bottom: 20px;
		left: 0;
		flex-direction: row;
		align-items: center;
		gap: 6px;
		width: auto;
	}

	.tt-cart .wc-block-cart-item__wrap {
		gap: 0 6px;
	}

	.tt-cart .wc-block-components-product-details .wc-block-components-product-details__model,
	.tt-cart .wc-block-components-product-details .wc-block-components-product-details__action {
		margin-bottom: 8px;
	}

	.tt-cart-chip {
		padding: 2px 8px;
		font-size: 11px;
		letter-spacing: 0.88px;
	}

	.tt-cart .wc-block-cart-item__wrap .wc-block-components-product-name {
		font-size: 17px !important;
		text-wrap: pretty;
	}

	.tt-cart .wc-block-components-product-details > span {
		font-size: 13px;
	}

	.tt-cart .wc-block-components-product-details .wc-block-components-product-details__fits {
		margin-top: 8px;
	}

	.tt-cart .wc-block-cart-item__prices {
		margin-top: 8px !important;
		margin-right: 8px !important;
		font-size: 13px !important;
	}

	.tt-cart .wc-block-cart-item__prices .wc-block-components-product-price__value,
	.tt-cart .wc-block-cart-item__prices .wc-block-formatted-money-amount {
		font-size: 15px;
	}

	.tt-cart .wc-block-components-product-details .wc-block-components-product-details__stock,
	.tt-cart .wc-block-cart-item__wrap .wc-block-components-product-badge {
		margin-top: 8px !important;
	}

	.tt-cart-stock {
		gap: 6px;
	}

	.tt-cart-stock::before {
		width: 7px;
		height: 7px;
	}

	.tt-cart .wc-block-components-quantity-selector {
		height: 46px;
	}

	.tt-cart .wc-block-components-quantity-selector__button {
		height: 44px !important;
	}

	.tt-cart .wc-block-components-quantity-selector__input {
		flex-basis: 36px;
		width: 36px !important;
		height: 44px !important;
	}

	.tt-cart .wc-block-cart-items .wc-block-cart-item__remove-link {
		min-height: 44px;
		padding: 0 10px !important;
		font-size: 12px !important;
		letter-spacing: 0.96px;
	}

	.tt-cart-help {
		gap: 12px;
		margin-top: 24px !important;
		padding: 22px 18px;
	}

	.tt-cart-help__label {
		font-size: 12px;
		letter-spacing: 1.8px;
	}

	.tt-cart-help__link {
		display: flex;
		align-items: center;
		min-height: 44px;
		font-size: 13px;
		letter-spacing: 0.65px;
	}

	.tt-cart-empty {
		gap: 24px;
	}

	.tt-cart-empty__panel {
		align-items: stretch;
		gap: 18px;
		padding: 32px 20px;
	}

	.tt-cart-empty__title {
		font-size: 28px !important;
	}

	.tt-cart-empty__text {
		font-size: 16px;
	}

	.tt-cart-empty__actions {
		flex-direction: column;
	}

	.tt-cart-empty__btn {
		height: 50px;
		padding: 0 24px !important;
	}

	/* WooCommerce's sticky checkout bar (shown once the real button scrolls
	   away): ink, a hairline on top, the button sized like the design's. */
	.tt-cart .wc-block-cart__submit-container--sticky {
		padding: 10px 16px calc(10px + env(safe-area-inset-bottom)) !important;
		background: var(--wp--preset--color--ink, #141412) !important;
		box-shadow: 0 -1px 0 #30302e;
	}

	.tt-cart .wc-block-cart__submit-container--sticky::before {
		display: none !important;
	}

	.tt-cart .wc-block-cart__submit-container--sticky .wc-block-cart__submit-button {
		height: 48px !important;
		font-size: 15px !important;
	}
}
