/**
 * Electro Child — Modern product cards
 * Equal-height where possible, never clipped, clean spacing.
 */

:root {
	--chalcass-red: #c8102e;
	--chalcass-ink: #1a1f2c;
	--chalcass-muted: #6b7280;
	--chalcass-line: rgba(26, 31, 44, 0.08);
	--chalcass-surface: #ffffff;
	--chalcass-soft: #f4f5f7;
	--chalcass-shadow: 0 6px 18px rgba(26, 31, 44, 0.06);
	--chalcass-shadow-hover: 0 14px 32px rgba(26, 31, 44, 0.1);
	--chalcass-ease: cubic-bezier(0.22, 1, 0.36, 1);
	--chalcass-card-pad-x: 1.15rem;
	--chalcass-card-pad-top: 1.2rem;
	--chalcass-card-pad-bottom: 1.25rem;
	--chalcass-stack-gap: 0.75rem;
	--chalcass-card-gap: 1.15rem;
}

/* ---------- Never clip product sections / carousels ---------- */
.chalcass-product-cards .section-products-carousel,
.chalcass-product-cards .products-carousel,
.chalcass-product-cards .products-carousel-tabs,
.chalcass-product-cards .section-products,
.chalcass-product-cards .owl-carousel,
.chalcass-product-cards .owl-carousel .owl-stage-outer,
.chalcass-product-cards .owl-carousel .owl-stage,
.chalcass-product-cards ul.products {
	overflow: visible !important;
	height: auto !important;
	max-height: none !important;
}

.chalcass-product-cards .owl-carousel .owl-stage {
	display: flex !important;
	align-items: stretch !important;
}

.chalcass-product-cards .owl-carousel .owl-item {
	float: none !important;
	display: flex !important;
	height: auto !important;
	min-height: 0 !important;
}

.chalcass-product-cards ul.products {
	display: flex;
	flex-wrap: wrap;
	align-items: stretch;
	margin-bottom: 0;
	/* Override Electro/Bootstrap g-0 so cards aren't flush */
	--bs-gutter-x: var(--chalcass-card-gap) !important;
	--bs-gutter-y: calc(var(--chalcass-card-gap) + 0.25rem) !important;
	gap: 0; /* gutters handle spacing for .row */
	row-gap: 0;
	column-gap: 0;
}

.chalcass-product-cards ul.products.row > li.product,
.chalcass-product-cards ul.products.row > .product {
	padding-left: calc(var(--bs-gutter-x) * 0.5) !important;
	padding-right: calc(var(--bs-gutter-x) * 0.5) !important;
	padding-top: calc(var(--bs-gutter-y) * 0.5) !important;
	padding-bottom: calc(var(--bs-gutter-y) * 0.5) !important;
	margin: 0 !important;
	box-sizing: border-box;
}

.chalcass-product-cards ul.products > li.product,
.chalcass-product-cards .owl-item > .product,
.chalcass-product-cards .products-carousel .product {
	display: flex !important;
	flex-direction: column;
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
	margin: 0 !important;
	position: relative;
	float: none !important;
	border-bottom: 0 !important;
}

.chalcass-product-cards ul.products > li.product::after,
.chalcass-product-cards .owl-item > .product::after {
	display: none !important;
	content: none !important;
}

/* Carousel gutters — Owl sizes items tightly; padding creates visible space */
.chalcass-product-cards .owl-carousel .owl-item {
	padding: 0.35rem calc(var(--chalcass-card-gap) / 2) 1rem !important;
	box-sizing: border-box;
}

.chalcass-product-cards .owl-carousel.row {
	margin-left: 0 !important;
	margin-right: 0 !important;
}

.chalcass-product-cards .owl-carousel.row > .owl-stage-outer,
.chalcass-product-cards .owl-carousel .owl-stage-outer {
	margin: 0;
}

.chalcass-product-cards ul.products > li.product .product-outer,
.chalcass-product-cards .owl-item .product-outer,
.chalcass-product-cards .products-carousel .product-outer {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	width: 100%;
	height: auto !important;
	min-height: 100%;
	overflow: visible !important;
}

