/**
 * Cart block — items on the left with tilted polaroid thumbnails, the chosen
 * options on a mint-tint slip (values hand-written), and a rounded white
 * summary card on the right (sticky on desktop), pill buttons and the
 * "Add something more" carousel.
 */

/* Summary card: a white rounded card with a soft shadow. */
.wp-block-woocommerce-cart .wc-block-cart__sidebar,
.wp-block-woocommerce-cart .wp-block-woocommerce-cart-totals-block {
	background-color: var(--wp--preset--color--white);
	border-radius: var(--wp--preset--border-radius--large);
	box-shadow: var(--wp--custom--card--shadow);
	padding: 26px 22px 22px;
	position: relative;
}

/* WooCommerce puts the summary beside the items from 920px; below, it follows them. */
@media (min-width: 920px) {
	.wp-block-woocommerce-cart .wc-block-cart__sidebar {
		align-self: flex-start;
		position: sticky;
		top: calc(var(--wp-admin--admin-bar--height, 0px) + var(--wp--custom--header--height) + 16px);
	}
}

@media (max-width: 919px) {
	.wp-block-woocommerce-cart .wc-block-components-sidebar-layout.wc-block-cart {
		row-gap: var(--wp--preset--spacing--60);
	}

	/* The stacked summary keeps its "Summary" title, as in the design (WooCommerce hides it). */
	.wp-block-woocommerce-cart .wc-block-cart .wc-block-components-sidebar .wc-block-cart__totals-title {
		display: block;
		line-height: 1.4;
		margin: 0;
		padding: 8px 16px 10px 0;
		text-align: left;
	}
}

.wp-block-woocommerce-cart .wc-block-cart__totals-title {
	color: var(--wp--preset--color--accent-light);
	font-family: var(--wp--preset--font-family--alegreya);
	font-size: var(--wp--preset--font-size--x-large);
	font-style: italic;
	font-weight: 700;
	letter-spacing: -0.01em;
	text-transform: none;
}

/* WooCommerce draws only top (and bottom) rules here: restyle those, never all four sides. */
.wp-block-woocommerce-cart .wc-block-components-totals-wrapper,
.wp-block-woocommerce-cart .wp-block-woocommerce-cart-order-summary-totals-block {
	border-top-color: var(--wp--preset--color--accent-soft);
	border-top-style: dashed;
	border-top-width: 1.5px;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-cart-order-summary-block {
	border-bottom-color: var(--wp--preset--color--accent-soft);
	border-bottom-style: dashed;
	border-bottom-width: 1.5px;
}

.wp-block-woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__label {
	font-size: 1rem;
	font-weight: 600;
}

.wp-block-woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	font-size: 1.375rem;
	font-weight: 700;
}

.wp-block-woocommerce-cart .wc-block-components-totals-footer-item .wc-block-components-totals-item__value {
	color: var(--wp--preset--color--accent);
}

