.apg-slider,
.apg-slider * {
	box-sizing: border-box;
}

.apg-slider {
	--apg-slider-ratio: 4 / 3;
	--apg-slider-radius: 12px;
	--apg-slider-surface: #f6f4ef;
	--apg-slider-arrow-color: #24221e;
	--apg-slider-arrow-bg: rgba(255, 255, 255, 0.92);
	--apg-slider-arrow-bg-hover: #ffffff;
	--apg-slider-arrow-size: 44px;
	--apg-slider-dot-color: rgba(255, 255, 255, 0.55);
	--apg-slider-dot-active: #ffffff;
	--apg-slider-dot-size: 7px;
	--apg-slider-dot-shadow: rgba(0, 0, 0, 0.35);
	--apg-slider-focus: #7b6a49;
	position: relative;
	width: 100%;
	max-width: 100%;
}

.apg-slider__viewport {
	position: relative;
	overflow: hidden;
	aspect-ratio: var(--apg-slider-ratio);
	border-radius: var(--apg-slider-radius);
	background: var(--apg-slider-surface);
}

.apg-slider__track {
	display: flex;
	height: 100%;
	touch-action: pan-y;
	will-change: transform;
	transition: transform 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

.apg-slider[data-apg-dragging="1"] .apg-slider__track {
	transition: none;
}

.apg-slider__slide {
	flex: 0 0 100%;
	min-width: 0;
	height: 100%;
}

/* !important: guards against theme-wide "img { height: auto; max-width: 100% }"
   resets that would otherwise break the cover-crop inside a fixed-ratio frame. */
.apg-slider__img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: none !important;
	border: 0 !important;
	object-fit: cover !important;
	object-position: center !important;
	background: var(--apg-slider-surface);
	pointer-events: none;
	-webkit-user-drag: none;
}

/* !important: the site theme commonly styles bare <button> elements
   (background, font, border) — these must not leak into the widget. */
.apg-slider__arrow {
	position: absolute;
	top: 50%;
	z-index: 2;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	width: var(--apg-slider-arrow-size);
	height: var(--apg-slider-arrow-size);
	min-width: 0 !important;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	border-radius: 50%;
	background: var(--apg-slider-arrow-bg) !important;
	color: var(--apg-slider-arrow-color) !important;
	font: inherit;
	line-height: 1;
	text-transform: none;
	letter-spacing: normal;
	box-shadow: none;
	appearance: none;
	-webkit-appearance: none;
	cursor: pointer;
	touch-action: manipulation;
	transform: translateY(-50%);
	transition: background 160ms ease;
}

.apg-slider__arrow:hover {
	background: var(--apg-slider-arrow-bg-hover);
}

.apg-slider__arrow:focus-visible {
	outline: 2px solid var(--apg-slider-focus);
	outline-offset: 2px;
}

.apg-slider__arrow svg,
.apg-slider__arrow i {
	width: 40%;
	height: 40%;
	font-size: 16px;
	color: inherit;
}

.apg-slider__arrow--prev {
	left: 12px;
}

.apg-slider__arrow--next {
	right: 12px;
}

/* A single icon control drives both arrows; mirror it for "previous". */
.apg-slider__arrow--prev svg,
.apg-slider__arrow--prev i {
	transform: scaleX(-1);
}

.apg-slider__dots {
	position: absolute;
	left: 50%;
	bottom: 4px;
	z-index: 2;
	display: flex;
	align-items: center;
	gap: 2px;
	transform: translateX(-50%);
}

/* Visible dot stays small (reference look); the button's own box is the
   tap target, sized closer to a comfortable touch area than the dot itself.
   !important: strips any theme-wide <button> background/border/font so the
   dot row never shows a solid bar behind it. */
.apg-slider__dot {
	position: relative;
	display: inline-flex !important;
	width: 32px;
	height: 32px;
	min-width: 0 !important;
	margin: 0;
	padding: 0 !important;
	border: 0 !important;
	background: none !important;
	box-shadow: none !important;
	font: inherit;
	cursor: pointer;
	touch-action: manipulation;
}

/* JS toggles the `hidden` attribute to slide the dot window; the higher
   specificity here keeps it winning over the `display` rule above. */
.apg-slider__dot[hidden] {
	display: none !important;
}

.apg-slider__dot::before {
	content: '';
	position: absolute;
	top: 50%;
	left: 50%;
	width: var(--apg-slider-dot-size);
	height: var(--apg-slider-dot-size);
	border-radius: 50%;
	background: var(--apg-slider-dot-color);
	box-shadow: 0 1px 3px var(--apg-slider-dot-shadow);
	transform: translate(-50%, -50%);
	transition: background 160ms ease, transform 160ms ease;
}

.apg-slider__dot.is-active::before {
	background: var(--apg-slider-dot-active);
	transform: translate(-50%, -50%) scale(1.25);
}

.apg-slider__dot:focus-visible {
	outline: 2px solid var(--apg-slider-focus);
	outline-offset: 2px;
	border-radius: 50%;
}

.apg-slider-placeholder {
	padding: 28px 20px;
	border: 1px dashed rgba(36, 34, 30, 0.24);
	border-radius: 8px;
	background: #fbfaf7;
	color: #6f6a60;
	font-size: 14px;
	line-height: 1.45;
	text-align: center;
}

@media (prefers-reduced-motion: reduce) {
	.apg-slider__track {
		transition: none;
	}

	.apg-slider__arrow,
	.apg-slider__dot::before {
		transition: none;
	}
}
