/* Cose Theme - cart and checkout (page.php + WooCommerce blocks)
   WooCommerce renders these pages with its own React blocks, which ship
   their own rounded, grey/blue styling; everything here replaces that with
   the site's: HAL Timezone at one size, 1px black lines and boxes, squared
   corners, plain uppercase labels. The block selectors are WooCommerce's
   (.wc-block-*), so they're fairly specific - and several need !important
   to win against the block stylesheet's own !important/inline rules. */

/* The fixed logo sits at the left on every page, so content starts to the
   right of it (same idea as the product page's sidebar column). */
body.woocommerce-cart .page-content,
body.woocommerce-checkout .page-content {
	padding: 40px 40px 80px calc(40px + clamp(220px, 22vw, 320px) + 40px);
}

/* One text size across the site (10px): the blocks set their own
   (headings, totals, labels, the small print). */
body.woocommerce-cart .page-content *:not(svg):not(path),
body.woocommerce-checkout .page-content *:not(svg):not(path) {
	font-size: 1rem !important;
	letter-spacing: 0 !important;
	line-height: 1.4;
	border-radius: 0 !important;
	box-shadow: none !important;
}

body.woocommerce-cart .page-content,
body.woocommerce-checkout .page-content {
	color: #000;
}

/* --- Headings: uppercase, medium-bold, like the product titles --- */

body.woocommerce-cart .wc-block-cart__totals-title,
body.woocommerce-cart .wc-block-cart-items__header,
body.woocommerce-checkout .wc-block-components-title,
body.woocommerce-checkout .wc-block-components-checkout-step__title,
body.woocommerce-checkout .wc-block-components-checkout-order-summary__title-text,
body.woocommerce-cart h2,
body.woocommerce-cart h3,
body.woocommerce-checkout h2,
body.woocommerce-checkout h3 {
	text-transform: uppercase;
	font-weight: 500 !important;
	margin: 0 0 16px;
}

/* --- Links and the product name --- */

body.woocommerce-cart .page-content a,
body.woocommerce-checkout .page-content a {
	color: inherit !important;
	text-decoration: none !important;
}

body.woocommerce-cart .wc-block-components-product-name,
body.woocommerce-checkout .wc-block-components-product-name {
	font-weight: 500;
	text-transform: uppercase;
}

/* --- Lines: 1px black, in place of the blocks' light grey --- */

body.woocommerce-cart .wc-block-cart-items,
body.woocommerce-cart .wc-block-cart-items th,
body.woocommerce-cart .wc-block-cart-items td,
body.woocommerce-cart .wc-block-cart-items__row,
body.woocommerce-cart .wc-block-components-totals-wrapper,
body.woocommerce-cart .wc-block-components-panel,
body.woocommerce-checkout .wc-block-components-totals-wrapper,
body.woocommerce-checkout .wc-block-components-panel,
body.woocommerce-checkout .wc-block-components-order-summary,
body.woocommerce-checkout .wc-block-checkout__terms,
body.woocommerce-checkout .wc-block-checkout__actions {
	border-color: #000 !important;
}

/* Every border that has one is black - the blocks use a few different
   light greys (address card, totals block, separators...). Scoped to the
   filled cart and the checkout: the empty cart's product grid uses
   transparent borders as spacers, which this would turn into black bars. */
body.woocommerce-cart .wp-block-woocommerce-filled-cart-block *,
body.woocommerce-checkout .wp-block-woocommerce-checkout * {
	border-color: #000 !important;
}

/* The totals block has its own separators inside; its outer frame only
   doubled the order summary's border (clearest on small screens, where the
   summary is repeated). */
body.woocommerce-checkout .checkout-order-summary-block-fill,
body.woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-totals-block,
body.woocommerce-checkout .wc-block-components-checkout-order-summary__title {
	border: none !important;
}

/* The order summary card: a plain boxed column. Only the inner block gets
   the frame - the outer .wc-block-components-sidebar is just the column,
   and framing both drew a double border. */