.wp-block-woocommerce-cart .wc-block-components-totals-item__description,
.wp-block-woocommerce-cart .wc-block-components-totals-shipping__via {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

/* Line items. */
.wp-block-woocommerce-cart .wc-block-cart-items__header {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
	letter-spacing: 0.08em;
}

.wp-block-woocommerce-cart .wc-block-cart-items td,
.wp-block-woocommerce-cart .wc-block-cart-items th {
	border-top-color: var(--wp--preset--color--accent-soft);
	border-top-style: dashed;
	border-top-width: 1.5px;
}

.wp-block-woocommerce-cart table.wc-block-cart-items {
	border-bottom: 1.5px dashed var(--wp--preset--color--accent-soft);
}

/* Thumbnails: small polaroids (a deeper white strip at the bottom), tilted. */
.wp-block-woocommerce-cart .wc-block-cart-item__image img {
	aspect-ratio: 104 / 114;
	background-color: var(--wp--preset--color--white);
	border-radius: var(--wp--custom--paper--radius);
	box-shadow: 0 1px 2px rgba(2, 58, 52, 0.12), 0 8px 16px rgba(2, 58, 52, 0.12);
	box-sizing: border-box;
	object-fit: cover;
	padding: 6px 6px 16px;
	rotate: -2deg;
}

.wp-block-woocommerce-cart .wc-block-cart-items__row:nth-child(4n + 2) .wc-block-cart-item__image img {
	rotate: 1.5deg;
}

.wp-block-woocommerce-cart .wc-block-cart-items__row:nth-child(4n + 3) .wc-block-cart-item__image img {
	rotate: -1deg;
}

.wp-block-woocommerce-cart .wc-block-cart-items__row:nth-child(4n + 4) .wc-block-cart-item__image img {
	rotate: 2deg;
}

.wp-block-woocommerce-cart .wc-block-components-product-name {
	color: var(--wp--preset--color--contrast);
	font-size: var(--wp--preset--font-size--medium);
	font-weight: 500;
	line-height: 1.3;
	text-decoration: none;
}

.wp-block-woocommerce-cart .wc-block-cart-item__total .wc-block-components-product-price,
.wp-block-woocommerce-cart .wc-block-cart-item__prices {
	font-weight: 700;
}

.wp-block-woocommerce-cart .wc-block-cart-item__total .wc-block-components-product-price {
	color: var(--wp--preset--color--accent);
}

/* Chosen options and personalisation ("Front: «Eleni»") on a mint-tint slip. */
.wp-block-woocommerce-cart .wc-block-components-product-details {
	background-color: var(--wp--preset--color--accent-tint);
	border-radius: var(--wp--preset--border-radius--medium);
	display: grid;
	font-size: 0.84375rem;
	gap: 4px 10px;
	grid-template-columns: auto minmax(0, 1fr);
	list-style: none;
	margin: 8px 0;
	padding: 10px 12px;
}

.wp-block-woocommerce-cart .wc-block-components-product-details li {
	display: contents;
}

.wp-block-woocommerce-cart .wc-block-components-product-details__name {
	color: var(--wp--preset--color--muted);
	font-weight: 400;
}

.wp-block-woocommerce-cart .wc-block-components-product-details__value {
	color: var(--wp--preset--color--accent);
	font-family: var(--wp--preset--font-family--playpen-sans);
	font-size: 0.9375rem;
	line-height: 1.35;
}

/* Phones: each choice on two lines (label, then the hand-written value). */
@media (max-width: 480px) {
	.wp-block-woocommerce-cart .wc-block-components-product-details {
		gap: 0;
		grid-template-columns: minmax(0, 1fr);
	}

	.wp-block-woocommerce-cart .wc-block-components-product-details__value {
		margin-bottom: 6px;
	}
}

.wp-block-woocommerce-cart .wc-block-components-product-metadata__description,
.wp-block-woocommerce-cart .wc-block-components-product-low-stock-badge {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--small);
}

/* Quantity stepper: the design's mint-tint pill with round 44px buttons, 124px wide as on the product page. */
.wp-block-woocommerce-cart .wc-block-cart-item__quantity .wc-block-components-quantity-selector {
	align-items: center;
	background-color: var(--wp--preset--color--accent-tint);
	border: 0;
	border-radius: var(--wp--preset--border-radius--pill);
	display: inline-flex;
	gap: 4px;
	padding: 2px;
	width: auto;
}

.wp-block-woocommerce-cart .wc-block-components-quantity-selector::after {
	display: none;
}

.wp-block-woocommerce-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button {
	border-radius: var(--wp--preset--border-radius--pill);
	color: var(--wp--preset--color--contrast);
	flex: none;
	font-family: inherit;
	font-size: 1.125rem;
	height: 44px;
	min-height: 0;
	min-width: 0;
	opacity: 1;
	padding: 0;
	width: 44px;
}

.wp-block-woocommerce-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:hover:not(:disabled) {
	background-color: color-mix(in srgb, var(--wp--preset--color--accent) 10%, transparent);
}

.wp-block-woocommerce-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled {
	opacity: 0.35;
}

/* The number in the body font at 16px (iOS zooms in on smaller fields); WooCommerce's 40px minimum width is dropped. */
.wp-block-woocommerce-cart .wc-block-components-quantity-selector .wc-block-components-quantity-selector__input {
	background: transparent;
	border: 0;
	flex: none;
	font-family: inherit;
	font-size: 1rem;
	font-weight: 600;
	height: 44px;
	min-height: 0;
	min-width: 0;
	padding: 0;
	width: 24px;
}

/* The design shows the chosen options under the name, not the long description. */
.wp-block-woocommerce-cart .wc-block-components-product-metadata__description {
	display: none;
}

/* The bin: a round 44px button, as in the design. */
.wp-block-woocommerce-cart .wc-block-cart-item__remove-link.wc-block-cart-item__remove-link {
	align-items: center;
	border-radius: var(--wp--preset--border-radius--pill);
	color: var(--wp--preset--color--muted);
	display: inline-flex;
	font-size: var(--wp--preset--font-size--small);
	justify-content: center;
	min-height: 44px;
	min-width: 44px;
}

.wp-block-woocommerce-cart .wc-block-cart-item__remove-link.wc-block-cart-item__remove-link:hover {
	background-color: color-mix(in srgb, var(--wp--preset--color--accent) 10%, transparent);
	color: var(--wp--preset--color--contrast);
}

/*
 * Phones: WooCommerce's row grid has a fixed 132px column for the name, so
 * with the stepper and the bin side by side the rows were wider than the
 * page column. The name column takes the room that is left instead, and the
 * bin moves to the end of the row, in line with the stepper and under the
 * line total, as in the design.
 */
