/* ==========================================================================
   Pelagi — WooCommerce Product Card (Jovoy-style)
   Targets: .qodef-woo-product-list .product (info-below layout)

   The companion JS in functions.php restructures the markup so that:
     - the wishlist button is appended into  .qodef-e-media-inner
     - the add-to-cart button is wrapped in .pelagi-cart-bar and appended
       at the bottom of .qodef-e-inner (so the card border wraps it)

   We use the body[class*=seraphina-core] prefix on contested rules to
   outweigh seraphina-core.min.css's defaults.
   ========================================================================== */

/* Anti-FOUC: cards start invisible; JS adds .pelagi-ready after restructuring */
.qodef-woo-product-list .product {
	position: relative;
	list-style: none;
	opacity: 0;
	transition: opacity 0.15s ease;
}

.qodef-woo-product-list .product.pelagi-ready {
	opacity: 1;
}

/* --- Outer card -----------------------------------------------------------*/
.qodef-woo-product-list .product .qodef-e-inner {
	position: relative;
	background: #fff;
	border: 1px solid transparent;
	transition: border-color 0.25s ease, box-shadow 0.25s ease;
	display: flex;
	flex-direction: column;
}

/* Hover border around the entire card */
.qodef-woo-product-list .product:hover .qodef-e-inner {
	border-color: #1a1a1a;
}

/* --- Image area -----------------------------------------------------------*/
.qodef-woo-product-list .product .qodef-e-media {
	position: relative;
	background-color: #f4f3ef;
	overflow: hidden;
}

.qodef-woo-product-list .product .qodef-e-media-image {
	display: block;
}

.qodef-woo-product-list .product .qodef-e-media-image img,
.qodef-woo-product-list .product .qodef-e-media img {
	display: block;
	margin: 0 auto;
	width: 100%;
	height: auto;
	background: transparent;
}

/* Badges: horizontal, flush top-left
   JS (pelagiRestructureCards) wraps all .qodef-woo-product-mark spans
   into .pelagi-badge-wrap so we can lay them out horizontally. */
.qodef-woo-product-list .product .pelagi-badge-wrap {
	position: absolute;
	top: 0;
	left: 0;
	z-index: 5;
	display: flex;
	flex-direction: row;
	gap: 0;
	pointer-events: none;
}

/* Override the parent theme's absolute + translateY vertical stacking */
#qodef-woo-page .qodef-woo-product-list .product .pelagi-badge-wrap .qodef-woo-product-mark,
.qodef-woo-shortcode .qodef-woo-product-list .product .pelagi-badge-wrap .qodef-woo-product-mark {
	position: static !important;
	top: auto !important;
	left: auto !important;
	transform: none !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
	padding: 6px 14px !important;
	margin: 0 !important;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1;
	color: #fff !important;
	background: #1a1a1a !important;
	border-radius: 0 !important;
	border: 0 !important;
}

/* Sale badge → red */
#qodef-woo-page .qodef-woo-product-list .product .pelagi-badge-wrap .qodef-woo-product-mark.qodef--on-sale,
.qodef-woo-shortcode .qodef-woo-product-list .product .pelagi-badge-wrap .qodef-woo-product-mark.qodef--on-sale {
	background: #b4152c !important;
}

/* Best Seller badge → red */
#qodef-woo-page .qodef-woo-product-list .product .pelagi-badge-wrap .qodef-woo-product-mark.qodef--bestseller,
.qodef-woo-shortcode .qodef-woo-product-list .product .pelagi-badge-wrap .qodef-woo-product-mark.qodef--bestseller {
	background: #b4152c !important;
}

/* Out-of-stock badge → muted dark */
#qodef-woo-page .qodef-woo-product-list .product .pelagi-badge-wrap .qodef-woo-product-mark.qodef--out-of-stock,
.qodef-woo-shortcode .qodef-woo-product-list .product .pelagi-badge-wrap .qodef-woo-product-mark.qodef--out-of-stock {
	background: #555 !important;
}

