/*
 * The client's cart style on the cart page and The7's header cart dropdown.
 * Loaded by mu-plugins/site-customizations.php, which explains the setup.
 * Colours come from The7's button and accent settings.
 */

/* Free shipping banner, used in both places. */
.pwi-ship {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 10px 12px;
	background-color: #e9f5f8;
	border: 1px solid #b5dfea;
	border-radius: 6px;
	color: #262d37;
	font-weight: 700;
	line-height: 1.3;
	text-align: center;
}

.pwi-ship svg {
	display: block;
	fill: none;
	stroke: currentColor;
	stroke-linecap: round;
	stroke-linejoin: round;
}

.pwi-ship__truck {
	display: flex;
	flex: none;
	color: var(--the7-accent-color, #219ebc);
}

.pwi-ship__truck svg {
	width: 24px;
	height: 24px;
	stroke-width: 1.8;
}

/* Coloured through the stroke: The7 forces one text colour inside its header
   cart dropdown, which would otherwise turn the icons black there. */
.pwi-ship .pwi-ship__truck svg,
.pwi-ship .pwi-ship__info svg {
	stroke: var(--the7-accent-color, #219ebc);
}

.pwi-ship__info {
	display: flex;
	flex: none;
	margin: 0;
	padding: 2px;
	background: none;
	border: 0;
	border-radius: 50%;
	box-shadow: none;
	color: var(--the7-accent-color, #219ebc);
	cursor: help;
	line-height: 1;
}

.pwi-ship__info svg {
	width: 17px;
	height: 17px;
	stroke-width: 2;
}

.pwi-ship__info:focus-visible {
	outline: 2px solid var(--the7-btn-hover-bg-color, #476f7f);
	outline-offset: 1px;
}

/* Note shown above the banner on hover, focus or tap. */
.pwi-ship__note {
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	z-index: 5;
	width: max-content;
	max-width: 220px;
	padding: 6px 10px;
	background-color: #fff;
	border: 1px solid #b5dfea;
	border-radius: 4px;
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
	color: #262d37;
	font-size: 13px;
	font-weight: 400;
	line-height: 1.4;
	transform: translateX(-50%);
	visibility: hidden;
	opacity: 0;
	transition: opacity 0.15s, visibility 0.15s;
	pointer-events: none;
}

.pwi-ship__info:hover + .pwi-ship__note,
.pwi-ship__info:focus + .pwi-ship__note {
	visibility: visible;
	opacity: 1;
}

/* Cart page: banner in the totals column, then the checkout button in the
   site's Add to Cart colour, then Continue Shopping as a link. */
.wp-block-woocommerce-cart p.pwi-cart-ship {
	margin: 0 0 16px;
	font-size: 16px;
}

.wp-block-woocommerce-proceed-to-checkout-block .wc-block-cart__submit-button {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 10px;
	min-height: 52px;
	background-color: var(--the7-btn-bg-color, #219ebc);
	border-radius: var(--the7-btn-m-border-radius, 100px);
	color: var(--the7-btn-color, #fff);
	font-size: 17px;
	font-weight: 700;
}

.wp-block-woocommerce-proceed-to-checkout-block .wc-block-cart__submit-button:hover,
.wp-block-woocommerce-proceed-to-checkout-block .wc-block-cart__submit-button:focus {
	background-color: var(--the7-btn-hover-bg-color, #476f7f);
	color: var(--the7-btn-hover-color, #fff);
}

.wp-block-woocommerce-proceed-to-checkout-block .wc-block-cart__submit-button::after,
.shopping-cart-inner .pwi-mc-checkout::after {
	content: "";
	flex: none;
	width: 18px;
	height: 18px;
	background-color: currentColor;
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") no-repeat center / contain;
	mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='M5 12h14M13 6l6 6-6 6'/%3E%3C/svg%3E") no-repeat center / contain;
}

.wp-block-woocommerce-cart p.pwi-cart-continue {
	margin: 14px 0 0;
	text-align: center;
	font-size: 16px;
}

.wp-block-woocommerce-cart p.pwi-cart-continue a {
	text-decoration: underline;
	text-underline-offset: 3px;
}

/* Header cart dropdown: The7's own total and buttons give way to the summary. */
.masthead .shopping-cart-inner {
	width: 300px;
}

.shopping-cart-inner > .buttons,
.shopping-cart-inner > .shopping-cart-bottom {
	display: none !important;
}

.shopping-cart-inner .pwi-mc-summary {
	display: flex;
	flex-direction: column;
	gap: 10px;
	margin-top: 14px;
}

.shopping-cart-inner .pwi-mc-ship .pwi-ship {
	gap: 6px;
	padding: 8px;
	font-size: 13px;
}


.shopping-cart-inner .pwi-mc-ship .pwi-ship__truck svg {
	width: 22px;
	height: 22px;
}

.shopping-cart-inner .pwi-mc-subtotal {
	display: flex;
	align-items: baseline;
	justify-content: space-between;
	gap: 8px;
	margin: 0;
	padding: 0;
}

.shopping-cart-inner .pwi-mc-subtotal__label {
	font-weight: 700;
}

.shopping-cart-inner .pwi-mc-count {
	font-weight: 400;
	opacity: 0.7;
}

.shopping-cart-inner .pwi-mc-subtotal__amount,
.shopping-cart-inner .pwi-mc-subtotal__amount .amount {
	font-size: 18px;
	font-weight: 700;
	white-space: nowrap;
}

.shopping-cart-inner a.button.pwi-mc-checkout {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	width: 100%;
	margin: 0;
	padding: 12px 16px;
	font-size: 15px;
	box-sizing: border-box;
}

.shopping-cart-inner .pwi-mc-continue {
	align-self: center;
	padding: 2px 4px;
	font-size: 14px;
	text-decoration: underline;
	text-underline-offset: 3px;
}
