/*
 * Craftis Featured Products — frontend styles.
 * Card markup/classes mirror the theme's shop-grid card exactly
 * (woocommerce/content-product.php + assets/src/scss/_shop.scss,
 * craftis-product-card instead of craftis-shop-card since this widget
 * can render outside a <ul> product loop) — same visual system, kept in
 * sync deliberately. Colors/fonts fall back to the theme's design tokens
 * (craftis-dynamic.css) via var().
 */

.craftis-featured-products {
	display: grid;
	grid-template-columns: repeat(2, 1fr);
	gap: 32px;
}

@media (min-width: 768px) {
	.craftis-featured-products--cols-2 { grid-template-columns: repeat(2, 1fr); }
	.craftis-featured-products--cols-3 { grid-template-columns: repeat(3, 1fr); }
	.craftis-featured-products--cols-4 { grid-template-columns: repeat(4, 1fr); }
	.craftis-featured-products--cols-5 { grid-template-columns: repeat(5, 1fr); }
}

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

.craftis-featured-products--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-featured-products--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 (craftis_catalog_mode_render_enquire_button()
 * in the theme's inc/catalog-mode.php) — printed in the normal document
 * flow after the price (render() in class-featured-products.php), NOT
 * absolutely positioned, so it can never overlap the title/rating/price
 * above it. margin-top: auto pushes it to the bottom of
 * .craftis-product-card__body's flex column (which already stretches to
 * fill the card via flex-grow: 1), so it lines up at the same height
 * across every card in a row regardless of title/category line count. */
.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;
}
