/**
 * Zichuan Sourcing — 主题基础样式
 * 淡紫色主题设计令牌 + 最小骨架。
 * 页面级视觉主要由 Elementor 负责，这里只提供全局变量与兜底样式。
 */

:root {
	/* ── 淡紫色主色板 ── */
	--zc-primary: #7c5cbf;        /* 主紫 */
	--zc-primary-dark: #5f43a3;   /* 深紫（hover / 强调） */
	--zc-primary-light: #a888e0;  /* 亮紫 */
	--zc-lavender: #f3eefc;       /* 淡紫背景 */
	--zc-lavender-soft: #faf7ff;  /* 更淡的紫（区块交替） */
	--zc-accent: #b18aff;         /* 点缀紫 */

	/* ── 中性色 ── */
	--zc-ink: #1f1a2e;            /* 主文字（带紫调的深色） */
	--zc-body: #4a4458;           /* 正文灰紫 */
	--zc-muted: #8b8397;          /* 次要文字 */
	--zc-border: #e7e0f2;         /* 描边 */
	--zc-white: #ffffff;

	/* ── 排版 ── */
	--zc-font: "Poppins", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
	--zc-radius: 12px;
	--zc-radius-lg: 20px;
	--zc-shadow: 0 8px 30px rgba(124, 92, 191, 0.12);
	--zc-shadow-hover: 0 14px 40px rgba(124, 92, 191, 0.22);
}

/* Furniture category page. */
.zc-furniture-hero,
.zc-lighting-hero,
.zc-chairs-hero {
	position: relative;
}

.zc-furniture-benefits,
.zc-lighting-benefits,
.zc-chairs-benefits {
	margin-top: -34px;
	position: relative;
	z-index: 2;
}

.zc-furniture-category-row .elementor-container,
.zc-lighting-category-row .elementor-container,
.zc-chairs-category-row .elementor-container {
	align-items: center;
}

.zc-furniture-category-image img,
.zc-lighting-category-image img,
.zc-chairs-category-image img {
	display: block;
	width: 100%;
	height: 390px;
	object-fit: cover;
}

.zc-furniture-gallery {
	display: grid;
	grid-template-columns: repeat(3, minmax(0, 1fr));
	gap: 20px;
}

.zc-furniture-gallery figure {
	position: relative;
	overflow: hidden;
	min-height: 230px;
	margin: 0;
	border-radius: 14px;
	background: var(--zc-ink);
	box-shadow: var(--zc-shadow);
}

.zc-furniture-gallery img {
	display: block;
	width: 100%;
	height: 100%;
	min-height: 230px;
	object-fit: cover;
	transition: transform 0.45s ease;
}

.zc-furniture-gallery figcaption {
	position: absolute;
	right: 0;
	bottom: 0;
	left: 0;
	padding: 30px 16px 14px;
	color: var(--zc-white);
	font-size: 14px;
	font-weight: 600;
	background: linear-gradient(to top, rgba(31, 26, 46, 0.9), rgba(31, 26, 46, 0));
}

.zc-furniture-gallery figure:hover img {
	transform: scale(1.04);
}

.zc-furniture-gallery--capability figure:first-child {
	grid-column: span 2;
}

.zc-furniture-inquiry .sureforms-form-container,
.zc-lighting-inquiry .sureforms-form-container,
.zc-chairs-inquiry .sureforms-form-container {
	margin: 0;
}

@media (max-width: 767px) {
	.zc-furniture-benefits,
	.zc-lighting-benefits,
	.zc-chairs-benefits {
		margin-top: 0;
	}

	.zc-furniture-category-row .elementor-column,
	.zc-lighting-category-row .elementor-column,
	.zc-chairs-category-row .elementor-column {
		width: 100%;
	}

	.zc-furniture-category-row .elementor-column:first-child,
	.zc-lighting-category-row .elementor-column:first-child,
	.zc-chairs-category-row .elementor-column:first-child {
		order: 1;
	}

	.zc-furniture-category-row .elementor-column:last-child,
	.zc-lighting-category-row .elementor-column:last-child,
	.zc-chairs-category-row .elementor-column:last-child {
		order: 2;
	}

	.zc-furniture-category-image img,
	.zc-lighting-category-image img,
	.zc-chairs-category-image img {
		height: 280px;
	}

	.zc-furniture-gallery {
		grid-template-columns: 1fr;
		gap: 14px;
	}

	.zc-furniture-gallery--capability figure:first-child {
		grid-column: auto;
	}
}