@media (max-width: 480px) {
	.wp-block-woocommerce-cart .wc-block-cart table.wc-block-cart-items .wc-block-cart-items__row {
		grid-template-columns: 80px minmax(0, 1fr);
		position: relative;
	}

	.wp-block-woocommerce-cart .wc-block-cart-item__remove-link.wc-block-cart-item__remove-link {
		position: absolute;
		right: 0;
	}
}

/* Buttons. */
.wp-block-woocommerce-cart .wc-block-cart__submit-button,
.wp-block-woocommerce-cart .wc-block-components-button:not(.is-link) {
	border-radius: var(--wp--preset--border-radius--pill);
	min-height: 54px;
}

.wp-block-woocommerce-cart .wc-block-cart__submit-button .wc-block-components-button__text::after {
	background-color: currentColor;
	content: "";
	display: inline-block;
	height: 18px;
	margin-left: 8px;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14'/%3E%3Cpath d='m12 5 7 7-7 7'/%3E%3C/svg%3E") center / contain no-repeat;
	vertical-align: -3px;
	width: 18px;
}

/* Mobile sticky checkout bar (WooCommerce shows it on small screens). */
.wc-block-cart__submit-container--sticky {
	-webkit-backdrop-filter: blur(10px);
	backdrop-filter: blur(10px);
	background-color: color-mix(in srgb, var(--wp--preset--color--base) 94%, transparent);
	box-shadow: 0 -6px 20px rgba(2, 58, 52, 0.08);
}

.wc-block-cart__submit-container--sticky::before {
	display: none;
}

/* While the button is pinned there, the end of the page (the footer's last line) stays clear of it. */
@media (max-width: 782px) {
	body:has(.wc-block-cart__submit-container--sticky) {
		padding-bottom: 96px;
	}
}

/* Trust points (an icon list) and the DM link inside the summary. */
.wp-block-woocommerce-cart ul.ma-cart-trust {
	border-top: 1.5px dashed var(--wp--preset--color--accent-soft);
	gap: 11px;
	margin: 18px 0 0;
	padding-top: 16px;
}

.wp-block-woocommerce-cart ul.ma-cart-trust > li::before {
	height: 16px;
	width: 16px;
}

/* A summary saved with the second design: check marks in mint circles. */
.wp-block-woocommerce-cart p.ma-cart-trust {
	align-items: center;
	display: flex;
	gap: 10px;
	margin: 10px 0 0;
}

.wp-block-woocommerce-cart p.ma-cart-trust::before {
	background-color: var(--wp--preset--color--accent-soft);
	background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23046B5E' stroke-width='2.75' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M20 6 9 17l-5-5'/%3E%3C/svg%3E");
	background-position: center;
	background-repeat: no-repeat;
	background-size: 12px;
	border-radius: 50%;
	content: "";
	flex: none;
	height: 22px;
	width: 22px;
}

.wp-block-woocommerce-cart .ma-dm-link {
	margin-top: 6px;
}

/* "Add something more": small polaroids with the round + button. */
.ma-cross-sells {
	margin-top: var(--wp--preset--spacing--50);
}

.ma-cross-sells .is-product-collection-layout-carousel .wc-block-product {
	max-width: 156px;
	min-width: 156px;
	padding: 8px 8px 14px;
}

.ma-cross-sells .ma-card__media .wc-block-components-product-image {
	border-radius: 2px;
}

/*
 * WooCommerce's own cross-sells in the default Cart page ("You may be
 * interested in…"): tilted polaroids with the design's full-width outline
 * button, kept at the bottom of each card. Three in a row from 600px; on
 * phones a row of small polaroids you swipe, like "Add something more".
 */
