/**
 * BD Woo Product Card — scoped front-end styles.
 * All rules are namespaced under .bd-woo-card-wrapper to avoid global leakage.
 */

.bd-woo-card-wrapper {
	/* Sensible fallbacks; overridden per-card via inline custom properties. */
	--bd-accent: #ec4899;
	--bd-accent-soft: rgba(236, 72, 153, 0.12);
	--bd-accent-shadow: rgba(236, 72, 153, 0.35);
	--bd-accent-glow: rgba(236, 72, 153, 0.55);
	--bd-card-border: rgba(236, 72, 153, 0.18);
	--bd-button-bg: #0f1117;
	--bd-button-hover-bg: var(--bd-accent);
	--bd-float-distance: -10px;
	--bd-float-speed: 6s;

	/* Layered, category-colored glow used on button hover (overridable). */
	--bd-button-glow: 0 10px 26px var(--bd-accent-shadow), 0 0 20px 2px var(--bd-accent-glow);

	box-sizing: border-box;
	width: 100%;
}

.bd-woo-card-wrapper *,
.bd-woo-card-wrapper *::before,
.bd-woo-card-wrapper *::after {
	box-sizing: border-box;
}

/* ----------------------------------------------------------------------------
   Card
---------------------------------------------------------------------------- */
.bd-woo-card-wrapper .bd-woo-product-card {
	position: relative;
	display: flex;
	flex-direction: column;
	overflow: hidden;
	background: #ffffff;
	border: 1px solid var(--bd-card-border);
	border-radius: 22px;
	box-shadow: 0 10px 30px rgba(15, 17, 23, 0.06);
	transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.3s ease;
	height: 100%;
}

.bd-woo-card-wrapper .bd-woo-product-card:hover {
	border-color: var(--bd-accent);
	box-shadow: 0 18px 45px var(--bd-accent-shadow);
	transform: translateY(-4px);
}

/* ----------------------------------------------------------------------------
   Media / image area
---------------------------------------------------------------------------- */
.bd-woo-card-wrapper .bd-woo-product-media {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	/*
	 * Fixed height (not just min-height) so every card has an identical image
	 * area regardless of each product image's real dimensions. Without this a
	 * tall image stretches its card — and the grid row stretches every card to
	 * match — so some categories looked much taller than others.
	 */
	height: 300px;
	padding: 28px;
	background: linear-gradient(180deg, var(--bd-accent-soft) 0%, rgba(255, 255, 255, 0) 100%);
	border-radius: 20px 20px 0 0;
	overflow: hidden;
}

.bd-woo-card-wrapper .bd-woo-product-image-link {
	display: flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	text-decoration: none;
}

.bd-woo-card-wrapper .bd-woo-product-image {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	height: 100%;
	will-change: transform;
}

.bd-woo-card-wrapper .bd-woo-product-image img {
	display: block;
	/*
	 * Fill the fixed image box and contain — every product image then renders
	 * at the same height/scale regardless of its own dimensions, so cards look
	 * identical across categories (small/narrow images no longer shrink and
	 * tall/square images no longer dominate).
	 */
	width: 100%;
	height: 100%;
	max-width: 100%;
	max-height: 100%;
	object-fit: contain;
	filter: drop-shadow(0 18px 22px rgba(15, 17, 23, 0.18));
	transition: transform 0.4s ease;
}

/* Floating animation (GPU friendly: transform only). */
.bd-woo-card-wrapper .bd-float-on .bd-woo-product-image {
	animation: bd-woo-float var(--bd-float-speed) ease-in-out infinite;
}

@keyframes bd-woo-float {
	0% {
		transform: translateY(0);
	}
	50% {
		transform: translateY(var(--bd-float-distance));
	}
	100% {
		transform: translateY(0);
	}
}

/* Scale image on hover without affecting layout. */
.bd-woo-card-wrapper .bd-woo-product-card:hover .bd-woo-product-image img {
	transform: scale(1.06);
}

/* ----------------------------------------------------------------------------
   Badges
---------------------------------------------------------------------------- */
.bd-woo-card-wrapper .bd-woo-badge {
	position: absolute;
	top: 14px;
	z-index: 2;
	padding: 5px 12px;
	font-size: 11px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	color: #ffffff;
	border-radius: 999px;
	line-height: 1;
}

.bd-woo-card-wrapper .bd-woo-badge--sale {
	left: 14px;
	background-color: var(--bd-accent);
}

.bd-woo-card-wrapper .bd-woo-badge--stock {
	right: 14px;
	background-color: #6b7280;
}

/* ----------------------------------------------------------------------------
   Body
---------------------------------------------------------------------------- */
.bd-woo-card-wrapper .bd-woo-product-body {
	display: flex;
	flex-direction: column;
	gap: 10px;
	padding: 20px 22px 24px;
	/* Grow to fill equal-height cards so the button can pin to the bottom. */
	flex: 1 1 auto;
}

