/*!
 * 主题自身样式
 *
 * 三层样式里的第 3 层，永远最后加载，用来：
 *   1. 补目标站 Kirki 内联里那几个 osty 主样式没定义的令牌
 *   2. 写页头页脚自己的栅格（osty 的页脚是 Elementor 模板，容器类没有样式）
 *   3. 补 osty 有 DOM 契约但没写样式的几处（属性表、排序栏、产品 CTA 等）
 *
 * 类名一律用 ms- / yxseo- 前缀，不要碰 WordPress 通用类。
 */

/* =========================================================================
   1. 设计令牌
   ========================================================================= */
:root {
	--yxseo-wrap: 1320px;
	--yxseo-radius: 12px;
	--yxseo-shadow: 0 18px 40px -24px rgba(0, 0, 0, .22);
}

/* osty 主样式已定义 --color-primary:hsl(37,99%,73%)＝#f89b01，
   这里只补它没定义的几个（目标站 Kirki 内联里有、osty CSS 里没有）。 */
:root,
[data-theme="light"] {
	--color-bg: hsl(0, 0%, 96%);
	--color-contrast-higher: hsl(0, 0%, 15%);
	--color-contrast-medium: hsl(0, 0%, 35%);
	--color-contrast-low: hsl(0, 0%, 70%);
	--color-contrast-lower: hsl(0, 0%, 92%);
}

:root {
	--main-header-width-md: 1320px;
	--main-header-height: 100px;
	--main-header-height-md: 80px;
	--font-primary: 'Inter', 'Poppins', 'Helvetica Neue', Arial, 'PingFang SC', 'Microsoft YaHei', sans-serif;
	--font-heading: 'Poppins', 'Inter', 'PingFang SC', 'Microsoft YaHei', sans-serif;
}

body {
	font-family: var(--font-primary);
	background-color: var(--color-bg);
	color: var(--color-contrast-higher);
}

h1, h2, h3, h4, h5, h6,
.elementor-heading-title {
	font-family: var(--font-heading);
}

/* 主题内容区通用容器（栈式布局，避免各页自己算宽度） */
.yxseo-wrap {
	width: 100%;
	max-width: var(--yxseo-wrap);
	margin: 0 auto;
	padding: 0 20px;
}

/* =========================================================================
   2. 页头
   栅格、定位、下拉动画全部交给 osty 的 main.css / style.css，这里只补
   目标站由 Kirki 内联输出、osty 样式表里没有的那几条。
   ========================================================================= */

/* 目标站 kirki-inline-styles 里的 LOGO 尺寸（main.css 没写，不补 LOGO 会被撑大） */
.main-header__logo a,
.main-header__logo svg,
.main-header__logo img {
	height: 60px;
}

@media (max-width: 767px) {
	.main-header__logo a,
	.main-header__logo svg,
	.main-header__logo img {
		height: 40px;
	}
}

/*
 * 宽屏滚动后页头切紧凑形态：整条一级导航淡出左移，汉堡按钮接上。
 *
 * 目标站这段是 GSAP 在 showMenu() 里写内联样式完成的
 * （opacity:0 / visibility:hidden / translateX(-35px)，逐项 stagger .03s），
 * osty 的样式表里**没有**对应规则 —— 这里用纯 CSS 过渡补上同样的终态，
 * 省掉一整个 GSAP 依赖。
 *
 * visibility 的过渡时间特意错开：收起时等淡出跑完再隐藏（0s .35s），
 * 展开时立刻可见再淡入，避免"先出现再淡入"的闪。
 */
.main-header__inner .main-header__default > #primary-menu-default > .menu-item {
	visibility: visible;
	transition: opacity .35s cubic-bezier(.6, 0, .1, 1),
	            transform .35s cubic-bezier(.6, 0, .1, 1),
	            visibility 0s 0s;
}

.main-header__inner.move .main-header__default > #primary-menu-default > .menu-item {
	opacity: 0;
	visibility: hidden;
	transform: translateX(-35px);
	transition: opacity .35s cubic-bezier(.6, 0, .1, 1),
	            transform .35s cubic-bezier(.6, 0, .1, 1),
	            visibility 0s .35s;
}

