/**
 * Blossom Product Grid Widget - Stylesheet
 * Version: 1.0.0
 */

/* =========================================================
   CSS Custom Properties
   ========================================================= */
:root {
	--bpw-primary:       #2e7d32;
	--bpw-primary-dark:  #1b5e20;
	--bpw-dark:          #111111;
	--bpw-gray-100:      #f5f5f5;
	--bpw-gray-200:      #eeeeee;
	--bpw-gray-400:      #bdbdbd;
	--bpw-gray-600:      #757575;
	--bpw-white:         #ffffff;
	--bpw-shadow-sm:     0 2px 8px rgba(0, 0, 0, 0.08);
	--bpw-shadow-md:     0 8px 24px rgba(0, 0, 0, 0.12);
	--bpw-shadow-hover:  0 16px 40px rgba(46, 125, 50, 0.18);
	--bpw-transition:    all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
	--bpw-radius-card:   12px;
	--bpw-radius-btn:    6px;
	--bpw-font-stack:    'Poppins', 'Segoe UI', system-ui, -apple-system, sans-serif;
}

/* =========================================================
   Widget Wrapper
   ========================================================= */
.bpw-widget-wrapper {
	width: 100%;
	font-family: var(--bpw-font-stack);
}

/* =========================================================
   Product Grid
   ========================================================= */
.bpw-product-grid {
	display: grid;
	grid-template-columns: repeat(4, 1fr);
	gap: 24px;
	width: 100%;
	align-items: stretch;
}

/* No products message */
.bpw-no-products {
	grid-column: 1 / -1;
	text-align: center;
	color: var(--bpw-gray-600);
	font-size: 1rem;
	padding: 40px 0;
}

/* =========================================================
   Product Card
   ========================================================= */
.bpw-product-card {
	background-color: var(--bpw-white);
	border-radius: var(--bpw-radius-card);
	overflow: hidden;
	box-shadow: var(--bpw-shadow-sm);
	display: flex;
	flex-direction: column;
	height: 100%;
	transition: var(--bpw-transition);
}

.bpw-product-card:hover {
	box-shadow: var(--bpw-shadow-hover);
	transform: translateY(-4px);
}

/* Card link */
.bpw-card-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

.bpw-card-link:hover,
.bpw-card-link:focus {
	text-decoration: none;
	color: inherit;
	outline: none;
}

/* =========================================================
   Card Image
   ========================================================= */
.bpw-card-image-wrap {
	position: relative;
	width: 100%;
	height: 220px;
	overflow: hidden;
	border-radius: 12px 12px 0 0;
	background-color: var(--bpw-gray-100);
	flex-shrink: 0;
}

.bpw-card-image {
	width: 100%;
	height: 100%;
	object-fit: cover;
	object-position: center;
	display: block;
	transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1);
	border-radius: 12px 12px 0 0;
}

.bpw-product-card:hover .bpw-card-image {
	transform: scale(1.06);
}

/* Subtle overlay on hover */
.bpw-card-overlay {
	position: absolute;
	inset: 0;
	background: linear-gradient(
		to bottom,
		transparent 50%,
		rgba(17, 17, 17, 0.08) 100%
	);
	opacity: 0;
	transition: var(--bpw-transition);
	pointer-events: none;
}

.bpw-product-card:hover .bpw-card-overlay {
	opacity: 1;
}

/* =========================================================
   Card Body
   ========================================================= */
.bpw-card-body {
	padding: 18px 20px 20px;
	display: flex;
	flex-direction: column;
	flex-grow: 1;
	gap: 14px;
	align-items: flex-start;
}

/* =========================================================
   Product Title
   ========================================================= */
.bpw-card-title {
	margin: 0;
	font-size: 0.975rem;
	font-weight: 600;
	line-height: 1.4;
	color: var(--bpw-dark);
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
	transition: color 0.25s ease;
	letter-spacing: -0.01em;
}

.bpw-product-card:hover .bpw-card-title {
	color: var(--bpw-primary);
}

/* =========================================================
   Read More Button
   ========================================================= */
.bpw-read-more-btn {
	display: inline-flex;
	align-items: center;
	gap: 6px;
	padding: 10px 20px;
	background-color: var(--bpw-primary);
	color: var(--bpw-white);
	font-size: 0.825rem;
	font-weight: 600;
	font-family: var(--bpw-font-stack);
	border-radius: var(--bpw-radius-btn);
	transition: var(--bpw-transition);
	cursor: pointer;
	letter-spacing: 0.02em;
	text-transform: uppercase;
	margin-top: auto;
	white-space: nowrap;
}

