/*
 * Product cards (inc/product-card.php): size chips that add to the cart, the card's messages, and the
 * card buttons. Every card on the site: shop, category and search pages, carousels, related products,
 * the wishlist.
 */

:root {
	--wb-heart: #d62d20;
	--wb-chip-line: #a3a3a3; /* An available size: a clear grey outline (Salty Crush uses #a9a9a9). */
	--wb-chip-off-line: #e6e6e6; /* Sold out, or all in the shopper's cart. */
	--wb-chip-off-text: #b0b0b0;
}

/* ---------- Size chips ---------- */

/* Available sizes stand out: a mid-grey outline and the size in semibold dark text (owner, 2026-11-20: "pale
   and barely visible"; the old outline was the theme's #ebebeb, the same as a sold-out size's). The outline is
   drawn inside the chip: the theme draws it outside (a 1 px box-shadow), and the product grid
   (#glozin-shop-content, overflow hidden) cut it off the chips at the grid's left edge (owner, 2026-11-19). */
body ul.products li.product .product-variation-items .product-variation-item--label[data-wb-mode] {
	box-shadow: inset 0 0 0 1px var(--wb-chip-line);
	margin-bottom: 0;
	border-radius: 4px; /* As the size boxes in the filter. */
	background-color: var(--gz-color-light);
	color: var(--gz-color-dark);
	font-weight: 600;
	cursor: pointer;
	transition: background-color 0.2s, color 0.2s, box-shadow 0.2s;
}

/* A chip adds that size to the cart, so none starts "selected": the theme filled the first size black. */
body ul.products li.product .product-variation-items .product-variation-item--label[data-wb-mode].selected {
	box-shadow: inset 0 0 0 1px var(--wb-chip-line);
	background-color: var(--gz-color-light);
	color: var(--gz-color-dark);
}

/* With a mouse: the chip fills on hover, as the theme's do. Touch screens: no fill left behind after a tap. */
@media (hover: hover) {
	body ul.products li.product .product-variation-items .product-variation-item--label[data-wb-mode]:not(.is-sold-out):not(.is-maxed):hover {
		box-shadow: inset 0 0 0 1px var(--gz-color-dark);
		background-color: var(--gz-color-dark);
		color: var(--gz-color-light);
	}
}
@media (hover: none) {
	body ul.products li.product .product-variation-items .product-variation-item--label[data-wb-mode]:not(.is-sold-out):not(.is-maxed):hover {
		box-shadow: inset 0 0 0 1px var(--wb-chip-line);
		background-color: var(--gz-color-light);
		color: var(--gz-color-dark);
	}
}

body ul.products li.product .product-variation-items .product-variation-item--label[data-wb-mode]:focus-visible {
	outline: none;
	box-shadow: inset 0 0 0 2px var(--gz-color-dark);
}

/* Sold out, or all of that size already in the shopper's cart: greyed and crossed out. Sold out does nothing;
   "all in your cart" says so on the card when clicked. */
body ul.products li.product .product-variation-items .product-variation-item--label[data-wb-mode]:is(.is-sold-out, .is-maxed),
body ul.products li.product .product-variation-items .product-variation-item--label[data-wb-mode]:is(.is-sold-out, .is-maxed):hover {
	box-shadow: inset 0 0 0 1px var(--wb-chip-off-line);
	background-color: var(--gz-color-light);
	color: var(--wb-chip-off-text);
	font-weight: 400;
	text-decoration: line-through;
	cursor: default;
}
body ul.products li.product .product-variation-items .product-variation-item--label[data-wb-mode].is-maxed {
	cursor: pointer;
}

/* Adding: the size fades and a small ring turns in its place. */
body ul.products li.product .product-variation-items .product-variation-item--label[data-wb-mode].is-loading {
	color: transparent !important;
	pointer-events: none;
}
body ul.products li.product .product-variation-items .product-variation-item--label[data-wb-mode].is-loading::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 50%;
	width: 12px;
	height: 12px;
	margin: -6px 0 0 -6px;
	border: 1.5px solid var(--gz-color-dark);
	border-right-color: transparent;
	border-radius: 50%;
	animation: wb-chip-spin 0.6s linear infinite;
}
body ul.products li.product .product-variation-items .product-variation-item--label[data-wb-mode].is-loading:hover::after {
	border-color: var(--gz-color-light);
	border-right-color: transparent;
}
@keyframes wb-chip-spin {
	to {
		transform: rotate(360deg);
	}
}