.bd-woo-card-wrapper .bd-woo-product-cat {
	font-size: 12px;
	font-weight: 700;
	letter-spacing: 0.08em;
	text-transform: uppercase;
	color: var(--bd-accent);
}

.bd-woo-card-wrapper .bd-woo-product-title {
	margin: 0;
	font-size: 19px;
	font-weight: 700;
	line-height: 1.3;
}

.bd-woo-card-wrapper .bd-woo-product-title a {
	color: #0f1117;
	text-decoration: none;
}

.bd-woo-card-wrapper .bd-woo-product-title a:hover {
	color: var(--bd-accent);
}

.bd-woo-card-wrapper .bd-woo-product-rating {
	font-size: 14px;
	line-height: 1;
}

.bd-woo-card-wrapper .bd-woo-product-price {
	font-size: 20px;
	font-weight: 800;
	color: #0f1117;
}

.bd-woo-card-wrapper .bd-woo-product-price del {
	margin-right: 6px;
	font-weight: 500;
	color: #9ca3af;
}

.bd-woo-card-wrapper .bd-woo-product-price ins {
	text-decoration: none;
}

/* ----------------------------------------------------------------------------
   Button
---------------------------------------------------------------------------- */
.bd-woo-card-wrapper .bd-woo-product-button {
	/* Pin to the bottom so buttons line up across cards of equal height. */
	margin-top: auto;
	padding-top: 6px;
}

.bd-woo-card-wrapper .bd-woo-product-button .button,
.bd-woo-card-wrapper .bd-woo-product-button .added_to_cart {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 100%;
	min-height: 52px;
	padding: 14px 20px;
	font-size: 14px;
	font-weight: 700;
	letter-spacing: 0.04em;
	text-transform: uppercase;
	text-decoration: none;
	color: #ffffff;
	background-color: var(--bd-button-bg);
	border: none;
	border-radius: 999px;
	cursor: pointer;
	transition: background-color 0.3s ease, transform 0.2s ease, box-shadow 0.3s ease;
}

.bd-woo-card-wrapper .bd-woo-product-button .button:hover,
.bd-woo-card-wrapper .bd-woo-product-button .button:focus-visible {
	background-color: var(--bd-button-hover-bg);
	box-shadow: var(--bd-button-glow);
	transform: translateY(-1px);
}

/* "Added to cart" secondary link sits below the main button when present. */
.bd-woo-card-wrapper .bd-woo-product-button .added_to_cart {
	margin-top: 10px;
	background-color: var(--bd-accent);
}

.bd-woo-card-wrapper .bd-woo-product-button .button.loading {
	opacity: 0.75;
	pointer-events: none;
}

/* ----------------------------------------------------------------------------
   States
---------------------------------------------------------------------------- */
.bd-woo-card-wrapper .bd-out-of-stock .bd-woo-product-image img {
	filter: grayscale(0.35) drop-shadow(0 18px 22px rgba(15, 17, 23, 0.12));
}

/* ----------------------------------------------------------------------------
   Accessibility — focus states
---------------------------------------------------------------------------- */
.bd-woo-card-wrapper a:focus-visible,
.bd-woo-card-wrapper .button:focus-visible {
	outline: 3px solid var(--bd-accent);
	outline-offset: 2px;
}

/* ----------------------------------------------------------------------------
   Responsive
---------------------------------------------------------------------------- */
@media (max-width: 1024px) {
	.bd-woo-card-wrapper .bd-woo-product-media {
		height: 260px;
		padding: 22px;
	}
}

@media (max-width: 600px) {
	.bd-woo-card-wrapper .bd-woo-product-media {
		height: 230px;
		padding: 18px;
	}
	.bd-woo-card-wrapper .bd-woo-product-body {
		padding: 16px 16px 20px;
	}
	.bd-woo-card-wrapper .bd-woo-product-title {
		font-size: 17px;
	}
	.bd-woo-card-wrapper .bd-woo-product-button .button,
	.bd-woo-card-wrapper .bd-woo-product-button .added_to_cart {
		min-height: 48px;
	}
}

/* ----------------------------------------------------------------------------
   Reduced motion
---------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
	.bd-woo-card-wrapper .bd-float-on .bd-woo-product-image {
		animation: none;
	}
	.bd-woo-card-wrapper .bd-woo-product-card,
	.bd-woo-card-wrapper .bd-woo-product-image img,
	.bd-woo-card-wrapper .bd-woo-product-button .button {
		transition: none;
	}
	.bd-woo-card-wrapper .bd-woo-product-card:hover {
		transform: none;
	}
	.bd-woo-card-wrapper .bd-woo-product-card:hover .bd-woo-product-image img {
		transform: none;
	}
}
