/**
 * Faradoran Commerce header actions: the wishlist and cart links that HeaderCommerceActions renders.
 *
 * Loaded on every Faradoran Theme frontend page (handle faradoran-commerce-header, right after faradoran-theme-header,
 * through the action faradoran_theme_header_enqueue_assets). Moved from the Theme in Phase 12b without changes; until
 * Phase 13 the rules read the Theme design tokens (--faradoran-theme-*) directly.
 */

/* Rules from the Faradoran Theme's header.css (Phase 12b), in their original order. */

.faradoran-header-action--wishlist,
.faradoran-header-action--cart {
	transition: color var(--faradoran-theme-motion-fast) var(--faradoran-theme-easing-standard);
}

.faradoran-header-action--wishlist:hover,
.faradoran-header-action--wishlist:focus-visible,
.faradoran-header-action--cart:hover,
.faradoran-header-action--cart:focus-visible {
	color: var(--faradoran-theme-color-green);
}

.faradoran-header-action--wishlist:focus-visible,
.faradoran-header-action--cart:focus-visible {
	color: var(--faradoran-theme-color-gold);
}

.faradoran-header-action--wishlist .faradoran-header-action__count,
.faradoran-header-action--cart .faradoran-header-action__count {
	z-index: 1;
}

@media (hover: hover) and (pointer: fine) {
	.faradoran-header-action--wishlist[data-tooltip]::after,
.faradoran-header-action--cart[data-tooltip]::after {
		content: attr(data-tooltip);
		position: absolute;
		top: calc(100% + var(--faradoran-theme-space-1));
		left: 50%;
		z-index: var(--faradoran-theme-z-header-dropdown);
		padding: var(--faradoran-theme-space-1) var(--faradoran-theme-space-2);
		border-radius: var(--faradoran-theme-radius-sm);
		background-color: var(--faradoran-theme-color-green-dark);
		box-shadow: var(--faradoran-theme-shadow-md);
		color: var(--faradoran-theme-color-ivory);
		font-size: var(--faradoran-theme-font-size-xs);
		line-height: var(--faradoran-theme-line-height-tight);
		white-space: nowrap;
		pointer-events: none;
		opacity: 0;
		visibility: hidden;
		transform: translateX(-50%);
		transition:
			opacity var(--faradoran-theme-motion-fast) var(--faradoran-theme-easing-standard),
visibility var(--faradoran-theme-motion-fast) var(--faradoran-theme-easing-standard);
	}

	.faradoran-header-action--wishlist[data-tooltip]:hover::after,
.faradoran-header-action--wishlist[data-tooltip]:focus-visible::after,
.faradoran-header-action--cart[data-tooltip]:hover::after,
.faradoran-header-action--cart[data-tooltip]:focus-visible::after {
		opacity: 1;
		visibility: visible;
	}
}

.faradoran-header-action__icon-shell {
	position: relative;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	flex-shrink: 0;
}

.faradoran-header-action__icon-shell--cart {
	inline-size: 1.5625rem;
	block-size: 1.5625rem;
	overflow: visible;
}

.faradoran-header-action--cart .faradoran-icon--cart {
	display: block;
	inline-size: 100%;
	block-size: 100%;
}

.faradoran-header-action--cart .faradoran-header-cart-count {
	position: absolute;
	top: var(--faradoran-theme-cart-badge-offset-top);
	left: var(--faradoran-theme-cart-badge-offset-left);
	right: auto;
	bottom: auto;
	z-index: 1;
	pointer-events: none;
}

/* The two tooltip selectors of the Theme header.css reduced-motion rule (its other selectors stay in the Theme). */
@media (prefers-reduced-motion: reduce) {
	.faradoran-header-action--wishlist[data-tooltip]::after,
.faradoran-header-action--cart[data-tooltip]::after {
		transition: none;
	}
}