.bpw-read-more-btn:hover {
	background-color: var(--bpw-primary-dark);
	transform: translateX(2px);
}

/* Arrow icon in button */
.bpw-btn-arrow {
	transition: transform 0.25s ease;
	flex-shrink: 0;
}

.bpw-read-more-btn:hover .bpw-btn-arrow {
	transform: translateX(3px);
}

/* =========================================================
   Load More Section
   ========================================================= */
.bpw-load-more-wrap {
	display: flex;
	flex-direction: column;
	align-items: center;
	justify-content: center;
	margin-top: 40px;
	gap: 16px;
}

.bpw-load-more-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	padding: 14px 40px;
	background-color: transparent;
	color: var(--bpw-primary);
	border: 2px solid var(--bpw-primary);
	border-radius: var(--bpw-radius-btn);
	font-family: var(--bpw-font-stack);
	font-size: 0.9rem;
	font-weight: 600;
	letter-spacing: 0.03em;
	text-transform: uppercase;
	cursor: pointer;
	transition: var(--bpw-transition);
	position: relative;
	overflow: hidden;
}

.bpw-load-more-btn::before {
	content: '';
	position: absolute;
	inset: 0;
	background-color: var(--bpw-primary);
	transform: scaleX(0);
	transform-origin: left;
	transition: transform 0.3s ease;
	z-index: 0;
}

.bpw-load-more-btn:hover::before {
	transform: scaleX(1);
}

.bpw-load-more-btn span {
	position: relative;
	z-index: 1;
}

.bpw-load-more-btn:hover {
	color: var(--bpw-white);
	border-color: var(--bpw-primary);
}

.bpw-load-more-btn:disabled,
.bpw-load-more-btn.bpw-disabled {
	opacity: 0.5;
	cursor: not-allowed;
	pointer-events: none;
}

.bpw-load-more-btn:focus-visible {
	outline: 2px solid var(--bpw-primary);
	outline-offset: 3px;
}

/* =========================================================
   Loading Spinner
   ========================================================= */
.bpw-spinner {
	display: none;
	align-items: center;
	justify-content: center;
	gap: 6px;
}

.bpw-spinner.bpw-visible {
	display: flex;
}

.bpw-spinner span {
	display: block;
	width: 9px;
	height: 9px;
	border-radius: 50%;
	background-color: var(--bpw-primary);
	animation: bpwBounce 1.1s infinite ease-in-out both;
}

.bpw-spinner span:nth-child(1) { animation-delay: -0.32s; }
.bpw-spinner span:nth-child(2) { animation-delay: -0.16s; }
.bpw-spinner span:nth-child(3) { animation-delay: 0s; }

@keyframes bpwBounce {
	0%, 80%, 100% {
		transform: scale(0.6);
		opacity: 0.4;
	}
	40% {
		transform: scale(1);
		opacity: 1;
	}
}

/* =========================================================
   Card Entrance Animation
   ========================================================= */
.bpw-product-card {
	animation: bpwFadeInUp 0.4s ease both;
}

@keyframes bpwFadeInUp {
	from {
		opacity: 0;
		transform: translateY(16px);
	}
	to {
		opacity: 1;
		transform: translateY(0);
	}
}

/* Stagger incoming AJAX cards */
.bpw-product-card.bpw-incoming {
	animation: bpwFadeInUp 0.35s ease both;
}

.bpw-product-card.bpw-incoming:nth-child(1)  { animation-delay: 0.00s; }
.bpw-product-card.bpw-incoming:nth-child(2)  { animation-delay: 0.05s; }
.bpw-product-card.bpw-incoming:nth-child(3)  { animation-delay: 0.10s; }
.bpw-product-card.bpw-incoming:nth-child(4)  { animation-delay: 0.15s; }
.bpw-product-card.bpw-incoming:nth-child(5)  { animation-delay: 0.20s; }

/* =========================================================
   Responsive: Tablet
   ========================================================= */
@media (max-width: 1024px) {
	.bpw-product-grid {
		grid-template-columns: repeat(2, 1fr);
	}
}

/* =========================================================
   Responsive: Mobile
   ========================================================= */
@media (max-width: 767px) {
	.bpw-product-grid {
		grid-template-columns: 1fr;
	}

	.bpw-card-image-wrap {
		height: 200px;
	}

	.bpw-load-more-btn {
		width: 100%;
		max-width: 320px;
	}
}

/* =========================================================
   Elementor Editor Compatibility
   ========================================================= */
.elementor-widget-bpw-product-grid .bpw-product-card {
	height: 100%;
}

/* Google Fonts: Poppins is loaded via enqueue or Elementor's font system */