.chalcass-product-cards ul.products > li.product .product-inner,
.chalcass-product-cards .owl-item .product-inner,
.chalcass-product-cards .products-carousel .product-inner {
	display: flex;
	flex-direction: column;
	flex: 1 1 auto;
	width: 100%;
	height: auto !important;
	min-height: 100%;
	position: relative;
	/* Kill Electro's default padding — we pad sections ourselves */
	padding: 0 !important;
	background: var(--chalcass-surface);
	border: 1px solid var(--chalcass-line);
	border-radius: 14px;
	box-shadow: var(--chalcass-shadow);
	overflow: hidden; /* contain content inside rounded card */
	transition:
		transform 0.3s var(--chalcass-ease),
		box-shadow 0.3s var(--chalcass-ease),
		border-color 0.25s ease;
}

.chalcass-product-cards ul.products > li.product:not(:has(.product-inner)) {
	background: var(--chalcass-surface);
	border: 1px solid var(--chalcass-line);
	border-radius: 14px;
	box-shadow: var(--chalcass-shadow);
	overflow: hidden;
	padding: 0 !important;
}

.chalcass-product-cards ul.products > li.product:hover .product-inner,
.chalcass-product-cards .owl-item .product:hover .product-inner {
	transform: translateY(-2px);
	box-shadow: var(--chalcass-shadow-hover);
	border-color: rgba(200, 16, 46, 0.14);
}

/* ---------- Header (title only — no category clutter) ---------- */
.chalcass-product-cards .product-loop-header,
.chalcass-product-cards .product-item__header {
	padding: var(--chalcass-card-pad-top) var(--chalcass-card-pad-x) 0.65rem;
	position: relative;
	flex: 0 0 auto;
	z-index: 1;
}

.chalcass-product-cards .loop-product-categories,
.chalcass-product-cards ul.products .loop-product-categories,
.chalcass-product-cards .owl-item .loop-product-categories {
	display: none !important;
}

.chalcass-product-cards .woocommerce-loop-product__title,
.chalcass-product-cards h2.woocommerce-loop-product__title,
.chalcass-product-cards h3.woocommerce-loop-product__title,
.chalcass-product-cards .product-title {
	color: var(--chalcass-ink) !important;
	font-size: 0.95rem !important;
	font-weight: 650 !important;
	line-height: 1.35 !important;
	margin: 0 !important;
	letter-spacing: -0.015em;
	min-height: 2.7em;
	max-height: 2.7em;
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 2;
	line-clamp: 2;
	overflow: hidden;
}

.chalcass-product-cards li.product:hover .woocommerce-loop-product__title,
.chalcass-product-cards .product:hover .woocommerce-loop-product__title {
	color: var(--chalcass-red) !important;
}

/* Duplicate body in grid/carousel — hide for cleanliness */
.chalcass-product-cards ul.products[data-view="grid"] .product-loop-body,
.chalcass-product-cards ul.products:not([data-view="list-view"]) .product-loop-body,
.chalcass-product-cards .owl-carousel .product-loop-body,
.chalcass-product-cards .products-carousel .product-loop-body {
	display: none !important;
}

/* ---------- Image — full-width, centered in card ---------- */
.chalcass-product-cards .product-loop-header .woocommerce-LoopProduct-link,
.chalcass-product-cards .product-item__header .woocommerce-LoopProduct-link {
	display: block !important;
	width: 100% !important;
}

.chalcass-product-cards .products > .product .product-thumbnail,
.chalcass-product-cards .owl-item > .product .product-thumbnail,
.chalcass-product-cards .product-thumbnail,
.chalcass-product-cards .product-item__thumbnail {
	position: relative;
	display: flex !important;
	align-items: center;
	justify-content: center;
	width: calc(100% - (2 * var(--chalcass-card-pad-x))) !important;
	max-width: calc(100% - (2 * var(--chalcass-card-pad-x))) !important;
	margin: 0.15rem auto 0 !important;
	box-sizing: border-box;
	background: var(--chalcass-soft);
	border-radius: 12px;
	overflow: hidden;
	aspect-ratio: 1 / 1;
	flex: 0 0 auto;
}

