/*
 * The Total Office Shop – cart page ("My Cart").
 * Loaded only on the cart page, after tto-home.css (header, footer, buttons).
 */

.tto-home .tto-cartpage {
	--tto-cart-cols: minmax(0, 1fr) 180px 160px 150px;
	--tto-heading: #333;
	padding-bottom: 8px;
}

.tto-home .tto-cartpage__title {
	margin: 8px 0 0;
	text-align: center;
	font-size: clamp(30px, 2.8vw, 40px);
	font-weight: 600;
	line-height: 1.2;
	color: var(--tto-heading);
}

.tto-home .tto-cartpage__inner {
	max-width: 942px;
	margin: 64px auto 0;
}

/* ---------- Shared column layout (head, items, bill rows) ---------- */

.tto-home .tto-cartgrid {
	display: grid;
	grid-template-columns: var(--tto-cart-cols);
	align-items: start;
	column-gap: 0;
}

.tto-home .tto-cartgrid--head {
	margin-bottom: 20px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--tto-text);
}

.tto-home .tto-cartlist {
	display: grid;
	gap: 20px;
}

.tto-home .tto-cartitem {
	margin: 0;
	padding: 0;
	list-style: none;
}

.tto-home .tto-cartitem__product {
	display: flex;
	gap: 16px;
	min-width: 0;
	padding-right: 24px;
}

.tto-home .tto-cartitem__thumb {
	flex: 0 0 100px;
	width: 100px;
	height: 100px;
	overflow: hidden;
	border-radius: 12px;
	background: #f3f2f0;
}

.tto-home .tto-cartitem__thumb img {
	width: 100%;
	height: 100%;
	padding: 6%;
	object-fit: contain;
	mix-blend-mode: multiply;
}

.tto-home .tto-cartitem__text {
	display: flex;
	flex-direction: column;
	gap: 6px;
	min-width: 0;
	padding-top: 10px;
}

.tto-home .tto-cartitem__name {
	font-size: 22px;
	font-weight: 500;
	line-height: 1.25;
	color: var(--tto-heading);
}

.tto-home .tto-cartitem__name a:hover {
	text-decoration: underline;
	text-underline-offset: 4px;
	text-decoration-thickness: 1px;
}

.tto-home .tto-cartitem__cats {
	font-size: 16px;
	line-height: 1.35;
	color: var(--tto-text);
}

.tto-home .tto-cartitem__meta:empty {
	display: none;
}

.tto-home .tto-cartitem__meta,
.tto-home .tto-cartitem__meta dl,
.tto-home .tto-cartitem__meta dt,
.tto-home .tto-cartitem__meta dd,
.tto-home .tto-cartitem__meta p {
	margin: 0;
	font-size: 13px;
	line-height: 1.4;
	color: var(--tto-muted);
}

.tto-home .tto-cartitem__meta dt {
	float: left;
	margin-right: 4px;
	font-weight: 500;
}

.tto-home .tto-cartitem__remove {
	align-self: flex-start;
	margin-top: 2px;
	font-size: 13px;
	color: var(--tto-muted);
	text-decoration: underline;
	text-underline-offset: 3px;
}

.tto-home .tto-cartitem__remove:hover {
	color: #b42318;
}

.tto-home .tto-cartitem__price,
.tto-home .tto-cartitem__total {
	padding-top: 10px;
	font-size: 22px;
	font-weight: 400;
	line-height: 1.25;
	color: var(--tto-heading);
	white-space: nowrap;
}