/*
 * .ms-ma-bg 是汉堡按钮底下那块深色底板（::after 是纯色 #262626、圆角 14px），
 * 也是抽屉展开后的**深色面板本体**。
 *
 * 目标站里它的尺寸完全由 JS 给：
 *   关着   gsap.to(t,{width:r,height:l})   r,l = .container-menu 的宽高
 *   打开   gsap.to(t,{width:i,height:s})   i,s = #primary-menu-button 的宽高
 * osty 样式表里只写了 transform:scale(0) → scale(1) 这一半，尺寸得自己补。
 * site.js 的 sizeDrawerPanel() 负责写内联 px，这里只负责补间
 * （power2.inOut ≈ cubic-bezier(.42,0,.58,1)）。
 */
.ms-ma-bg {
	transition: transform .4s cubic-bezier(.6, 0, .1, 1),
	            width .5s cubic-bezier(.42, 0, .58, 1),
	            height .5s cubic-bezier(.42, 0, .58, 1);
}

/* JS 还没跑之前（或者被禁用时）先撑满汉堡按钮 */
.main-header__inner.move .ms-ma-bg {
	width: 100%;
	height: 100%;
}

/* 桌面导航里的子菜单展开按钮隐藏（下拉走 osty 的 :hover 规则）。
   抽屉里的那份要留着，所以只挑 #primary-menu-default。 */
@media (min-width: 1024px) {
	#ms-header #primary-menu-default .sub-toggle {
		display: none;
	}
}

/*
 * 抽屉（.ms-menu）里的子菜单改成手风琴。
 *
 * 目标站是 3 级横向 flyout —— 点一级就把整层 ul 左移 100%，把左侧 100% 处的
 * 子菜单推出来，面板宽度再补间过去。那套动画全靠 GSAP 补间 xPercent，
 * 而且在那块 179px 宽的面板里（窄屏就更别说）本来就挤。
 * 这里换成手风琴：点右侧的 .sub-toggle 展开下一层。
 * 桌面导航（#primary-menu-default）不受影响，仍然走 osty 的 :hover 下拉。
 *
 * 注意 osty 把 #primary-menu-button 里的链接压成 opacity:0，原本要靠
 * #primary-menu-button.show 和 .sub-menu.show 放出来。一级那份由 site.js
 * 加 .show 处理；子菜单既然不再走 flyout，这里直接把 opacity 放开。
 */
#ms-header .ms-menu .sub-menu {
	position: static;
	left: auto;
	transform: none;
	visibility: visible;
	opacity: 1;
	box-shadow: none;
	background: transparent;
	display: none;
	padding-left: 18px;
}

#ms-header .ms-menu .sub-menu .menu-item > a {
	opacity: 1;
}

#ms-header .ms-menu .menu-item.sub-open > .sub-menu {
	display: block;
}

#ms-header .ms-menu .menu-item {
	position: relative;
}

#ms-header .ms-menu .sub-toggle {
	position: absolute;
	top: 6px;
	right: 0;
	width: 36px;
	height: 36px;
	border: 0;
	background: transparent;
	color: inherit;
	cursor: pointer;
}

#ms-header .ms-menu .sub-toggle::after {
	content: "";
	display: block;
	width: 8px;
	height: 8px;
	margin: 0 auto;
	border-right: 2px solid currentColor;
	border-bottom: 2px solid currentColor;
	transform: rotate(45deg);
	transition: transform .25s ease;
}

#ms-header .ms-menu .menu-item.sub-open > .sub-toggle::after {
	transform: rotate(-135deg);
}

@media (max-width: 1023px) {
	#ms-header .lycusicons {
		display: none;
	}
}

/* =========================================================================
   3. 页脚（osty 的页脚是 Elementor 模板，容器类没有样式，这里自己写栅格）
   ========================================================================= */
.ms-footer {
	margin-top: 80px;
	background-color: #121212;
	color: rgba(255, 255, 255, .78);
}

.ms-footer .footer-container {
	width: 100%;
	max-width: var(--yxseo-wrap);
	margin: 0 auto;
	padding: 0 20px;
}

.ms-footer__top {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 20px;
	padding: 44px 0;
	border-bottom: 1px solid rgba(255, 255, 255, .1);
}

