/* YB Social Proof — frontend */

.ybsp-sold {
	display: inline-block;
	margin: 6px 0 10px;
	padding: 4px 10px;
	font-size: 13px;
	font-weight: 600;
	color: #c45c26;
	background: #fff5ee;
	border-radius: 6px;
	line-height: 1.4;
}

.ybsp-sold-mobile-wrap {
	display: none;
}

/* Sold badge overlay on main product image (desktop + mobile) */
.product-images.images,
.woocommerce-product-gallery,
.summary-before .product-images {
	position: relative;
}

@media (min-width: 769px) {
	.ybsp-sold-mobile-wrap {
		display: block;
		position: absolute;
		right: 12px;
		bottom: 12px;
		z-index: 6;
		margin: 0;
		pointer-events: none;
	}

	.ybsp-sold-mobile-wrap .ybsp-sold {
		margin: 0;
		padding: 5px 12px;
		font-size: 13px;
		line-height: 1.3;
		background: rgba(255, 245, 238, 0.95);
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
		border-radius: 999px;
	}

	/* Hide duplicate sold badge in summary on desktop */
	.entry-summary > .ybsp-sold,
	.summary > .ybsp-sold {
		display: none !important;
	}
}

@media (max-width: 768px) {
	.ybsp-sold-mobile-wrap {
		display: block;
		position: absolute;
		right: 10px;
		bottom: 10px;
		z-index: 6;
		margin: 0;
		pointer-events: none;
	}

	.ybsp-sold-mobile-wrap .ybsp-sold {
		margin: 0;
		padding: 5px 10px;
		font-size: 12px;
		line-height: 1.3;
		background: rgba(255, 245, 238, 0.95);
		box-shadow: 0 2px 8px rgba(0, 0, 0, 0.14);
		border-radius: 999px;
	}

	/* Hide duplicate sold badge in summary on mobile */
	.entry-summary > .ybsp-sold,
	.summary > .ybsp-sold {
		display: none !important;
	}
}

/* Hot ranking */
.ybsp-rank {
	margin: 16px 0 24px;
}

.ybsp-rank__tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 14px;
}

.ybsp-rank__tab {
	appearance: none;
	border: 1px solid #e5e5e5;
	background: #fff;
	color: #333;
	padding: 6px 14px;
	border-radius: 20px;
	font-size: 13px;
	cursor: pointer;
	line-height: 1.4;
}

.ybsp-rank__tab.is-active {
	background: #222;
	border-color: #222;
	color: #fff;
}

.ybsp-rank__panel {
	display: none;
}

.ybsp-rank__panel.is-active {
	display: block;
}

.ybsp-rank__track {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 12px;
}

.ybsp-rank__card {
	position: relative;
	display: flex;
	flex-direction: column;
	text-decoration: none;
	color: inherit;
	background: #fff;
	border-radius: 10px;
	overflow: hidden;
	border: 1px solid #eee;
	transition: box-shadow 0.2s ease;
}

.ybsp-rank__card:hover {
	box-shadow: 0 4px 14px rgba(0, 0, 0, 0.08);
}

.ybsp-rank__badge {
	position: absolute;
	top: 8px;
	left: 8px;
	z-index: 2;
	width: 24px;
	height: 24px;
	border-radius: 50%;
	background: #888;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	display: flex;
	align-items: center;
	justify-content: center;
}

.ybsp-rank__badge--gold {
	background: #d4a017;
}

.ybsp-rank__badge--silver {
	background: #9aa0a6;
}

.ybsp-rank__badge--bronze {
	background: #b87333;
}

.ybsp-rank__thumb {
	display: block;
	aspect-ratio: 1;
	overflow: hidden;
	background: #f6f6f6;
}

.ybsp-rank__thumb img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
}

.ybsp-rank__name {
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	font-size: 13px;
	line-height: 1.35;
	margin: 8px 8px 4px;
	min-height: 2.7em;
}

.ybsp-rank__price {
	font-size: 13px;
	font-weight: 600;
	margin: 0 8px 4px;
	color: #c45c26;
}

.ybsp-rank__sold {
	font-size: 12px;
	color: #888;
	margin: 0 8px 10px;
}

.ybsp-rank__empty {
	padding: 20px;
	color: #888;
	text-align: center;
}

@media (max-width: 768px) {
	.ybsp-rank__track {
		display: flex;
		overflow-x: auto;
		scroll-snap-type: x mandatory;
		gap: 10px;
		padding-bottom: 6px;
		-webkit-overflow-scrolling: touch;
	}

	.ybsp-rank__card {
		flex: 0 0 150px;
		width: 150px;
		scroll-snap-align: start;
	}
}

/* Purchase popup toast */
.ybsp-toast-wrap {
	position: fixed;
	left: 16px;
	bottom: 20px;
	z-index: 9999;
	pointer-events: none;
}

.ybsp-toast {
	pointer-events: auto;
	display: flex;
	align-items: center;
	gap: 10px;
	max-width: 320px;
	padding: 10px 12px;
	background: #fff;
	border-radius: 12px;
	box-shadow: 0 8px 28px rgba(0, 0, 0, 0.15);
	cursor: pointer;
	transform: translateY(20px);
	opacity: 0;
	transition: transform 0.35s ease, opacity 0.35s ease;
}

.ybsp-toast.is-in {
	transform: translateY(0);
	opacity: 1;
}

.ybsp-toast.is-out {
	transform: translateY(20px);
	opacity: 0;
}

.ybsp-toast__img {
	width: 48px;
	height: 48px;
	border-radius: 8px;
	object-fit: cover;
	flex-shrink: 0;
	background: #f0f0f0;
}

.ybsp-toast__text {
	font-size: 13px;
	line-height: 1.4;
	color: #333;
	flex: 1;
}

.ybsp-toast__close {
	appearance: none;
	border: 0;
	background: transparent;
	color: #999;
	font-size: 18px;
	line-height: 1;
	cursor: pointer;
	padding: 2px 4px;
	flex-shrink: 0;
}

.ybsp-toast__close:hover {
	color: #333;
}

@media (max-width: 768px) {
	.ybsp-toast-wrap {
		bottom: 95px;
		left: 8px;
		right: auto;
	}

	.ybsp-toast {
		max-width: 280px;
	}
}
