.product-theme-boxes {
	padding: 32px 0;
}

.product-theme-boxes__grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 22px;
}

.product-theme-boxes__item {
	position: relative;
	overflow: visible;
	min-height: 0;
	background: #f7f7f8;
	border-radius: 8px;
	aspect-ratio: 1 / 1;
}

.product-theme-boxes__item:hover,
.product-theme-boxes__item:focus-within {
	z-index: 10;
}

.product-theme-boxes__item--large {
	grid-row: span 2;
	grid-column: span 2;
}

.product-theme-boxes__item--large:first-child {
	height: calc(100% + 1px);
}

.product-theme-boxes__item--wide {
	grid-column: span 2;
	aspect-ratio: 2 / 1;
}

.product-theme-boxes__image {
	display: block;
	width: 100%;
	height: 100%;
	object-fit: cover;
	border-radius: inherit;
}

.product-theme-boxes__label {
	position: absolute;
	left: 16px;
	bottom: 16px;
	z-index: 1;
	max-width: calc(100% - 32px);
	padding: 8px 12px;
	color: #111;
	font-size: 0.82rem;
	font-weight: 700;
	line-height: 1.2;
	background: rgba(255, 255, 255, 0.82);
	border: 1px solid rgba(236, 236, 239, 0.9);
	border-radius: 9999px;
	backdrop-filter: blur(8px);
}

.product-theme-boxes__hotspot {
	position: absolute;
	top: var(--hotspot-y);
	left: var(--hotspot-x);
	z-index: 3;
	transform: translate(-50%, -50%);
}

.product-theme-boxes__target {
	position: relative;
	z-index: 1;
	display: block;
	width: 26px;
	height: 26px;
	padding: 0;
	background: rgba(255, 255, 255, 0.58);
	border: 1px solid rgba(255, 255, 255, 0.85);
	border-radius: 9999px;
	box-shadow: 0 4px 14px rgba(17, 17, 17, 0.2);
	backdrop-filter: blur(8px);
}

.product-theme-boxes__target::before,
.product-theme-boxes__target::after {
	position: absolute;
	top: 50%;
	left: 50%;
	content: "";
	border-radius: 9999px;
	transform: translate(-50%, -50%);
}

.product-theme-boxes__target::before {
	width: 9px;
	height: 9px;
	background: #fff;
	box-shadow: 0 0 0 1px rgba(17, 17, 17, 0.12);
}

.product-theme-boxes__target::after {
	width: 34px;
	height: 34px;
	border: 1px solid rgba(255, 255, 255, 0.72);
}

.product-theme-boxes__popover {
	position: absolute;
	bottom: calc(100% + 6px);
	left: 50%;
	z-index: 4;
	display: none;
	grid-template-columns: minmax(0, 1fr) 42px;
	width: 232px;
	min-height: 66px;
	overflow: hidden;
	pointer-events: none;
	visibility: hidden;
	background: #fff;
	border-radius: 4px;
	box-shadow: 0 12px 30px rgba(17, 17, 17, 0.18);
	opacity: 0;
	transform: translate(-50%, 8px);
	transition: opacity 0.16s ease 0.12s, transform 0.16s ease 0.12s, visibility 0s linear 0.28s;
}

.product-theme-boxes__hotspot--left .product-theme-boxes__popover {
	right: auto;
	left: 50%;
	transform: translate(-50%, 8px);
}

.product-theme-boxes__hotspot:hover .product-theme-boxes__popover,
.product-theme-boxes__hotspot:focus-within .product-theme-boxes__popover {
	display: grid;
	pointer-events: auto;
	visibility: visible;
	opacity: 1;
	transform: translate(-50%, 0);
	transition-delay: 0s;
}

.product-theme-boxes__product-link {
	display: grid;
	grid-template-columns: 44px minmax(0, 1fr);
	gap: 10px;
	align-items: center;
	min-width: 0;
	padding: 10px;
	color: #111;
	background: #fff;
}

.product-theme-boxes__product-thumb {
	width: 40px;
	height: 40px;
	object-fit: contain;
	background: #f7f7f8;
	border-radius: 3px;
}

.product-theme-boxes__product-info {
	display: grid;
	gap: 4px;
	min-width: 0;
}

.product-theme-boxes__product-title {
	display: -webkit-box;
	overflow: hidden;
	font-size: 0.72rem;
	font-weight: 700;
	line-height: 1.25;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
}

.product-theme-boxes__product-price {
	color: #111;
	font-size: 0.72rem;
	font-weight: 800;
	line-height: 1;
}

.product-theme-boxes__product-price del {
	display: none;
}

.product-theme-boxes__product-price ins {
	text-decoration: none;
}

.product-theme-boxes__cart-button {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 42px;
	color: #fff;
	font-size: 0;
	background: var(--wp--preset--color--primary, #614d76);
}

.product-theme-boxes__cart-button.is-loading,
.product-theme-boxes__cart-button.has-error {
	pointer-events: none;
}

.product-theme-boxes__cart-button.is-loading::after {
	position: absolute;
	inset: 11px;
	content: "";
	border: 2px solid rgba(255, 255, 255, 0.45);
	border-top-color: #fff;
	border-radius: 9999px;
	animation: product-theme-boxes-spin 0.8s linear infinite;
}

.product-theme-boxes__cart-button.is-loading::before {
	opacity: 0;
}

.product-theme-boxes__cart-button.has-error {
	background: #9f1239;
}

.product-theme-boxes__cart-button::before {
	content: "";
	width: 18px;
	height: 18px;
	background: currentColor;
	mask: url("data:image/svg+xml,%3Csvg viewBox='0 0 24 24' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M7 18a2 2 0 1 0 0 4 2 2 0 0 0 0-4Zm10 0a2 2 0 1 0 0 4 2 2 0 0 0 0-4ZM6.2 6l.4 2h11.9a1 1 0 0 1 .96 1.28l-1.4 4.8A2 2 0 0 1 16.14 15H8.1a2 2 0 0 1-1.96-1.6L4.5 4H2a1 1 0 1 1 0-2h3.32a1 1 0 0 1 .98.8L6.2 6Z'/%3E%3C/svg%3E") center / contain no-repeat;
}

@keyframes product-theme-boxes-spin {
	to {
		transform: rotate(360deg);
	}
}

.product-theme-boxes__target:focus-visible,
.product-theme-boxes__product-link:focus-visible,
.product-theme-boxes__cart-button:focus-visible {
	outline: 3px solid rgba(97, 77, 118, 0.24);
	outline-offset: 3px;
}

@media (max-width: 900px) {
	.product-theme-boxes__grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 16px;
	}

	.product-theme-boxes__item--large,
	.product-theme-boxes__item--wide {
		grid-column: span 2;
	}
}

@media (max-width: 520px) {
	.product-theme-boxes {
		padding: 24px 0;
	}

	.product-theme-boxes__grid {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.product-theme-boxes__item,
	.product-theme-boxes__item--large,
	.product-theme-boxes__item--wide {
		grid-column: auto;
		grid-row: auto;
		aspect-ratio: 1 / 1;
	}

	.product-theme-boxes__popover {
		width: 216px;
	}
}

@media (prefers-reduced-motion: reduce) {
	.product-theme-boxes__image,
	.product-theme-boxes__popover {
		transition: none;
	}

	.product-theme-boxes__cart-button.is-loading::after {
		animation: none;
	}
}
