/* Mobile sticky product bar.
 * Hidden by default; shown only on mobile (<=767px) when scrollY > 200.
 * Renders above all other fixed UI (z-index 9999 > vivaia-spt-container 9998).
 */

.vivaia-sticky-bar {
	display: none;
}

@media (max-width: 767px) {
	.vivaia-sticky-bar {
		position: fixed;
		left: 0;
		right: 0;
		bottom: 0;
		display: flex;
		align-items: center;
		gap: 10px;
		padding: 8px 12px calc(8px + env(safe-area-inset-bottom)) 12px;
		background: #fff;
		box-shadow: 0 -4px 10px -2px rgba(0, 0, 0, 0.08);
		z-index: 9999;
		transform: translateY(100%);
		transition: transform 0.5s ease-out;
		box-sizing: border-box;
	}

	.vivaia-sticky-bar[data-vsb-visible="1"] {
		transform: translateY(0);
	}

	.vsb-thumb {
		flex: 0 0 auto;
		display: block;
		width: 48px;
		height: 48px;
		border-radius: 4px;
		overflow: hidden;
		background: #f2f2f2;
	}

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

	.vsb-info {
		flex: 1 1 auto;
		min-width: 0;
		display: flex;
		flex-direction: column;
		gap: 4px;
	}

	.vsb-title {
		font-size: 13px;
		line-height: 1.2;
		color: #0d0d0d;
		display: -webkit-box;
		-webkit-line-clamp: 1;
		-webkit-box-orient: vertical;
		overflow: hidden;
		text-overflow: ellipsis;
	}

	.vsb-swatches {
		display: flex;
		align-items: center;
		gap: 6px;
		overflow-x: auto;
		scrollbar-width: none;
		-ms-overflow-style: none;
	}

	.vsb-swatches::-webkit-scrollbar {
		display: none;
	}

	.vsb-swatch {
		flex: 0 0 auto;
		display: block;
		width: 20px;
		height: 20px;
		border-radius: 50%;
		overflow: hidden;
		border: 1px solid rgba(0, 0, 0, 0.08);
		background: #f2f2f2;
	}

	.vsb-swatch img,
	.vsb-swatch-color {
		display: block;
		width: 100%;
		height: 100%;
		object-fit: cover;
	}

	.vivaia-sticky-bar .vsb-cta {
		flex: 0 0 auto;
		display: inline-flex;
		align-items: center;
		justify-content: center;
		padding: 10px 16px;
		background: #0d0d0d !important;
		color: #fff !important;
		font-size: 12px;
		font-weight: 600;
		letter-spacing: 0.5px;
		text-transform: uppercase;
		text-decoration: none;
		border-radius: 2px;
		white-space: nowrap;
	}

	.vivaia-sticky-bar .vsb-cta:hover,
	.vivaia-sticky-bar .vsb-cta:focus {
		color: #fff !important;
		background: #333 !important;
	}

	/* Nudge the vivaia-sticky-popup-trigger PNG up so it doesn't overlap the bar.
	 * Plugin CSS: .vivaia-spt-container { position:fixed; z-index:9998 }
	 *             .vivaia-spt-pos-bottom-(left|right) { bottom:20px }
	 * We only nudge once the bar is actually visible.
	 */
	body.vivaia-has-sticky-bar .vivaia-sticky-bar[data-vsb-visible="1"] ~ .vivaia-spt-container.vivaia-spt-pos-bottom-left,
	body.vivaia-has-sticky-bar .vivaia-sticky-bar[data-vsb-visible="1"] ~ .vivaia-spt-container.vivaia-spt-pos-bottom-right,
	body.vivaia-has-sticky-bar[data-vsb-visible="1"] .vivaia-spt-container.vivaia-spt-pos-bottom-left,
	body.vivaia-has-sticky-bar[data-vsb-visible="1"] .vivaia-spt-container.vivaia-spt-pos-bottom-right {
		bottom: calc(20px + 76px);
		transition: bottom 0.3s ease;
	}
}