.chalcass-product-cards .products > .product .product-thumbnail > img,
.chalcass-product-cards .owl-item > .product .product-thumbnail > img,
.chalcass-product-cards .products > .product .wp-post-image,
.chalcass-product-cards .owl-item > .product .wp-post-image,
.chalcass-product-cards .product-thumbnail img,
.chalcass-product-cards .product-item__thumbnail img {
	display: block !important;
	width: 100% !important;
	height: 100% !important;
	max-width: 100% !important;
	max-height: 100% !important;
	margin: 0 auto !important;
	object-fit: contain;
	object-position: center;
	padding: 0.75rem;
	box-sizing: border-box;
	transition: transform 0.4s var(--chalcass-ease);
}

.chalcass-product-cards li.product:hover .product-thumbnail img,
.chalcass-product-cards .product:hover .product-item__thumbnail img {
	transform: scale(1.03);
}

/* ---------- Badge — single flat pill ---------- */
.chalcass-product-cards .chalcass-pct-badge,
.chalcass-product-cards span.onsale.chalcass-pct-badge,
.chalcass-product-cards span.onsale {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	top: 0.85rem !important;
	right: 0.85rem !important;
	left: auto !important;
	bottom: auto !important;
	background: var(--chalcass-red) !important;
	color: #fff !important;
	border-radius: 999px !important;
	font-size: 0.75rem !important;
	font-weight: 700 !important;
	min-height: 1.6rem;
	padding: 0.28rem 0.6rem !important;
	box-shadow: none !important;
	filter: none !important;
	z-index: 5;
}

.chalcass-product-cards .wobd-badges-wrapper {
	position: absolute;
	top: 0.85rem;
	right: 0.85rem;
	left: auto;
	z-index: 5;
	pointer-events: none;
	background: transparent !important;
	box-shadow: none !important;
	filter: none !important;
}

.chalcass-product-cards .wobd-badges-wrapper .wobd-badges,
.chalcass-product-cards .wobd-badges-wrapper .wobd-text-bg-wrap,
.chalcass-product-cards .wobd-badges-wrapper [class*="wobd-text-template"],
.chalcass-product-cards .wobd-badges-wrapper [class*="wobd-"] {
	position: static !important;
	inset: auto !important;
	background: transparent !important;
	background-image: none !important;
	box-shadow: none !important;
	filter: none !important;
	border: 0 !important;
	padding: 0 !important;
	margin: 0 !important;
	min-width: 0 !important;
	min-height: 0 !important;
	width: auto !important;
	height: auto !important;
}

.chalcass-product-cards .wobd-badges-wrapper .wobd-badges::before,
.chalcass-product-cards .wobd-badges-wrapper .wobd-badges::after,
.chalcass-product-cards .wobd-badges-wrapper .wobd-text-bg-wrap::before,
.chalcass-product-cards .wobd-badges-wrapper .wobd-text-bg-wrap::after,
.chalcass-product-cards .wobd-badges-wrapper [class*="wobd-text-template"]::before,
.chalcass-product-cards .wobd-badges-wrapper [class*="wobd-text-template"]::after,
.chalcass-product-cards .wobd-badges-wrapper .wobd-text::before,
.chalcass-product-cards .wobd-badges-wrapper .wobd-text::after {
	content: none !important;
	display: none !important;
}

.chalcass-product-cards .wobd-badges-wrapper .wobd-text,
.chalcass-product-cards .wobd-badges-wrapper #wobd-badge {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	background: var(--chalcass-red) !important;
	background-image: none !important;
	color: #fff !important;
	border-radius: 999px !important;
	font-size: 0.75rem !important;
	font-weight: 700 !important;
	min-height: 1.6rem !important;
	padding: 0.28rem 0.6rem !important;
	line-height: 1 !important;
	box-shadow: none !important;
	filter: none !important;
	text-shadow: none !important;
	white-space: nowrap;
}

.chalcass-product-cards .wobd-badges-wrapper .wobd-second-text {
	display: none !important;
}

/* ---------- Footer — stacked, fully inside card ---------- */
.chalcass-product-cards .product-loop-footer,
.chalcass-product-cards .product-item__footer {
	margin-top: auto;
	padding: 1rem var(--chalcass-card-pad-x) var(--chalcass-card-pad-bottom);
	display: flex;
	flex-direction: column;
	align-items: stretch;
	justify-content: flex-end;
	gap: var(--chalcass-stack-gap);
	flex: 0 0 auto;
	width: 100%;
	box-sizing: border-box;
	overflow: visible !important;
}

