/*
 * Cart (woocommerce/cart/cart.php): "My cart" and the product table on the left, summary
 * column (coupon, totals, checkout) on the right. Values match the live Core design; fonts and
 * colour tokens are in core.css. Loaded on the cart only.
 */

/* Notices (coupon applied, item removed…) above the cart */
.mylaw-cart-page .woocommerce-notices-wrapper:not(:empty) {
	margin-top: 1.5rem;
}

/* Layout */

.mylaw-cart {
	display: grid;
	grid-template-columns: minmax(0, 1fr);
}

.mylaw-cart__main {
	padding-bottom: 40px;
}

.woocommerce .mylaw-cart__summary {
	width: auto; /* WooCommerce sets .cart-collaterals to 100%, which stops the bleed below */
}

.mylaw-cart__summary {
	margin: 0 calc(-1 * var(--gutter));
	padding: 40px 24px;
	background: var(--co-tint);
}

@media (min-width: 768px) {
	.mylaw-cart {
		grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
		border-left: 1px solid var(--co-line);
	}

	.mylaw-cart__summary {
		margin: 0;
		border-right: 1px solid var(--co-line);
		border-left: 1px solid var(--co-line);
	}
}

@media (min-width: 1025px) {
	.mylaw-cart {
		grid-template-columns: minmax(0, 3fr) minmax(0, 2fr);
	}

	.mylaw-cart__summary {
		padding: 48px 40px 50px;
	}
}

/* Heading with item count (also used on the empty cart) */

.mylaw-cart__title {
	display: inline-flex;
	align-items: flex-start;
	gap: 8px;
	margin: 40px 0 33px;
	color: var(--co-navy);
	font-family: var(--co-serif);
	font-size: 52px;
	font-weight: 400;
	line-height: 1.04;
	letter-spacing: -0.02em;
}

.mylaw-cart__main .mylaw-cart__title {
	padding: 0 40px;
}

.mylaw-cart__count {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 32px;
	height: 32px;
	padding: 0 6px;
	border: 1px solid #e5ecf1;
	border-radius: 999px;
	background: var(--co-tint);
	font-family: var(--co-sans);
	font-size: 14px;
	letter-spacing: 0;
	line-height: 1;
}

/* Product table */

.woocommerce .mylaw-cart table.shop_table.cart {
	margin: 0;
	border: 0;
	border-top: 1px solid var(--co-line);
	border-radius: 0;
	border-collapse: collapse;
}

.woocommerce .mylaw-cart table.shop_table.cart th,
.woocommerce .mylaw-cart table.shop_table.cart td {
	padding: 21px 40px;
	border: 0;
	border-bottom: 1px solid var(--co-line);
	color: var(--co-navy);
	font-size: 18px;
	font-weight: 500;
	line-height: 1.3;
	vertical-align: middle;
}

.woocommerce .mylaw-cart table.shop_table.cart thead th {
	color: var(--co-blue);
	font-size: 14px;
}

.woocommerce .mylaw-cart table.shop_table.cart .product-remove {
	width: 1%;
	padding-right: 0;
}

.woocommerce .mylaw-cart table.shop_table.cart .product-price {
	text-align: right;
	white-space: nowrap;
}

/* Sale / pass-holder price: was price struck through, then the price paid */
.woocommerce .mylaw-cart .product-price del {
	margin-right: 6px;
	color: var(--co-muted);
	font-size: 14px;
}

.woocommerce .mylaw-cart .product-price ins {
	text-decoration: none;
}

.woocommerce .mylaw-cart .product-name a {
	color: var(--co-navy);
	text-decoration: none;
}

.woocommerce .mylaw-cart .product-name a:hover {
	color: var(--co-orange);
}

.woocommerce .mylaw-cart .product-name dl.variation {
	margin: 6px 0 0;
	color: var(--co-blue);
	font-size: 14px;
}

.woocommerce .mylaw-cart a.remove {
	width: auto;
	height: auto;
	color: var(--co-muted) !important; /* WooCommerce sets red with !important */
	font-size: 20px;
	font-weight: 400;
}

.woocommerce .mylaw-cart a.remove:hover {
	background: none;
	color: var(--co-navy) !important;
}

/* Browse more courses */

.mylaw-cart__actions {
	display: flex;
	justify-content: flex-end;
	margin-top: 124px;
	padding: 0 40px;
}

.mylaw-cart__browse {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: var(--co-navy);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
	text-decoration: none;
	text-transform: uppercase;
}

.mylaw-cart__browse:hover {
	color: var(--co-orange);
}

.mylaw-cart__browse .icon {
	width: 16px;
	height: 16px;
}

/* Summary: coupon */

.mylaw-cart__summary-title {
	margin: 0 0 40px;
	color: var(--co-navy);
	font-family: var(--co-sans);
	font-size: 24px;
	font-weight: 500;
	line-height: 1.3;
}

.mylaw-cart__coupon {
	margin-bottom: 20px;
}

.mylaw-cart__coupon label {
	display: block;
	margin-bottom: 16px;
	color: var(--co-blue);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.3;
}

