/*
 * The design's own icons (inc/icons.php swaps the markup). This file only sizes them and
 * strips the box the core/WooCommerce icon needed, so each control is the design's 18x18 box.
 */

/* An icon drawn with strokes is never filled by a core "fill: currentColor" rule. */
:root svg.lbs-icon {
	display: block;
	fill: none;
}

/* Header controls: the Figma icon box (18x18), the design's 70% opacity button, full on hover
   (reference Header.tsx: opacity-70 hover:opacity-100 transition-opacity). */
header.wp-block-template-part .wp-block-search__button-only .wp-block-search__button,
header.wp-block-template-part .wc-block-customer-account__link,
header.wp-block-template-part .wc-block-mini-cart__button,
header.wp-block-template-part .wp-block-navigation__responsive-container-open {
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	min-width: 0;
	min-height: 0;
	opacity: 0.7;
	transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* The hidden search field keeps its text height; the toggle itself stays the 18px icon box. */
header.wp-block-template-part .wp-block-search__button-only .wp-block-search__button {
	height: 18px;
	align-self: center;
}

header.wp-block-template-part .wp-block-search__button-only .wp-block-search__button:hover,
header.wp-block-template-part .wc-block-customer-account__link:hover,
header.wp-block-template-part .wc-block-mini-cart__button:hover,
header.wp-block-template-part .wp-block-navigation__responsive-container-open:hover {
	opacity: 1;
}

header.wp-block-template-part .wp-block-search__button svg.lbs-icon,
header.wp-block-template-part .wc-block-customer-account__link svg.lbs-icon,
header.wp-block-template-part .wc-block-mini-cart__button svg.lbs-icon {
	width: 18px;
	height: 18px;
	min-width: 18px;
	min-height: 18px;
	margin: 0;
}

/* The search toggle is the icon and nothing else while the field is hidden. */
header.wp-block-template-part .wp-block-search__button-only.wp-block-search__searchfield-hidden .wp-block-search__inside-wrapper {
	min-width: 0;
	padding: 0;
	border: 0;
}

/* The cart count: Figma 18:1079, 16x16 amber disc 8px right of and 6px above the icon box,
   DM Sans 600 9px / 13.5px (reference: absolute -top-1.5 -right-1.5 w-4 h-4 text-[9px] font-semibold). */
header.wp-block-template-part .wc-block-mini-cart__button {
	gap: 0;
}

/* WooCommerce's inline-block wrapper sits on a text line box and lifts the button 2.5px off centre. */
header.wp-block-template-part .wc-block-mini-cart {
	display: block;
}

header.wp-block-template-part .wc-block-mini-cart__badge {
	top: -6px;
	left: 8px;
	margin: 0;
	transform: none;
	box-sizing: border-box;
	width: 16px;
	min-width: 16px;
	height: 16px;
	padding: 0;
	border: 0;
	border-radius: 50%;
	font-family: var(--wp--preset--font-family--body);
	font-size: var(--lbs-t-chip);
	font-weight: 600;
	line-height: 16px;
	letter-spacing: 0;
	-webkit-font-smoothing: antialiased;
	-moz-osx-font-smoothing: grayscale;
}

/* Mobile menu: the reference's 20x15 three-line button and its open-state cross. */
.wp-block-navigation__responsive-container-open svg.lbs-icon--menu,
.wp-block-navigation__responsive-container-close svg.lbs-icon--menu-close {
	width: 20px;
	height: 15px;
	overflow: visible;
}

/* The cross sits exactly where the three lines were (reference: the same button morphs in place):
   20x15 box at the header's right gutter, centred on the header row, at the button's 70% opacity. */
header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
	position: fixed;
	top: calc(var(--wp-admin--admin-bar--height, 0px) + 24.5px);
	right: 24px;
	margin: 0;
	padding: 0;
	border: 0;
	background: transparent;
	opacity: 0.7;
	transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* md: the 80px header row and 48px gutter (Header.tsx h-16 md:h-20, px-6 md:px-12). */
@media (min-width: 768px) {
	header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close {
		top: calc(var(--wp-admin--admin-bar--height, 0px) + 32.5px);
		right: 48px;
	}
}

header.wp-block-template-part .wp-block-navigation__responsive-container.is-menu-open .wp-block-navigation__responsive-container-close:hover {
	opacity: 1;
}

/* Cart drawer (reference SideCart.tsx): close 20px at opacity-50, remove 14px at opacity-40,
   empty bag 40px above the message. */
.wc-block-mini-cart__drawer .wc-block-components-drawer__close svg.lbs-icon--drawer-close {
	width: 20px;
	height: 20px;
}

/* Reference close: the bare 20px icon, 32px from the drawer's right edge (px-8) and 28px from its top
   (py-6 plus centring on the 28px title line). WooCommerce pads it 1em with !important. */
.wc-block-mini-cart__drawer .wc-block-components-button.wc-block-components-drawer__close {
	top: 28px;
	inset-inline-end: 32px;
	margin: 0;
	padding: 0 !important;
	opacity: 0.5;
	transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-block-mini-cart__drawer .wc-block-components-button.wc-block-components-drawer__close:hover {
	opacity: 1;
}

.wc-block-mini-cart__drawer .wc-block-cart-item__remove-link svg.lbs-icon--remove {
	width: 14px;
	height: 14px;
}

.wc-block-mini-cart__drawer .wc-block-cart-item__remove-link {
	opacity: 0.4;
	transition: opacity 150ms cubic-bezier(0.4, 0, 0.2, 1);
}

.wc-block-mini-cart__drawer .wc-block-cart-item__remove-link:hover {
	opacity: 0.8;
}

.wc-block-mini-cart__drawer svg.lbs-icon--cart-empty {
	width: 40px;
	height: 40px;
	margin: 0 auto 16px;
}

/* Section icons placed as image blocks (shop filter, product wishlist): the figure is exactly the
   icon box, not a text line box around an inline image. */
.wp-block-image img[src*="/icons/reference/"],
.wp-block-image img[src*="/icons/figma/"] {
	display: block;
}

/* ABOVE THE FRAME (from 1360px): the header icons keep Figma 18:1065's proportions (value / 13.59
   vw), like the rest of the header (chrome.css). At 1359 each equals the value above. */
@media (min-width: 1360px) {
	header.wp-block-template-part .wp-block-search__button-only .wp-block-search__button {
		height: 1.3245vw;
	}

	header.wp-block-template-part .wp-block-search__button svg.lbs-icon,
	header.wp-block-template-part .wc-block-customer-account__link svg.lbs-icon,
	header.wp-block-template-part .wc-block-mini-cart__button svg.lbs-icon {
		width: 1.3245vw;
		height: 1.3245vw;
		min-width: 1.3245vw;
		min-height: 1.3245vw;
	}

	header.wp-block-template-part .wc-block-mini-cart__badge {
		top: -0.4415vw;
		left: 0.5887vw;
		width: 1.1773vw;
		min-width: 1.1773vw;
		height: 1.1773vw;
		font-size: var(--lbs-t-chip);
		line-height: 1.1773vw;
	}
}