body.woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block {
	border: 1px solid #000 !important;
	background: transparent !important;
}

/* --- Cart items: portrait 3:4 photos, like everywhere else --- */

body.woocommerce-cart .wc-block-cart-item__image img,
body.woocommerce-checkout .wc-block-components-order-summary-item__image img {
	width: 100%;
	height: auto;
	aspect-ratio: 3 / 4;
	object-fit: cover;
}

body.woocommerce-cart .wc-block-cart-item__image {
	width: 72px;
}

/* --- Form fields: the select's 1px black box --- */

body.woocommerce-checkout .wc-block-components-text-input input,
body.woocommerce-checkout .wc-block-components-text-input textarea,
body.woocommerce-checkout .wc-blocks-components-select .wc-blocks-components-select__select,
body.woocommerce-checkout .wc-block-components-combobox .wc-block-components-combobox-control input,
body.woocommerce-checkout .wc-block-components-textarea,
body.woocommerce-checkout textarea,
body.woocommerce-cart .wc-block-components-quantity-selector,
body.woocommerce-cart .wc-block-components-totals-coupon__input input {
	background: transparent !important;
	border: 1px solid #000 !important;
	color: #000 !important;
	min-height: 55px;
}

body.woocommerce-cart .wc-block-components-quantity-selector {
	min-height: 0;
	width: auto;
}

body.woocommerce-cart .wc-block-components-quantity-selector input {
	border: none !important;
	min-height: 0;
}

body.woocommerce-checkout .wc-block-components-text-input input:focus,
body.woocommerce-checkout .wc-blocks-components-select__select:focus,
body.woocommerce-checkout textarea:focus {
	outline: none !important;
	border-color: #000 !important;
}

body.woocommerce-checkout .wc-block-components-text-input label,
body.woocommerce-checkout .wc-blocks-components-select__label {
	color: #000 !important;
}

/* Checkboxes and radios */

body.woocommerce-checkout .wc-block-components-checkbox__input[type="checkbox"] {
	background: transparent !important;
	border: 1px solid #000 !important;
}

body.woocommerce-checkout .wc-block-components-checkbox__mark {
	fill: #000;
}

body.woocommerce-checkout .wc-block-components-radio-control__option,
body.woocommerce-checkout .wc-block-components-radio-control-accordion-option {
	border: 1px solid #000 !important;
	background: transparent !important;
}

body.woocommerce-checkout .wc-block-components-radio-control__input {
	border: 1px solid #000 !important;
	background: transparent !important;
}

/* --- Buttons: plain bordered boxes, regular -> medium on hover --- */

body.woocommerce-cart .wc-block-components-button:not(.is-link),
body.woocommerce-checkout .wc-block-components-button:not(.is-link) {
	background: transparent !important;
	color: #000 !important;
	border: 1px solid #000 !important;
	min-height: 55px;
	text-transform: uppercase;
	font-weight: 400;
	opacity: 1 !important;
}

body.woocommerce-cart .wc-block-components-button:not(.is-link):hover,
body.woocommerce-cart .wc-block-components-button:not(.is-link):focus,
body.woocommerce-checkout .wc-block-components-button:not(.is-link):hover,
body.woocommerce-checkout .wc-block-components-button:not(.is-link):focus {
	background: transparent !important;
	color: #000 !important;
	font-weight: 500;
	outline: none;
}

body.woocommerce-cart .wc-block-components-button.is-link,
body.woocommerce-checkout .wc-block-components-button.is-link,
body.woocommerce-cart .wc-block-cart-item__remove-link,
body.woocommerce-cart .wc-block-components-quantity-selector__button {
	background: none !important;
	border: none !important;
	color: #000 !important;
	font-weight: 400;
}

body.woocommerce-cart .wc-block-components-button.is-link:hover,
body.woocommerce-checkout .wc-block-components-button.is-link:hover,
body.woocommerce-cart .wc-block-cart-item__remove-link:hover {
	font-weight: 500;
}

