/* =========================================================================
 * CHUCHI – Product Carousel for Bricks
 * Structure:
 *   .chuchi-pc                     (positioning context for arrows; NOT clipped)
 *     .chuchi-pc__track.swiper     (.bricks-swiper-container; clips slides,
 *                                   but keeps a shadow-safe bleed area)
 *       .swiper-wrapper
 *         .swiper-slide
 *           .chuchi-pc__card
 *     .chuchi-pc__arrow--prev / --next
 *     .swiper-pagination
 * ===================================================================== */

.brxe-chuchi-product-carousel {
	/* The element box itself never clips – let card shadows and the
	 * arrow buttons spill outside it. */
	overflow: visible;
}

.chuchi-pc {
	--chuchi-pc-arrow-size: 44px;
	--chuchi-pc-img-ratio: 1 / 1;
	--chuchi-pc-shadow-space: 24px;

	position: relative;
	width: 100%;
	overflow: visible;
}

/* -------------------------------------------------------------------------
 * Track / clipping
 *
 * Swiper needs to hide the off-stage slides, but plain `overflow:hidden`
 * also clips the cards' drop shadows. We give the track an internal
 * shadow-safe margin:
 *   - padding + equal negative margin  -> vertical shadow room, no layout shift
 *   - `overflow: clip` + `overflow-clip-margin` -> horizontal shadow bleed
 *     on browsers that support it (Chrome 90+, FF 102+, Safari 16+),
 *     falling back to `hidden` everywhere else.
 * ---------------------------------------------------------------------- */
.chuchi-pc__track.swiper {
	/* vertical: real padding + equal negative margin => shadow room with no
	 * layout shift, works even with the `overflow: hidden` fallback */
	padding-block: var(--chuchi-pc-shadow-space);
	margin-block: calc(var(--chuchi-pc-shadow-space) * -1);
	/* horizontal bleed for edge-card shadows, progressive enhancement only
	 * (no negative inline margin => never triggers page-level x-scroll) */
	overflow: hidden;
	overflow: clip;
	overflow-clip-margin: var(--chuchi-pc-shadow-space);
}

/* Equal-height cards */
.chuchi-pc--equal .swiper-wrapper {
	align-items: stretch;
}
.chuchi-pc--equal .swiper-slide {
	height: auto;
}
.chuchi-pc .swiper-slide {
	display: flex;
	/* let a lifted card's shadow show above/below its own slide box */
	overflow: visible;
}

/* -------------------------------------------------------------------------
 * Card
 * ---------------------------------------------------------------------- */
