/**
 * Rows that scroll sideways: the arrows, and the scroll mode of an
 * Elementor Loop Grid (the product cards) given the "wcg-scroll" class.
 * Set up by scroll-cues.js; the category tiles use the same cues.
 */

/* ------------------------------------------------------ loop grid (cards) */

/*
 * Elementor's own Columns, gap and breakpoints still decide how many cards
 * show at once (--grid-columns, --grid-column-gap); the rest are a swipe away.
 *
 * This is the wcg-scroll class typed into CSS Classes. The DKM scrolling
 * section's "Scroll sideways" prints the same rules per device into
 * Elementor's own CSS (includes/layout/scroll-settings.php) and marks the grid
 * wcg-sw-*; the rules for the cards below cover both.
 */
.wcg-scroll .elementor-loop-container.elementor-grid {
	grid-auto-flow: column;
	grid-template-columns: none;
	/* "Rows" in the Loop Grid's DKM scrolling section, per device. */
	grid-template-rows: repeat(var(--wcg-scroll-rows, 1), auto);
	grid-auto-columns: calc((100% - ((var(--grid-columns, 4) - 1) * var(--grid-column-gap, 0px))) / var(--grid-columns, 4));
	overflow-x: auto;
	margin-block: -4px; /* Room for a focus ring, given back. */
	padding-block: 4px;
	scroll-snap-type: x proximity;
	scrollbar-width: none; /* No scrollbar on any device: the arrows above. */
	-webkit-overflow-scrolling: touch;
}

.wcg-scroll .elementor-loop-container.elementor-grid::-webkit-scrollbar,
[class*="wcg-sw-"] .elementor-loop-container.elementor-grid::-webkit-scrollbar {
	display: none;
}

.wcg-scroll .elementor-loop-container > .e-loop-item,
[class*="wcg-sw-"] .elementor-loop-container > .e-loop-item {
	min-width: 0;
	scroll-snap-align: start;
}

/*
 * A scrolling row must not make its parent as wide as all its cards: in a
 * flex column (Elementor's containers) that widened the page, so the row never
 * overflowed itself, the last cards were off the screen and no arrow showed.
 */
.wcg-scroll .elementor-loop-container.elementor-grid {
	contain: inline-size;
}

/* ----------------------------------------------------------------- arrows */

/*
 * A pair of round arrows beside "Sirvi" (or in a bar above a row with no
 * header), there whenever the row has more than it shows, on a phone too;
 * the one at an end is dimmed. No fade: it got lost against the page.
 *
 * The theme styles every <button> (Hello's reset: a pink border, padding and
 * "transition: all .3s"; the Elementor kit: a blue fill, and another on
 * :hover/:focus). Every arrow rule is doubled up (.a.a[data]) to outrank
 * those, sets everything they set and names its own transition, or the
 * arrows would look like theme buttons and animate into ours.
 */
.wcg-scroll__nav {
	display: inline-flex;
	flex: none;
	gap: 8px;
	margin: calc((var(--control-sm) - 24px) / -2) 0; /* Never taller than a 24px line: the header does not grow. */
}

.wcg-scroll__nav[hidden],
.wcg-scroll__bar[hidden] {
	display: none;
}

.wcg-scroll__bar {
	display: flex;
	justify-content: flex-end;
	margin: 0 0 12px;
}

.wcg-scroll__bar > .wcg-scroll__nav {
	margin: 0;
}

.wcg-scroll__arrow.wcg-scroll__arrow[data-wcg-scroll-arrow] {
	display: inline-flex;
	position: static;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--control-sm);
	height: var(--control-sm);
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	transform: none;
	border: var(--border-hairline) solid var(--border-default);
	border-radius: 999px;
	background: var(--bg-surface);
	box-shadow: none;
	color: var(--text-primary);
	font-size: 0;
	line-height: 0;
	text-transform: none;
	cursor: pointer;
	opacity: 1;
	transition: var(--motion-control);
}

.wcg-scroll__arrow.wcg-scroll__arrow[data-wcg-scroll-arrow]:hover,
.wcg-scroll__arrow.wcg-scroll__arrow[data-wcg-scroll-arrow]:focus {
	border-color: var(--border-default);
	background: var(--bg-subtle);
	color: var(--text-primary);
}