/* WooCommerce adds "View cart" after an added button; the mini cart opens instead. */
body ul.products li.product .product-variation-items .added_to_cart {
	display: none;
}

/* Phones: size boxes in proportion to the 2-up cards. */
@media (max-width: 767px) {
	body ul.products li.product .product-variation-items {
		gap: 4px;
	}
	body ul.products li.product .product-variation-items .product-variation-item--label {
		min-width: 30px;
		height: 22px;
		padding: 0 6px;
		font-size: 12px;
	}
	body ul.products li.product .product-variation-items .product-variation-item--label.is-loading::after {
		width: 10px;
		height: 10px;
		margin: -5px 0 0 -5px;
	}
}

/* ---------- Messages on the card (product-card.js) ---------- */

/* Over the bottom of the photo, next to the chips that caused them: no jump in the grid, no trip to the
   product page (owner, 2026-11-20). The look is the site's message design (assets/notices/notices.css). */
body ul.products li.product .wb-card-note {
	position: absolute;
	z-index: 6;
	inset-inline: 10px;
	bottom: 10px;
	margin: 0;
	padding: 11px 36px 11px 40px;
	font-size: 13px;
	line-height: 1.45;
	opacity: 0;
	transform: translateY(6px);
	transition: opacity 0.2s, transform 0.2s;
	cursor: default;
}
body ul.products li.product .wb-card-note.is-visible {
	opacity: 1;
	transform: none;
}
body ul.products li.product .wb-card-note::before {
	top: 12px;
	inset-inline-start: 13px;
	width: 18px;
	height: 18px;
}
body ul.products li.product .wb-card-note .wb-notice__text {
	flex: 1 1 100%;
}
body ul.products li.product .wb-card-note .wb-notice__close {
	top: 6px;
	inset-inline-end: 4px;
}
@media (prefers-reduced-motion: reduce) {
	body ul.products li.product .wb-card-note {
		transition: none;
		transform: none;
	}
}
@media (max-width: 767px) {
	body ul.products li.product .wb-card-note {
		inset-inline: 6px;
		bottom: 6px;
		padding: 8px 28px 8px 30px;
		font-size: 12px;
		line-height: 1.4;
	}
	body ul.products li.product .wb-card-note::before {
		top: 9px;
		inset-inline-start: 9px;
		width: 15px;
		height: 15px;
	}
	body ul.products li.product .wb-card-note .wb-notice__close {
		top: 2px;
		inset-inline-end: 0;
	}
}

/* ---------- Card buttons ---------- */

/* No cart button on the card at any width: a size chip adds to the cart (owner, 2026-11-20). The theme's bar at
   the bottom of the photo ("Select options", and "Out of Stock" over the out-of-stock badge) and its bag icon go. */
body ul.products li.product .product-featured-icons--second,
body ul.products li.product .product-featured-icons .product-loop-button-atc {
	display: none !important;
}

/* Below 1,200 px the theme moves the card buttons to the photo's bottom corner. Keep them top right, as on
   desktop: from the bottom, a wishlisted card's lone heart hung halfway up the photo. */
@media (max-width: 1199px) {
	body ul.products li.product .product-thumbnail .product-featured-icons--primary {
		top: 10px;
		bottom: auto;
	}
}

/* Wishlisted: a solid red heart (the outer edge of the theme's own heart, filled). On desktop the button stays
   light like quick view beside it, instead of the theme's dark ".added" one (owner, 2026-11-19). */