/* --- Empty cart: the "new in store" grid, in the shop's own card style --- */

body.woocommerce-cart .wc-block-grid__product {
	border: none !important;
	padding: 0 10px 0 0 !important;
	text-align: left;
}

body.woocommerce-cart .wc-block-grid__product-image img {
	width: 100%;
	height: auto;
	aspect-ratio: 4 / 5;
	object-fit: cover;
}

body.woocommerce-cart .wc-block-grid__product-title {
	text-transform: uppercase;
	font-weight: 500;
	padding: 12px 0 0;
}

body.woocommerce-cart .wc-block-grid__product-price {
	font-weight: 400;
}

body.woocommerce-cart .wc-block-grid__product .wp-block-button__link,
body.woocommerce-cart .wc-block-grid__product .add_to_cart_button {
	background: transparent !important;
	color: #000 !important;
	border: 1px solid #000 !important;
	text-transform: uppercase;
	font-weight: 400;
	width: 100%;
	padding: 16px;
}

body.woocommerce-cart .wc-block-grid__product .wp-block-button__link:hover,
body.woocommerce-cart .wc-block-grid__product .add_to_cart_button:hover {
	font-weight: 500;
}

/* No sad-face icon above the empty-cart message. */
body.woocommerce-cart .wc-block-cart__empty-cart__title.with-empty-cart-icon::before {
	content: none !important;
	display: none !important;
}

/* --- Notices and placeholders: boxed in black, not red/grey --- */

body.woocommerce-cart .wc-block-components-notice-banner,
body.woocommerce-checkout .wc-block-components-notice-banner,
body.woocommerce-checkout .wc-block-components-shipping-placeholder,
body.woocommerce-checkout .wc-block-components-shipping-rates-control__package .wc-block-components-notice-banner {
	background: transparent !important;
	border: 1px solid #000 !important;
	color: #000 !important;
}

body.woocommerce-cart .wc-block-components-notice-banner > svg,
body.woocommerce-checkout .wc-block-components-notice-banner > svg {
	background-color: #000 !important;
	fill: #fff !important;
}

/* The quantity badge on an order-summary photo */
body.woocommerce-checkout .wc-block-components-order-summary-item__quantity {
	background: #000 !important;
	color: #fff !important;
	border: none !important;
}

/* The totals: the final line's label and amount read as the heaviest (not
   the small print under it, e.g. the shipping note, which is also inside
   the footer item). */
body.woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
body.woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__value,
body.woocommerce-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__label,
body.woocommerce-checkout .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	font-weight: 500;
	text-transform: uppercase;
}

body.woocommerce-cart .wc-block-components-totals-item__description,
body.woocommerce-checkout .wc-block-components-totals-item__description {
	font-weight: 400;
	text-transform: none;
}

/* The "enter an address to see shipping options" box was a grey panel with
   grey text. */
body.woocommerce-checkout .wc-block-components-shipping-rates-control__no-shipping-address-message {
	background: transparent !important;
	border: 1px solid #000 !important;
	color: #000 !important;
	padding: 16px;
}

/* --- Order received / classic checkout endpoints --- */

body.woocommerce-checkout .woocommerce-order h2,
body.woocommerce-checkout .woocommerce-order .woocommerce-notice {
	text-transform: uppercase;
	font-weight: 500;
}

body.woocommerce-checkout .woocommerce-order table,
body.woocommerce-checkout .woocommerce-order th,
body.woocommerce-checkout .woocommerce-order td {
	border-color: #000 !important;
}

/* Order number / date / total / payment row: no browser indent and no dashed
   dividers - the items just sit in a line (two by two on small screens). */
body.woocommerce-checkout .woocommerce-order ul.order_details {
	display: flex;
	flex-wrap: wrap;
	gap: 12px 40px;
	margin: 0 0 32px;
	padding: 0;
	list-style: none;
}

