/**
 * Mini-Cart block — lilac count badge on the bag icon (as in the design)
 * and a drawer that matches the rest of the store.
 */

/*
 * The badge background comes from the Mini-Cart block's "Product count"
 * colour (lilac in the header template part). WooCommerce's script also
 * writes an inline text colour that can match the background, so the digit
 * colour is pinned here; !important is the only way past an inline style.
 */
.wc-block-mini-cart__badge.wc-block-mini-cart__badge {
	border: 0;
	color: var(--wp--preset--color--plum) !important;
	font-family: var(--wp--preset--font-family--commissioner);
	font-size: 11px;
	font-weight: 700;
	height: 19px;
	line-height: 19px;
	min-width: 19px;
	padding: 0 5px;
}

.wc-block-mini-cart__quantity-badge {
	position: relative;
}

/* Drawer. The page behind is dimmed in deep teal, like behind the menu drawer. */
.wc-block-components-drawer__screen-overlay.wc-block-components-drawer__screen-overlay {
	background-color: color-mix(in srgb, var(--wp--preset--color--accent-strong) 45%, transparent);
}

.wc-block-mini-cart__drawer .wp-block-woocommerce-mini-cart-contents {
	background-color: var(--wp--preset--color--base);
	color: var(--wp--preset--color--contrast);
}

.wc-block-mini-cart__drawer .wc-block-mini-cart__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;
}

/* Thumbnails: small tilted polaroids, as in the cart. */
.wc-block-mini-cart__drawer .wc-block-cart-item__image img,
.wc-block-mini-cart__drawer .wc-block-components-product-image img {
	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 6px 12px rgba(2, 58, 52, 0.1);
	box-sizing: border-box;
	padding: 4px 4px 10px;
	rotate: -2deg;
}

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

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

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

/* The chosen options under the name, not the long description (as on the cart page). */
.wc-block-mini-cart__drawer .wc-block-components-product-metadata__description {
	display: none;
}

/*
 * The close button (52px, its padding fixed by WooCommerce with !important)
 * stays inside the drawer: WooCommerce's −1em end margin pushed it 2px past
 * the edge.
 */
.wc-block-mini-cart__drawer .wc-block-components-button.wc-block-components-drawer__close {
	margin-inline-end: -10px;
}

.wc-block-mini-cart__drawer .wc-block-components-product-name {
	color: var(--wp--preset--color--contrast);
	font-weight: 500;
	text-decoration: none;
}

.wc-block-mini-cart__drawer .wc-block-components-product-details {
	color: var(--wp--preset--color--muted);
	font-size: var(--wp--preset--font-size--x-small);
}

.wc-block-mini-cart__drawer .wc-block-components-product-price {
	color: var(--wp--preset--color--accent);
	font-weight: 700;
}

.wc-block-mini-cart__drawer .wc-block-mini-cart__footer {
	border-top: 1.5px dashed var(--wp--preset--color--accent-soft);
}

/* Border-box, so the 48px minimum includes the padding (the buttons were 78px tall). */
.wc-block-mini-cart__drawer .wc-block-mini-cart__footer-actions .wc-block-components-button,
.wc-block-mini-cart__drawer .wc-block-mini-cart__shopping-button {
	border-radius: var(--wp--preset--border-radius--pill);
	box-sizing: border-box;
	min-height: 48px;
}

/* "Cart": the white outline pill with a sea-glass ring (WooCommerce rings it in the text colour). */
.wc-block-mini-cart__drawer .wc-block-components-button:not(.is-link).is-style-outline.wc-block-mini-cart__footer-cart {
	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;
}

.wc-block-mini-cart__drawer .wc-block-components-button:not(.is-link).is-style-outline.wc-block-mini-cart__footer-cart:hover {
	background-color: var(--wp--preset--color--accent-tint);
	color: var(--wp--preset--color--accent);
}

/* Quantity stepper: the mint-tint pill with 44px round buttons, 124px wide as on the product page. */
.wc-block-mini-cart__drawer .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);
	gap: 4px;
	min-width: 0;
	padding: 2px;
	width: auto;
}

.wc-block-mini-cart__drawer .wc-block-components-quantity-selector::after {
	display: none;
}

.wc-block-mini-cart__drawer .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: 44px;
	opacity: 1;
	padding: 0;
	width: 44px;
}

.wc-block-mini-cart__drawer .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);
}

.wc-block-mini-cart__drawer .wc-block-components-quantity-selector .wc-block-components-quantity-selector__button:disabled {
	opacity: 0.35;
}

/*
 * The theme gives number fields a 48px minimum and side padding; not inside
 * the stepper. The number is in the body font at 16px (iOS zooms in on
 * smaller fields).
 */
.wc-block-mini-cart__drawer .wc-block-components-quantity-selector input.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;
	text-align: center;
	width: 24px;
}

/*
 * The drawer is always narrow, and WooCommerce's row grid has a fixed 132px
 * column for the name: on a 360px phone the rows were wider than the drawer.
 * The name column takes the room that is left instead, and the bin (a round
 * 44px button) moves to the end of the row, in line with the stepper and
 * under the line total, as in the cart. The doubled class outranks
 * WooCommerce's grid rule, which loads with the drawer.
 */
.wc-block-mini-cart__drawer.wc-block-mini-cart__drawer table.wc-block-cart-items .wc-block-cart-items__row {
	grid-template-columns: 80px minmax(0, 1fr);
	position: relative;
}

.wc-block-mini-cart__drawer .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;
	justify-content: center;
	min-height: 44px;
	min-width: 44px;
	position: absolute;
	right: 0;
}

.wc-block-mini-cart__drawer .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);
}
