/* ==========================================================================
   iPartsMall Child — 首页通用区块（Hero / Brands 之后的所有 section）
   对照基准：wp-site-prototype/index.html
   - .ns-sec / .ns-sec-soft / .ns-sec-head / .ns-kicker：通用区头
   - .ns-btn：通用按钮
   - .ns-products / .ns-why / .ns-ws / .ns-quotes / .ns-posts / .ns-faq / .ns-news
   ========================================================================== */

/* 首页自定义区块不受主题 content-size 约束，宽度统一交给 .ns-wrap（1200px）控制
   覆盖 WP 核心的 .is-layout-constrained > *{max-width:var(--wp--style--global--content-size)} */
.entry-content > .ns-sec,
.entry-content > .wp-block-group.ns-sec,
.entry-content > .ns-brands {
	max-width: none;
}

/* ---------- 通用区头 ---------- */
.ns-sec {
	padding: 72px 0;
}

.ns-sec-soft {
	background: var(--ns-bg-soft);
}

.ns-center {
	text-align: center;
}

.ns-sec-head {
	max-width: 660px;
	margin: 0 0 40px;
}

.ns-sec-head.center {
	margin-left: auto;
	margin-right: auto;
	text-align: center;
}

.ns-kicker {
	display: block;
	font-size: 12.5px;
	font-weight: 800;
	letter-spacing: 1.6px;
	text-transform: uppercase;
	color: var(--ns-brand);
}

.ns-sec-head h1,
.ns-sec-head h2 {
	font-size: clamp(26px, 3vw, 38px);
	letter-spacing: -1.1px;
	line-height: 1.16;
	margin: 12px 0;
	font-weight: 800;
	color: var(--ns-ink);
}

.ns-sec-head p {
	color: var(--ns-muted);
	font-size: 16.5px;
	margin: 0;
}

/* group 区块内部各子块的默认 gap 清掉，间距由组件自己控制 */
.ns-sec > * + * {
	margin-block-start: 0;
}

/* ---------- 通用按钮 ---------- */
.ns-btn {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	gap: 8px;
	border-radius: 11px;
	font-weight: 700;
	font-size: 15.5px;
	padding: 15px 26px;
	border: 1px solid transparent;
	cursor: pointer;
	transition: 0.18s;
	text-decoration: none;
}

.ns-btn-primary {
	background: var(--ns-brand);
	color: var(--ns-bg);
	box-shadow: 0 6px 18px rgba(29, 78, 216, 0.24);
}

.ns-btn-primary:hover {
	background: var(--ns-brand-hover);
	color: var(--ns-bg);
}

.ns-btn-outline {
	background: var(--ns-bg);
	color: var(--ns-ink);
	border-color: var(--ns-line);
}

.ns-btn-outline:hover {
	border-color: var(--ns-brand-2);
	color: var(--ns-brand);
}

/* ---------- 商品区（WooCommerce shortcode 输出，卡片按原型规格压缩） ----------
   原型卡规格：4 列 / gap 20 / 缩略图 4:3.1 / 圆角 22 / 标题 15px / 价格 20px / 加购键 38px  */
ul.products {
	display: grid !important;
	grid-template-columns: repeat(4, 1fr) !important;
	gap: 20px;
	max-width: var(--ns-max);
	margin: 0 auto;
	padding: 0;
	list-style: none;
}

ul.products li.product {
	display: flex;
	/* Blocksy 默认是 column，会让 align-self:flex-end 把价格/按钮推到右侧；
	   这里强制 row，配合各子项 width:100% 实现「整块换行 + 价格与按钮同一行靠左」 */
	flex-direction: row !important;
	flex-wrap: wrap;
	justify-content: flex-start;
	align-content: flex-start;
	background: var(--ns-bg);
	border: 1px solid var(--ns-line);
	border-radius: var(--ns-radius-lg);
	overflow: hidden;
	padding: 0 !important;
	margin: 0 !important;
	transition: 0.24s;
}

ul.products li.product:hover {
	transform: translateY(-5px);
	box-shadow: var(--ns-shadow-md);
	border-color: #c9dbfb;
}

