/* 0.5.11: unified product cards. Loaded only when the card layer is enabled. */
/* Keep the purchase row stable after AJAX additions. The header cart and
 * confirmation-panel action remain available; WooCommerce keeps its success
 * state and screen-reader announcement on the add-to-cart control. */
body.ibnhoms-core-design.ibnhoms-unified-cards :is(.e-loop-item, ul.products li.product) .add_to_cart_button ~ a.added_to_cart.wc-forward {
	display: none !important;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .ibnhoms-catalog-discovery {
	max-width: 1180px;
	margin-inline: auto;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .elementor-loop-container:not(.swiper-container) {
	width: 100%;
	max-width: 1180px;
	margin-inline: auto;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 24px !important;
	align-items: stretch;
}

/* The related-product carousel already uses a static grid in Site Core.
 * Its outer shell must remain one full-width block, not a second grid. */
body.ibnhoms-core-design.ibnhoms-unified-cards .elementor-widget-loop-carousel .elementor-loop-container {
	display: block !important;
	width: 100%;
	max-width: 1180px;
	margin-inline: auto;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .elementor-widget-loop-carousel .swiper-wrapper {
	width: 100%;
	grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
	gap: 24px !important;
}

/* Center the two featured homepage products without enlarging their cards. */
@media (min-width: 1025px) {
	body.ibnhoms-core-design.ibnhoms-unified-cards.home .elementor-loop-container:has(> .e-loop-item ~ .e-loop-item):not(:has(> .e-loop-item ~ .e-loop-item ~ .e-loop-item)) {
		grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
	}
	body.ibnhoms-core-design.ibnhoms-unified-cards.home .elementor-loop-container:has(> .e-loop-item ~ .e-loop-item):not(:has(> .e-loop-item ~ .e-loop-item ~ .e-loop-item)) > .e-loop-item {
		grid-column: 2 / span 2;
	}
	body.ibnhoms-core-design.ibnhoms-unified-cards.home .elementor-loop-container:has(> .e-loop-item ~ .e-loop-item):not(:has(> .e-loop-item ~ .e-loop-item ~ .e-loop-item)) > .e-loop-item ~ .e-loop-item {
		grid-column: 4 / span 2;
	}
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item {
	min-width: 0;
	border-radius: 18px;
}

/* Each template has an image-only container also labelled prod-card.
 * Only the outer container is a card; nested containers stay transparent. */
body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .prod-card .prod-card {
	border: 0 !important;
	border-radius: 0 !important;
	background: none !important;
	box-shadow: none !important;
	padding: 0 !important;
	margin: 0 !important;
	gap: 0 !important;
	overflow: visible;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .prod-card::before,
body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .prod-card::after {
	display: none !important;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item > .elementor-section-wrap > .prod-card {
	animation: none !important;
	opacity: 1 !important;
	visibility: visible !important;
	padding: 0 !important;
	border: 1px solid #34414d !important;
	border-radius: 18px !important;
	background: #15212c !important;
	box-shadow: 0 8px 24px rgb(0 0 0 / 13%);
	transition: border-color .2s ease, box-shadow .2s ease;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item > .elementor-section-wrap > .prod-card > .e-con-inner {
	padding: 0 !important;
	gap: 0 !important;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-theme-post-featured-image {
	width: calc(100% - 28px) !important;
	margin: 14px 14px 0 !important;
	padding: 12px !important;
	box-sizing: border-box;
	aspect-ratio: 4 / 3;
	border: 1px solid #2b3742;
	border-radius: 12px !important;
	background: #0e171f !important;
	flex: 0 0 auto;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-theme-post-featured-image img {
	object-fit: contain !important;
	object-position: center !important;
	border-radius: 5px !important;
	transform: none !important;
	filter: none !important;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-theme-post-title {
	padding: 20px 20px 0 !important;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-theme-post-title .elementor-heading-title {
	font-size: 20px !important;
	font-weight: 700;
	line-height: 1.35;
	height: 2.7em;
	min-height: 2.7em;
	max-height: 2.7em;
	text-wrap: balance;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-theme-post-title a {
	color: #f4f6f8;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-theme-post-title a:hover {
	color: #ff5065;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-theme-post-excerpt {
	padding: 8px 20px 0 !important;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-theme-post-excerpt p {
	font-size: 14px;
	line-height: 1.65;
	height: 3.3em;
	min-height: 3.3em;
	max-height: 3.3em;
	color: #b6c0ca;
	-webkit-line-clamp: 2;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-woocommerce-product-price {
	padding: 18px 20px 0 !important;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-woocommerce-product-price .price {
	font-size: 21px;
	line-height: 1.4;
	color: #f5f7fa;
	min-height: 30px;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-woocommerce-product-price del {
	color: #a3aeb9;
	opacity: 1;
	font-size: 16px;
	font-weight: 500;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-woocommerce-product-add-to-cart {
	padding: 16px 20px 20px !important;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-woocommerce-product-add-to-cart :where(.elementor-widget-container, .elementor-add-to-cart, .e-loop-add-to-cart-form-container, form.cart) {
	display: block;
	width: 100% !important;
	max-width: none !important;
	margin: 0 !important;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-woocommerce-product-add-to-cart .button {
	display: flex;
	width: 100% !important;
	max-width: none !important;
	min-height: 46px;
	padding: 11px 16px;
	border-radius: 10px;
	font-size: 15px;
	line-height: 1.4;
	box-shadow: none;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item a:focus-visible {
	outline: 2px solid #ff7484;
	outline-offset: 3px;
}

body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item:hover > .elementor-section-wrap > .prod-card {
	border-color: #a74754 !important;
	box-shadow: 0 10px 26px rgb(0 0 0 / 20%);
}

@media (max-width: 1024px) {
	/* Astra archive and single-product containers have 14px less gutter on
	 * each side than the Elementor pages. Keep card widths consistent. */
	body.ibnhoms-core-design.ibnhoms-unified-cards.archive.woocommerce .elementor-loop-container:not(.swiper-container),
	body.ibnhoms-core-design.ibnhoms-unified-cards.single-product .elementor-widget-loop-carousel .elementor-loop-container {
		width: calc(100% - 28px);
	}
	body.ibnhoms-core-design.ibnhoms-unified-cards .elementor-loop-container:not(.swiper-container),
	body.ibnhoms-core-design.ibnhoms-unified-cards .elementor-widget-loop-carousel .swiper-wrapper {
		grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
		gap: 20px !important;
	}
}

@media (max-width: 640px) {
	body.ibnhoms-core-design.ibnhoms-unified-cards .elementor-loop-container:not(.swiper-container),
	body.ibnhoms-core-design.ibnhoms-unified-cards .elementor-widget-loop-carousel .swiper-wrapper {
		grid-template-columns: minmax(0, 1fr) !important;
		max-width: 440px;
		gap: 20px !important;
	}
	body.ibnhoms-core-design.ibnhoms-unified-cards .elementor-widget-loop-carousel .elementor-loop-container {
		max-width: 440px;
	}
	body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item .elementor-widget-theme-post-title .elementor-heading-title {
		font-size: 19px !important;
	}
	body.ibnhoms-core-design.ibnhoms-unified-cards .e-loop-item:hover {
		transform: none !important;
		box-shadow: none;
	}
}
