/**
 * UltraBuilder Loop Builder Widget Styles
 */

/* Main Container */
.ehfa-loop-widget-wrapper {
	width: 100%;
	position: relative;
	box-sizing: border-box;
}

.ehfa-loop-container {
	display: grid;
	width: 100%;
	box-sizing: border-box;
}

/* Grid Layout */
.ehfa-loop-container.ehfa-layout-grid {
	display: grid;
}

/* List Layout (Horizontal Cards) */
.ehfa-loop-container.ehfa-layout-list {
	display: flex;
	flex-direction: column;
}

.ehfa-loop-container.ehfa-layout-list .ehfa-loop-item {
	display: flex;
	flex-direction: row;
	align-items: stretch;
}

.ehfa-loop-container.ehfa-layout-list .ehfa-card-media {
	flex: 0 0 35%;
	max-width: 35%;
}

.ehfa-loop-container.ehfa-layout-list .ehfa-card-content {
	flex: 1 1 auto;
}

@media (max-width: 767px) {
	.ehfa-loop-container.ehfa-layout-list .ehfa-loop-item {
		flex-direction: column;
	}
	.ehfa-loop-container.ehfa-layout-list .ehfa-card-media {
		flex: 1 1 auto;
		max-width: 100%;
	}
}

/* Masonry Layout */
.ehfa-loop-container.ehfa-layout-masonry {
	display: block;
	column-count: 3;
	column-gap: 24px;
}

.ehfa-loop-container.ehfa-layout-masonry .ehfa-loop-item {
	break-inside: avoid;
	margin-bottom: 24px;
	display: inline-block;
	width: 100%;
}

@media (max-width: 1024px) {
	.ehfa-loop-container.ehfa-layout-masonry {
		column-count: 2;
	}
}

@media (max-width: 767px) {
	.ehfa-loop-container.ehfa-layout-masonry {
		column-count: 1;
	}
}

/* Loop Item Card */
.ehfa-loop-item {
	position: relative;
	display: flex;
	flex-direction: column;
	background-color: #ffffff;
	border-radius: 8px;
	overflow: hidden;
	transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1), box-shadow 0.3s cubic-bezier(0.16, 1, 0.3, 1), border-color 0.2s ease, background-color 0.2s ease;
	box-sizing: border-box;
}

/* Equal Height */
.ehfa-equal-height-yes .ehfa-loop-item {
	height: 100%;
}

.ehfa-equal-height-yes .ehfa-card-content {
	display: flex;
	flex-direction: column;
	flex-grow: 1;
}

.ehfa-equal-height-yes .ehfa-loop-btn-wrap {
	margin-top: auto;
}

/* Hover Lift Effect */
.ehfa-hover-lift-yes .ehfa-loop-item:hover {
	transform: translateY(-5px);
}

/* Media / Featured Image */
.ehfa-card-media {
	position: relative;
	overflow: hidden;
	width: 100%;
	line-height: 0;
}

.ehfa-card-media a {
	display: block;
	width: 100%;
	height: 100%;
}

.ehfa-loop-img {
	width: 100%;
	height: 220px;
	object-fit: cover;
	display: block;
	transition: transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}

.ehfa-card-media.ehfa-has-zoom:hover .ehfa-loop-img {
	transform: scale(1.06);
}

/* Overlay Badge on Media */
.ehfa-terms-badge-wrap.ehfa-badge-overlay {
	position: absolute;
	top: 14px;
	left: 14px;
	z-index: 2;
	display: flex;
	gap: 6px;
}

.ehfa-badge-overlay .ehfa-term-badge {
	box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
	backdrop-filter: blur(4px);
}

/* Card Content Area */
.ehfa-card-content {
	padding: 20px;
	box-sizing: border-box;
}

/* Title */
.ehfa-loop-title {
	margin: 0 0 10px 0;
	font-size: 20px;
	font-weight: 700;
	line-height: 1.35;
	color: #1f2937;
}

.ehfa-loop-title a {
	color: inherit;
	text-decoration: none;
	transition: color 0.2s ease;
}

/* Meta */
.ehfa-loop-meta {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 8px;
	font-size: 13px;
	color: #6b7280;
	margin-bottom: 12px;
}

.ehfa-meta-item {
	display: inline-flex;
	align-items: center;
	gap: 4px;
}