.ms-footer__top .elementor-widget-heading p {
	margin: 0;
	font-size: 14px;
	letter-spacing: .08em;
	text-transform: uppercase;
	color: rgba(255, 255, 255, .6);
}

.ms-footer__top .elementor-widget-heading h3 {
	margin: 6px 0 0;
	color: #fff;
	font-size: clamp(22px, 3vw, 32px);
}

.ms-footer__cta {
	display: flex;
	gap: 12px;
	flex-wrap: wrap;
}

.ms-footer__cta .elementor-button {
	display: inline-flex;
	align-items: center;
	padding: 12px 26px;
	border-radius: 999px;
	background-color: var(--color-primary);
	color: #121212;
	font-weight: 600;
	text-decoration: none;
	transition: transform .25s ease, background-color .25s ease;
}

.ms-footer__cta .elementor-button:hover {
	transform: translateY(-2px);
	background-color: #fff;
}

.ms-footer__cols {
	display: grid;
	grid-template-columns: repeat(4, minmax(0, 1fr));
	gap: 34px;
	padding: 44px 0;
}

.ms-footer__col .elementor-widget-heading h2 {
	margin: 0 0 18px;
	color: #fff;
	font-size: 18px;
}

.ms-footer__col .elementor-icon-list-items {
	list-style: none;
	margin: 0;
	padding: 0;
}

.ms-footer__col .elementor-icon-list-item {
	margin: 0 0 10px;
}

.ms-footer__col .elementor-icon-list-item > a {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	color: rgba(255, 255, 255, .72);
	text-decoration: none;
	font-size: 14px;
	transition: color .2s ease, transform .2s ease;
}

.ms-footer__col .elementor-icon-list-item > a:hover {
	color: var(--color-primary);
	transform: translateX(3px);
}

.ms-footer__col .elementor-icon-list-icon svg {
	width: 13px;
	height: 13px;
	fill: currentColor;
}

.ms-footer__bottom {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	padding: 22px 0;
	border-top: 1px solid rgba(255, 255, 255, .1);
	font-size: 13px;
}

.ms-footer__bottom .elementor-heading-title {
	margin: 0;
	color: rgba(255, 255, 255, .6);
}

.ms-footer__bottom .elementor-social-icons-wrapper {
	display: flex;
	gap: 10px;
}

.ms-footer__bottom .elementor-social-icon {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	width: 34px;
	height: 34px;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, .08);
	color: #fff;
	transition: background-color .25s ease, color .25s ease;
}

.ms-footer__bottom .elementor-social-icon:hover {
	background-color: var(--color-primary);
	color: #121212;
}

.ms-footer__bottom .elementor-social-icon svg {
	width: 15px;
	height: 15px;
	fill: currentColor;
}

@media (max-width: 1023px) {
	.ms-footer__cols {
		grid-template-columns: repeat(2, minmax(0, 1fr));
	}
}

@media (max-width: 575px) {
	.ms-footer__cols {
		grid-template-columns: minmax(0, 1fr);
	}
}

/* =========================================================================
   3.5 栏目标题区
   osty 只给 .page-template-default / .search / .woocommerce-page 定义了大标题，
   产品、工艺、文章这些自定义归档页拿不到，这里统一补上。

   带 .container 的那种（首页用的默认模板）宽度与内边距由 osty 的 .container
   定死，这里不要再叠一层 —— 叠上去会让标题区凭空多出 68px 高，
   把首屏整体往下推。
   ========================================================================= */
.ms-sp--header:not(.container) {
	width: 100%;
	max-width: var(--main-header-width-md);
	margin: 48px auto 20px;
	padding: 0 20px;
}

.ms-sp--title {
	margin: 0 0 14px;
	font-size: clamp(32px, 4.6vw, 64px);
	font-weight: 700;
	line-height: 1.12;
	word-wrap: break-word;
}