.chuchi-pc__card {
	display: flex;
	flex-direction: column;
	width: 100%;
	background: var(--chuchi-pc-card-bg, #ffffff);
	border-radius: 14px;
	/* clip ONLY the media zoom, not the whole card, so shadows stay intact */
	box-shadow: 0 1px 2px rgba(16, 24, 40, 0.06), 0 1px 3px rgba(16, 24, 40, 0.10);
	transition: box-shadow 0.25s ease, transform 0.25s ease;
}

.chuchi-pc__card:hover {
	box-shadow: 0 14px 30px -12px rgba(16, 24, 40, 0.22);
	transform: translateY(-2px);
}

/* Media */
.chuchi-pc__media {
	position: relative;
	display: block;
	overflow: hidden;
	border-radius: inherit;
	border-end-start-radius: 0;
	border-end-end-radius: 0;
	background: #f4f4f5;
	aspect-ratio: var(--chuchi-pc-img-ratio, 1 / 1);
}

.chuchi-pc__media img {
	width: 100%;
	height: 100%;
	object-fit: cover;
	display: block;
	transition: transform 0.45s ease;
}

.chuchi-pc__card:hover .chuchi-pc__media img {
	transform: scale(1.04);
}

/* "Original" image ratio */
.chuchi-pc--ratio-auto .chuchi-pc__media {
	aspect-ratio: auto;
}
.chuchi-pc--ratio-auto .chuchi-pc__media img {
	height: auto;
}

/* Product badges (markup + base styles come from product-badges.css) */
.chuchi-pc__media .chuchi-pc__badges {
	z-index: 3;
}

/* Content */
.chuchi-pc__content {
	display: flex;
	flex-direction: column;
	gap: 8px;
	padding: 16px;
	flex: 1 1 auto;
}

.chuchi-pc__cats {
	font-size: 12px;
	text-transform: uppercase;
	letter-spacing: 0.04em;
	opacity: 0.6;
}

.chuchi-pc__title {
	margin: 0;
	font-size: 1rem;
	line-height: 1.35;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.chuchi-pc__title a {
	color: inherit;
	text-decoration: none;
}
.chuchi-pc__title a:hover {
	text-decoration: underline;
}

.chuchi-pc__rating {
	font-size: 14px;
	line-height: 1;
}

.chuchi-pc__excerpt {
	font-size: 14px;
	line-height: 1.5;
	opacity: 0.75;
}

.chuchi-pc__price {
	font-weight: 700;
	color: var(--chuchi-pc-price-color, inherit);
}
.chuchi-pc__price del {
	opacity: 0.5;
	font-weight: 400;
	margin-inline-end: 6px;
}
.chuchi-pc__price ins {
	text-decoration: none;
}

.chuchi-pc__actions {
	margin-block-start: auto;
	padding-top: 6px;
}

.chuchi-pc__actions .button,
.chuchi-pc__actions .added_to_cart {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	text-align: center;
}
.chuchi-pc__actions .added_to_cart {
	margin-top: 6px;
	font-size: 0.85em;
	opacity: 0.8;
}

/* -------------------------------------------------------------------------
 * Arrows
 * ---------------------------------------------------------------------- */
.chuchi-pc__arrow {
	position: absolute;
	z-index: 10;
	top: 42%;
	transform: translateY(-50%);
	display: flex;
	align-items: center;
	justify-content: center;
	width: var(--chuchi-pc-arrow-size, 44px);
	height: var(--chuchi-pc-arrow-size, 44px);
	padding: 0;
	margin: 0;
	cursor: pointer;
	border-radius: 999px;
	border: 1px solid rgba(16, 24, 40, 0.08);
	background: var(--chuchi-pc-arrow-bg, #ffffff);
	color: var(--chuchi-pc-arrow-color, #111111);
	box-shadow: 0 6px 18px rgba(16, 24, 40, 0.16);
	transition: opacity 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.chuchi-pc__arrow:hover {
	transform: translateY(-50%) scale(1.07);
}

.chuchi-pc__arrow svg {
	width: 46%;
	height: 46%;
}

/* Swiper locks / disables the nav nodes it is wired to */
.chuchi-pc__arrow.swiper-button-disabled {
	opacity: 0;
	pointer-events: none;
}
.chuchi-pc__arrow.swiper-button-lock {
	display: none;
}

.chuchi-pc__arrow--prev {
	inset-inline-start: 8px;
}
.chuchi-pc__arrow--next {
	inset-inline-end: 8px;
}

/* Arrows pulled outside the track (desktop only) */
@media (min-width: 1024px) {
	.chuchi-pc--arrows-outside {
		padding-inline: calc(var(--chuchi-pc-arrow-size, 44px) / 2 + 10px);
	}
	.chuchi-pc--arrows-outside .chuchi-pc__arrow--prev {
		inset-inline-start: 0;
	}
	.chuchi-pc--arrows-outside .chuchi-pc__arrow--next {
		inset-inline-end: 0;
	}
}

/* -------------------------------------------------------------------------
 * Pagination dots
 * ---------------------------------------------------------------------- */
.chuchi-pc--has-dots {
	padding-bottom: 34px;
}
.chuchi-pc .swiper-pagination.chuchi-pc__dots {
	bottom: 0;
}

/* -------------------------------------------------------------------------
 * Mobile: one product, presented as a pronounced card
 * ---------------------------------------------------------------------- */
@media (max-width: 767px) {
	.chuchi-pc__card {
		border-radius: 18px;
		box-shadow: 0 12px 34px -12px rgba(16, 24, 40, 0.28);
	}

	.chuchi-pc__content {
		padding: 18px;
		gap: 10px;
	}

	.chuchi-pc__title {
		font-size: 1.05rem;
	}

	.chuchi-pc__actions .button {
		padding-block: 12px;
		font-size: 1rem;
	}

	/* compact overlay arrows centred on the image */
	.chuchi-pc__arrow {
		--chuchi-pc-arrow-size: 40px;
		top: 34%;
	}
	.chuchi-pc--arrows-outside .chuchi-pc__arrow--prev {
		inset-inline-start: 8px;
	}
	.chuchi-pc--arrows-outside .chuchi-pc__arrow--next {
		inset-inline-end: 8px;
	}
}