.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wc-block-product-template {
	column-gap: 20px;
	padding-top: 8px;
	row-gap: 34px;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wc-block-product {
	background-color: var(--wp--preset--color--white);
	border-radius: var(--wp--custom--product-card--radius);
	box-shadow: var(--wp--custom--paper--shadow);
	display: flex;
	flex-direction: column;
	padding: 10px 10px 16px;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wc-block-product:nth-child(3n + 1) {
	rotate: -1deg;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wc-block-product:nth-child(3n + 2) {
	rotate: 0.8deg;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wc-block-product:nth-child(3n + 3) {
	rotate: -0.5deg;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wc-block-components-product-image {
	background-color: var(--wp--preset--color--surface);
	border-radius: 2px;
	margin-bottom: 12px;
	overflow: hidden;
}

/* Names and prices as on the theme's own cards (the names are h2s, and the preset size class uses !important). */
.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wp-block-post-title {
	color: var(--wp--preset--color--contrast);
	font-family: var(--wp--preset--font-family--commissioner);
	font-size: var(--wp--preset--font-size--small) !important;
	font-style: normal;
	font-weight: 500;
	letter-spacing: 0;
	line-height: 1.3;
	margin: 0;
	padding-inline: 4px;
	text-align: left;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wp-block-post-title a {
	color: inherit;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wc-block-components-product-price {
	color: var(--wp--preset--color--accent);
	font-weight: 700;
	margin-top: 2px;
	padding-inline: 4px;
	text-align: left;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wc-block-components-product-button {
	margin: auto 0 0;
	padding-top: 12px;
	width: 100%;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wc-block-components-product-button__button.wc-block-components-product-button__button {
	background-color: var(--wp--preset--color--white);
	box-shadow: inset 0 0 0 1.5px var(--wp--preset--color--sea-glass);
	color: var(--wp--preset--color--accent);
	font-weight: 600;
	min-height: 44px;
	padding-block: 0;
	width: 100%;
}

.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wc-block-components-product-button__button.wc-block-components-product-button__button:hover {
	background-color: var(--wp--preset--color--accent-tint);
	color: var(--wp--preset--color--accent);
}

@media (min-width: 600px) {
	.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wc-block-product-template {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

/* Phones: room for the tilted cards and their shadows inside the scroller, without moving them. */
@media (max-width: 599px) {
	.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wc-block-product-template {
		display: flex;
		margin-inline: -10px;
		overflow-x: auto;
		overscroll-behavior-x: contain;
		padding: 10px 10px 24px;
		scroll-padding-inline: 10px;
		scroll-snap-type: x mandatory;
		scrollbar-width: none;
	}

	.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wc-block-product-template::-webkit-scrollbar {
		display: none;
	}

	.wp-block-woocommerce-cart .wp-block-woocommerce-product-collection:not(.ma-carousel) .wc-block-product {
		box-sizing: border-box;
		flex: 0 0 156px;
		padding: 8px 8px 14px;
		scroll-snap-align: start;
	}
}

/*
 * Empty cart. The theme's pattern (the cream monogram, a heading, a line and
 * a button) stays left-aligned under the page heading, as in the design,
 * with lines up to 440px. WooCommerce's own content (a centred title and
 * link, "New in store" and a product grid) uses the whole column, with the
 * cream monogram in place of the sad face and a dashed rule instead of dots.
 */
.wp-block-woocommerce-empty-cart-block > p:not(.has-text-align-center) {
	max-width: 440px;
}

.wp-block-woocommerce-empty-cart-block .ma-empty-mark {
	margin: var(--wp--preset--spacing--30) 0 0;
	width: 76px;
}

.wp-block-woocommerce-empty-cart-block .ma-empty-mark img {
	display: block;
	height: 76px;
	width: 76px;
}

.wp-block-woocommerce-empty-cart-block .wc-block-cart__empty-cart__title {
	color: var(--wp--preset--color--accent-light);
	font-family: var(--wp--preset--font-family--alegreya);
	font-size: var(--wp--preset--font-size--xx-large);
	font-style: italic;
	font-weight: 700;
}

.wp-block-woocommerce-empty-cart-block .wc-block-cart__empty-cart__title.with-empty-cart-icon::before {
	background: url("../../images/monogram-cream.webp") center / contain no-repeat;
	height: 76px;
	margin-bottom: var(--wp--preset--spacing--30);
	-webkit-mask: none;
	mask: none;
	width: 76px;
}

/* WooCommerce's "Browse store" link: the theme's teal pill button, as in the design. */
.wp-block-woocommerce-empty-cart-block > p.has-text-align-center > a:only-child {
	align-items: center;
	background-color: var(--wp--preset--color--accent);
	border-radius: var(--wp--preset--border-radius--pill);
	color: var(--wp--preset--color--base);
	display: inline-flex;
	font-family: var(--wp--preset--font-family--commissioner);
	font-size: 0.9375rem;
	font-weight: 700;
	justify-content: center;
	line-height: 1.2;
	min-height: 50px;
	padding: 0 1.625rem;
	text-decoration: none;
	transition: background-color var(--wp--custom--transition);
}

.wp-block-woocommerce-empty-cart-block > p.has-text-align-center > a:only-child:hover {
	background-color: var(--wp--preset--color--accent-strong-light);
	color: var(--wp--preset--color--base);
}

.wp-block-woocommerce-empty-cart-block > p.has-text-align-center > a:only-child:active {
	background-color: var(--wp--preset--color--accent-strong);
}

.wp-block-woocommerce-empty-cart-block > .wp-block-separator.is-style-dots {
	margin-block: var(--wp--preset--spacing--60) var(--wp--preset--spacing--40);
	width: 100%;
}

.wp-block-woocommerce-empty-cart-block > .wp-block-separator.is-style-dots::before {
	border-top: 1.5px dashed var(--wp--preset--color--sea-glass);
	content: "";
	display: block;
	letter-spacing: 0;
	padding: 0;
}