/* --- .qodef-e-media-inner: now only hosts the wishlist heart -------------*/
body[class*="seraphina-core"] .qodef-woo-product-list .product .qodef-e-media-inner {
	position: absolute;
	left: 0;
	right: 0;
	bottom: 0;
	top: auto;
	width: 100%;
	height: auto;
	display: flex;
	align-items: center;
	justify-content: flex-end;
	gap: 0;
	padding: 12px 16px;
	z-index: 4;
	background: transparent;
	transform: none;
	opacity: 1;
	pointer-events: none;
}

/* --- Wishlist heart (always visible, simple, bottom-right of image) ------*/
body[class*="seraphina-core"] .qodef-woo-product-list .product .qodef-e-media-inner .qwfw-add-to-wishlist-wrapper {
	position: relative !important;
	right: auto !important;
	bottom: auto !important;
	top: auto !important;
	left: auto !important;
	transform: none !important;
	margin: 0 0 0 auto !important;
	padding: 0 !important;
	z-index: 6;
	pointer-events: auto;
	background: transparent !important;
	display: inline-flex !important;
	align-items: center;
	opacity: 1 !important;
	visibility: visible !important;
}

.qodef-woo-product-list .product .qodef-e-media-inner .qwfw-add-to-wishlist-wrapper .qwfw-add-to-wishlist {
	background: transparent !important;
	box-shadow: none !important;
	border: 0 !important;
	padding: 4px !important;
	color: #b4152c !important;
	font-size: 0 !important;
	display: inline-flex !important;
	align-items: center;
	justify-content: center;
}

.qodef-woo-product-list .product .qodef-e-media-inner .qwfw-add-to-wishlist-wrapper .qwfw-m-text {
	display: none !important;
}

.qodef-woo-product-list .product .qodef-e-media-inner .qwfw-add-to-wishlist-wrapper .qwfw-m-icon svg {
	width: 21px;
	height: 18px;
	stroke: #b4152c;
	fill: none;
}

/* Hide any duplicate wishlist still inside .qodef-e-content */
body[class*="seraphina-core"] .qodef-woo-product-list .product .qodef-e-content .qwfw-add-to-wishlist-wrapper {
	display: none !important;
}

/* --- Quick view: hidden on the cards (target reference doesn't show it) --*/
body[class*="seraphina-core"] .qodef-woo-product-list .product .qqvfw-quick-view-button-wrapper {
	display: none !important;
}

/* --- Content (below image) ------------------------------------------------*/
.qodef-woo-product-list .product .qodef-e-content {
	display: grid;
	grid-template-columns: 1fr auto;
	column-gap: 16px;
	row-gap: 4px;
	align-items: start;
	padding: 18px 18px 16px;
	text-align: left;
	border-top: 0;
}

.qodef-woo-product-list .product .qodef-e-content .qodef-woo-product-title {
	grid-column: 1 / 2;
	grid-row: 1 / 2;
	margin: 0;
	font-family: inherit;
	font-size: 13px;
	font-weight: 500;
	letter-spacing: 0.06em;
	text-transform: uppercase;
	line-height: 1.3;
}

.qodef-woo-product-list .product .qodef-e-content .qodef-woo-product-title a {
	color: #1a1a1a;
	text-decoration: none;
}

.qodef-woo-product-list .product .qodef-e-content .qodef-e-top-holder {
	grid-column: 1 / 2;
	grid-row: 2 / 3;
	margin: 0;
	padding: 0;
}

.qodef-woo-product-list .product .qodef-e-content .qodef-e-info {
	display: block;
	margin: 0;
	font-size: 13px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	line-height: 1.3;
	color: #1a1a1a;
}

.qodef-woo-product-list .product .qodef-e-content .qodef-e-info a {
	color: inherit;
	text-decoration: none;
}

.qodef-woo-product-list .product .qodef-e-content .qodef-e-info .qodef-info-separator-single,
.qodef-woo-product-list .product .qodef-e-content .qodef-e-info .qodef-info-separator-end {
	display: none;
}

.qodef-woo-product-list .product .qodef-e-content .pelagi-try-me {
	grid-column: 2 / 3;
	grid-row: 1 / 2;
	display: inline-flex;
	align-items: center;
	gap: 6px;
	font-size: 12px;
	color: #b4152c;
	white-space: nowrap;
	justify-self: end;
}

.qodef-woo-product-list .product .qodef-e-content .pelagi-try-me__check {
	font-size: 13px;
	line-height: 1;
}

