/*
Theme Name: Edu Press Child
Description: Child theme of Edu Press
Template: edu-press
Version: 1.0.0
*/

/* Import parent theme styles */
@import url("../edu-press/style.css");

/* 本地化 woff2 字体（来自 uploads） */
@font-face {
    font-family: 'FDZhengWen';
    src: url('/wp-content/uploads/zhengwen.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}
@font-face {
    font-family: 'FDBiaoti';
    src: url('/wp-content/uploads/biaoti.woff2') format('woff2');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

/* 收银台页面样式 - 与checkout页面保持一致 */
.cashier-page .woocommerce {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
}

.cashier-page .woocommerce-checkout {
    background: #fff;
    border-radius: 5px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    padding: 30px;
}

.cashier-page .col2-set {
    display: flex;
    gap: 30px;
    flex-wrap: wrap;
}

.cashier-page .col-1,
.cashier-page .col-2 {
    flex: 1;
    min-width: 300px;
}

.cashier-page .woocommerce-billing-fields h3 {
    color: #333;
    font-size: 1.5em;
    margin-bottom: 20px;
    border-bottom: 2px solid #f0f0f0;
    padding-bottom: 10px;
}

.cashier-page .form-row {
    margin-bottom: 20px;
}

.cashier-page .form-row label {
    display: block;
    margin-bottom: 5px;
    font-weight: 600;
    color: #555;
}

.cashier-page .form-row .required {
    color: #e74c3c;
}

.cashier-page .input-text,
.cashier-page .select {
    width: 100%;
    padding: 12px 15px;
    border: 1px solid #ddd;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
    box-sizing: border-box;
}

.cashier-page .input-text:focus,
.cashier-page .select:focus {
    outline: none;
    border-color: #007cba;
    box-shadow: 0 0 5px rgba(0, 124, 186, 0.3);
}

.cashier-page .form-row-first,
.cashier-page .form-row-last {
    width: 48%;
    display: inline-block;
}

.cashier-page .form-row-first {
    margin-right: 4%;
}

.cashier-page .button.alt {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
    margin-top: 20px;
}

.cashier-page .button.alt:hover {
    background: #005a87;
}

.cashier-page .button.alt:disabled {
    background: #ccc;
    cursor: not-allowed;
}

/* 订单摘要样式 */
.cashier-page #order_review {
    background: #f9f9f9;
    border: 1px solid #e0e0e0;
    border-radius: 5px;
    padding: 20px;
}

.cashier-page #order_review h3 {
    color: #333;
    font-size: 1.3em;
    margin-bottom: 15px;
    border-bottom: 1px solid #ddd;
    padding-bottom: 10px;
}

.cashier-page .shop_table {
    width: 100%;
    border-collapse: collapse;
    margin-bottom: 20px;
}

.cashier-page .shop_table th,
.cashier-page .shop_table td {
    padding: 12px;
    text-align: left;
    border-bottom: 1px solid #e0e0e0;
}

.cashier-page .shop_table th {
    background: #f5f5f5;
    font-weight: 600;
    color: #333;
}

.cashier-page .shop_table .product-name {
    font-weight: 500;
}

.cashier-page .shop_table .product-quantity {
    color: #666;
    font-weight: normal;
}

.cashier-page .shop_table .order-total th,
.cashier-page .shop_table .order-total td {
    font-weight: 600;
    font-size: 1.1em;
    border-top: 2px solid #ddd;
    background: #f0f0f0;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .cashier-page .col2-set {
        flex-direction: column;
    }
    
    .cashier-page .form-row-first,
    .cashier-page .form-row-last {
        width: 100%;
        margin-right: 0;
        margin-bottom: 15px;
    }
    
    .cashier-page .woocommerce-checkout {
        padding: 20px 15px;
    }
}

/* 隐藏checkout页面的付款方式验证错误信息 */
.woocommerce-checkout .payment-methods-hidden {
    display: none !important;
}

/* 确保checkout页面下单按钮正常显示 */
.woocommerce-checkout #payment .place-order {
    background: transparent;
    border: none;
    padding: 0;
}