/* WooCommerce's clearfix pseudo-elements would count as flex items. */
body.woocommerce-checkout .woocommerce-order ul.order_details::before,
body.woocommerce-checkout .woocommerce-order ul.order_details::after {
	display: none;
}

body.woocommerce-checkout .woocommerce-order ul.order_details li {
	margin: 0;
	padding: 0;
	border: 0;
}

/* The billing and shipping address boxes: space between them. */
body.woocommerce-checkout .woocommerce-order .woocommerce-columns--addresses .woocommerce-column {
	margin-bottom: 24px;
}

/* --- Small screens: content takes the full width, logo steps aside --- */

@media (max-width: 900px) {
	body.woocommerce-cart .site-logo,
	body.woocommerce-checkout .site-logo {
		display: none;
	}

	body.woocommerce-cart .page-content,
	body.woocommerce-checkout .page-content {
		padding: 24px 16px 60px;
	}

	body.woocommerce-checkout .woocommerce-order ul.order_details {
		gap: 12px 24px;
	}
}

/* --- Empty cart: hover swaps to the second photo, like the shop; and the
   whole page fits the window (no page scroll) --- */

body.woocommerce-cart .wc-block-grid__product-image {
	position: relative;
	aspect-ratio: 4 / 5;
	overflow: hidden;
}

body.woocommerce-cart .wc-block-grid__product-image img {
	position: absolute;
	inset: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	margin: 0;
}

body.woocommerce-cart .wc-block-grid__product-image-secondary {
	opacity: 0;
	transition: opacity 0.4s ease;
}

body.woocommerce-cart .wc-block-grid__product:hover .wc-block-grid__product-image-secondary {
	opacity: 1;
}

body.woocommerce-cart .wc-block-grid__products {
	padding-left: 90px;
	padding-right: 90px;
}

body.woocommerce-cart .wc-block-grid__product-link {
	display: block;
	width: 100%;
}

body.woocommerce-cart .wc-block-grid__product-image {
	display: block;
	width: 100%;
}

/* Photo sized from the window height so title + photo + info + button
   always fit without page scroll (3:4 photo, ~360px of other content). */
@media (min-width: 901px) {
	body.woocommerce-cart .wc-block-grid__product-link {
		width: min(100%, calc((100vh - 360px) * 0.8));
	}

	body.woocommerce-cart .page-content {
		padding-bottom: 20px;
	}
}

/* "Svuota carrello": the same bordered box as the cart's other buttons. */
body.woocommerce-cart .cose-empty-cart {
	display: flex;
	align-items: center;
	justify-content: center;
	min-height: 55px;
	margin-top: 10px;
	border: 1px solid #000;
	color: #000 !important;
	text-transform: uppercase;
	text-decoration: none !important;
	cursor: pointer;
}

body.woocommerce-cart .cose-empty-cart:hover {
	font-weight: 500;
}

/* The order summary's heading sat right against its box's border, both in
   the collapsible one at the top (mobile) and the one at the end of the
   form; the lines under it already have a 16px inset. */
body.woocommerce-checkout .wc-block-components-checkout-order-summary__title {
	padding-left: 16px !important;
	padding-right: 16px !important;
}

body.woocommerce-checkout .wp-block-woocommerce-checkout-order-summary-block .wc-block-components-checkout-step__heading {
	padding: 16px 16px 0 !important;
	margin: 0 !important;
}

/* The collapsible summary at the top of the mobile checkout lists its
   contents flush with the box; the one at the end of the form insets them
   16px (on the same elements). Same inset here. */
body.woocommerce-checkout .wc-block-components-checkout-order-summary__content .wc-block-components-order-summary,
body.woocommerce-checkout .wc-block-components-checkout-order-summary__content .wc-block-components-totals-coupon,
body.woocommerce-checkout .wc-block-components-checkout-order-summary__content .wc-block-components-totals-item {
	padding-left: 16px !important;
	padding-right: 16px !important;
}