.qodef-woo-product-list .product .qodef-e-content .price {
	grid-column: 2 / 3;
	grid-row: 2 / 3;
	margin: 0;
	font-size: 14px;
	font-weight: 700;
	color: #1a1a1a;
	text-align: right;
	justify-self: end;
}

.qodef-woo-product-list .product .qodef-e-content .price ins,
.qodef-woo-product-list .product .qodef-e-content .price del {
	background: transparent;
	text-decoration: none;
}

.qodef-woo-product-list .product .qodef-e-content .price del {
	opacity: 0.5;
	text-decoration: line-through;
	margin-right: 6px;
	font-weight: 500;
}

/* --- Olfactory notes summary ----------------------------------------------*/
.qodef-woo-product-list .product .pelagi-product-featured {
	grid-column: 1 / -1;
	grid-row: 3 / 4;
	display: flex;
	justify-content: space-around;
	align-items: flex-start;
	gap: 12px;
	list-style: none;
	margin: 14px 0 0;
	padding: 16px 4px 4px;
	border-top: 1px solid #ececec;
	text-align: center;
}

.qodef-woo-product-list .product .pelagi-product-featured__item {
	flex: 1 1 0;
	margin: 0;
	padding: 0;
	list-style: none;
}

.qodef-woo-product-list .product .pelagi-product-featured__name {
	margin: 0 0 4px;
	font-size: 13px;
	font-weight: 700;
	color: #1a1a1a;
	letter-spacing: 0.02em;
}

.qodef-woo-product-list .product .pelagi-product-featured__value {
	margin: 0;
	font-size: 13px;
	font-weight: 400;
	color: #555;
}

/* --- ADD TO CART bar (at the bottom of the card, inside the border) ------*/
.qodef-woo-product-list .product .pelagi-cart-bar {
	margin-top: auto;
	padding: 14px;
	display: block;
}

body[class*="seraphina-core"] .qodef-woo-product-list .product .pelagi-cart-bar > .button,
body[class*="seraphina-core"] .qodef-woo-product-list .product .pelagi-cart-bar > .added_to_cart {
	position: static !important;
	display: block !important;
	width: 100% !important;
	margin: 0 !important;
	padding: 16px 20px !important;
	background: #1a1a1a !important;
	color: #fff !important;
	border: 0 !important;
	border-radius: 0 !important;
	font-size: 13px !important;
	font-weight: 700 !important;
	letter-spacing: 0.18em !important;
	text-transform: uppercase !important;
	text-align: center !important;
	line-height: 1 !important;
	min-width: 0 !important;
	height: auto !important;
	transform: none !important;
	opacity: 1 !important;
	pointer-events: auto !important;
	transition: background-color 0.2s ease !important;
}

body[class*="seraphina-core"] .qodef-woo-product-list .product .pelagi-cart-bar > .button .qodef-m-text {
	color: #fff !important;
}

body[class*="seraphina-core"] .qodef-woo-product-list .product .pelagi-cart-bar > .button:hover {
	background: #000 !important;
}

/* --- Mobile (≤ 767px) -----------------------------------------------------*/
@media ( max-width: 767px ) {

	.qodef-woo-product-list .product .pelagi-product-featured {
		display: none;
	}

	.qodef-woo-product-list .product .qodef-e-content {
		padding: 14px 12px 12px;
	}

	.qodef-woo-product-list .product .qodef-e-content .qodef-woo-product-title,
	.qodef-woo-product-list .product .qodef-e-content .qodef-e-top-holder {
		grid-column: 1 / -1;
	}

	.qodef-woo-product-list .product .qodef-e-content .pelagi-try-me {
		grid-column: 1 / 2;
		grid-row: 3 / 4;
		justify-self: start;
		margin-top: 6px;
	}

	.qodef-woo-product-list .product .qodef-e-content .price {
		grid-column: 2 / 3;
		grid-row: 3 / 4;
		justify-self: end;
		margin-top: 6px;
	}

	.qodef-woo-product-list .product .pelagi-cart-bar {
		display: none;
	}

	.qodef-woo-product-list .product:hover .qodef-e-inner {
		border-color: transparent;
	}
}