.ehfa-meta-item .dashicons {
	font-size: 14px;
	width: 14px;
	height: 14px;
	line-height: 14px;
	color: #9ca3af;
}

.ehfa-meta-sep {
	opacity: 0.6;
}

/* Excerpt */
.ehfa-loop-excerpt {
	margin-bottom: 16px;
	color: #4b5563;
	font-size: 14px;
	line-height: 1.6;
}

.ehfa-loop-excerpt p {
	margin: 0;
}

/* Terms Badge */
.ehfa-terms-badge-wrap {
	display: flex;
	flex-wrap: wrap;
	gap: 6px;
	margin-bottom: 10px;
}

.ehfa-term-badge {
	display: inline-block;
	font-size: 11px;
	font-weight: 600;
	text-transform: uppercase;
	letter-spacing: 0.5px;
	padding: 4px 10px;
	border-radius: 20px;
	background-color: #eff6ff;
	color: #2563eb;
	text-decoration: none;
}

.ehfa-term-badge a {
	color: inherit;
	text-decoration: none;
}

/* Read More Button */
.ehfa-loop-btn-wrap {
	margin-top: 10px;
}

.ehfa-loop-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 6px;
	background-color: #3b82f6;
	color: #ffffff;
	font-size: 14px;
	font-weight: 600;
	padding: 8px 18px;
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.2s ease;
	border: none;
	cursor: pointer;
}

.ehfa-loop-btn:hover {
	background-color: #2563eb;
	color: #ffffff;
	transform: translateY(-1px);
}

/* Custom Field item */
.ehfa-custom-field-item {
	font-size: 14px;
	font-weight: 600;
	color: #111827;
	margin-bottom: 8px;
}

/* WooCommerce Elements */
.ehfa-wc-price-wrap {
	margin-bottom: 12px;
	font-size: 16px;
	font-weight: 700;
	color: #059669;
}

.ehfa-wc-cart-wrap {
	margin-top: 10px;
}

/* Divider */
.ehfa-loop-divider.ehfa-divider-line {
	width: 100%;
	height: 1px;
	background-color: #e5e7eb;
	margin: 14px 0;
}

.ehfa-loop-divider.ehfa-divider-spacer {
	width: 100%;
	height: 15px;
}

/* Pagination */
.ehfa-pagination-wrap {
	display: flex;
	justify-content: center;
	align-items: center;
	margin-top: 36px;
	width: 100%;
}

.ehfa-pagination {
	display: flex;
	align-items: center;
	gap: 6px;
	flex-wrap: wrap;
}

.ehfa-pagination .page-numbers {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 38px;
	height: 38px;
	padding: 0 12px;
	font-size: 14px;
	font-weight: 600;
	color: #374151;
	background-color: #f3f4f6;
	border-radius: 6px;
	text-decoration: none;
	transition: all 0.2s ease;
}

.ehfa-pagination .page-numbers.current,
.ehfa-pagination .page-numbers:hover {
	background-color: #3b82f6;
	color: #ffffff;
}

.ehfa-pagination .page-numbers.dots {
	background: transparent;
	color: #9ca3af;
}

/* Load More Button */
.ehfa-load-more-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	font-size: 15px;
	font-weight: 600;
	padding: 12px 28px;
	background-color: #3b82f6;
	color: #ffffff;
	border: none;
	border-radius: 8px;
	cursor: pointer;
	transition: all 0.2s ease;
	box-shadow: 0 2px 6px rgba(59, 130, 246, 0.25);
}

.ehfa-load-more-btn:hover {
	background-color: #2563eb;
	box-shadow: 0 4px 12px rgba(37, 99, 235, 0.35);
}

.ehfa-load-more-btn.is-loading {
	opacity: 0.75;
	pointer-events: none;
}

.ehfa-spinner {
	width: 16px;
	height: 16px;
	border: 2px solid rgba(255, 255, 255, 0.3);
	border-top-color: #ffffff;
	border-radius: 50%;
	animation: ehfa-spin 0.8s linear infinite;
	display: inline-block;
}

@keyframes ehfa-spin {
	to {
		transform: rotate(360deg);
	}
}

/* No posts found */
.ehfa-no-posts-found {
	padding: 40px 20px;
	text-align: center;
	background: #f9fafb;
	border: 1px dashed #d1d5db;
	border-radius: 8px;
	color: #6b7280;
	font-size: 15px;
}