body ul.products li.product .wcboost-wishlist-button.added {
	--gz-button-bg-color: var(--gz-color-light);
	--gz-button-bg-color-hover: var(--gz-color-light);
	--gz-button-color: var(--gz-color-dark);
	--gz-button-color-hover: var(--gz-color-dark);
	--gz-button-border-color-hover: var(--gz-color-light);
}
body ul.products li.product:is(.wbplp-wished, :has(.wcboost-wishlist-button.added)) .product-featured-icons--primary {
	opacity: 1 !important;
	visibility: visible !important;
	transform: none !important;
}
body ul.products li.product .wcboost-wishlist-button.added .wcboost-wishlist-button__icon {
	position: relative;
	display: inline-flex;
}
body ul.products li.product .wcboost-wishlist-button.added svg {
	opacity: 0;
}
body ul.products li.product .wcboost-wishlist-button.added .wcboost-wishlist-button__icon::after {
	content: "";
	position: absolute;
	inset: 0;
	background: var(--wb-heart);
	-webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 19 16'%3E%3Cpath d='M17.4693 1.46278C16.4831 0.52335 15.178 0 13.8216 0C12.4652 0 11.1601 0.52335 10.1739 1.46278L9.5 2.11096L8.8261 1.46278C7.84238 0.51698 6.53343 -0.00720742 5.17448 0.000442952C3.81807 -0.00598466 2.512 0.518175 1.53069 1.46278C1.04762 1.9183 0.662488 2.46909 0.399178 3.08097C0.135869 3.69285 0 4.35278 0 5.01983C0 5.68687 0.135869 6.3468 0.399178 6.95868C0.662488 7.57057 1.04762 8.12135 1.53069 8.57687L8.96715 15.7858C9.04006 15.8502 9.12189 15.9034 9.21006 15.9439C9.39624 16.0187 9.60376 16.0187 9.78994 15.9439C9.87811 15.9034 9.95994 15.8502 10.0329 15.7858L17.4693 8.57687C17.9524 8.12135 18.3375 7.57057 18.6008 6.95868C18.8641 6.3468 19 5.68687 19 5.01983C19 4.35278 18.8641 3.69285 18.6008 3.08097C18.3375 2.46909 17.9524 1.9183 17.4693 1.46278Z'/%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 19 16'%3E%3Cpath d='M17.4693 1.46278C16.4831 0.52335 15.178 0 13.8216 0C12.4652 0 11.1601 0.52335 10.1739 1.46278L9.5 2.11096L8.8261 1.46278C7.84238 0.51698 6.53343 -0.00720742 5.17448 0.000442952C3.81807 -0.00598466 2.512 0.518175 1.53069 1.46278C1.04762 1.9183 0.662488 2.46909 0.399178 3.08097C0.135869 3.69285 0 4.35278 0 5.01983C0 5.68687 0.135869 6.3468 0.399178 6.95868C0.662488 7.57057 1.04762 8.12135 1.53069 8.57687L8.96715 15.7858C9.04006 15.8502 9.12189 15.9034 9.21006 15.9439C9.39624 16.0187 9.60376 16.0187 9.78994 15.9439C9.87811 15.9034 9.95994 15.8502 10.0329 15.7858L17.4693 8.57687C17.9524 8.12135 18.3375 7.57057 18.6008 6.95868C18.8641 6.3468 19 5.68687 19 5.01983C19 4.35278 18.8641 3.69285 18.6008 3.08097C18.3375 2.46909 17.9524 1.9183 17.4693 1.46278Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

/* With a mouse, not hovered: just the flat red heart on the photo; hovered: the buttons. Touch screens have no
   hover, so they always show the buttons. */
@media (hover: hover) {
	body ul.products li.product:is(.wbplp-wished, :has(.wcboost-wishlist-button.added)):not(:hover) .product-featured-icons--primary > :not(.wcboost-wishlist-button) {
		opacity: 0;
		visibility: hidden;
	}
	body ul.products li.product:is(.wbplp-wished, :has(.wcboost-wishlist-button.added)):not(:hover) .product-featured-icons--primary .wcboost-wishlist-button {
		background: transparent !important;
		box-shadow: none !important;
	}
}

/* Phones and tablets (the theme's card breakpoint, 1,024 px): no cart button (above), and the heart is an outline
   on the photo with no button behind it (Salty Crush), solid red when wishlisted (owner, 2026-11-19). */
@media (max-width: 1024px) {
	body ul.products li.product .gz-button-add-to-cart-mobile {
		display: none !important;
	}
	body ul.products li.product .product-thumbnail .product-featured-icons--primary .wcboost-wishlist-button,
	body ul.products li.product .product-thumbnail .product-featured-icons--primary .wcboost-wishlist-button:hover {
		--gz-button-bg-color: transparent;
		--gz-button-bg-color-hover: transparent;
		--gz-button-border-color: transparent;
		--gz-button-border-color-hover: transparent;
		--gz-button-color: var(--gz-color-dark);
		--gz-button-color-hover: var(--gz-color-dark);
		background: transparent !important;
		border-color: transparent !important;
		box-shadow: none !important;
		color: var(--gz-color-dark) !important;
	}
	body ul.products li.product .product-thumbnail .product-featured-icons--primary .wcboost-wishlist-button .wcboost-wishlist-button__icon,
	body ul.products li.product .product-thumbnail .product-featured-icons--primary .wcboost-wishlist-button svg {
		width: 20px;
		height: 17px;
	}
}

/* List cards ("You may also like" beside the mini cart, the cart page's cross-sells;
   woocommerce/content-product-list.php): the size chips sit under the price, centred like the rest. */
body ul.products li.product .wb-list-chips {
	margin-top: 12px;
}
.glozin-mini-products-recommended ul.products li.product .wb-list-chips .product-variation-items {
	justify-content: center;
	flex-wrap: wrap;
}

/* ---------- Colour and size on the card (inc/card-options.php, owner 2026-11-24) ---------- */

/* The rows: the colour swatches (the theme's own swatch look), then the sizes, a little closer than the theme's 11 px. */
body .wb-card-options .wb-opt-row + .product-variation-items {
	margin-top: 8px;
}
body .wb-card-options .wb-opt {
	cursor: pointer;
}
/* The chosen colour: the theme's ring for a chosen swatch. */
body .wb-card-options .wb-opt.product-variation-item--color.is-chosen {
	--gz-border-color: var(--gz-color-dark);
}
/* Another kind of option (a length, say): a box like the sizes, filled when chosen. */
body .wb-card-options .wb-opt.product-variation-item--label {
	min-width: 0;
	padding: 0 10px;
	font-weight: 600;
	--gz-border-color: var(--wb-chip-line);
}
body .wb-card-options .wb-opt.product-variation-item--label.is-chosen {
	--gz-border-color: var(--gz-color-dark);
	background-color: var(--gz-color-dark);
	color: var(--gz-color-light);
}
body .wb-card-options .wb-opt:focus-visible {
	outline: 2px solid var(--gz-color-dark);
	outline-offset: 2px;
}
/* Nothing in stock with it: faded and struck through, and it can't be chosen. */
body .wb-card-options .wb-opt.is-sold-out,
body .wb-card-options .wb-opt.is-sold-out:hover {
	--gz-border-color: var(--wb-chip-off-line);
	cursor: default;
}
body .wb-card-options .wb-opt.product-variation-item--color.is-sold-out .product-variation-item__color {
	opacity: 0.45;
}
body .wb-card-options .wb-opt.product-variation-item--color.is-sold-out::after {
	content: "";
	position: absolute;
	top: 50%;
	left: 15%;
	width: 70%;
	height: 1px;
	background: var(--gz-color-dark);
	transform: rotate(-45deg);
	pointer-events: none;
}
body .wb-card-options .wb-opt.product-variation-item--label.is-sold-out {
	color: var(--wb-chip-off-text);
	font-weight: 400;
	text-decoration: line-through;
}
/* The chosen colour's name beside the swatches. */
body .wb-card-options .wb-opt-name {
	margin-inline-start: 4px;
	font-size: 13px;
	line-height: 1.2;
	color: #6b6b6b;
	white-space: nowrap;
	overflow: hidden;
	text-overflow: ellipsis;
	min-width: 0;
}
@media (max-width: 767px) {
	body .wb-card-options .wb-opt-row + .product-variation-items {
		margin-top: 6px;
	}
	body .wb-card-options .wb-opt-name {
		font-size: 12px;
	}
	body .wb-card-options .wb-opt.product-variation-item--label {
		height: 22px;
		padding: 0 6px;
		font-size: 12px;
	}
}