/* At an end: still there (the pair never jumps about), plainly not usable. */
.wcg-scroll__arrow.wcg-scroll__arrow[data-wcg-scroll-arrow][aria-disabled="true"] {
	background: var(--bg-surface);
	opacity: 0.35;
	cursor: default;
}

.wcg-scroll__arrow.wcg-scroll__arrow[data-wcg-scroll-arrow]:focus:not(:focus-visible) {
	outline: none;
}

.wcg-scroll__arrow.wcg-scroll__arrow[data-wcg-scroll-arrow]:focus-visible {
	outline: 2px solid var(--border-focus);
	outline-offset: 2px;
}

.wcg-scroll__arrow.wcg-scroll__arrow[data-wcg-scroll-arrow] svg {
	display: block;
	flex: none;
	width: 18px;
	height: 18px;
}

/* ------------------------------------------- wcg-scroll--head: in a header */

/* In a section's own header (the element before the grid): after its link. */
.wcg-scroll__nav.wcg-scroll__nav--head {
	margin-inline-start: 8px;
}

/* ----------- on the row's sides (wcg-scroll-is-side, set by the script) */

/*
 * The arrows sit over the row's left and right edges, each in a rail as tall
 * as the row, fixed in its middle. They do not move with the page: sticky
 * arrows (1.53-1.57) jumped about as the page scrolled.
 */
.wcg-scroll-is-side {
	position: relative;
}

.wcg-scroll__nav.wcg-scroll__nav--side {
	position: absolute;
	inset: 0 -12px;
	z-index: 2;
	display: flex;
	justify-content: space-between;
	margin: 0;
	pointer-events: none;
}

.wcg-scroll__nav.wcg-scroll__nav--side[hidden] {
	display: none;
}

.wcg-scroll__nav--side > .wcg-scroll__rail {
	display: flex;
	flex-direction: column;
	justify-content: center;
}

.wcg-scroll__nav--side .wcg-scroll__arrow.wcg-scroll__arrow[data-wcg-scroll-arrow] {
	width: var(--control-md);
	height: var(--control-md);
	pointer-events: auto;
}

/* Over the cards a dimmed arrow is only noise: gone at an end. */
.wcg-scroll__nav--side .wcg-scroll__arrow.wcg-scroll__arrow[data-wcg-scroll-arrow][aria-disabled="true"] {
	visibility: hidden;
}

/*
 * With a mouse the side arrows cover the cards only while the pointer is on
 * the row (or a key has moved focus into it). A phone has no hover: there
 * they stay, the only sign the row goes on. The header and bar arrows are
 * always there (1.48.32 took the hover-only ones away for that reason).
 */
@media (hover: hover) and (pointer: fine) {
	.wcg-scroll-is-side .wcg-scroll__nav--side .wcg-scroll__arrow.wcg-scroll__arrow[data-wcg-scroll-arrow] {
		opacity: 0;
	}

	/* "Side arrows: Always show" (wcg-side-always) in the Loop Grid's DKM scrolling. */
	.wcg-side-always.wcg-scroll-is-side .wcg-scroll__nav--side .wcg-scroll__arrow.wcg-scroll__arrow[data-wcg-scroll-arrow],
	.wcg-scroll-is-side:hover .wcg-scroll__nav--side .wcg-scroll__arrow.wcg-scroll__arrow[data-wcg-scroll-arrow],
	.wcg-scroll-is-side:focus-within .wcg-scroll__nav--side .wcg-scroll__arrow.wcg-scroll__arrow[data-wcg-scroll-arrow] {
		opacity: 1;
	}
}

@media (prefers-reduced-motion: reduce) {
	.wcg-scroll__arrow.wcg-scroll__arrow[data-wcg-scroll-arrow] {
		transition: none;
	}
}

/* ------------------------------------------- dots and autoplay's pause */

