/*
 * Craftis Featured Products Carousel — frontend styles.
 * .craftis-product-card rules are a deliberate duplicate of
 * featured-products.css's card styles (same class names, same theme
 * design-token var() fallbacks) — this widget is loaded independently of
 * the grid widget, and CSS custom properties don't survive
 * cross-stylesheet @import without an actual @import rule, which would
 * force the grid widget's CSS to load on every page using only the
 * carousel. Keep both in sync by hand if the shared card design changes.
 */

.craftis-fp-carousel {
	position: relative;
	/* No max-width/padding here deliberately — same as
	 * .craftis-featured-products (the non-carousel grid widget), this
	 * widget fills whatever width its Elementor container/column gives
	 * it rather than adding a second, competing width constraint. The
	 * page's Elementor container is what boxes the content; duplicating
	 * that here with a hardcoded max-width caused a double-inset
	 * (container padding + this widget's own padding stacked). */
}

.craftis-fp-carousel__track {
	position: relative;
}

/* The side gutter for the arrows to sit in only applies when they're
 * actually shown ("Show Arrows" is off by default) — otherwise it left
 * an unexplained inset making the track narrower than the container it
 * now matches. Arrows are positioned against THIS element, not the
 * outer .craftis-fp-carousel, so they land in that reserved gutter next
 * to the cards instead of overlapping the product image on top of it. */
.craftis-fp-carousel--has-arrows .craftis-fp-carousel__track {
	padding: 0 52px;
}

@media (max-width: 767px) {
	.craftis-fp-carousel--has-arrows .craftis-fp-carousel__track {
		padding: 0 40px;
	}
}

.craftis-fp-carousel .swiper {
	overflow: hidden;
}

.craftis-fp-carousel .swiper-wrapper {
	align-items: stretch;
}

.craftis-fp-carousel .swiper-slide {
	height: auto;
}

.craftis-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	height: 100%;
	background-color: var(--color-white, #FFFFFF);
	border-radius: 14px;
	overflow: hidden;
}