.ms-sp--title + .term-description {
	margin: 0 0 8px;
	max-width: 940px;
	font-size: 16px;
	line-height: 1.8;
	color: var(--color-contrast-medium, #595959);
}

.ms-sp--title + .term-description p {
	margin: 0;
}

/* =========================================================================
   4. 补 osty 没有样式的几处
   ========================================================================= */

/* 4.1 排序栏 */
.woocommerce-content-loop-header {
	display: flex;
	align-items: center;
	justify-content: space-between;
	gap: 16px;
	margin: 0 0 24px;
}

.woocommerce-result-count {
	margin: 0;
	font-size: 14px;
	color: var(--color-contrast-medium, #595959);
}

.woocommerce-ordering select.orderby {
	appearance: none;
	-webkit-appearance: none;
	padding: 10px 40px 10px 18px;
	border: 1px solid rgba(0, 0, 0, .12);
	border-radius: 999px;
	background: #fff url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%23121212' stroke-width='1.6'%3E%3Cpath d='m6 9 6 6 6-6'/%3E%3C/svg%3E") no-repeat right 14px center / 16px 16px;
	font-size: 14px;
	cursor: pointer;
}

/* 4.2 产品详情右侧的「咨询订购」按钮组 */
.lyproductsbtns {
	display: flex;
	flex-wrap: wrap;
	gap: 12px;
	margin: 26px 0;
}

.lyproductsbtns .ms-product-link {
	margin: 0;
}

.lyproductsbtns .btn {
	display: inline-flex;
	align-items: center;
	gap: 10px;
	padding: 13px 30px;
	border-radius: 999px;
	background-color: var(--color-primary);
	color: #121212;
	font-weight: 600;
	text-decoration: none;
	border: 0;
	cursor: pointer;
	transition: transform .25s ease, background-color .25s ease;
}

.lyproductsbtns .btn:hover {
	transform: translateY(-2px);
	background-color: #121212;
	color: #fff;
}

.lyproductsbtns .f-btn-l,
.lyproductsbtns .btn-r_icon {
	display: none;
}

/* 4.3 产品参数表 */
table.woocommerce-product-attributes.shop_attributes {
	width: 100%;
	border-collapse: collapse;
	margin: 24px 0 40px;
	font-size: 15px;
}

table.shop_attributes th,
table.shop_attributes td {
	padding: 13px 18px;
	border: 1px solid rgba(0, 0, 0, .09);
	text-align: left;
	vertical-align: top;
}

table.shop_attributes th {
	width: 180px;
	background-color: rgba(0, 0, 0, .025);
	font-weight: 600;
	color: var(--color-contrast-higher, #262626);
}

table.shop_attributes td p {
	margin: 0;
}

/* 4.4 产品 SKU / 分类行 */
.product_meta {
	display: flex;
	flex-wrap: wrap;
	gap: 18px;
	margin: 16px 0;
	font-size: 14px;
	color: var(--color-contrast-medium, #595959);
}

.product_meta a {
	color: var(--color-contrast-higher, #262626);
}

/* 4.5 库存/定制提示条 */
.stock-notification {
	display: inline-flex;
	align-items: center;
	gap: 8px;
	padding: 7px 16px;
	border-radius: 999px;
	background-color: rgba(37, 99, 99, .08);
	color: #1f6f43;
	font-size: 14px;
}

/* 4.6 分页（分页模块输出的 .pagination__list，osty 有部分样式，这里补齐） */
nav.pagination {
	margin: 46px 0 10px;
}

nav.pagination .pagination__list {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	justify-content: center;
	gap: 8px;
	list-style: none;
	margin: 0;
	padding: 0;
}

nav.pagination .pagination__item {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 42px;
	height: 42px;
	padding: 0 12px;
	border-radius: 999px;
	background-color: #fff;
	color: var(--color-contrast-higher, #262626);
	text-decoration: none;
	font-size: 14px;
	transition: background-color .2s ease, color .2s ease;
}

nav.pagination .page-item.active .pagination__item,
nav.pagination .pagination__item.current {
	background-color: var(--color-primary);
	color: #121212;
}

nav.pagination .pagination__item:hover {
	background-color: #121212;
	color: #fff;
}

nav.pagination .pagination__item svg {
	width: 16px;
	height: 16px;
}

/* 4.7 面包屑（复用常驻模块的 .breadcrumbs__* 类，嵌在 osty 的容器里） */
.ms-page-title__breadcrumbs .breadcrumbs__separator {
	margin: 0 8px;
	opacity: .45;
}

.ms-page-title__breadcrumbs a {
	color: inherit;
	text-decoration: none;
}

.ms-page-title__breadcrumbs a:hover {
	color: var(--color-primary);
}

/* =========================================================================
   5. 灯箱（gallery-scale 模块用）
   ========================================================================= */
.yxseo-lightbox {
	position: fixed;
	inset: 0;
	z-index: 9999;
	display: none;
	align-items: center;
	justify-content: center;
	background-color: rgba(0, 0, 0, .88);
	padding: 40px 20px;
}

.yxseo-lightbox.is-open {
	display: flex;
}

.yxseo-lightbox img {
	max-width: 92vw;
	max-height: 88vh;
	object-fit: contain;
	box-shadow: 0 30px 80px -30px rgba(0, 0, 0, .8);
}

.yxseo-lightbox__close {
	position: absolute;
	top: 22px;
	right: 26px;
	width: 44px;
	height: 44px;
	border: 0;
	border-radius: 50%;
	background-color: rgba(255, 255, 255, .14);
	color: #fff;
	cursor: pointer;
}

.yxseo-lightbox__close:hover {
	background-color: var(--color-primary);
	color: #121212;
}

/* =========================================================================
   6. 客服条（kefu-bar 模块用）
   ========================================================================= */
.yxseo-kefu {
	position: fixed;
	right: 18px;
	bottom: 96px;
	z-index: 90;
	display: flex;
	flex-direction: column;
	gap: 8px;
}

.yxseo-kefu__item {
	position: relative;
	display: flex;
	align-items: center;
	justify-content: center;
	width: 46px;
	height: 46px;
	border-radius: 50%;
	background-color: #fff;
	color: #121212;
	box-shadow: var(--yxseo-shadow);
	text-decoration: none;
	transition: background-color .2s ease, color .2s ease;
}

.yxseo-kefu__item:hover {
	background-color: var(--color-primary);
}

.yxseo-kefu__label {
	position: absolute;
	right: 58px;
	white-space: nowrap;
	padding: 7px 14px;
	border-radius: 8px;
	background-color: #121212;
	color: #fff;
	font-size: 13px;
	opacity: 0;
	visibility: hidden;
	transform: translateX(6px);
	transition: all .2s ease;
}

.yxseo-kefu__item:hover .yxseo-kefu__label {
	opacity: 1;
	visibility: visible;
	transform: none;
}

.yxseo-kefu__qr {
	position: absolute;
	right: 58px;
	bottom: 0;
	padding: 8px;
	border-radius: 10px;
	background-color: #fff;
	box-shadow: var(--yxseo-shadow);
	opacity: 0;
	visibility: hidden;
	transition: all .2s ease;
}

.yxseo-kefu__item:hover .yxseo-kefu__qr {
	opacity: 1;
	visibility: visible;
}

.yxseo-kefu__qr img {
	display: block;
	width: 120px;
	height: 120px;
	object-fit: contain;
}

@media (max-width: 1023px) {
	.yxseo-kefu.is-hidden-mobile {
		display: none;
	}
}

/* 返回顶部：复用 osty 的 .back-to-top 类，这里只保证它始终可点 */
.back-to-top {
	cursor: pointer;
}

/* =========================================================================
   7. 空状态
   ========================================================================= */
.yxseo-empty {
	padding: 70px 20px;
	text-align: center;
	color: var(--color-contrast-medium, #595959);
}

.yxseo-empty p {
	margin: 0;
	font-size: 16px;
}

/* =========================================================================
   8. 详情页补丁（osty 没写的几处）
   ========================================================================= */

/* 产品详情下半区 */
.ms-sb-inner {
	padding: 50px 0 10px;
}

.ms-single-top {
	padding-top: 30px;
}

/* 产品图库缩略图列 */
.ms-single-product__media .ms-product-thumbs {
	display: flex;
	flex-wrap: wrap;
	gap: 10px;
	margin-top: 14px;
}

.ms-single-product__media .ms-product-thumbs a {
	display: block;
	width: 84px;
	height: 84px;
	overflow: hidden;
	border-radius: 10px;
	border: 2px solid transparent;
	transition: border-color .2s ease;
}

.ms-single-product__media .ms-product-thumbs a.is-active {
	border-color: var(--color-primary);
}

.ms-single-product__media .ms-product-thumbs img {
	width: 100%;
	height: 100%;
	object-fit: cover;
}

/* 产品详情里的联系方式小块 */
.yxseo-product-contact {
	list-style: none;
	margin: 18px 0;
	padding: 16px 20px;
	border-radius: var(--yxseo-radius);
	background-color: rgba(0, 0, 0, .028);
	font-size: 14px;
	line-height: 2;
	color: var(--color-contrast-medium, #595959);
}

/*
 * 文章正文宽度（目标站的博客正文有最大宽度限制）。
 *
 * 只对博客文章（single.php + .ms-sp--article-inner）生效。
 * 包装工艺详情页（single-portfolios.php）虽然也带 .ms-single-post，
 * 但它的正文是整页的 Elementor 版式，必须通栏 ——
 * 套上 860px 之后两栏被压到 370px 宽，右栏文字撑得老高，
 * 左栏图片又带着 flex-grow:1 跟着长，整块变成一列竖条。
 * 所以这里用 :not(.ms-content--portfolio) 把它排除掉。
 */
.ms-sp--article {
	margin: 10px 0 40px;
}

.ms-sp--article-inner,
.ms-single-post:not(.ms-content--portfolio) .entry-content {
	width: 100%;
	max-width: 860px;
	margin: 0 auto;
	padding: 0 20px;
}

.ms-single-post:not(.ms-content--portfolio) .entry-content h2 {
	margin: 40px 0 16px;
	font-size: 28px;
}

.ms-single-post:not(.ms-content--portfolio) .entry-content h3 {
	margin: 32px 0 14px;
	font-size: 22px;
}

.ms-single-post:not(.ms-content--portfolio) .entry-content p {
	margin: 0 0 20px;
	line-height: 1.9;
}

.ms-single-post:not(.ms-content--portfolio) .entry-content img {
	max-width: 100%;
	height: auto;
	border-radius: var(--yxseo-radius);
}

/* 上下篇 */
.post-navigation {
	margin: 40px 0;
}

.post-navigation .nav-links {
	display: flex;
	flex-wrap: wrap;
	gap: 16px;
}

.post-navigation .nav-previous,
.post-navigation .nav-next {
	flex: 1 1 260px;
}

.post-navigation .nav-previous.is-empty,
.post-navigation .nav-next.is-empty {
	visibility: hidden;
}

.post-navigation a {
	display: block;
	padding: 18px 22px;
	border-radius: var(--yxseo-radius);
	background-color: #fff;
	text-decoration: none;
	color: inherit;
	transition: box-shadow .25s ease, transform .25s ease;
}

.post-navigation a:hover {
	transform: translateY(-2px);
	box-shadow: var(--yxseo-shadow);
}

.post-navigation .nav-label {
	display: block;
	font-size: 13px;
	color: var(--color-contrast-low, #b3b3b3);
	margin-bottom: 4px;
}

.post-navigation .post-title {
	margin: 0;
	font-size: 16px;
	font-weight: 600;
}

/* 文章列表卡片之间留白 */
.ms-posts--list > .grid-item {
	margin-bottom: 24px;
	padding-bottom: 24px;
	border-bottom: 1px solid rgba(0, 0, 0, .07);
}

.ms-posts--list > .grid-item__thumb img,
.ms-posts--list .media-wrapper img {
	width: 100%;
	height: auto;
	border-radius: var(--yxseo-radius);
	object-fit: cover;
}

.ms-posts--list .post-excerpt {
	color: var(--color-contrast-medium, #595959);
	line-height: 1.8;
}

/* 即时搜索面板里的链接 */
.yxseo-search-panel a:hover {
	background-color: rgba(0, 0, 0, .05);
}

/* 分页在窄屏的收缩 */
@media (max-width: 575px) {
	nav.pagination .pagination__item {
		min-width: 36px;
		height: 36px;
		padding: 0 9px;
		font-size: 13px;
	}
}