/*
 * "Dots" and "Autoplay" in the Loop Grid's DKM scrolling: a dot per arrow
 * step under the row, the current one long, and the pause button before them
 * while autoplay runs. Each button is a 24px target with the dot drawn inside,
 * 32px under a finger (--wcg-scroll-dot); a long row of them wraps.
 * Doubled up (.a.a[data]) against the theme's button styles, like the arrows.
 */
.wcg-scroll__dots {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	justify-content: center;
	gap: 2px;
	margin: 12px 0 0;
}

.wcg-scroll-has-dots {
	--wcg-scroll-dot: 24px;
}

@media (pointer: coarse) {
	.wcg-scroll-has-dots {
		--wcg-scroll-dot: 32px;
	}
}

.wcg-scroll__dots[hidden] {
	display: none;
}

.wcg-scroll__dot.wcg-scroll__dot[data-wcg-scroll-dot],
.wcg-scroll__play.wcg-scroll__play[data-wcg-scroll-play] {
	display: inline-flex;
	position: static;
	align-items: center;
	justify-content: center;
	box-sizing: border-box;
	width: var(--wcg-scroll-dot, 24px);
	height: var(--wcg-scroll-dot, 24px);
	min-width: 0;
	min-height: 0;
	margin: 0;
	padding: 0;
	transform: none;
	border: 0;
	border-radius: 999px;
	background: transparent;
	box-shadow: none;
	color: var(--text-secondary);
	font-size: 0;
	line-height: 0;
	cursor: pointer;
	transition: var(--motion-control);
}

.wcg-scroll__dot.wcg-scroll__dot[data-wcg-scroll-dot]:hover,
.wcg-scroll__dot.wcg-scroll__dot[data-wcg-scroll-dot]:focus,
.wcg-scroll__play.wcg-scroll__play[data-wcg-scroll-play]:hover,
.wcg-scroll__play.wcg-scroll__play[data-wcg-scroll-play]:focus {
	border: 0;
	background: transparent;
	color: var(--text-primary);
}

.wcg-scroll__dot.wcg-scroll__dot[data-wcg-scroll-dot]::before {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	border-radius: 999px;
	background: var(--border-default);
	transition: width var(--motion-hover) var(--motion-ease), background var(--motion-hover) var(--motion-ease);
}

.wcg-scroll__dot.wcg-scroll__dot[data-wcg-scroll-dot]:hover::before {
	background: var(--text-secondary);
}

.wcg-scroll__dot.wcg-scroll__dot[data-wcg-scroll-dot][aria-current="true"] {
	width: calc(var(--wcg-scroll-dot, 24px) + 8px);
}

.wcg-scroll__dot.wcg-scroll__dot[data-wcg-scroll-dot][aria-current="true"]::before {
	width: 20px;
	background: var(--text-primary);
}

.wcg-scroll__play.wcg-scroll__play[data-wcg-scroll-play] {
	margin-inline-end: 4px;
}

.wcg-scroll__play.wcg-scroll__play[data-wcg-scroll-play] svg {
	display: block;
	width: 14px;
	height: 14px;
}

.wcg-scroll__dot.wcg-scroll__dot[data-wcg-scroll-dot]:focus:not(:focus-visible),
.wcg-scroll__play.wcg-scroll__play[data-wcg-scroll-play]:focus:not(:focus-visible) {
	outline: none;
}

.wcg-scroll__dot.wcg-scroll__dot[data-wcg-scroll-dot]:focus-visible,
.wcg-scroll__play.wcg-scroll__play[data-wcg-scroll-play]:focus-visible {
	outline: 2px solid var(--border-focus);
	outline-offset: 0;
}

/* Side arrows centred on the row, not on the row and its dots (their height + 12px). */
.wcg-scroll-has-dots .wcg-scroll__nav.wcg-scroll__nav--side {
	bottom: calc(var(--wcg-scroll-dot, 24px) + 12px);
}

@media (prefers-reduced-motion: reduce) {
	.wcg-scroll__dot.wcg-scroll__dot[data-wcg-scroll-dot],
	.wcg-scroll__dot.wcg-scroll__dot[data-wcg-scroll-dot]::before,
	.wcg-scroll__play.wcg-scroll__play[data-wcg-scroll-play] {
		transition: none;
	}
}
