/*
Theme Name:   XePress
Theme URI:    https://yythemes.com/
Description:  A child theme of XeTheme that recreates the yythemes homepage appearance.
Author:       Your Name
Author URI:   https://yythemes.com/
Template:     xetheme
Version:      1.0.1
License:      GNU General Public License v2 or later
License URI:  http://www.gnu.org/licenses/gpl-2.0.html
Text Domain:  xepress
Tags:         one-column, custom-colors, custom-menu, custom-logo, featured-images
*/

/* =========================================================
   0. Design tokens
   - 颜色 & 页面宽度直接继承 XeTheme 的 CSS 变量：
       --xe-main-color, --xe-dark-color, --xe-light-color,
       --xe-fg-color, --xe-muted, --xe-page-width
   - XePress 默认把主色改为紫色（见 functions.php 中的
     xetheme_color_defaults 过滤器）
   - 仅保留 XePress 特有的布局变量 --xepress-header-h
   ========================================================= */
:root {
    /* 头部高度，用于 hero 顶部让位透明页头 */
    --xepress-header-h: 72px;
}

/* =========================================================
   2. Hero —— 顶部让出透明页头高度
   ========================================================= */
.xepress-hero {
    background-color: #242a56;
    background-image:
        radial-gradient(circle at 20% 20%, rgba(104, 120, 214, 0.45), transparent 55%),
        radial-gradient(circle at 80% 80%, rgba(77, 97, 214, 0.45), transparent 55%),
        linear-gradient(135deg, #242a56 0%, #3a4d8f 100%);
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    color: #ffffff;
    text-align: center;

    /* 关键：让出头部高度，使透明页头悬浮于 hero 上方 */
    padding: calc(var(--xepress-header-h) + 80px) 20px 260px;

    position: relative;
}

.xepress-hero .container {
    max-width: var(--xe-page-width, 1320px);
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

.xepress-hero__title {
    font-size: 34px;
    font-weight: 700;
    color: #ffffff;
    margin: 0 0 20px;
    line-height: 1.3;
    letter-spacing: .5px;
}

.xepress-hero__desc {
    font-size: 18px;
    color: rgba(255, 255, 255, 0.85);
    max-width: 740px;
    margin: 0 auto;
    line-height: 1.7;
}

/* =========================================================
   3. Main / Product Grid
   ========================================================= */
.xepress-main {
    padding: 0 0 60px;
    margin-top: -160px;
    position: relative;
    z-index: 2;
}

.xepress-main .container {
    max-width: var(--xe-page-width, 1320px);
    margin: 0 auto;
}

.xepress-flex {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
}

.xepress-card {
    width: 31.5%;
    margin-bottom: 38px;
    background-color: #ffffff;
    border-radius: 10px;
    padding: 20px;
    box-shadow: 0 0 1.25rem rgba(31, 45, 61, 0.05);
    transition: transform .2s ease, box-shadow .2s ease;
    text-align: center;
    box-sizing: border-box;
}

.xepress-card:hover {
    transform: translateY(-10px);
    box-shadow: 0 1rem 3rem rgba(31, 45, 61, 0.125);
}

.xepress-card__body {
    padding: 0;
    text-align: center;
}

.xepress-card__data {
    margin: 15px 0;
}

/* 标题：只显示一行 */
.xepress-card__title {
    font-size: 18px;
    font-weight: 700;
    margin: 0 0 8px;
    line-height: 1.4;

}

.xepress-card__title a {
    color: var(--xe-fg-color, #333);
    text-decoration: none;
    transition: color .2s ease;

}

.xepress-card__version {
	padding: 3px 8px;
    font-size: 13px;
    font-weight: 500;
    color: #ffffff;
    background: var(--xe-main-color);
    border-radius: 3px;
    letter-spacing: .5px;
    line-height: 1;
}

.xepress-card__title a:hover {
    color: var(--xe-main-color);
}

/* 描述：只显示两行 */
.xepress-card__desc {
    font-size: 14px;
    color: var(--xe-muted, #999);
    line-height: 1.6;
    margin: 0;
    /* 固定两行高度，保持同行卡片底部对齐 */
    height: calc(1.6em * 2);
    /* 两行溢出省略 */
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

/* 缩略图：固定 16:9 比例，任何断点下视觉一致 */
.xepress-card__thumb {
    display: block;
    width: 100%;
    border-radius: 5px;
    overflow: hidden;
    margin: 15px 0;
    padding:10px;
}

.xepress-card__thumb img {
    display: block;
    width: 100%;
    height: 100%;
    max-height:260px;
    object-fit: cover;
    transform: scale(1);
    transition: transform .3s ease;
}

.xepress-card:hover .xepress-card__thumb img {
    transform: scale(1.05);
}

.xepress-card__price {
    color: #ef4444;
    font-size: 20px;
    font-weight: 600;
    margin: 10px 0 0;
    min-height: 28px;
}

.xepress-card__price .woocommerce-Price-amount {
    color: #ef4444;
}

.xepress-card__price del .woocommerce-Price-amount {
    color: #999;
    font-size: 14px;
    margin-right: 6px;
    text-decoration: line-through;
    font-weight: 400;
}

.xepress-card__price .free {
    color: #16a34a;
}

.xepress-card__buttons {
    margin-top: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 15px;
    justify-content: center; 
}

.xepress-btn {
    display: inline-block;
    padding: 10px 18px;
    border-radius: 4px;
    font-size: 14px;
    font-weight: 500;
    line-height: 1;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
    border: 1px solid transparent;
    cursor: pointer;
}

.xepress-btn--primary {
    background-color: var(--xe-main-color);
    color: #ffffff;
}

.xepress-btn--primary:hover {
    background-color: var(--xe-dark-color);
    color: #ffffff;
}

.xepress-btn--ghost {
    background-color: transparent;
    color: var(--xe-main-color);
    border-color: var(--xe-main-color);
}

.xepress-btn--ghost:hover {
    background-color: var(--xe-main-color);
    color: #ffffff;
}

.xepress-badge {
    display: inline-block;
    font-size: 12px;
    padding: 2px 8px;
    border-radius: 10px;
    background-color: var(--xe-light-color);
    color: #ffffff;
    margin-left: 6px;
    vertical-align: middle;
}

.xepress-badge--sale {
    background-color: #ef4444;
}

.xepress-empty {
    width: 100%;
    text-align: center;
    padding: 60px 20px;
    color: var(--xe-muted, #999);
    background-color: #ffffff;
    border-radius: 10px;
    box-shadow: 0 0 1.25rem rgba(31, 45, 61, 0.05);
}

/* =========================================================
   4. Pagination
   ========================================================= */
.xepress-pagination {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    padding: 0;
    margin: 40px 0 0;
    list-style: none;
    text-align: center;
}

.xepress-pagination .page-numbers {
    display: inline-block;
    padding: 8px 14px;
    font-size: 14px;
    color: #666666;
    background-color: #ffffff;
    border: 1px solid #dee2e6;
    border-radius: 6px;
    text-decoration: none;
    transition: background-color .2s ease, color .2s ease;
    line-height: 1;
}

.xepress-pagination .page-numbers.current,
.xepress-pagination .page-numbers:hover {
    background-color: var(--xe-main-color);
    border-color: var(--xe-main-color);
    color: #ffffff;
}

/* =========================================================
   5. Responsive
   ========================================================= */
@media screen and (max-width: 1024px) {
    .xepress-card {
        width: 48.5%;
        margin-bottom: 26px;
    }
}

@media screen and (max-width: 767px) {
    :root { --xepress-header-h: 60px; }

    .xepress-hero {
        padding: calc(var(--xepress-header-h) + 50px) 20px 110px;
    }
    .xepress-hero__title {
        font-size: 24px;
    }
    .xepress-hero__desc {
        font-size: 16px;
    }
    .xepress-main {
        margin-top: -60px;
    }
    .xepress-card {
        width: 100%;
        margin-bottom: 20px;
    }
    .xepress-card__title {
        font-size: 16px;
    }
}




/* =========================================================
   6. 单品页模板（覆盖 WooCommerce single-product）
   ========================================================= */
.single-product .site-main {
    max-width: 100%;
    padding: 0;
    margin-bottom: 0;
}
.single-product .woocommerce-notices-wrapper{
    display:none;
}
/* ---------- Hero ---------- */
.xepress-single-product .xepress-product-hero {
	position: relative;
	background-color: #242a56;
	background-image:
		radial-gradient(circle at 20% 20%, rgba(104, 120, 214, 0.35), transparent 55%),
		radial-gradient(circle at 80% 80%, rgba(77, 97, 214, 0.35), transparent 55%),
		linear-gradient(135deg, #242a56 0%, #3a4d8f 100%);
	background-size: cover;
	background-position: center center;
	background-repeat: no-repeat;
	color: #ffffff;
	padding: calc(var(--xe-header-total-height, var(--xepress-header-h, 72px)) + 60px) 20px 80px;
}

.xepress-single-product .xepress-product-hero .container {
	max-width: var(--xe-page-width, 1320px);
}

.xepress-product-hero__inner {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 40px;
	justify-content: space-between;
}

.xepress-product-hero__content {
	flex: 1 1 480px;
	min-width: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
}

.xepress-product-hero__image {
	flex: 0 1 500px;
	max-width: 100%;
}

.xepress-product-hero__image img {
	display: block;
	width: 100%;
	height: auto;
	border-radius: 10px;
	box-shadow: 0 30px 60px rgba(0, 0, 0, .35);
}

.xepress-product-hero__title {
	display: flex;
	align-items: center;
	flex-wrap: wrap;
	gap: 12px;
	margin: 0 0 20px;
	font-size: 30px;
	font-weight: 600;
	color: #fff;
	line-height: 1.3;
	letter-spacing: .5px;
}

.xepress-product-hero__version {
	display: inline-block;
	padding: 4px 12px;
	font-size: 15px;
	font-weight: 500;
	color: #ffffff;
	background: #4a5cb8;
	border-radius: 5px;
	letter-spacing: .5px;
	line-height: 1.4;
}

.xepress-product-hero__desc {
	font-size: 15px;
	line-height: 1.85;
	color: rgba(255, 255, 255, 0.8);
	margin-bottom: 26px;
	max-width: 560px;
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
    overflow: hidden;
    /* 可选：防止长单词撑破容器 */
    word-break: break-all; 
    text-align:center;
}

.xepress-product-hero__prices {
	margin-bottom: 26px;
}

.xepress-product-hero__price {
	font-size: 30px;
	font-weight: 600;
	color: #ffffff;
	line-height: 1.2;
}

.xepress-product-hero__price .woocommerce-Price-amount {
	color: #ffffff;
}

.xepress-product-hero__price del {
	color: rgba(255, 255, 255, 0.55);
	font-size: 18px;
	font-weight: 400;
	margin-right: 8px;
}

.xepress-product-hero__price ins {
	text-decoration: none;
	color: #ffffff;
}

.xepress-product-hero__price-note {
	margin-top: 6px;
	font-size: 14px;
	color: #f8b84e;
	font-weight: 500;
}

.xepress-product-hero__buttons {
	display: flex;
	flex-wrap: wrap;
	align-items: center;
	gap: 10px;
	margin-bottom: 26px;
}

.xepress-product-hero__buttons .cart {
	margin: 0;
	padding: 0;
	display: contents;
    display: flex;
    gap: 10px;
    justify-content: center;
    flex-wrap: wrap;
}

.woocommerce .xepress-product-hero__buttons .button {
	display: inline-flex;
	align-items: center;
	justify-content: center;
	min-width: 100px;
	padding: 11px 26px;
	font-size: 14px;
	font-weight: 500;
	color: #fff;
	text-decoration: none;
	border: 0;
	border-radius: 4px;
	cursor: pointer;
	font-family: inherit;
	line-height: 1.4;
	transition: transform .2s, box-shadow .2s, background-color .2s;
}

.woocommerce .xepress-product-hero__buttons .button:hover {
	color: #fff;
	transform: translateY(-2px);
	box-shadow: 0 8px 20px rgba(0, 0, 0, .28);
}

.woocommerce .xepress-product-hero__buttons .single_add_to_cart_button    { background: #2fa84f!important; }
.woocommerce .xepress-product-hero__buttons .single_add_to_cart_button:hover    { background: #268c41!important; }

.woocommerce .xepress-product-hero__buttons .xe-buy-now-button { background: #2b8bd6!important; }
.woocommerce .xepress-product-hero__buttons .xe-buy-now-button:hover { background: #216ba5!important; }

.woocommerce .xepress-product-hero__buttons .xe-free-download-link   { background: #7e57c2!important; }
.woocommerce .xepress-product-hero__buttons .xe-free-download-link:hover   { background: #6846a3!important; }

.woocommerce .xepress-product-hero__buttons .xe-admin-download-link   { background: #29b6c5!important; }
.woocommerce .xepress-product-hero__buttons .xe-admin-download-link:hover   { background: #1f8c99!important; }

/* 可变产品：让默认加购表单的按钮继承绿色按钮风格 */
.woocommerce .xepress-product-hero__buttons .xe-demo-link {
	background: #2fa84f!important;
}
.woocommerce .xepress-product-hero__buttons .xe-demo-link:hover {
	background: #268c41!important;
}

.xepress-product-hero__contact {
	display: flex;
	flex-wrap: wrap;
	gap: 24px;
	font-size: 13px;
	color: rgba(255, 255, 255, 0.75);
}

@media only screen and (max-width: 767px) {
    .xepress-product-hero__contact {
        flex-direction: column;
        align-items: center;
        gap: 10px;
    }
}

.xepress-product-hero__contact-item {
	display: inline-flex;
	align-items: center;
	gap: 6px;
}

.xepress-product-hero__contact-item svg {
	fill: rgba(255, 255, 255, 0.7);
}

/* ---------- Body ---------- */
.xepress-single-product .xepress-product-body {
	background: #ffffff;
	padding: 20px 0 60px;
}

.xepress-single-product .xepress-product-body .container {
	max-width: var(--xe-page-width, 1320px);
}

.xepress-product-tabs {
	display: flex;
	flex-wrap: wrap;
	gap: 0;
	border-bottom: 1px solid #ebebeb;
	margin-bottom: 32px;
}

.xepress-product-tab {
	position: relative;
	padding: 14px 24px;
	font-size: 15px;
	color: #666;
	background: transparent;
	border: 0;
	cursor: pointer;
	transition: color .2s;
	font-family: inherit;
}

.xepress-product-tab:hover {
	color: var(--xe-main-color);
}

.xepress-product-tab.is-active {
	color: var(--xe-main-color);
	font-weight: 600;
}

.xepress-product-tab.is-active::after {
	content: "";
	position: absolute;
	left: 0;
	right: 0;
	bottom: -1px;
	height: 2px;
	background: var(--xe-main-color);
}

.xepress-product-panels {
	position: relative;
}

.xepress-product-panel {
	display: none;
}

.xepress-product-panel.is-active {
	display: block;
}

.xepress-product-content {
	font-size: 15px;
	line-height: 1.85;
	color: #444;
}

.xepress-product-content blockquote {
	margin: 0 0 28px;
	padding: 20px 24px 20px 36px;
	background: #f5f6f8;
	border-radius: 6px;
	color: #666;
	font-size: 14px;
	line-height: 1.8;
	position: relative;
	border-left: 0;
}

.xepress-product-content blockquote::before {
	content: "\201C";
	position: absolute;
	top: 6px;
	left: 12px;
	font-size: 34px;
	color: #c9cbd1;
	font-family: Georgia, serif;
	line-height: 1;
}

.xepress-product-content h2,
.xepress-product-content h3 {
	margin: 28px 0 14px;
	font-size: 17px;
	font-weight: 600;
	color: #222;
}

.xepress-product-content ul {
	padding-left: 22px;
	margin: 0 0 20px;
	list-style: none;
}

.xepress-product-content ul li {
	position: relative;
	margin-bottom: 10px;
	padding-left: 8px;
	color: #555;
}

.xepress-product-content ul li::before {
	content: "";
	position: absolute;
	left: -12px;
	top: 12px;
	width: 5px;
	height: 5px;
	background: var(--xe-main-color);
	border-radius: 50%;
}

.xepress-product-content a {
	color: var(--xe-main-color);
}

.xepress-product-content a:hover {
	text-decoration: underline;
}

.xepress-product-content code {
	padding: 2px 6px;
	font-size: 13px;
	background: #f2f4f7;
	border-radius: 3px;
	color: #d6336c;
}

/* ---------- 响应式 ---------- */
@media screen and (max-width: 900px) {
	.xepress-product-hero__inner {
		flex-direction: column-reverse;
	}
	.xepress-product-hero__content,
	.xepress-product-hero__image {
		flex: 1 1 100%;
		width: 100%;
	}
	.xepress-product-hero__image {
		max-width: 480px;
		margin: 0 auto;
	}
}

@media screen and (max-width: 767px) {
	.xepress-single-product .xepress-product-hero {
		padding: calc(var(--xe-header-total-height, var(--xepress-header-h, 60px)) + 40px) 16px 60px;
	}
	.xepress-product-hero__title {
        display:block;
        line-height:1.5;
		font-size: 20px;
	}
	.xepress-product-hero__price {
		font-size: 24px;
	}
	.xepress-product-btn {
		flex: 1 1 auto;
		min-width: 0;
		padding: 10px 16px;
		font-size: 13px;
	}
	.xepress-product-tab {
		padding: 12px 16px;
		font-size: 14px;
	}
	.xepress-single-product .xepress-product-body {
		padding: 32px 0 48px;
	}
}