.woocommerce-checkout #place_order {
    background: #007cba;
    color: #fff;
    border: none;
    padding: 15px 30px;
    font-size: 16px;
    font-weight: 600;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
    width: 100%;
}

.woocommerce-checkout #place_order:hover {
    background: #005a87;
}

/* Custom styles for child theme */

/* ==================================================
   全局字体优化 - Global Font Enhancement
   ================================================== */

/* 已移除 Google Fonts 的 @import，改用本地 woff2 字体 */

/* 定义字体变量 - Font Variables */
:root {
    /* 正文字体与标题：优先使用本地化 woff2 字体，回退到系统字体 */
    --custom-body-font: 'FDZhengWen', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Microsoft YaHei', 'PingFang SC', 'Hiragino Sans GB', 'Inter', 'Noto Sans SC', sans-serif;
    --custom-heading-font: 'FDBiaoti', Georgia, 'Times New Roman', 'Inter', 'Noto Serif SC', serif;
    
    /* 覆盖父主题的字体变量 */
    --thim-font_body-font-family: var(--custom-body-font) !important;
    --thim-font_title-font-family: var(--custom-heading-font) !important;
}

/* 全局正文字体 - Global Body Font */
body,
body *:not(.fa):not(.fas):not(.far):not(.fab):not(.fal):not([class*="icon-"]):not([class*="ti-"]):not([class*="thim-"]) {
    font-family: var(--custom-body-font) !important;
    /* font-family: 'Roboto'; */ /* 原始字体已注释 */
}

/* 优化字体渲染 - Optimize Font Rendering */
body {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    font-feature-settings: "kern" 1;
    font-kerning: normal;
}

/* 标题字体 - Heading Fonts (h1-h6) */
h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6,
.site-header .logo a,
.site-title,
.entry-title,
.page-title,
.widget-title,
.widgettitle {
    font-family: var(--custom-heading-font) !important;
    /* font-family: 'Playfair Display'; */ /* 原始字体已注释 */
    font-weight: 600;
    letter-spacing: 0.02em;
}

/* 页面主标题尺寸统一为 40px - Primary Page Headings */
.page-title,
.entry-title,
h1,
.h1,
.lp-content-area h1 {
    font-size: 40px !important;
    font-weight: 700 !important;
    line-height: 1.25;
}

/* 同级标题：h2.title 统一为 32px 加粗 */
h2.title {
    font-size: 32px !important;
    font-weight: 700 !important;
    line-height: 1.25;
}

/* 导航菜单字体 - Navigation Menu Font */
.navigation ul.navbar-main-menu > li a,
.main-navigation a,
.top-menu a,
.menu a {
    /* 使用标题字体，确保更强的粗体效果 */
    font-family: var(--custom-heading-font) !important;
    font-weight: 700;
    /* 允许没有粗体的字体进行合成加粗 */
    font-synthesis: weight;
}

/* 按钮字体 - Button Font */
button,
.button,
.btn,
input[type="submit"],
input[type="button"],
.woocommerce #respond input#submit,
.woocommerce a.button,
.woocommerce button.button,
.woocommerce input.button,
.woocommerce-page #respond input#submit,
.woocommerce-page a.button,
.woocommerce-page button.button,
.woocommerce-page input.button {
    font-family: var(--custom-body-font) !important;
    font-weight: 500;
}

/* 表单输入字体 - Form Input Font */
input,
textarea,
select,
.input-text,
.form-control {
    font-family: var(--custom-body-font) !important;
}

/* LearnPress 课程相关字体 - LearnPress Course Font */
.course-title,
.course-name,
.lesson-title,
.quiz-title,
.lp-content-area h1,
.lp-content-area h2,
.lp-content-area h3,
.lp-content-area h4 {
    font-family: var(--custom-heading-font) !important;
}