/*
 * CRITICAL: Electro sets .price-add-to-cart { height: 2.571em }.
 * Dual price + CTA overflow that box and hang half outside the card.
 */
.chalcass-product-cards .products > .product .price-add-to-cart,
.chalcass-product-cards .owl-item > .product .price-add-to-cart,
.chalcass-product-cards .price-add-to-cart,
.chalcass-product-cards .products.show-btn > li.product .price-add-to-cart {
	display: flex !important;
	flex-direction: column !important;
	flex-wrap: nowrap !important;
	align-items: stretch !important;
	justify-content: flex-start !important;
	gap: 0.35rem;
	width: 100%;
	height: auto !important;
	min-height: 0 !important;
	max-height: none !important;
	clear: both;
	margin: 0 !important;
	overflow: visible !important;
	position: relative;
}

.chalcass-product-cards .chalcass-card-excerpt {
	display: -webkit-box;
	-webkit-box-orient: vertical;
	-webkit-line-clamp: 1;
	line-clamp: 1;
	overflow: hidden;
	text-overflow: ellipsis;
	margin: 0;
	padding: 0;
	min-height: 1.45em;
	font-size: 0.8125rem;
	font-weight: 400;
	line-height: 1.45;
	color: var(--chalcass-muted);
}

.chalcass-product-cards .chalcass-card-excerpt.is-empty {
	visibility: hidden;
}

.chalcass-product-cards .price-add-to-cart > .price,
.chalcass-product-cards .price,
.chalcass-product-cards .electro-price,
.chalcass-product-cards .chalcass-price {
	margin: 0 !important;
	float: none !important;
	width: 100%;
	min-height: 0;
	height: auto !important;
	line-height: 1.3;
}

.chalcass-product-cards .chalcass-price--card .chalcass-price-regular,
.chalcass-product-cards .wc-dual-price-regular {
	font-size: 0.8125rem !important;
	font-weight: 500 !important;
	color: var(--chalcass-muted) !important;
	margin-bottom: 0.2rem;
}

.chalcass-product-cards .chalcass-price--card .chalcass-price-cod,
.chalcass-product-cards .chalcass-price--card .wc-dual-price-sale,
.chalcass-product-cards .wc-dual-price-sale {
	font-size: 1.125rem !important;
	font-weight: 800 !important;
	color: var(--chalcass-red) !important;
	letter-spacing: -0.02em;
	line-height: 1.3;
}

.chalcass-product-cards .chalcass-price-amount--cod .amount,
.chalcass-product-cards .wc-dual-price-sale-amount,
.chalcass-product-cards .wc-dual-price-sale-amount .amount,
.chalcass-product-cards .chalcass-price-regular .amount,
.chalcass-product-cards .wc-dual-price-regular .amount {
	font-size: inherit !important;
	font-weight: inherit !important;
	color: inherit !important;
}

/* Hide loop-only controls (never touch single-product Add to Cart) */
.chalcass-product-cards ul.products .add-to-cart-wrap,
.chalcass-product-cards .owl-item .add-to-cart-wrap,
.chalcass-product-cards ul.products li.product .button.add_to_cart_button,
.chalcass-product-cards ul.products li.product .added_to_cart,
.chalcass-product-cards ul.products li.product a.button.product_type_simple,
.chalcass-product-cards ul.products li.product a.button.product_type_variable,
.chalcass-product-cards ul.products li.product a.button.product_type_grouped,
.chalcass-product-cards ul.products li.product a.button.product_type_external,
.chalcass-product-cards ul.products .hover-area,
.chalcass-product-cards .owl-item .hover-area,
.chalcass-product-cards ul.products .yith-wcwl-add-to-wishlist,
.chalcass-product-cards .owl-item .yith-wcwl-add-to-wishlist,
.chalcass-product-cards ul.products .add-to-compare-link,
.chalcass-product-cards .owl-item .add-to-compare-link,
.chalcass-product-cards ul.products .compare.button,
.chalcass-product-cards .owl-item .compare.button {
	display: none !important;
}