.mylaw-cart__coupon-field {
	display: flex;
	align-items: center;
	height: 56px;
	padding: 3px;
	border: 1px solid var(--co-line);
	border-radius: var(--co-pill);
	background: #fff;
}

.mylaw-cart__coupon-field:focus-within {
	border-color: var(--co-navy);
}

.mylaw-cart__coupon-field input {
	flex: 1 1 auto;
	min-width: 0;
	height: 100%;
	padding: 0 16px;
	border: 0;
	background: none;
	color: var(--co-navy);
	font-family: var(--co-sans);
	font-size: 16px;
	outline: none;
}

.mylaw-cart__coupon-field input::placeholder {
	color: var(--co-muted);
}

.mylaw-cart__coupon-field button {
	flex: 0 0 auto;
	height: 48px;
	padding: 0 20px;
	border: 0;
	border-radius: var(--co-pill);
	background: var(--co-navy);
	color: #fff;
	font-family: var(--co-sans);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
	text-transform: uppercase;
	cursor: pointer;
}

.mylaw-cart__coupon-field button:hover {
	background: #002f52;
}

/* Summary: totals and checkout button */

.woocommerce .mylaw-cart .cart-collaterals .cart_totals {
	width: 100%;
	float: none;
}

.woocommerce .mylaw-cart .cart_totals > h2 {
	display: none;
}

.woocommerce .mylaw-cart .cart_totals table.shop_table {
	margin: 0;
	border: 0;
	border-radius: 0;
}

.woocommerce .mylaw-cart .cart_totals table.shop_table th,
.woocommerce .mylaw-cart .cart_totals table.shop_table td {
	padding: 10px 0;
	border: 0;
	color: var(--co-blue);
	font-size: 16px;
	font-weight: 500;
	line-height: 1.3;
	text-align: left;
	vertical-align: middle;
}

.woocommerce .mylaw-cart .cart_totals table.shop_table td {
	color: var(--co-navy);
	text-align: right;
}

/* Small screens: WooCommerce hides the <th> and labels each <td> with ::before */
.woocommerce .mylaw-cart .cart_totals table.shop_table td::before {
	color: var(--co-blue);
	font-size: 16px;
	font-weight: 500;
}

.woocommerce .mylaw-cart .cart_totals table.shop_table tr td {
	background: none;
}

.woocommerce .mylaw-cart .cart_totals tr.order-total th,
.woocommerce .mylaw-cart .cart_totals tr.order-total td::before {
	color: var(--co-navy);
}

.woocommerce .mylaw-cart .cart_totals tr.order-total td {
	font-size: 24px;
}

.woocommerce .mylaw-cart .cart_totals tr.order-total strong {
	font-weight: 500;
}

.woocommerce .mylaw-cart .cart_totals .woocommerce-remove-coupon {
	color: var(--co-blue);
	font-size: 14px;
}

.woocommerce .mylaw-cart .wc-proceed-to-checkout {
	padding: 24px 0 0;
}

.woocommerce-cart .mylaw-cart .wc-proceed-to-checkout a.checkout-button {
	margin: 0;
	padding: 14px;
	border-radius: var(--co-pill);
	background: var(--co-orange);
	color: #fff;
	font-family: var(--co-sans);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
	text-transform: uppercase;
}

.woocommerce-cart .mylaw-cart .wc-proceed-to-checkout a.checkout-button:hover {
	background: var(--co-orange-hover);
	color: #fff;
}

/* Empty cart */

.mylaw-cart-page .wc-empty-cart-message .woocommerce-info {
	margin-bottom: 1.5rem;
}

.mylaw-cart-page .woocommerce .return-to-shop {
	margin-bottom: 4rem;
}

.mylaw-cart-page .woocommerce .return-to-shop a.button {
	padding: 14px 32px;
	border-radius: var(--co-pill);
	background: var(--co-orange);
	color: #fff;
	font-family: var(--co-sans);
	font-size: 14px;
	font-weight: 500;
	line-height: 1.5;
	text-transform: uppercase;
}

.mylaw-cart-page .woocommerce .return-to-shop a.button:hover {
	background: var(--co-orange-hover);
}

/* Narrow screens */

@media (max-width: 1024px) {
	.woocommerce .mylaw-cart table.shop_table.cart th,
	.woocommerce .mylaw-cart table.shop_table.cart td {
		padding: 16px;
		font-size: 16px;
	}

	.mylaw-cart__main .mylaw-cart__title {
		padding: 0 16px;
	}

	.mylaw-cart__actions {
		margin-top: 48px;
		padding: 0 16px;
	}
}

@media (max-width: 767px) {
	.mylaw-cart__title {
		font-size: 40px;
	}

	.mylaw-cart__main .mylaw-cart__title,
	.mylaw-cart__actions {
		padding: 0;
	}

	.woocommerce .mylaw-cart table.shop_table.cart th:first-child,
	.woocommerce .mylaw-cart table.shop_table.cart td:first-child {
		padding-left: 0;
	}

	.woocommerce .mylaw-cart table.shop_table.cart th:last-child,
	.woocommerce .mylaw-cart table.shop_table.cart td:last-child {
		padding-right: 0;
	}

	.mylaw-cart__actions {
		justify-content: center;
		margin-top: 24px;
	}
}
