/* ==========================================================================
   GoGlow Product Badges — sticker-style seals
   New arrival / low stock / best seller / free shipping
   ========================================================================== */

.goglow-pbadges {
	display: flex;
	align-items: center;
	gap: 4px;
	pointer-events: none;
	/* The shadow sits on the row because clip-path would cut it off the seal itself. */
	filter: drop-shadow(0 3px 5px rgba(0, 0, 0, 0.28));
}

/* ---- The seal ---- */

.goglow-pbadge {
	position: relative;
	display: flex;
	flex: 0 0 auto;
	width: 64px;
	height: 64px;
	align-items: center;
	justify-content: center;
	padding: 8px;
	overflow: hidden;
	clip-path: polygon(50.00% 0.00%, 57.12% 5.06%, 65.45% 2.45%, 70.66% 9.46%, 79.39% 9.55%, 82.17% 17.83%, 90.45% 20.61%, 90.54% 29.34%, 97.55% 34.55%, 94.94% 42.88%, 100.00% 50.00%, 94.94% 57.12%, 97.55% 65.45%, 90.54% 70.66%, 90.45% 79.39%, 82.17% 82.17%, 79.39% 90.45%, 70.66% 90.54%, 65.45% 97.55%, 57.12% 94.94%, 50.00% 100.00%, 42.88% 94.94%, 34.55% 97.55%, 29.34% 90.54%, 20.61% 90.45%, 17.83% 82.17%, 9.55% 79.39%, 9.46% 70.66%, 2.45% 65.45%, 5.06% 57.12%, 0.00% 50.00%, 5.06% 42.88%, 2.45% 34.55%, 9.46% 29.34%, 9.55% 20.61%, 17.83% 17.83%, 20.61% 9.55%, 29.34% 9.46%, 34.55% 2.45%, 42.88% 5.06%);
	color: #ffffff;
	font-size: 0.6rem;
	font-weight: 800;
	letter-spacing: 0.02em;
	line-height: 1.1;
	text-align: center;
	text-transform: uppercase;
	word-break: break-word;
	transform: rotate(-8deg);
}

.goglow-pbadge:nth-child(even) {
	transform: rotate(7deg);
}

/* Thin stitched ring inside the edge, like a printed sticker. */
.goglow-pbadge::before {
	content: "";
	position: absolute;
	inset: 4px;
	border: 1.5px dashed rgba(255, 255, 255, 0.55);
	border-radius: 50%;
}

.goglow-pbadge {
	flex-direction: column;
	gap: 2px;
	padding: 6px 7px;
}

.goglow-pbadge-icon {
	flex: 0 0 auto;
	width: 18px;
	height: 18px;
}

.goglow-pbadge--sale .goglow-pbadge-text {
	direction: ltr;
	unicode-bidi: isolate;
	font-size: 1.15em;
}

.goglow-pbadge-text {
	position: relative;
	display: block;
	max-width: 100%;
}

/* Colour follows the meaning of each badge. */
.goglow-pbadge--v-just_arrived { background: linear-gradient(145deg, #2fc26b, #138a47); }
.goglow-pbadge--v-fresh_stock  { background: linear-gradient(145deg, #3fcf9a, #0f8f6a); }
.goglow-pbadge--v-hot_item     { background: linear-gradient(145deg, #ff8a2a, #e0301e); }
.goglow-pbadge--v-stock_count  { background: linear-gradient(145deg, #f2503f, #c21f13); }
.goglow-pbadge--v-stock_text   { background: linear-gradient(145deg, #ffb020, #e56a10); }
.goglow-pbadge--v-top_seller   { background: linear-gradient(145deg, #f7c531, #d98a0c); }
.goglow-pbadge--v-trending     { background: linear-gradient(145deg, #a855f7, #6d28d9); }
.goglow-pbadge--v-favorite     { background: linear-gradient(145deg, #f472b6, #db2777); }
.goglow-pbadge--v-free_shipping { background: linear-gradient(145deg, #3aa0ee, #1565c0); }
.goglow-pbadge--v-free_delivery { background: linear-gradient(145deg, #22c3d6, #0a86a8); }
.goglow-pbadge--v-pre_order     { background: linear-gradient(145deg, #6366f1, #4338ca); }
.goglow-pbadge--v-pre_sale      { background: linear-gradient(145deg, #8b5cf6, #5b21b6); }
.goglow-pbadge--v-ships_soon    { background: linear-gradient(145deg, #14b8a6, #0f766e); }
.goglow-pbadge--v-sale         { background: linear-gradient(145deg, #ff4d6d, #c9184a); }
.goglow-pbadge--v-out_of_stock  { background: linear-gradient(145deg, #7a8290, #3d434f); }

/* ---- Product cards: top-right of the image ---- */

.goglow-pbadges--card {
	position: absolute;
	z-index: 4;
	top: 8px;
	right: 8px;
	flex-direction: column;
}

.goglow-pbadges--card .goglow-pbadge {
	width: 38px;
	height: 38px;
	gap: 1px;
	padding: 3px;
	font-size: 0.4rem;
	line-height: 1.05;
}

.goglow-pbadges--card .goglow-pbadge::before {
	inset: 3px;
	border-width: 1px;
}

.goglow-pbadges--card .goglow-pbadge-icon {
	width: 11px;
	height: 11px;
}

/* On RTL pages the sale % / "Out of Stock" badge already sits in that corner,
   so the seals start just below it. */
[dir="rtl"] .goglow-product-card:has(.onsale, .goglow-out-of-stock-badge) > .goglow-pbadges--card {
	top: 44px;
}

/* List view: the badges sit at the top corner of the CARD (the empty area beside the image), in a row.
   Logical offset: top left on RTL pages, top right on LTR pages — always on the text side, away from the image. */
.woocommerce ul.products.goglow-list-view .goglow-pbadges--card,
.woocommerce-page ul.products.goglow-list-view .goglow-pbadges--card {
	top: 16px;
	right: auto;
	left: auto;
	inset-inline-end: 16px;
	inset-inline-start: auto;
	flex-direction: row;
}

/* Below 520px list cards stack (image on top), so the badges go back onto the image, top right. */
@media (max-width: 520px) {
	.woocommerce ul.products.goglow-list-view .goglow-pbadges--card,
	.woocommerce-page ul.products.goglow-list-view .goglow-pbadges--card {
		top: 8px;
		right: 8px;
		left: auto;
		inset-inline-end: auto;
		flex-direction: column;
	}
}

/* ---- Product page: on the product image, top right (where the logo watermark used to sit) ---- */

.goglow-pbadges--page {
	position: absolute;
	z-index: 22;
	top: 44px;
	right: 16px;
	max-width: calc(100% - 32px);
	flex-wrap: wrap;
	justify-content: flex-end;
}

.goglow-pbadges--page .goglow-pbadge {
	width: 62px;
	height: 62px;
	font-size: 0.56rem;
}

@media (max-width: 520px) {
	.goglow-pbadges--page {
		top: 36px;
		right: 10px;
	}

	.goglow-pbadges--page .goglow-pbadge {
		width: 50px;
		height: 50px;
		font-size: 0.5rem;
	}
}

/* The theme's own sale pill is replaced by the add-on's sticker, so the row can start higher. */
.goglow-pbadges--page.goglow-pbadges--no-pill {
	top: 14px;
}

@media (max-width: 520px) {
	.goglow-pbadges--page.goglow-pbadges--no-pill {
		top: 10px;
	}
}