/* WooCommerce 产品标题字体 - WooCommerce Product Title Font */
.woocommerce .product-title,
.woocommerce .product_title,
.woocommerce h2.woocommerce-loop-product__title,
.woocommerce-page .product-title,
.woocommerce-page .product_title {
    font-family: var(--custom-heading-font) !important;
}

/* 侧边栏和小工具字体 - Sidebar & Widget Font */
.sidebar .widget,
.sidebar .widget p,
.sidebar .widget li,
.widget-area .widget,
.widget-area .widget p,
.widget-area .widget li {
    font-family: var(--custom-body-font) !important;
}

/* 文章内容字体优化 - Article Content Font Enhancement */
.entry-content,
.post-content,
.page-content,
article p,
article li {
    font-family: var(--custom-body-font) !important;
    line-height: 1.8;
    letter-spacing: 0.01em;
}

/* 引用样式优化 - Blockquote Enhancement */
blockquote,
.wp-block-quote {
    font-family: var(--custom-heading-font) !important;
    font-style: italic;
    font-weight: 400;
}

/* 代码字体保持等宽 - Code Font (Monospace) */
code,
pre,
kbd,
samp,
.code,
.wp-block-code {
    font-family: 'Consolas', 'Monaco', 'Courier New', monospace !important;
    /* 代码字体不受自定义字体影响 */
}

/* 元信息字体 - Meta Information Font */
.entry-meta,
.post-meta,
.comment-meta,
.posted-on,
.byline,
.cat-links,
.tags-links {
    font-family: var(--custom-body-font) !important;
    font-size: 0.9em;
    font-weight: 400;
}

/* 页脚字体 - Footer Font */
.site-footer,
.site-footer p,
.site-footer li,
.site-footer a {
    font-family: var(--custom-body-font) !important;
}

/* 针对 Elementor 编辑器的字体 - Elementor Font Override */
.elementor-widget-heading .elementor-heading-title,
.elementor-widget-text-editor,
.elementor-element {
    font-family: inherit !important;
}

/* 响应式字体大小优化 - Responsive Font Size */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    h1 { font-size: 1.8em; }
    h2 { font-size: 1.6em; }
    h3 { font-size: 1.4em; }
    h4 { font-size: 1.2em; }
    h5 { font-size: 1.1em; }
    h6 { font-size: 1em; }
}

/* ==================================================
   以下是原有的收银台样式 - Original Cashier Styles Below
   ================================================== */

/* ==================================================
   Featured Courses 等高与图片框统一（以第三张图片 720x404 为准）
   目标：卡片封面高度一致；图片等比缩放不变形
   ================================================== */
/* 让网格中的项目拉伸，保证同一行卡片等高 */
.thim-ekits-course[data-layout="grid"] .thim-ekits-course__inner {
    align-items: stretch;
    grid-auto-rows: 1fr;
}

/* 课程卡片纵向布局充满高度 */
.thim-ekits-course__inner .thim-ekits-course__item {
    height: 100%;
}

.thim-ekits-course__item {
    display: flex;
    flex-direction: column;
}

.thim-ekits-course__item .elementor[data-thim-ekit-loop-item-type="lp_course"],
.thim-ekits-course__item .e-parent,
.thim-ekits-course__item .e-con-inner {
    display: flex;
    flex-direction: column;
    height: 100%;
}

/* 封面图片框使用第三张图片的比例(720:404)，统一高度 */
.thim-ekits-course__item .elementor-widget-thim-loop-item-featured-image .elementor-widget-container a {
    display: block;
    width: 100%;
    aspect-ratio: 720 / 404;
    overflow: hidden;
    background: transparent;
}

/* 图片等比缩放以匹配图片框尺寸，保持不变形 */
.thim-ekits-course__item .elementor-widget-thim-loop-item-featured-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: contain;
    object-position: center center;
    display: block;
}

/* 将 Read More 按钮固定在卡片底部并满宽 */
.thim-ekits-course__item .elementor-widget-thim-loop-item-read-more {
    margin-top: auto;
}
.thim-ekits-course__item .elementor-widget-thim-loop-item-read-more .elementor-button {
    width: 100%;
}

