/*
 * Shopcrier — storefront styles.
 * Colors are always inline (per announcement), so only layout/animation lives here.
 */
.shopcrier-bars { position: relative; width: 100%; font-weight: 700; }
/* Sticky positions (Settings > Sticky Top/Bottom Bar). The top bar clears the fixed admin bar. */
.shopcrier-bars--sticky { position: sticky; z-index: 99990; }
.shopcrier-bars--sticky.shopcrier-bars--top { top: 0; }
.admin-bar .shopcrier-bars--sticky.shopcrier-bars--top { top: var(--wp-admin--admin-bar--height, 32px); }
@media (max-width: 600px) { .admin-bar .shopcrier-bars--sticky.shopcrier-bars--top { top: 0; } }
.shopcrier-bars--sticky.shopcrier-bars--bottom { bottom: 0; }
/* Hidden until the pre-paint script / main script decides (dismissed items never flash). */
.shopcrier-bars [data-cloak] { display: none !important; }
.shopcrier-bars [hidden] { display: none !important; }

/* ---- Vertical bar ---- */
.shopcrier--vertical { position: relative; padding: 0.625rem 0; text-align: center; overflow: hidden; }
.shopcrier__inner { display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 0 1rem; margin: 0 auto; max-width: 1280px; box-sizing: border-box; }
.shopcrier__content { min-width: 0; flex: 1 1 auto; font-size: 0.875rem; line-height: 1.4; color: inherit; text-decoration: none; }
.shopcrier__content--vertical,
.shopcrier__content--slide { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.shopcrier__content--slide { text-align: center; }
.shopcrier__content--marquee { white-space: nowrap; flex: 0 0 auto; }
.shopcrier__content p { display: inline; margin: 0; }
.shopcrier__content a { color: inherit; text-decoration: underline; font-weight: 600; }
/* Stretched link: the whole bar is clickable while controls stay above it (z-index). */
a.shopcrier__content { position: static; }
.shopcrier__overlay { position: absolute; inset: 0; }
@media (min-width: 768px) {
	.shopcrier__content { font-size: 1rem; }
	.shopcrier__content--vertical { display: block; -webkit-line-clamp: unset; }
}

/* ---- Actions ---- */
.shopcrier__button { position: relative; z-index: 10; flex-shrink: 0; display: inline-block; padding: 0.375rem 0.875rem; border-radius: 4px; font-size: 0.8125rem; font-weight: 700; line-height: 1.3; text-decoration: none; white-space: nowrap; transition: opacity 0.15s; }
.shopcrier__button:hover, .shopcrier__button:focus-visible { opacity: 0.85; text-decoration: none; }
@media (min-width: 768px) { .shopcrier__button { font-size: 0.875rem; } }
/* With a button, message and button sit together in the middle instead of the button hugging the edge. */
.shopcrier__inner:has(.shopcrier__button) .shopcrier__content { flex: 0 1 auto; }
/* Small screens: when message, button and countdown do not fit on one line, the actions wrap below instead of squeezing the message. */
@media (max-width: 767.98px) {
	.shopcrier--vertical .shopcrier__inner { flex-wrap: wrap; row-gap: 0.375rem; }
	.shopcrier--vertical .shopcrier__inner .shopcrier__content { flex: 1 1 10rem; }
	/* The dismiss button stays at the right edge instead of wrapping onto a line of its own. */
	.shopcrier--vertical .shopcrier__inner:has(.shopcrier__dismiss) { position: relative; padding-right: 2.75rem; }
	.shopcrier--vertical .shopcrier__inner .shopcrier__dismiss { position: absolute; right: 0.75rem; top: 50%; margin: 0; transform: translateY(-50%); }
}
.shopcrier-countdown { display: flex; align-items: center; gap: 0.25rem; font-weight: 700; font-size: 0.875rem; flex-shrink: 0; position: relative; z-index: 10; }
@media (min-width: 768px) { .shopcrier-countdown { font-size: 1.125rem; } }
.shopcrier__dismiss { position: relative; z-index: 10; flex-shrink: 0; padding: 0.5rem; margin: -0.25rem; background: transparent; border: 0; color: inherit; cursor: pointer; opacity: 0.7; transition: opacity 0.15s; line-height: 0; }
.shopcrier__dismiss:hover, .shopcrier__dismiss:focus-visible { opacity: 1; }
.shopcrier__dismiss svg { width: 1.25rem; height: 1.25rem; }

/* ---- Slider ---- */
.shopcrier-slider { position: relative; overflow: hidden; }
.shopcrier-slider__track { display: flex; will-change: transform; }
.shopcrier-slider__track.is-animated { transition: transform 350ms ease-in-out; }
.shopcrier-slider__slide { position: relative; width: 100%; flex-shrink: 0; display: flex; align-items: center; justify-content: center; gap: 1rem; padding: 0.625rem 3rem; box-sizing: border-box; }
.shopcrier-slider__arrow { position: absolute; top: 50%; transform: translateY(-50%); z-index: 10; padding: 0.5rem; background: transparent; border: 0; cursor: pointer; opacity: 0.7; transition: opacity 0.15s; line-height: 0; color: inherit; }
.shopcrier-slider__arrow:hover, .shopcrier-slider__arrow:focus-visible { opacity: 1; }
.shopcrier-slider__arrow--prev { left: 0.5rem; }
.shopcrier-slider__arrow--next { right: 0.5rem; }
.shopcrier-slider__announcer { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }

/* ---- Marquee ---- */
.shopcrier-marquee-wrap { position: relative; overflow: hidden; }
.shopcrier-marquee { display: flex; width: max-content; animation: shopcrier-marquee var(--shopcrier-marquee-duration, 30s) linear infinite; }
.shopcrier-marquee > * { min-width: 0; }
.shopcrier-marquee__copy { display: flex; flex-shrink: 0; min-width: 100%; }
.shopcrier-marquee__item { position: relative; flex: 1 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 1rem; padding: 0.625rem 2rem; box-sizing: border-box; }
.shopcrier-marquee [data-announcement-id] { flex: 0 0 auto; }
.shopcrier-marquee__gap { flex-shrink: 0; width: 10rem; }
.shopcrier-marquee:hover, .shopcrier-marquee:focus-within { animation-play-state: paused; }
@keyframes shopcrier-marquee {
	0% { transform: translateX(0); }
	100% { transform: translateX(calc(-100% / var(--shopcrier-marquee-copies, 2))); }
}

/* ---- Countdown separator blink ---- */
@keyframes shopcrier-blink { 50% { opacity: 0; } }
.shopcrier-countdown__sep { animation: shopcrier-blink 2s linear infinite; }

/* ---- Reduced motion ---- */
@media (prefers-reduced-motion: reduce) {
	.shopcrier-countdown__sep { animation: none; }
	.shopcrier-marquee { animation: none; overflow-x: auto; }
	.shopcrier-slider__track.is-animated { transition: none; }
	[data-announcement-id] * { transition-duration: 0s !important; }
}

/* ---- Device visibility (pure CSS, cache-safe) ---- */
@media (max-width: 767.98px) { .shopcrier--desktop-only { display: none !important; } }
@media (min-width: 768px) { .shopcrier--mobile-only { display: none !important; } }

/* Never print announcement bars. */
@media print { .shopcrier-bars { display: none !important; } }