/* View Product — fully inside card with breathing room */
.chalcass-product-cards .chalcass-view-product.button,
.chalcass-product-cards a.chalcass-view-product,
.chalcass-product-cards .products.show-btn > li.product .chalcass-view-product.button {
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	float: none !important;
	width: 100% !important;
	max-width: 100% !important;
	min-width: 0 !important;
	height: 2.75rem !important;
	min-height: 2.75rem !important;
	margin: 0.15rem 0 0 !important;
	padding: 0 1rem !important;
	border-radius: 10px !important;
	border: 1px solid var(--chalcass-ink) !important;
	background: var(--chalcass-ink) !important;
	color: #fff !important;
	font-size: 0.8125rem !important;
	font-weight: 650 !important;
	letter-spacing: 0.02em;
	text-indent: 0 !important;
	text-transform: none !important;
	text-decoration: none !important;
	line-height: 1 !important;
	box-shadow: none !important;
	position: relative !important;
	top: auto !important;
	left: auto !important;
	right: auto !important;
	bottom: auto !important;
	transform: none !important;
	flex: 0 0 auto;
	box-sizing: border-box;
	overflow: visible !important;
	white-space: nowrap;
	transition: background 0.25s ease, border-color 0.25s ease;
}

.chalcass-product-cards .chalcass-view-product.button:hover,
.chalcass-product-cards .chalcass-view-product.button:focus,
.chalcass-product-cards a.chalcass-view-product:hover,
.chalcass-product-cards a.chalcass-view-product:focus {
	background: var(--chalcass-red) !important;
	border-color: var(--chalcass-red) !important;
	color: #fff !important;
	transform: none !important;
}

.chalcass-product-cards .chalcass-view-product.button::before,
.chalcass-product-cards .chalcass-view-product.button::after {
	display: none !important;
	content: none !important;
}

/* Owl dots / nav clearance */
.chalcass-product-cards .owl-carousel .owl-dots {
	margin-top: 1rem !important;
	position: relative;
	z-index: 1;
}

.chalcass-product-cards .section-products-carousel,
.chalcass-product-cards .products-carousel {
	padding-bottom: 0.75rem;
	margin-bottom: 0.75rem;
}

/* ---------- Single product ---------- */
.chalcass-product-cards.single-product .chalcass-price--single .chalcass-price-cod,
.chalcass-product-cards.single-product .summary .chalcass-price-cod {
	font-size: 1.75rem !important;
	font-weight: 800 !important;
	color: var(--chalcass-red) !important;
}

.chalcass-product-cards.single-product .summary .chalcass-pct-badge,
.chalcass-product-cards.single-product span.onsale.chalcass-pct-badge {
	position: relative;
	top: auto !important;
	right: auto !important;
	left: auto !important;
	display: inline-flex !important;
	margin: 0 0 0.75rem;
	box-shadow: none !important;
}

.chalcass-product-cards.single-product .woocommerce-product-gallery .chalcass-pct-badge,
.chalcass-product-cards.single-product .product-images-wrapper .chalcass-pct-badge,
.chalcass-product-cards.single-product .product-images-wrapper span.onsale {
	position: absolute !important;
	top: 0.85rem !important;
	right: 0.85rem !important;
	left: auto !important;
	z-index: 5;
}

/* ---------- Mobile ---------- */
@media (max-width: 767.98px) {
	:root {
		--chalcass-card-pad-x: 0.9rem;
		--chalcass-card-pad-top: 1.05rem;
		--chalcass-card-pad-bottom: 1.15rem;
		--chalcass-stack-gap: 0.75rem;
	}

	.chalcass-product-cards ul.products {
		--bs-gutter-x: 0.85rem !important;
		--bs-gutter-y: 1rem !important;
	}

	.chalcass-product-cards .chalcass-price--card .chalcass-price-cod,
	.chalcass-product-cards .wc-dual-price-sale {
		font-size: 1.05rem !important;
	}

	.chalcass-product-cards .chalcass-view-product.button,
	.chalcass-product-cards a.chalcass-view-product {
		height: 2.6rem !important;
		min-height: 2.6rem !important;
	}
}