/* ── 兜底基础样式（当页面非 Elementor 全宽时） ── */
body.zichuan-theme {
	margin: 0;
	font-family: var(--zc-font);
	color: var(--zc-body);
	background: var(--zc-white);
	line-height: 1.7;
	-webkit-font-smoothing: antialiased;
}

body.zichuan-theme h1,
body.zichuan-theme h2,
body.zichuan-theme h3,
body.zichuan-theme h4 {
	color: var(--zc-ink);
	font-weight: 700;
	line-height: 1.25;
}

body.zichuan-theme a {
	color: var(--zc-primary);
	text-decoration: none;
	transition: color 0.2s ease;
}

body.zichuan-theme a:hover {
	color: var(--zc-primary-dark);
}

.zichuan-container {
	max-width: 1200px;
	margin: 0 auto;
	padding: 0 24px;
}

/* ── 兜底页眉（无 Elementor header 模板时） ── */
.zc-fallback-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	padding: 18px 32px;
	background: var(--zc-white);
	border-bottom: 1px solid var(--zc-border);
	position: sticky;
	top: 0;
	z-index: 999;
}

.zc-fallback-header .zc-brand {
	font-size: 22px;
	font-weight: 800;
	color: var(--zc-primary);
}

.zc-fallback-header nav ul {
	display: flex;
	gap: 28px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.zc-fallback-header nav a {
	color: var(--zc-ink);
	font-weight: 500;
}

/* ── 兜底页脚 ── */
.zc-fallback-footer {
	background: var(--zc-ink);
	color: #cfc8dd;
	padding: 48px 32px;
	text-align: center;
	margin-top: 60px;
}

.zc-fallback-footer a {
	color: var(--zc-primary-light);
}

/* ── 通用按钮（供非 Elementor 内容区复用） ── */
.zc-btn {
	display: inline-block;
	padding: 14px 32px;
	border-radius: 50px;
	background: var(--zc-primary);
	color: var(--zc-white);
	font-weight: 600;
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.zc-btn:hover {
	background: var(--zc-primary-dark);
	transform: translateY(-2px);
	box-shadow: var(--zc-shadow-hover);
}

.zc-btn--ghost {
	background: transparent;
	color: var(--zc-primary);
	border: 2px solid var(--zc-primary);
}

.zc-btn--ghost:hover {
	background: var(--zc-lavender);
}

/* 让 WP 管理条不遮挡 sticky header */
body.admin-bar .zc-fallback-header {
	top: 32px;
}

/* 页眉容器做成 sticky：滚动时顶部固定。覆盖在 Elementor 模板外层 div。 */
.zichuan-elementor-header {
	position: sticky;
	top: 0;
	z-index: 9999;
	background: var(--zc-white);
	box-shadow: 0 1px 0 var(--zc-border);
}
body.admin-bar .zichuan-elementor-header {
	top: 32px;
}
@media (max-width: 782px) {
	body.admin-bar .zichuan-elementor-header {
		top: 46px;
	}
}

/* ── 页眉容器：flex 行，列垂直居中 ──
 * 用 body 前缀提高特异性，压过 Elementor 逐元素生成的列宽/布局规则，不再用 !important。 */
body .zichuan-elementor-header .elementor-top-section > .elementor-container {
	display: flex;
	flex-direction: row;
	flex-wrap: nowrap;
	align-items: center;
}

/* 列不再用百分比宽，内容撑开 */
body .zichuan-elementor-header .elementor-top-column {
	flex: 0 0 auto;
	width: auto;
	align-content: center;
}

/* 导航列吃满剩余空间 */
body .zichuan-elementor-header .elementor-top-column:last-child {
	flex: 1 1 auto;
}

/* 清除所有内边距和边距 */
body .zichuan-elementor-header .elementor-widget-wrap,
body .zichuan-elementor-header .elementor-widget-container,
body .zichuan-elementor-header .elementor-widget-text-editor {
	padding: 0;
	margin-top: 0;
	margin-bottom: 0;
	align-items: center;
	align-content: center;
}

/* ================================================================== *
 * 页眉主导航（Elementor Header 模板里的原生菜单）。
 * 结构：ul.zc-nav > li.zc-nav__item(--has-sub) > a.zc-nav__link + ul.zc-nav__sub
 * ================================================================== */
.zc-nav {
	display: flex;
	align-items: center;
	justify-content: center;
	gap: 4px;
	list-style: none;
	margin: 0;
	padding: 0;
}

.zc-nav__item {
	position: relative;
}

.zc-nav__link {
	display: inline-flex;
	align-items: center;
	gap: 4px;
	padding: 10px 16px;
	font-size: 15px;
	font-weight: 600;
	color: var(--zc-ink);
	white-space: nowrap;
	border-radius: 8px;
	transition: color 0.2s ease, background 0.2s ease;
}

.zc-nav__item:hover > .zc-nav__link {
	color: var(--zc-primary);
	background: var(--zc-lavender);
}

.zc-nav__caret {
	font-size: 11px;
	line-height: 1;
	transition: transform 0.2s ease;
}

.zc-nav__item:hover > .zc-nav__link .zc-nav__caret {
	transform: rotate(180deg);
}

/* 下拉子菜单 */
.zc-nav__sub {
	position: absolute;
	top: 100%;
	left: 0;
	min-width: 220px;
	margin: 0;
	padding: 8px;
	list-style: none;
	background: var(--zc-white);
	border: 1px solid var(--zc-border);
	border-radius: 12px;
	box-shadow: var(--zc-shadow);
	opacity: 0;
	visibility: hidden;
	transform: translateY(8px);
	transition: opacity 0.18s ease, transform 0.18s ease, visibility 0.18s;
	z-index: 1000;
}

.zc-nav__item--has-sub:hover > .zc-nav__sub {
	opacity: 1;
	visibility: visible;
	transform: translateY(0);
}

.zc-nav__sub li {
	margin: 0;
}

.zc-nav__sub a {
	display: block;
	padding: 9px 14px;
	font-size: 14px;
	font-weight: 500;
	color: var(--zc-body);
	border-radius: 8px;
	white-space: nowrap;
	transition: color 0.15s ease, background 0.15s ease;
}

.zc-nav__sub a:hover {
	color: var(--zc-primary);
	background: var(--zc-lavender);
}

/* 汉堡按钮（移动端三横线，右侧）。桌面端隐藏。 */
.zc-menu-toggle {
	display: none;
	width: 44px;
	height: 44px;
	margin-left: auto;
	padding: 0;
	background: transparent;
	border: none;
	cursor: pointer;
}
.zc-menu-toggle__bars,
.zc-menu-toggle__bars::before,
.zc-menu-toggle__bars::after {
	content: '';
	display: block;
	width: 24px;
	height: 2px;
	margin: 0 auto;
	background: var(--zc-ink);
	border-radius: 2px;
	transition: transform 0.25s ease, opacity 0.2s ease, background 0.2s ease;
}
.zc-menu-toggle__bars {
	position: relative;
}
.zc-menu-toggle__bars::before {
	position: absolute;
	top: -7px;
}
.zc-menu-toggle__bars::after {
	position: absolute;
	top: 7px;
}
.zc-menu-toggle.is-open .zc-menu-toggle__bars {
	background: transparent;
}
.zc-menu-toggle.is-open .zc-menu-toggle__bars::before {
	transform: translateY(7px) rotate(45deg);
}
.zc-menu-toggle.is-open .zc-menu-toggle__bars::after {
	transform: translateY(-7px) rotate(-45deg);
}

/* 移动端：右侧汉堡，点击展开纵向菜单。 */
@media (max-width: 1024px) {
	/* 汉堡绝对定位到 header 右上角；header 需 position:relative（Elementor 固定 header 已是） */
	.zichuan-elementor-header {
		position: relative;
	}
	.zc-menu-toggle {
		position: absolute;
		top: 50%;
		right: 16px;
		transform: translateY(-50%);
		display: inline-flex;
		align-items: center;
		justify-content: center;
		z-index: 1001;
	}

	/* 导航容器折叠：max-height 0 + hidden，is-open 时展开。 */
	.zc-nav-wrap {
		display: none;
	}
	.zc-nav-wrap.is-open {
		display: block;
		position: absolute;
		top: 100%;
		left: 0;
		width: 100%;
		background: var(--zc-white);
		border-top: 1px solid var(--zc-border);
		box-shadow: var(--zc-shadow);
		z-index: 1000;
	}

	.zc-nav {
		flex-direction: column;
		align-items: stretch;
		gap: 0;
		padding: 8px 24px 16px;
	}
	.zc-nav__link {
		padding: 12px 0;
		border-radius: 0;
	}
	.zc-nav__item:hover > .zc-nav__link {
		background: transparent;
		color: var(--zc-ink);
	}
	/* 子菜单：点击 caret 展开（JS 监听），默认折叠。 */
	.zc-nav__sub {
		position: static;
		max-height: 0;
		overflow: hidden;
		opacity: 1;
		visibility: visible;
		transform: none;
		box-shadow: none;
		border: none;
		border-radius: 0;
		padding: 0 0 0 16px;
		min-width: 0;
		transition: max-height 0.25s ease;
	}
	.zc-nav__item--has-sub.is-sub-open > .zc-nav__sub {
		max-height: 500px;
	}
	.zc-nav__caret {
		transition: transform 0.2s ease;
		/* 收起态：▾ 朝下（字符原向） */
		transform: rotate(0deg);
	}
	.zc-nav__item--has-sub.is-sub-open > .zc-nav__link .zc-nav__caret {
		/* 展开态：旋转 180° 朝上 */
		transform: rotate(180deg);
	}
}

/* ================================================================== *
 * 页脚列（5 列）：标题与链接左对齐，链接竖排。
 * ================================================================== */
.zc-foot-links {
	display: flex;
	flex-direction: column;
	gap: 10px;
}

.zc-foot-link {
	display: block;
	font-size: 14px;
	line-height: 1.4;
	color: rgba(255, 255, 255, 0.75);
	transition: color 0.15s ease, padding-left 0.15s ease;
}

.zc-foot-link:hover {
	color: #ffffff;
	padding-left: 4px;
}

/* 页脚区块内标题与正文左对齐兜底 */
.zichuan-elementor-footer .elementor-widget-heading,
.zichuan-elementor-footer .elementor-widget-text-editor {
	text-align: left;
}

/* Value-added Services 的 image-box 尺寸（全宽 + 220px 高 + cover）已改为
 * 在 build-home.php 里用原生控件 image_size/image_height/image_object_fit 设置，
 * 编辑器与前台一致，这里不再用 CSS 覆盖。 */

/* Elementor 前端默认 `.elementor-icon:hover{color:#69727d}` 会把所有 icon-box
 * 图标悬停时染成灰色（stacked 的白图标在紫底上尤其难看）。这里覆盖：
 * 悬停保持原色 —— stacked 白色、framed/default 紫色，并加轻微放大反馈。 */
.elementor-view-stacked .elementor-icon:hover {
	color: #ffffff;
}
.elementor-view-framed .elementor-icon:hover,
.elementor-view-default .elementor-icon:hover {
	color: #8b5cf6;
}
.elementor-widget-icon-box:hover .elementor-icon,
.elementor-widget-icon:hover .elementor-icon {
	transform: scale(1.06);
	transition: transform 0.2s ease;
}

/* 左置图标（position=left → .elementor-position-inline-start）默认 align-items:start，
 * 把图标钉在文字块顶部，图标(40px)比标题行高，视觉上偏高、与标题/正文不在同一水平线。
 * 这里改成竖直居中，让图标中线对齐整块文字（标题+描述），Contact 信息行与
 * Home/Services/Solutions 的特性行都会对齐。
 * ⚠️ Elementor 会给每个 icon-box 输出 per-post CSS：
 *   .elementor-XXXX .elementor-element-YYYYYYY .elementor-icon-box-wrapper{align-items:start}
 * 特异性 (0,3,0)，会盖过只有 (0,2,0) 的通用规则 → 图标又变顶对齐。
 * 故加 .elementor 祖先前缀把特异性提到 (0,4,0) 稳压过 per-post，全站统一居中，无 !important。 */
.elementor .elementor-widget-icon-box.elementor-position-inline-start .elementor-icon-box-wrapper,
.elementor .elementor-widget-icon-box.elementor-position-inline-end .elementor-icon-box-wrapper {
	align-items: center;
}

/* ================================================================== *
 * 引流表单（SureForms 2140）横排布局 + 药丸提交按钮。
 * SureForms 字段默认各占一行（.srfm-block-width-100）竖排、提交按钮撑满一条，
 * 塞在窄列里又高又丑。这里改成 flex 横排：
 * 姓名 + 邮箱并排（各半宽），留言全宽，提交按钮做成紫色药丸并居中。
 * 用 .elementor-widget-shortcode 前缀（SureForms 表单在任何页面都被 shortcode
 * widget 包裹，首页与 Contact 页都能命中）提高特异性压过 SureForms 基础规则，
 * 不用 !important。
 * ================================================================== */
.elementor-widget-shortcode .srfm-form .srfm-fields-wrapper,
.elementor-widget-shortcode .srfm-form form,
.elementor-widget-shortcode form.srfm-form {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
	align-items: flex-start;
}
/* 每个字段块：默认占一行；姓名+邮箱这两个 input/email 块并排成两列 */
.elementor-widget-shortcode .srfm-form .srfm-block-single {
	flex: 1 1 100%;
	margin: 0;
}
.elementor-widget-shortcode .srfm-form .srfm-input-block.srfm-block-single,
.elementor-widget-shortcode .srfm-form .srfm-email-block.srfm-block-single {
	flex: 1 1 calc(50% - 8px);
	min-width: 220px;
}
/* 提交按钮容器（整行）：让内部 wrap 居中。 */
.elementor-widget-shortcode .srfm-form .srfm-custom-button-ctn {
	flex: 1 1 100%;
	display: flex;
	justify-content: center;
	margin: 0;
}
/* 按钮 wrap 约束成药丸宽度并居中：SureForms 给 #srfm-submit-btn 内联写死了
 * width:100%（内联样式，不用 !important 无法覆盖），所以这里不去改按钮 width，
 * 而是把它的父容器限成固定宽度 → 按钮 100% = 该宽度，得到居中的药丸按钮。 */
.elementor-widget-shortcode .srfm-form .srfm-submit-wrap {
	flex: 0 0 auto;
	width: 260px;
	max-width: 100%;
	margin: 0 auto;
}
/* 提交按钮本体：紫色药丸（width 由上面的 wrap 约束，此处不写 width）。 */
.elementor-widget-shortcode .srfm-form #srfm-submit-btn.srfm-button {
	padding: 14px 40px;
	border-radius: 100px;
	background: var(--zc-primary);
	color: var(--zc-white);
	font-weight: 600;
	border: 2px solid var(--zc-primary);
	transition: background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}
.elementor-widget-shortcode .srfm-form #srfm-submit-btn.srfm-button:hover {
	background: var(--zc-primary-dark);
	border-color: var(--zc-primary-dark);
	transform: translateY(-2px);
	box-shadow: var(--zc-shadow-hover);
}

/* ================================================================== *
 * 三图卡（Private Label 页 Flexible packaging 等）图片等高裁切。
 * 三张原图宽高比不同 → 卡片图高低不齐。给图加 .zc-eqimg 类，固定高度 +
 * object-fit:cover 居中裁切，三图严格等高。选择器带 .zc-eqimg 前缀提高
 * 特异性压过 Elementor 默认 img 规则，无 !important。
 * ================================================================== */
.zc-eqimg img {
	width: 100%;
	height: 240px;
	object-fit: cover;
}
@media (max-width: 767px) {
	.zc-eqimg img { height: 200px; }
}

/* ================================================================== *
 * 全站图片防溢出：Elementor image / image-box 不超出容器。
 * attachment 原图可能是 1600×2400 竖图或更宽，若 Elementor widget
 * 未设置固定宽度，图片会以原图像素撑破列宽。这里只设 max-width
 * 上限，不加 height:auto —— 避免覆盖 .zc-furniture-category-image /
 * .zc-eqimg 等已有的固定高度裁切规则（同特异性，后写覆盖前写）。
 * ================================================================== */
.elementor-widget-image img,
.elementor-widget-image-box img {
	max-width: 100%;
}