.craftis-fp-carousel--bordered .craftis-product-card {
	border: 1px solid var(--color-line, #E2DFDA);
}

.craftis-product-card__image-link {
	position: relative;
	display: block;
	overflow: hidden;
}

.craftis-product-card__image {
	width: 100%;
	aspect-ratio: 1 / 1;
	object-fit: cover;
	transition: transform 0.5s ease;
}

.craftis-fp-carousel--hover-zoom .craftis-product-card:hover .craftis-product-card__image {
	transform: scale(1.06);
}

.craftis-product-card__badge {
	position: absolute;
	top: 12px;
	left: 12px;
	z-index: 1;
	padding: 4px 12px;
	border-radius: 4px;
	background-color: var(--color-brand-red, #C8202F);
	color: #FFFFFF;
	font-size: 0.6875rem;
	text-transform: uppercase;
	letter-spacing: 0.08em;
}

/* Top-right corner discount pill — same rose-pink pill styling as the
 * theme's .craftis-price-discount-badge, positioned as its own
 * image-corner badge (opposite the Sale/New badge) instead of glued to
 * the price text. */
.craftis-product-card__badge--discount {
	top: 12px;
	right: 12px;
	left: auto;
	border-radius: 999px;
	background-color: rgba(227, 162, 166, 0.25);
	color: var(--color-brand-red, #C8202F);
}

/* Wishlist + add-to-cart icon stack, top-right of the image — sits below
 * where .craftis-product-card__badge--discount would be (that pill and
 * this icon stack share the top-right corner). */
.craftis-product-card__actions {
	position: absolute;
	top: 48px;
	right: 12px;
	z-index: 1;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.craftis-product-card__action-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 36px;
	height: 36px;
	border-radius: 50%;
	background-color: #FFFFFF;
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.12);
	color: var(--color-text, #2B2B28);
	transition: background-color 0.2s ease, color 0.2s ease, transform 0.15s ease;
}

.craftis-product-card__action-btn .craftis-icon {
	width: 16px;
	height: 16px;
}

.craftis-product-card__action-btn:hover,
.craftis-product-card__action-btn:focus-visible {
	background-color: var(--color-primary, #1F1E1B);
	color: #FFFFFF;
}

.craftis-product-card__action-btn:active {
	transform: scale(0.92);
}

.craftis-wishlist-toggle.is-active {
	color: var(--color-brand-red, #C8202F);
}

.craftis-wishlist-toggle.is-active:hover,
.craftis-wishlist-toggle.is-active:focus-visible {
	background-color: #FFFFFF;
	color: var(--color-brand-red, #C8202F);
}

.craftis-product-card__add-to-cart.loading {
	opacity: 0.6;
	pointer-events: none;
}

/* Catalog Mode's "Enquire Now" grid button — see the matching rule (and
 * its full explanation) in featured-products.css; duplicated here since
 * this widget loads independently and doesn't share that stylesheet. */
.craftis-enquire-btn--loop {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	margin-top: auto;
	padding: 12px 16px;
	border: none;
	border-radius: 0;
	background-color: var(--color-primary, #1F1E1B);
	color: #FFFFFF;
	transition: opacity 0.2s ease;
	box-sizing: border-box;
}

.craftis-enquire-btn--loop .craftis-enquire-btn__text {
	font-size: 0.75rem;
	font-weight: 600;
	letter-spacing: 0.08em;
	text-transform: uppercase;
}

.craftis-enquire-btn--loop:hover,
.craftis-enquire-btn--loop:focus-visible {
	opacity: 0.9;
}

.craftis-product-card__body {
	display: flex;
	flex-direction: column;
	align-items: flex-start;
	flex-grow: 1;
	gap: 6px;
	padding: 16px 18px 20px;
}

.craftis-product-card__category {
	text-transform: uppercase;
	font-weight: 500;
	letter-spacing: 0.13em;
	font-size: 0.6875rem;
	color: var(--color-text-muted, #6E6E6C);
}

.craftis-product-card__title-link {
	display: block;
}

.craftis-product-card__title {
	font-family: var(--font-heading, 'Metropolis'), sans-serif;
	font-weight: 700;
	font-size: 1.0625rem;
	line-height: 1.3;
	margin: 0;
	color: var(--color-text, #2B2B28);
}

.craftis-product-card__body .star-rating {
	font-size: 0.75rem;
}

.craftis-product-card__price {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 8px;
	font-family: var(--font-body, 'Jost'), sans-serif;
	font-size: 1rem;
	color: var(--color-text, #2B2B28);
}

.craftis-product-card__price del {
	color: var(--color-text-muted, #6E6E6C);
	opacity: 0.7;
	font-size: 0.875em;
}

.craftis-product-card__price ins {
	text-decoration: none;
	font-weight: 700;
	font-size: 1.125em;
	color: var(--color-text, #2B2B28);
}

.craftis-featured-products__notice {
	padding: 24px;
	background-color: var(--color-bg-warm, #F1F0ED);
	color: var(--color-text-muted, #6E6E6C);
	text-align: center;
}

/* ---- Arrows ---------------------------------------------------------- */

/* Vertically centered against the product IMAGE, not the whole card
 * (which also has title/price/rating text below it) — a fixed
 * percentage of the track's height would drift off the image once
 * titles wrap to different numbers of lines across slides, so this
 * targets a fixed pixel position from the top instead, matching the
 * square product-card image's own height at each breakpoint. */
.craftis-fp-carousel__arrow {
	position: absolute;
	top: 160px;
	z-index: 2;
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 40px;
	height: 40px;
	border: none;
	border-radius: 50%;
	background-color: #FFFFFF;
	box-shadow: 0 2px 10px rgba(0, 0, 0, 0.14);
	color: var(--color-text, #2B2B28);
	cursor: pointer;
	transition: background-color 0.2s ease, color 0.2s ease, opacity 0.2s ease;
	transform: translateY(-50%);
}

.craftis-fp-carousel__arrow:hover,
.craftis-fp-carousel__arrow:focus-visible {
	background-color: var(--color-primary, #1F1E1B);
	color: #FFFFFF;
}

.craftis-fp-carousel__arrow.swiper-button-disabled {
	opacity: 0.35;
	cursor: default;
	pointer-events: none;
}

.craftis-fp-carousel__arrow--prev {
	left: 0;
}

.craftis-fp-carousel__arrow--next {
	right: 0;
}

@media (max-width: 767px) {
	.craftis-fp-carousel__arrow {
		top: 120px;
		width: 36px;
		height: 36px;
	}
}

.craftis-fp-carousel__arrow-icon {
	display: block;
	width: 18px;
	height: 18px;
	background-color: currentColor;
	-webkit-mask-repeat: no-repeat;
	mask-repeat: no-repeat;
	-webkit-mask-position: center;
	mask-position: center;
	-webkit-mask-size: contain;
	mask-size: contain;
}

.craftis-fp-carousel__arrow-icon--prev {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='19' y1='12' x2='5' y2='12'/%3E%3Cpolyline points='12 19 5 12 12 5'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='19' y1='12' x2='5' y2='12'/%3E%3Cpolyline points='12 19 5 12 12 5'/%3E%3C/svg%3E");
}

.craftis-fp-carousel__arrow-icon--next {
	-webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E");
	mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23000' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cline x1='5' y1='12' x2='19' y2='12'/%3E%3Cpolyline points='12 5 19 12 12 19'/%3E%3C/svg%3E");
}

/* ---- Dots (Swiper's own pagination bullets, restyled) ----------------- */

.craftis-fp-carousel__pagination {
	position: static;
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	margin-top: 12px;
}

.craftis-fp-carousel .swiper-pagination-bullet {
	width: 8px;
	height: 8px;
	margin: 0;
	border-radius: 50%;
	background-color: var(--color-line, #E2DFDA);
	opacity: 1;
	transition: background-color 0.2s ease, transform 0.2s ease;
}

.craftis-fp-carousel .swiper-pagination-bullet-active {
	background-color: var(--color-primary, #1F1E1B);
	transform: scale(1.2);
}
