/**
 * 借貸刊登小工具樣式
 */

.loans-filter-widget {
	width: 100%;
}

/* 結果區域樣式 */
.loans-filter-results {
	margin-top: 0px;
	position: relative;
}

/* 載入狀態 */
.loans-loading {
	text-align: center;
	padding: 40px 20px;
}

.loans-loading-spinner {
	border: 4px solid #f3f3f3;
	border-top: 4px solid #0073aa;
	border-radius: 50%;
	width: 40px;
	height: 40px;
	animation: spin 1s linear infinite;
	margin: 0 auto 15px;
}

@keyframes spin {
	0% { transform: rotate(0deg); }
	100% { transform: rotate(360deg); }
}

.loans-loading p {
	margin: 0;
	color: #666;
	font-size: 14px;
}

.loans-list {
	display: grid;
	gap: 20px;
}

/* 響應式欄位數量 - 桌面版 */
.elementor-columns-1 .loans-list {
	grid-template-columns: repeat(1, 1fr);
}

.elementor-columns-2 .loans-list {
	grid-template-columns: repeat(2, 1fr);
}

.elementor-columns-3 .loans-list {
	grid-template-columns: repeat(3, 1fr);
}

.elementor-columns-4 .loans-list {
	grid-template-columns: repeat(4, 1fr);
}

.elementor-columns-5 .loans-list {
	grid-template-columns: repeat(5, 1fr);
}

.elementor-columns-6 .loans-list {
	grid-template-columns: repeat(6, 1fr);
}

/* 平板版 */
@media (max-width: 1024px) {
	.elementor-columns-tablet-1 .loans-list {
		grid-template-columns: repeat(1, 1fr);
	}

	.elementor-columns-tablet-2 .loans-list {
		grid-template-columns: repeat(2, 1fr);
	}

	.elementor-columns-tablet-3 .loans-list {
		grid-template-columns: repeat(3, 1fr);
	}

	.elementor-columns-tablet-4 .loans-list {
		grid-template-columns: repeat(4, 1fr);
	}
}

/* 手機版 */
@media (max-width: 767px) {
	.elementor-columns-mobile-1 .loans-list {
		grid-template-columns: repeat(1, 1fr);
	}

	.elementor-columns-mobile-2 .loans-list {
		grid-template-columns: repeat(2, 1fr);
	}

	.elementor-columns-mobile-3 .loans-list {
		grid-template-columns: repeat(3, 1fr);
	}
}

.loans-item {
	background: #fff;
	border: 1px solid #e0e0e0;
	border-radius: 8px;
	overflow: hidden;
	transition: all 0.3s ease;
	display: flex;
	flex-direction: column;
	height: 100%;
}

.loans-item:hover {
	box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
	transform: translateY(-2px);
}

/*is top label*/
.loans-item-top{
	position: relative;
}
.loans-item-top:before {
	content: 'TOP';
    background-color: #9d0f0e;
    color: #fff;
    padding: 4px 12px;
    border-radius: 4px;
    font-size: 10px;
    font-weight: 500;
    position: absolute;
    top: 0px;
    right: 0px;
    z-index: 9;
}

/* 特色圖 */
.loans-thumbnail {
	width: 100%;
	overflow: hidden;
	position: relative;
	padding-top: 56.25%; /* 16:9 比例 */
	background: #f0f0f0;
}

.loans-thumbnail img {
	position: absolute;
	top: 0;
	left: 0;
	width: 100%;
	height: 100%;
	object-fit: cover;
	transition: transform 0.3s ease;
}

.loans-item:hover .loans-thumbnail img {
	transform: scale(1.05);
}

/* 整個 item 可點擊連結 */
.loans-item-link {
	display: flex;
	flex-direction: column;
	height: 100%;
	text-decoration: none;
	color: inherit;
}

/* 內容區域 */
.loans-content {
	padding: 20px;
	flex: 1;
	display: flex;
	flex-direction: column;
}

.loans-title {
	margin: 0 0 15px 0;
	font-size: 20px;
	line-height: 1.4;
	font-weight: 600;
	text-align: center;
	color: #333;
}

.loans-item-link:hover .loans-title {
	color: #0073aa;
}

/* Taxonomy Terms 標籤 */
.loans-terms {
	display: flex;
	flex-wrap: wrap;
	gap: 8px;
	margin-bottom: 15px;
}

.loans-term {
	display: inline-block;
	padding: 4px 12px;
	background-color: #f0f0f0;
	color: #666;
	border-radius: 4px;
	font-size: 12px;
	font-weight: 500;
	line-height: 1.5;
}

.loans-term-location {
	background-color: #e3f2fd;
	color: #1976d2;
}

.loans-term-category {
	background-color: #f3e5f5;
	color: #7b1fa2;
}

.loans-term-tag {
	background-color: #fff3e0;
	color: #e65100;
}

.loans-no-results {
	text-align: center;
	padding: 40px 20px;
	background: #f9f9f9;
	border-radius: 8px;
}

.loans-no-results p {
	margin: 0;
	font-size: 16px;
	color: #666;
}

/* 分頁樣式 */
.loans-pagination {
	margin-top: 30px;
	text-align: center;
}

.loans-pagination ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: inline-flex;
	flex-wrap: wrap;
	justify-content: center;
	gap: 5px;
}

.loans-pagination li {
	display: inline-block;
	margin: 0;
}

.loans-pagination .page-numbers {
	display: inline-block;
	padding: 8px 12px;
	border: none;
	border-radius: 4px;
	text-decoration: none;
	color: #333;
	background: #fff;
	transition: all 0.3s ease;
	cursor: pointer;
}

.loans-pagination .page-numbers:hover,
.loans-pagination .page-numbers.current {
	background-color: #9D3333;
	color: #fff;
	border-color: #9D3333;
}

.loans-pagination .page-numbers.dots {
	cursor: default;
	border: none;
	background: transparent;
}

.loans-pagination .page-numbers.dots:hover {
	background: transparent;
	color: #333;
}

/* 響應式設計 */
@media (max-width: 768px) {
	.loans-item {
		padding: 0;
	}

	.loans-content {
		padding: 15px;
	}

	.loans-title {
		font-size: 18px;
	}
	.loans-terms{
		gap: 4px;
		margin-bottom: 0px;
	}
	.loans-term {
		font-size: 11px;
		padding: 3px 5px;
	}
}
