/* Cart and checkout (WooCommerce Cart and Checkout blocks) in the style of the store pages.
 * Only page width, type, colours, borders, corners and spacing: the blocks' markup, fields, buttons and
 * behaviour stay WooCommerce's, so payment and shipping plugins keep working.
 * Scoped to the two pages through the body classes WooCommerce adds. */

/* ---------- Page: same width and margins as the store pages ---------- */

html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main {
	box-sizing: border-box;
	width: 100%;
	max-width: calc(var(--tcs-content) + 80px); /* site.css */
	margin: 0 auto;
	padding: 0 40px;
	color: #000000;
	font-family: 'Helvetica Neue', 'Inter Tight', Helvetica, Arial, sans-serif;
	font-size: 14px;
	line-height: 1.45;
}

html :is(body.woocommerce-cart, body.woocommerce-checkout) .page-header .entry-title {
	max-width: none;
	margin: 28px 0 0;
	padding: 0;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.45;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

/* Hello pulls wide blocks 80 px out of the page: here they stay on the page margins */
html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main .alignwide {
	max-width: none;
	margin: 24px 0 0;
}

html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main :is(h2, h3, p, legend) {
	color: inherit;
}

/* ---------- Links and headings ---------- */

html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main a,
html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main a:visited {
	color: #000000;
}

html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main a:not(.wc-block-components-button):hover {
	color: #000000;
	text-decoration: underline;
	text-underline-offset: 3px;
}

html :is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-product-name {
	color: #000000;
	font-size: 14px;
	font-weight: 500;
	text-decoration: none;
}

/* Section titles as "Previous issues" and "You may also like": 12 px capitals */
html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main :is(
	.wc-block-components-checkout-step__title,
	.wc-block-cart__totals-title,
	.wc-block-components-checkout-order-summary__title-text,
	.wc-block-cart-items__header
) {
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.45;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

html :is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

html :is(body.woocommerce-cart, body.woocommerce-checkout) :is(
	.wc-block-components-product-metadata,
	.wc-block-checkout__guest-checkout-notice,
	.wc-block-components-totals-item__description,
	.wc-block-checkout__terms
) {
	color: #555555;
}

/* ---------- Buttons: black, capitals, square, as "Add to shopping bag" ---------- */

html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main .wc-block-components-button:not(.is-link) {
	min-height: 52px;
	padding: 0 16px;
	border: 0;
	border-radius: 0;
	background: #000000;
	color: #FFFFFF;
	box-shadow: none;
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-decoration: none;
	text-transform: uppercase;
	transition: background 0.25s ease;
}

html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main .wc-block-components-button:not(.is-link):is(:hover, :focus-visible) {
	background: #333333;
	color: #FFFFFF;
}

html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main .wc-block-components-button:not(.is-link):disabled {
	background: #767676;
	color: #FFFFFF;
}

html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main :is(a, button, input, select, textarea, [tabindex]):focus-visible {
	outline: 2px solid #000000;
	outline-offset: 3px;
	box-shadow: none;
}

/* ---------- Fields: square, grey border, black when in use ---------- */

html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main :is(
	.wc-block-components-text-input input,
	.wc-block-components-text-input textarea,
	.wc-block-components-textarea,
	.wc-blocks-components-select .wc-blocks-components-select__select,
	.wc-block-components-combobox .wc-block-components-combobox-control input
) {
	border: 1px solid #C8C8C8;
	border-radius: 0;
	background: #FFFFFF;
	color: #000000;
	font-family: inherit;
	font-size: 16px;
	box-shadow: none;
}

html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main :is(
	.wc-block-components-text-input input,
	.wc-block-components-text-input textarea,
	.wc-block-components-textarea,
	.wc-blocks-components-select .wc-blocks-components-select__select,
	.wc-block-components-combobox .wc-block-components-combobox-control input
):focus {
	border-color: #000000;
}

/* Fields with an error keep WooCommerce's red, for contrast */
html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main :is(.wc-block-components-text-input, .wc-blocks-components-select, .wc-block-components-combobox, .wc-block-components-textarea).has-error :is(input, select, textarea) {
	border-color: #CC1818;
}

html :is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-checkbox .wc-block-components-checkbox__input[type="checkbox"],
html :is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-radio-control__input {
	border-color: #000000;
	border-radius: 0;
}

html :is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-radio-control__input {
	border-radius: 50%;
}

html :is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-checkbox .wc-block-components-checkbox__mark {
	fill: #000000;
}

/* Quantity: square box, grey border */
html body.woocommerce-cart .wc-block-components-quantity-selector {
	border-radius: 0;
}

html body.woocommerce-cart .wc-block-components-quantity-selector::after {
	border: 1px solid #C8C8C8;
	border-radius: 0;
}

html body.woocommerce-cart .wc-block-components-quantity-selector input.wc-block-components-quantity-selector__input {
	color: #000000;
	font-family: inherit;
	font-size: 14px;
}

html body.woocommerce-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
	border: 0;
	border-radius: 0;
	background: transparent;
	color: #000000;
}

/* ---------- Boxes, lines, notices: square corners, light lines ---------- */

html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main :is(
	.wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-block,
	.wc-block-components-address-card,
	.wc-block-components-notice-banner,
	.wc-block-components-radio-control-accordion-option,
	.wc-block-components-radio-control__option,
	.wc-block-components-panel
) {
	border-radius: 0;
}

html :is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-sidebar .wp-block-woocommerce-checkout-order-summary-block {
	border-color: #E0E0E0;
}

/* Saved address card (logged-in customers): "Edit" as an underlined link, like "Read" in Downloads.
   It carries type="button", so Hello's pink button reset would style it otherwise. */
html body.woocommerce-checkout .site-main .wc-block-components-address-card__edit {
	padding: 0;
	border: 0;
	border-radius: 0;
	background: none;
	color: #000000;
	font: inherit;
	text-decoration: underline;
	text-underline-offset: 3px;
}

html body.woocommerce-checkout .site-main .wc-block-components-address-card__edit:is(:hover, :focus) {
	background: none;
	color: #000000;
	text-decoration-thickness: 2px;
}

/* PayPal "Pay in 3" message under the totals (PayPal Payments plugin): aligned with the totals text, space above and below */
html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main .ppcp-messages {
	margin: 16px 0;
	padding: 0 16px;
}

html body.woocommerce-cart .wc-block-cart-items,
html body.woocommerce-cart .wc-block-cart-items td,
html body.woocommerce-cart .wc-block-cart-items th,
html :is(body.woocommerce-cart, body.woocommerce-checkout) .wc-block-components-totals-wrapper {
	border-color: #E0E0E0;
}

/* Cover thumbnails: the mockup photo, no frame */
html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main :is(.wc-block-cart-item__image, .wc-block-components-order-summary-item__image) img {
	border-radius: 0;
}

/* ---------- Empty cart: title, button back to the shop, "new in store" covers ---------- */

html body.woocommerce-cart .wp-block-woocommerce-empty-cart-block :is(h2, .wp-block-heading) {
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	line-height: 1.45;
	letter-spacing: 0.02em;
	text-transform: uppercase;
}

html body.woocommerce-cart .site-main .wp-block-woocommerce-empty-cart-block :is(.wp-block-button__link, .wp-element-button) {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-height: 44px;
	padding: 0 24px;
	border: 0;
	border-radius: 0;
	background: #000000;
	color: #FFFFFF;
	font-family: inherit;
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.06em;
	text-decoration: none;
	text-transform: uppercase;
	transition: background 0.25s ease;
}

html body.woocommerce-cart .site-main .wp-block-woocommerce-empty-cart-block :is(.wp-block-button__link, .wp-element-button):is(:hover, :focus-visible) {
	background: #333333;
	color: #FFFFFF;
}

html body.woocommerce-cart .site-main .wc-block-grid__product-link,
html body.woocommerce-cart .site-main .wc-block-grid__product-title {
	color: #000000;
	font-size: 13px;
	font-weight: 500;
	text-decoration: none;
}

html body.woocommerce-cart .site-main .wc-block-grid__product-image img {
	border-radius: 0;
}

/* The order summary stays in view under the small sticky header (153 px), as the product column */
@media (min-width: 1024px) {
	html body.woocommerce-checkout .wc-block-components-sidebar.is-sticky {
		top: 177px;
	}
}

/* ---------- Mobile board margins ---------- */

@media (max-width: 767px) {
	html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main {
		padding: 0 16px;
	}

	html :is(body.woocommerce-cart, body.woocommerce-checkout) .page-header .entry-title {
		margin-top: 16px;
	}

	html :is(body.woocommerce-cart, body.woocommerce-checkout) .site-main .alignwide {
		margin-top: 16px;
	}
}