/* 缩略图：统一 4:3.1，白底（multiply 让商品图白边与底色无缝融合） */
ul.products li.product > figure {
	order: 1;
	width: 100%;
	margin: 0;
	aspect-ratio: 4 / 3.1;
	background: var(--ns-bg);
	display: grid;
	place-items: center;
	overflow: hidden;
	border-bottom: 1px solid var(--ns-line);
}

ul.products li.product figure a {
	display: grid;
	place-items: center;
	width: 100%;
	height: 100%;
	/* Blocksy 默认 isolation:isolate 会把 img 的 multiply 混合隔离在链接内，
	   必须解掉，白底才能融进 figure 的浅蓝渐变 */
	isolation: auto !important;
}

ul.products li.product figure img {
	width: auto !important;
	height: auto !important;
	max-width: 78%;
	max-height: 84%;
	aspect-ratio: auto !important;
	object-fit: contain;
	margin: 0 auto;
	border-radius: 12px;
	/* 白底商品图融入浅蓝渐变：白色×底色=底色 */
	mix-blend-mode: multiply;
}

/* 标题 */
ul.products li.product .woocommerce-loop-product__title {
	order: 2;
	width: 100%;
	margin: 13px 0 0;
	padding: 0 16px;
	font-size: 15px;
	line-height: 1.35;
	font-weight: 700;
	display: -webkit-box;
	-webkit-line-clamp: 2;
	-webkit-box-orient: vertical;
	overflow: hidden;
}

ul.products li.product .woocommerce-loop-product__title a {
	color: var(--ns-ink);
}

/* 分类 chip（原型 .grade 那一行） */
ul.products li.product ul.entry-meta {
	order: 3;
	width: 100%;
	margin: 7px 0 0;
	padding: 0 16px;
	list-style: none;
}

ul.products li.product ul.entry-meta li {
	display: inline-flex;
	align-items: center;
	font-size: 11.5px;
	font-weight: 650;
	color: var(--ns-ink-2);
	background: var(--ns-bg-tint);
	border-radius: 6px;
	padding: 3px 8px;
}

ul.products li.product ul.entry-meta a {
	color: inherit;
}

/* 价格 + 加购键同一行，全部左对齐（与标题/类目同一条 16px 左边线） */
ul.products li.product > .price {
	order: 4;
	align-self: flex-end;
	margin: 14px 0 0;
	padding: 9px 0 0 16px;
	font-size: 20px;
	font-weight: 800;
	letter-spacing: -0.5px;
	color: var(--ns-ink);
}

ul.products li.product > .price del {
	font-size: 13px;
	font-weight: 600;
	color: var(--ns-muted);
}

ul.products li.product > .price ins {
	text-decoration: none;
}

ul.products li.product .ct-woo-card-actions {
	order: 5;
	align-self: flex-end;
	margin: 14px 0 0 12px;
	padding: 0;
}

/* Woo 的 aria 描述 span 会撑高按钮盒，隐藏掉保证与价格底边对齐 */
ul.products li.product .ct-woo-card-actions .screen-reader-text {
	display: none !important;
}

ul.products li.product a.add_to_cart_button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	height: 38px;
	padding: 0 18px;
	border-radius: 11px;
	border: 1px solid var(--ns-brand);
	background: var(--ns-brand);
	color: #fff;
	font-size: 13px;
	font-weight: 700;
	line-height: 1;
	transition: 0.18s;
	box-shadow: 0 6px 14px rgba(29, 78, 216, 0.18);
}

ul.products li.product a.add_to_cart_button:hover {
	background: #1e40af;
	border-color: #1e40af;
	color: #fff;
	transform: translateY(-1px);
}

.ns-products .ns-viewall {
	margin-top: 32px;
}

/* ---------- Why us ---------- */
.ns-why {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 22px;
}

.ns-box {
	background: var(--ns-bg);
	border: 1px solid var(--ns-line);
	border-radius: var(--ns-radius-lg);
	padding: 26px;
}

