/* 九块九京东助手 — 商品卡片样式 v1.0.0（与 Blocksy 主题兼容，不依赖页面构建器） */

/* ---------- 单张卡片（横向，文章内用） ---------- */
.jd-product-card {
	display: flex;
	gap: 18px;
	border: 1px solid #eceef1;
	border-radius: 16px;
	padding: 18px;
	margin: 1.2em 0;
	background: #fff;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 16px rgba(15, 23, 42, 0.05);
	transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.jd-product-card:hover {
	box-shadow: 0 2px 4px rgba(15, 23, 42, 0.06), 0 10px 28px rgba(15, 23, 42, 0.1);
	transform: translateY(-2px);
}

.jd-product-card__img {
	flex: 0 0 132px;
	width: 132px;
}

.jd-product-card__img img {
	width: 132px;
	height: 132px;
	object-fit: cover;
	border-radius: 12px;
	display: block;
}

.jd-product-card__body {
	flex: 1;
	min-width: 0;
}

.jd-product-card__title {
	font-size: 17px;
	font-weight: 600;
	line-height: 1.5;
	margin: 0 0 8px;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

.jd-product-card__title a {
	color: #1e293b;
	text-decoration: none;
}

.jd-product-card__title a:hover {
	color: #e11d48;
}

.jd-product-card__price {
	display: flex;
	align-items: baseline;
	gap: 10px;
	flex-wrap: wrap;
	margin: 0 0 6px;
}

.jd-product-card__final {
	font-size: 26px;
	font-weight: 800;
	color: #e11d48;
	line-height: 1.2;
}

.jd-product-card__final small {
	font-size: 13px;
	font-weight: 600;
	margin-right: 2px;
}

.jd-product-card__orig {
	font-size: 14px;
	color: #94a3b8;
	text-decoration: line-through;
}

.jd-product-card__coupon {
	display: inline-block;
	font-size: 12px;
	font-weight: 600;
	color: #ea580c;
	background: #fff7ed;
	border: 1px dashed #fb923c;
	border-radius: 6px;
	padding: 2px 8px;
}

.jd-product-card__meta {
	font-size: 13px;
	color: #64748b;
	margin: 0 0 12px;
}

.jd-product-card__actions {
	display: flex;
	align-items: center;
	gap: 10px;
	flex-wrap: wrap;
	margin: 0;
}

.jd-product-card__btn {
	display: inline-block;
	background: linear-gradient(135deg, #ff6a00, #f43f5e);
	color: #fff !important;
	font-size: 15px;
	font-weight: 700;
	padding: 10px 26px;
	border-radius: 999px;
	text-decoration: none;
	box-shadow: 0 4px 12px rgba(244, 63, 94, 0.3);
}

.jd-product-card__btn:hover {
	color: #fff;
	filter: brightness(1.06);
}

.jd-product-card__copy {
	background: #fff;
	color: #334155;
	border: 1px solid #e2e8f0;
	font-size: 14px;
	font-weight: 600;
	padding: 9px 18px;
	border-radius: 999px;
	cursor: pointer;
}

.jd-product-card__copy:hover {
	border-color: #f43f5e;
	color: #e11d48;
}

.jd-product-card__copy:disabled {
	opacity: 0.6;
	cursor: default;
}

.jd-product-card__detail-link {
	font-size: 13px;
	margin: 10px 0 0;
}

.jd-product-card__detail-link a {
	color: #64748b;
	text-decoration: none;
}

.jd-product-card__detail-link a:hover {
	color: #e11d48;
}

/* ---------- 商品网格（纵向卡片，首页用） ---------- */
.jd-product-grid {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 18px;
	margin: 1em 0;
}

.jd-product-grid .jd-product-card--grid {
	flex-direction: column;
	gap: 0;
	padding: 0;
	margin: 0;
	overflow: hidden;
}

.jd-product-grid .jd-product-card--grid .jd-product-card__img {
	flex: none;
	width: 100%;
}

.jd-product-grid .jd-product-card--grid .jd-product-card__img img {
	width: 100%;
	height: auto;
	aspect-ratio: 1 / 1;
	border-radius: 0;
}

.jd-product-grid .jd-product-card--grid .jd-product-card__body {
	padding: 14px 14px 16px;
	display: flex;
	flex-direction: column;
}

.jd-product-grid .jd-product-card--grid .jd-product-card__title {
	font-size: 15px;
}

.jd-product-grid .jd-product-card--grid .jd-product-card__final {
	font-size: 22px;
}

.jd-product-grid .jd-product-card--grid .jd-product-card__actions {
	margin-top: auto;
}

.jd-product-grid .jd-product-card--grid .jd-product-card__btn {
	flex: 1;
	text-align: center;
	padding: 9px 10px;
	font-size: 14px;
}

.jd-product-grid .jd-product-card--grid .jd-product-card__copy {
	flex: 1;
	padding: 8px 6px;
	font-size: 13px;
}

/* ---------- 筛选排序栏 ---------- */
.jd-filter-bar {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 12px;
	flex-wrap: wrap;
	margin: 0 0 16px;
}

.jd-filter-bar__cats {
	display: flex;
	gap: 8px;
	flex-wrap: wrap;
}

.jd-filter-pill {
	display: inline-block;
	font-size: 14px;
	color: #334155;
	background: #f8fafc;
	border: 1px solid #e2e8f0;
	border-radius: 999px;
	padding: 6px 16px;
	text-decoration: none;
}

.jd-filter-pill:hover {
	border-color: #f43f5e;
	color: #e11d48;
}

.jd-filter-pill.is-active {
	background: #1e293b;
	border-color: #1e293b;
	color: #fff;
}

.jd-filter-bar__sorts {
	display: flex;
	gap: 14px;
}

.jd-filter-sort {
	font-size: 14px;
	color: #64748b;
	text-decoration: none;
}

.jd-filter-sort:hover {
	color: #e11d48;
}

.jd-filter-sort.is-active {
	color: #e11d48;
	font-weight: 700;
}

/* ---------- 详情图集 ---------- */
.jd-product-gallery {
	display: flex;
	flex-direction: column;
	gap: 16px;
	margin: 1.2em 0;
}

.jd-product-gallery__item {
	display: block;
}

.jd-product-gallery__item img {
	width: 100%;
	height: auto;
	border-radius: 12px;
	display: block;
	border: 1px solid #eceef1;
}

/* ---------- 搜索框按钮：防止“搜索”两字竖排换行 ---------- */
.wp-block-search__button {
	white-space: nowrap;
	flex: none;
}

/* ---------- 商品搜索框（v2.0.21 新增，首页 [jjj_search] 用） ---------- */
/* 圆角搜索条 + 品牌渐变按钮，与筛选 pill、领券购买按钮同风格；
   聚焦时边框变玫红并带柔和光圈。 */
.jd-search {
	margin: 0 0 28px;
}

.jd-search__label {
	display: block;
	font-size: 19px;
	font-weight: 700;
	color: #1e293b;
	margin: 0 0 12px;
}

.jd-search__bar {
	display: flex;
	background: #fff;
	border: 1.5px solid #e2e8f0;
	border-radius: 999px;
	overflow: hidden;
	box-shadow: 0 1px 2px rgba(15, 23, 42, 0.05), 0 4px 16px rgba(15, 23, 42, 0.05);
	transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.jd-search__bar:focus-within {
	border-color: #f43f5e;
	box-shadow: 0 0 0 4px rgba(244, 63, 94, 0.12), 0 4px 16px rgba(15, 23, 42, 0.06);
}

.jd-search__input {
	flex: 1;
	min-width: 0;
	border: 0;
	outline: 0;
	background: transparent;
	padding: 14px 8px 14px 22px;
	font-size: 16px;
	color: #1e293b;
}

.jd-search__input::placeholder {
	color: #94a3b8;
}

.jd-search__btn {
	flex: none;
	border: 0;
	cursor: pointer;
	background: linear-gradient(135deg, #ff6a00, #f43f5e);
	color: #fff;
	font-size: 16px;
	font-weight: 700;
	padding: 0 32px;
}

.jd-search__btn:hover {
	filter: brightness(1.06);
}

/* 搜索结果提示行：找到 N 件 + 清除搜索 */
.jd-search-status {
	font-size: 14px;
	color: #64748b;
	margin: 0 0 16px;
}

.jd-search-status a {
	color: #e11d48;
	font-weight: 600;
	text-decoration: none;
}

.jd-search-status a:hover {
	text-decoration: underline;
}

/* ---------- 相关产品 ---------- */
.jd-related {
	margin: 2em 0 1em;
}

.jd-related__title {
	font-size: 19px;
	font-weight: 700;
	margin: 0 0 14px;
}

/* ---------- 复制链接提示 ---------- */
.jd-toast {
	position: fixed;
	left: 50%;
	bottom: 28px;
	transform: translateX(-50%) translateY(8px);
	background: rgba(15, 23, 42, 0.92);
	color: #fff;
	font-size: 14px;
	padding: 11px 20px;
	border-radius: 999px;
	opacity: 0;
	pointer-events: none;
	transition: opacity 0.2s ease, transform 0.2s ease;
	z-index: 9999;
	max-width: 90vw;
	text-align: center;
}

.jd-toast.is-visible {
	opacity: 1;
	transform: translateX(-50%) translateY(0);
}

/* ---------- 移动端 ---------- */
@media (max-width: 960px) {
	.jd-product-grid {
		grid-template-columns: repeat(3, minmax(0, 1fr));
	}
}

@media (max-width: 640px) {
	.jd-product-grid {
		grid-template-columns: repeat(2, minmax(0, 1fr));
		gap: 12px;
	}

	.jd-search__label {
		font-size: 17px;
		margin-bottom: 10px;
	}

	.jd-search__input {
		padding: 12px 6px 12px 16px;
		font-size: 15px;
	}

	.jd-search__btn {
		padding: 0 20px;
		font-size: 15px;
	}

	.jd-product-card--single {
		flex-direction: column;
	}

	.jd-product-card--single .jd-product-card__img {
		flex: none;
		width: 100%;
	}

	.jd-product-card--single .jd-product-card__img img {
		width: 100%;
		height: auto;
		aspect-ratio: 1 / 1;
	}
}

/* ---------- 商品分类归档页（v2.0.15 新增） ---------- */
.jd-tax-archive {
	max-width: 1200px;
	margin: 0 auto;
	padding: 40px 20px 60px;
}

.jd-tax-archive__title {
	font-size: 28px;
	margin: 0 0 24px;
}

.jd-tax-archive__desc {
	color: #64748b;
	margin: -12px 0 24px;
}

/* ---------- 归档页分页 ---------- */
.jd-pagination {
	margin-top: 28px;
	text-align: center;
}

.jd-pagination .page-numbers {
	display: inline-flex;
	flex-wrap: wrap;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.jd-pagination .page-numbers a,
.jd-pagination .page-numbers span {
	display: inline-block;
	min-width: 36px;
	padding: 8px 12px;
	border: 1px solid #e2e8f0;
	border-radius: 8px;
	color: #334155;
	text-decoration: none;
	background: #fff;
}

.jd-pagination .page-numbers a:hover {
	border-color: #e11d48;
	color: #e11d48;
}

.jd-pagination .page-numbers.current {
	background: #e11d48;
	border-color: #e11d48;
	color: #fff;
}


/* ---------- 京东角标 ---------- */
.jd-product-card__img {
	position: relative;
}

.jd-product-card__badge {
	position: absolute;
	left: 8px;
	top: 8px;
	background: #e1251b;
	color: #fff;
	font-size: 12px;
	font-weight: 700;
	line-height: 1;
	padding: 5px 9px;
	border-radius: 999px;
	box-shadow: 0 2px 6px rgba(225, 37, 27, 0.4);
}