.tto-home .tto-cartitem__price del {
	display: block;
	font-size: 15px;
	color: var(--tto-soft, #9a9a9a);
}

.tto-home .tto-cartitem__price ins {
	text-decoration: none;
}

/* Quantity: − 1 + */

.tto-home .tto-cartitem__qty {
	padding-top: 6px;
}

.tto-home .tto-qty {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.tto-home .tto-qty__btn {
	display: grid;
	place-items: center;
	width: 28px;
	height: 28px;
	margin: 0;
	padding: 0;
	border: 0;
	border-radius: 9999px;
	background: transparent;
	color: var(--tto-black);
	cursor: pointer;
	transition: transform 0.15s ease, opacity 0.2s ease;
}

.tto-home .tto-qty__btn:hover {
	opacity: 0.7;
}

.tto-home .tto-qty__btn:active {
	transform: scale(0.92);
}

.tto-home .tto-qty__btn svg {
	width: 17px;
	height: 17px;
}

.tto-home .tto-qty__input {
	-webkit-appearance: none;
	appearance: none;
	-moz-appearance: textfield;
	width: 46px;
	height: 32px;
	margin: 0;
	padding: 0;
	border: 1px solid transparent;
	border-radius: 8px;
	background: transparent;
	box-shadow: none;
	text-align: center;
	font-family: inherit;
	font-size: 22px;
	font-weight: 400;
	line-height: 32px;
	color: var(--tto-heading);
}

.tto-home .tto-qty__input:focus {
	outline: none;
	border-color: var(--tto-line);
}

.tto-home .tto-qty__input::-webkit-outer-spin-button,
.tto-home .tto-qty__input::-webkit-inner-spin-button {
	-webkit-appearance: none;
	margin: 0;
}

.tto-home .tto-qty__single {
	display: inline-block;
	min-width: 46px;
	margin-left: 34px;
	text-align: center;
	font-size: 22px;
	color: var(--tto-heading);
}

/* Updating state + manual update button */

.tto-home .tto-cartform.is-updating .tto-cartlist {
	opacity: 0.5;
	pointer-events: none;
	transition: opacity 0.2s ease;
}

.tto-home .tto-cartform__update {
	margin-top: 24px;
}

.tto-home .tto-cartform.is-enhanced .tto-cartform__update {
	display: none;
}

/* ---------- Bill summary ---------- */

.tto-home .tto-bill {
	margin-top: 56px;
	padding-top: 40px;
	border-top: 1px solid var(--tto-line);
}

.tto-home .tto-bill__title {
	margin: 0 0 20px;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--tto-text);
}

.tto-home .tto-bill__rows {
	display: grid;
	gap: 8px;
	margin: 0;
}

.tto-home .tto-bill__row {
	display: grid;
	grid-template-columns: var(--tto-cart-cols);
	align-items: baseline;
}

.tto-home .tto-bill__row dt {
	grid-column: 1 / 4;
	display: flex;
	align-items: baseline;
	gap: 14px;
	margin: 0;
	font-size: 22px;
	font-weight: 700;
	line-height: 1.3;
	color: var(--tto-text);
}

.tto-home .tto-bill__row dd {
	grid-column: 4;
	margin: 0;
	font-size: 22px;
	font-weight: 400;
	line-height: 1.3;
	color: var(--tto-heading);
	white-space: nowrap;
}

.tto-home .tto-bill__row--total {
	margin-top: 18px;
}

.tto-home .tto-bill__row--total dd {
	font-weight: 700;
}

.tto-home .tto-bill__note {
	font-size: 15px;
	color: var(--tto-muted);
}

.tto-home .tto-bill__remove {
	font-size: 13px;
	font-weight: 400;
	color: var(--tto-muted);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Coupon */

.tto-home .tto-bill__footer {
	display: flex;
	flex-wrap: wrap;
	align-items: flex-start; /* discount field lines up with the checkout button */
	justify-content: space-between;
	gap: 24px;
	margin-top: 48px;
}

.tto-home .tto-coupon {
	display: flex;
	flex: 0 1 400px;
	gap: 10px;
}

.tto-home .tto-coupon__input {
	-webkit-appearance: none;
	appearance: none;
	flex: 1 1 auto;
	min-width: 0;
	height: 44px;
	margin: 0;
	padding: 0 18px;
	border: 1px solid var(--tto-line);
	border-radius: 9999px;
	background: #fff;
	box-shadow: none;
	font-family: inherit;
	font-size: 15px;
	color: var(--tto-black);
}

.tto-home .tto-coupon__input:focus {
	outline: none;
	border-color: var(--tto-black);
}

/* Actions */

.tto-home .tto-bill__actions {
	display: flex;
	flex-direction: column;
	align-items: flex-end;
	gap: 14px;
	margin-left: auto;
}

.tto-home .tto-bill__continue {
	font-size: 15px;
	color: var(--tto-text);
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Totals column lines up on the right edge, with the checkout button below. */
.tto-home .tto-cartgrid--head span:last-child,
.tto-home .tto-cartitem__total,
.tto-home .tto-bill__row dd {
	text-align: right;
}

/* Prices: the theme makes all prices bold; the design uses regular weight. */
.tto-home .tto-cartpage .amount,
.tto-home .tto-cartpage bdi {
	font: inherit;
	color: inherit;
}

.tto-home .tto-bill__row--total dd,
.tto-home .tto-bill__row--total dd strong {
	font-weight: 700;
}

/* ---------- Notices (e.g. "Cart updated.") ---------- */

.tto-home .tto-cartpage .woocommerce-notices-wrapper:not(:empty) {
	margin-bottom: 32px;
}

.tto-home .tto-cartpage .woocommerce-message,
.tto-home .tto-cartpage .woocommerce-info,
.tto-home .tto-cartpage .woocommerce-error {
	margin: 0 0 8px;
	padding: 14px 18px;
	border: 0;
	border-radius: 12px;
	background: var(--tto-field);
	list-style: none;
	font-size: 15px;
	color: var(--tto-text);
}

.tto-home .tto-cartpage .woocommerce-error {
	background: #fdecea;
	color: #8a1c13;
}

.tto-home .tto-cartpage .woocommerce-message::before,
.tto-home .tto-cartpage .woocommerce-info::before,
.tto-home .tto-cartpage .woocommerce-error::before {
	content: none;
	display: none;
}

.tto-home .tto-cartpage .woocommerce-message:focus,
.tto-home .tto-cartpage .woocommerce-info:focus,
.tto-home .tto-cartpage .woocommerce-error:focus,
.tto-home .tto-cartpage .woocommerce-notices-wrapper:focus {
	outline: none;
}

.tto-home .tto-cartpage .woocommerce-message a,
.tto-home .tto-cartpage .woocommerce-info a {
	text-decoration: underline;
}

/* Empty cart */

.tto-home .tto-cartpage .tto-empty {
	padding: 64px 24px;
	border-radius: 20px;
	background: #f3f2f0;
	text-align: center;
}

.tto-home .tto-cartpage .tto-empty p {
	margin-bottom: 20px;
	font-size: 17px;
}

/* ---------- Tablet ---------- */

@media (max-width: 1000px) {
	.tto-home .tto-cartpage {
		--tto-cart-cols: minmax(0, 1fr) 140px 140px 130px;
	}

	.tto-home .tto-cartgrid--head,
	.tto-home .tto-cartitem__name,
	.tto-home .tto-cartitem__price,
	.tto-home .tto-cartitem__total,
	.tto-home .tto-qty__input,
	.tto-home .tto-bill__title,
	.tto-home .tto-bill__row dt,
	.tto-home .tto-bill__row dd {
		font-size: 18px;
	}
}

/* ---------- Phones: each item becomes a card ---------- */

@media (max-width: 760px) {
	.tto-home .tto-cartpage__inner {
		margin-top: 32px;
	}

	.tto-home .tto-cartgrid--head {
		display: none;
	}

	.tto-home .tto-cartlist {
		gap: 0;
	}

	.tto-home .tto-cartitem {
		grid-template-columns: repeat(3, minmax(0, 1fr));
		row-gap: 14px;
		padding: 20px 0;
		border-bottom: 1px solid var(--tto-line);
	}

	.tto-home .tto-cartitem:first-child {
		padding-top: 0;
	}

	.tto-home .tto-cartitem__product {
		grid-column: 1 / -1;
		padding-right: 0;
	}

	.tto-home .tto-cartitem__thumb {
		flex-basis: 84px;
		width: 84px;
		height: 84px;
	}

	.tto-home .tto-cartitem__text {
		padding-top: 4px;
	}

	.tto-home .tto-cartitem__name {
		font-size: 17px;
	}

	.tto-home .tto-cartitem__cats {
		font-size: 14px;
	}

	.tto-home .tto-cartitem__price,
	.tto-home .tto-cartitem__qty,
	.tto-home .tto-cartitem__total {
		padding-top: 0;
		font-size: 16px;
	}

	.tto-home .tto-cartitem__total {
		text-align: right;
	}

	.tto-home .tto-cartitem__price::before,
	.tto-home .tto-cartitem__qty::before,
	.tto-home .tto-cartitem__total::before {
		content: attr(data-label);
		display: block;
		margin-bottom: 4px;
		font-size: 12px;
		font-weight: 600;
		letter-spacing: 0.04em;
		text-transform: uppercase;
		color: var(--tto-muted);
	}

	.tto-home .tto-qty__input,
	.tto-home .tto-qty__single {
		font-size: 16px;
	}

	.tto-home .tto-qty__input {
		width: 36px;
	}

	.tto-home .tto-qty__single {
		margin-left: 0;
		min-width: 0;
		text-align: left;
	}

	.tto-home .tto-bill {
		margin-top: 40px;
	}

	.tto-home .tto-bill__title {
		font-size: 18px;
	}

	.tto-home .tto-bill__row {
		display: flex;
		justify-content: space-between;
		gap: 16px;
	}

	.tto-home .tto-bill__row dt,
	.tto-home .tto-bill__row dd {
		font-size: 16px;
	}

	.tto-home .tto-bill__row dd {
		text-align: right;
	}

	.tto-home .tto-bill__footer {
		flex-direction: column;
		align-items: stretch;
		margin-top: 32px;
	}

	.tto-home .tto-coupon {
		flex-basis: auto;
	}

	.tto-home .tto-bill__actions {
		align-items: stretch;
		margin-left: 0;
		text-align: center;
	}

	.tto-home .tto-bill__continue {
		align-self: center;
	}
}