.ns-no {
	width: 40px;
	height: 40px;
	border-radius: 12px;
	background: linear-gradient(140deg, var(--ns-brand), #22d3ee);
	color: #fff;
	display: grid;
	place-items: center;
	font-weight: 900;
	font-size: 15px;
	margin-bottom: 15px;
}

.ns-box h3 {
	font-size: 17.5px;
	margin: 0 0 8px;
	letter-spacing: -0.3px;
	color: var(--ns-ink);
}

.ns-box p {
	font-size: 14.5px;
	color: var(--ns-muted);
	margin: 0;
}

/* ---------- Wholesale ---------- */
.ns-ws {
	background: linear-gradient(135deg, #0b2a6b, #1d4ed8 52%, #0e7490);
	border-radius: 26px;
	padding: 52px;
	color: #fff;
	display: grid;
	grid-template-columns: 1fr 1fr;
	gap: 48px;
	align-items: center;
	position: relative;
	overflow: hidden;
}

.ns-ws::after {
	content: "";
	position: absolute;
	width: 520px;
	height: 520px;
	border-radius: 50%;
	background: radial-gradient(circle, rgba(255, 255, 255, 0.14), transparent 65%);
	right: -150px;
	top: -190px;
}

/* 主题给标题定了颜色，会盖掉继承的白色，深色底上必须显式写死 */
.ns-ws h2 {
	color: #fff;
	font-size: clamp(26px, 3vw, 36px);
	letter-spacing: -1px;
	line-height: 1.16;
	margin: 0 0 14px;
}

.ns-ws h2 + p,
.ns-ws ul,
.ns-ws li {
	color: #e6eeff;
}

.ns-ws p {
	color: #d3e0ff;
	font-size: 16px;
	margin: 0 0 20px;
}

.ns-ws ul {
	list-style: none;
	padding: 0;
	margin: 0;
	display: grid;
	gap: 10px;
	font-size: 14.5px;
	color: #e6eeff;
}

.ns-ws li {
	display: flex;
	gap: 10px;
	align-items: center;
}

.ns-ws li::before {
	content: "";
	width: 17px;
	height: 17px;
	border-radius: 50%;
	background: rgba(255, 255, 255, 0.18);
	border: 1.5px solid rgba(255, 255, 255, 0.6);
	flex: none;
}

.ns-form {
	background: #fff;
	border-radius: 20px;
	padding: 26px;
	color: var(--ns-ink);
	position: relative;
	z-index: 1;
	box-shadow: var(--ns-shadow-lg);
}

.ns-form > h3 {
	font-size: 17px;
	margin: 0 0 5px;
}

.ns-form .ns-sub {
	font-size: 13px;
	color: var(--ns-muted);
	margin: 0 0 17px;
}

/* WPForms 塞进卡片后的微调 */
.ns-form .wpforms-container {
	margin: 0 !important;
}

.ns-form .wpforms-field-label {
	font-size: 12.5px !important;
	font-weight: 700 !important;
}

.ns-form input[type="text"],
.ns-form input[type="email"],
.ns-form textarea,
.ns-form select {
	border: 1px solid var(--ns-line) !important;
	border-radius: 10px !important;
	padding: 11px 13px !important;
	background: var(--ns-bg-soft) !important;
}

.ns-form .wpforms-submit-container {
	margin-top: 6px !important;
}

/* ---------- Testimonials ---------- */
.ns-quotes {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 22px;
}

.ns-q {
	background: var(--ns-bg);
	border: 1px solid var(--ns-line);
	border-radius: var(--ns-radius-lg);
	padding: 26px;
	display: flex;
	flex-direction: column;
	gap: 15px;
}

.ns-q .ns-st {
	color: var(--ns-warn);
	font-size: 14px;
	letter-spacing: 2px;
}

.ns-q p {
	font-size: 15px;
	color: var(--ns-ink-2);
	margin: 0;
	flex: 1;
}

.ns-q .ns-who {
	display: flex;
	align-items: center;
	gap: 12px;
	border-top: 1px solid var(--ns-line);
	padding-top: 15px;
}

.ns-q .ns-av {
	width: 40px;
	height: 40px;
	border-radius: 50%;
	background: var(--ns-brand-soft);
	color: var(--ns-brand);
	display: grid;
	place-items: center;
	font-weight: 800;
	font-size: 15px;
	flex: none;
}

.ns-q .ns-who b {
	font-size: 14px;
	display: block;
	color: var(--ns-ink);
}

.ns-q .ns-who span {
	font-size: 12.5px;
	color: var(--ns-muted);
}

/* ---------- Blog ---------- */
.ns-posts {
	display: grid;
	grid-template-columns: repeat(3, 1fr);
	gap: 22px;
}

.ns-post {
	border: 1px solid var(--ns-line);
	border-radius: var(--ns-radius-lg);
	overflow: hidden;
	background: var(--ns-bg);
	transition: 0.24s;
	display: block;
	text-decoration: none;
}

.ns-post:hover {
	transform: translateY(-4px);
	box-shadow: var(--ns-shadow-md);
}

.ns-post .ns-cover {
	aspect-ratio: 16 / 9.4;
	background: linear-gradient(140deg, var(--h1, #1d4ed8), var(--h2, #22d3ee));
	display: grid;
	place-items: center;
}

.ns-post .ns-cover b {
	color: rgba(255, 255, 255, 0.9);
	font-size: 11.5px;
	font-weight: 800;
	letter-spacing: 1.4px;
	text-transform: uppercase;
}

.ns-post .ns-bd {
	padding: 19px 20px 22px;
}

.ns-post .ns-bd small {
	font-size: 12px;
	color: var(--ns-muted);
	font-weight: 650;
}

.ns-post h3 {
	font-size: 16.5px;
	line-height: 1.38;
	margin: 8px 0 9px;
	letter-spacing: -0.25px;
	color: var(--ns-ink);
}

.ns-post p {
	font-size: 14px;
	color: var(--ns-muted);
	margin: 0;
}

.ns-post .ns-more {
	display: inline-block;
	margin-top: 13px;
	font-size: 13.5px;
	font-weight: 750;
	color: var(--ns-brand);
}

/* ---------- FAQ ---------- */
.ns-faq {
	max-width: 840px;
	margin: 0 auto;
}

.ns-qa {
	border: 1px solid var(--ns-line);
	border-radius: var(--ns-radius);
	background: var(--ns-bg);
	margin-bottom: 11px;
	overflow: hidden;
}

.ns-qa summary {
	padding: 18px 22px;
	font-weight: 700;
	font-size: 15.5px;
	cursor: pointer;
	list-style: none;
	display: flex;
	justify-content: space-between;
	gap: 16px;
	align-items: center;
	color: var(--ns-ink);
}

.ns-qa summary::-webkit-details-marker {
	display: none;
}

.ns-qa summary::after {
	content: "";
	width: 9px;
	height: 9px;
	border-right: 2px solid var(--ns-muted);
	border-bottom: 2px solid var(--ns-muted);
	transform: rotate(45deg);
	flex: none;
	transition: 0.2s;
	margin-right: 4px;
}

.ns-qa[open] summary::after {
	transform: rotate(-135deg);
}

.ns-qa[open] summary {
	color: var(--ns-brand);
}

.ns-qa .ns-ans {
	padding: 0 22px 20px;
	font-size: 14.8px;
	color: var(--ns-ink-2);
}

/* ---------- Newsletter ---------- */
.ns-news {
	background: var(--ns-ink);
	border-radius: 26px;
	padding: 46px;
	color: #fff;
	display: flex;
	flex-wrap: wrap;
	gap: 26px;
	align-items: center;
	justify-content: space-between;
}

.ns-news h3 {
	color: #fff;
	font-size: 24px;
	letter-spacing: -0.7px;
	margin: 0 0 7px;
}

.ns-news p {
	color: #9fb0c9;
	font-size: 14.5px;
	margin: 0;
}

.ns-news .wpforms-container {
	margin: 0 !important;
	min-width: 320px;
}

.ns-news form {
	display: flex;
	gap: 10px;
	flex-wrap: wrap;
}

.ns-news input[type="email"] {
	border: 1px solid rgba(255, 255, 255, 0.18) !important;
	background: rgba(255, 255, 255, 0.08) !important;
	color: #fff !important;
	border-radius: 11px !important;
	padding: 13px 15px !important;
	min-width: 240px;
}

.ns-news .wpforms-submit {
	background: var(--ns-brand) !important;
	border: 0 !important;
	border-radius: 11px !important;
	padding: 13px 22px !important;
	font-weight: 700 !important;
	color: #fff !important;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
	ul.products {
		grid-template-columns: repeat(3, 1fr) !important;
	}

	.ns-why,
	.ns-quotes,
	.ns-posts {
		grid-template-columns: repeat(2, 1fr);
	}

	.ns-ws {
		grid-template-columns: 1fr;
		padding: 40px;
		gap: 32px;
	}
}

@media (max-width: 640px) {
	.ns-sec {
		padding: 48px 0;
	}

	ul.products {
		grid-template-columns: 1fr 1fr !important;
		gap: 14px;
	}

	ul.products li.product > .price {
		font-size: 17px;
	}

	ul.products li.product a.add_to_cart_button {
		height: 34px;
		padding: 0 12px;
		font-size: 12px;
	}

	.ns-why,
	.ns-quotes,
	.ns-posts {
		grid-template-columns: 1fr;
	}

	.ns-ws {
		padding: 26px;
		border-radius: 20px;
	}

	.ns-news {
		padding: 28px;
		border-radius: 20px;
	}
}

/* ---------- 通用内容页组件（About / Contact / 单篇文章通用） ---------- */

/* 文章正文：限制阅读宽度，字号行高按长文调整 */
.ns-article {
	max-width: 780px;
	margin: 0 auto;
	padding: 48px 0 72px;
	font-size: 17px;
	line-height: 1.8;
	color: var(--ns-ink);
}

.ns-article p {
	margin: 0 0 18px;
}

.ns-article h2 {
	font-size: 24px;
	font-weight: 800;
	letter-spacing: -0.6px;
	margin: 36px 0 12px;
	color: var(--ns-ink);
}

.ns-article h3 {
	font-size: 19px;
	font-weight: 800;
	margin: 28px 0 10px;
	color: var(--ns-ink);
}

.ns-article ul {
	margin: 0 0 20px;
	padding: 0;
	list-style: none;
}

.ns-article li {
	position: relative;
	padding-left: 22px;
	margin-bottom: 9px;
}

.ns-article li::before {
	content: "";
	position: absolute;
	left: 4px;
	top: 11px;
	width: 7px;
	height: 7px;
	border-radius: 50%;
	background: var(--ns-brand);
}

.ns-article a {
	color: var(--ns-brand);
	text-decoration: underline;
}

/* 政策页表格（Refund / 长文里的对照表） */
.ns-article table {
	width: 100%;
	border-collapse: collapse;
	margin: 0 0 22px;
	font-size: 15.5px;
}

.ns-article th,
.ns-article td {
	text-align: left;
	padding: 13px 16px;
	border-bottom: 1px solid var(--ns-line);
	vertical-align: top;
}

.ns-article thead th {
	background: var(--ns-bg-soft);
	font-size: 14px;
	font-weight: 800;
	letter-spacing: 0.2px;
}

.ns-article tbody td:first-child {
	font-weight: 600;
}

.ns-article tbody tr:last-child td {
	border-bottom: 0;
}

@media (max-width: 640px) {
	.ns-article table {
		font-size: 14.5px;
	}

	.ns-article th,
	.ns-article td {
		padding: 10px 12px;
	}
}

/* 兼容性声明块 */
.ns-disclaimer {
	max-width: 880px;
	margin: 0 auto;
	background: var(--ns-bg-soft);
	border: 1px solid var(--ns-line);
	border-left: 4px solid var(--ns-brand);
	border-radius: var(--ns-radius-lg);
	padding: 26px 30px;
}

.ns-disclaimer h3 {
	font-size: 17px;
	font-weight: 800;
	margin: 0 0 10px;
	color: var(--ns-ink);
}

.ns-disclaimer p {
	margin: 0;
	font-size: 15px;
	line-height: 1.75;
	color: var(--ns-muted);
}

/* 联系页两栏：左说明 + 右表单 */
.ns-ws-grid {
	display: grid;
	grid-template-columns: 1fr 440px;
	gap: 48px;
	align-items: start;
}

.ns-checklist ul {
	margin: 0;
	padding: 0;
	list-style: none;
}

.ns-checklist li {
	display: flex;
	align-items: flex-start;
	gap: 10px;
	margin-bottom: 11px;
	font-size: 15.5px;
	color: var(--ns-muted);
}

@media (max-width: 1024px) {
	.ns-ws-grid {
		grid-template-columns: 1fr;
		gap: 32px;
	}

	.ns-article {
		padding: 32px 0 56px;
		font-size: 16.5px;
	}
}
