/* ============================================================
   Newkra Technology Limited UX Fixes —— 样式修正
   ------------------------------------------------------------
   1) 菜单栏左侧 Logo 尺寸收敛 + 左移 + 与菜单分隔线对齐 + 右侧品牌文字
   2) 首页「关联产品 / 更多入口」模块样式
   ============================================================ */

/* ------------------------------------------------------------
   1. Logo 尺寸收敛与水平/垂直定位
   ------------------------------------------------------------
   Astra 原始输出：桌面 .custom-logo-link img 宽 153px（原图 153×120 竖版），
   导航栏高度被这个竖版 logo 撑高，视觉头重脚轻。
   本段统一：尺寸收窄 → 左侧内边距归零左移 → 垂直居中贴合菜单分隔线 →
   右侧用伪元素补一行品牌名。

   图集结构（Astra）：
     .site-header-primary-section-left > .site-branding > .site-logo-img > a.custom-logo-link > img
     .site-header-primary-section-right > ... 主菜单
   ------------------------------------------------------------ */

/* --- 1.1 水平左移：让 logo 突破 1240px 居中容器，贴近页面左边缘 --- */
/*
   实测：.site-primary-header-wrap 宽度 1240px + 左右各 100px margin 居中，
   再叠加 20px padding-left → 桌面 logo 起点落在 x=120。
   这里把容器左侧的 margin / padding 一并归零，让左栏内容外扩到贴近视口左缘
   （保留 24px 呼吸位，避免完全贴边）。
*/
@media (min-width: 922px) {
    .site-header .site-primary-header-wrap.ast-container {
        max-width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        padding-left: 24px !important;
    }
}
.site-header .ast-builder-grid-row .site-header-primary-section-left {
    padding-left: 0 !important;
}
.site-header .site-branding.ast-site-identity {
    margin-left: 0 !important;
    padding-left: 0 !important;
}
/* 图集右侧原生有 16px 间隙，加上品牌文字后不需要，改由伪元素 margin 控制 */
.site-header .site-branding .site-logo-img {
    padding-right: 0 !important;
}

/* --- 1.2 垂直对齐：让 logo 中线与主菜单中线（分隔线之上）齐平 --- */
.site-header .site-header-primary-section-left.site-header-section,
.site-header .site-header-primary-section-right.site-header-section {
    align-items: center !important;
}
.site-header .site-branding.ast-site-identity {
    display: flex !important;
    align-items: center !important;
    padding-top: 0 !important;
    padding-bottom: 0 !important;
    height: 100%;
}
.site-header .site-branding .site-logo-img {
    display: flex;
    align-items: center;
    line-height: 0;
}

/* --- 1.3 尺寸：桌面 66px / 平板 58px / 手机 48px --- */
.site-header .site-branding .custom-logo-link img.custom-logo,
.site-header .ast-site-identity .custom-logo-link img.custom-logo,
.site-header .site-logo-img img.custom-logo {
    width: 66px !important;
    max-width: 66px !important;
    height: auto !important;
    display: block !important;
}
.site-header .site-branding .astra-logo-svg,
.site-header .ast-site-identity .astra-logo-svg {
    width: 66px !important;
}
.site-header .site-branding .custom-logo-link {
    display: flex !important;
    align-items: center !important;
}

/* --- 1.4 logo 右侧品牌名（通过伪元素，无需改模板） --- */
.site-header .site-branding .site-logo-img {
    position: relative;
}
.site-header .site-branding .site-logo-img::after {
    content: "NEWKRA TECHNOLOGY LIMITED";
    display: inline-block;
    margin-left: 16px;
    font-size: 18px;
    font-weight: 700;
    letter-spacing: 1.6px;
    line-height: 1.2;
    color: #1D1D1F;
    white-space: nowrap;
    vertical-align: middle;
}
.site-header .site-branding .site-logo-img {
    display: flex;
    align-items: center;
    gap: 0;
}

/* 中等屏：文字缩小，避免挤压菜单 */
@media (max-width: 1280px) {
    .site-header .site-branding .site-logo-img::after {
        font-size: 14px;
        letter-spacing: 1px;
        margin-left: 12px;
    }
}

/* 平板 / 手机：header 空间紧张，隐藏品牌文字，只留 logo */
@media (max-width: 921px) {
    .site-header .site-branding .site-logo-img::after {
        display: none !important;
    }
    .site-header .site-branding .custom-logo-link img.custom-logo,
    .site-header .ast-site-identity .custom-logo-link img.custom-logo,
    .site-header .site-logo-img img.custom-logo {
        width: 58px !important;
        max-width: 58px !important;
    }
    .site-header .site-branding .astra-logo-svg {
        width: 58px !important;
    }
}

@media (max-width: 544px) {
    .site-header .site-branding .custom-logo-link img.custom-logo,
    .site-header .ast-site-identity .custom-logo-link img.custom-logo,
    .site-header .site-logo-img img.custom-logo {
        width: 48px !important;
        max-width: 48px !important;
    }
    .site-header .site-branding .astra-logo-svg {
        width: 48px !important;
    }
}

/* ------------------------------------------------------------
   2. 首页 hero banner：1980×750 键盘大图 + 左文右图
   ------------------------------------------------------------
   子主题原始 .mk-hero 是纯色 #101013 + 居中文字。
   这里覆写为「整幅键盘场景图 + 左侧文案层」：
     - 图幅按 1980:750 (2.64:1) 比例铺满，超出部分居中裁切
     - 破格到视口全宽（脱离 1200px 容器），视觉更饱满
     - 文案靠在左侧，避开右侧键盘主体
   ------------------------------------------------------------ */

/* 首页正文容器去掉左右内距，让 banner 可以真正通栏 */
body.home .site-content > .ast-container,
body.home .ast-container {
    padding-left: 0 !important;
    padding-right: 0 !important;
    max-width: 100% !important;
}
/* banner 之外的区块重新补回内距，保持原有版式 */
body.home .entry-content > *:not(.mk-hero--banner):not(.mk-hero) {
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding-left: 24px;
    padding-right: 24px;
    box-sizing: border-box;
}
/* 隐藏 Astra 自动输出的页面标题 "Home"（banner 已承担首屏标题职责） */
body.home .entry-header .entry-title {
    display: none !important;
}
body.home .entry-header.ast-no-thumbnail {
    display: none !important;
}
/* 首页主内容区去掉顶部 60px 间距，让 banner 直接顶到 header 下沿 */
body.home #primary,
body.home #main,
body.home article {
    margin-top: 0 !important;
    padding-top: 0 !important;
}
body.home .entry-content {
    margin-top: 0 !important;
    padding-top: 0 !important;
}

.mk-hero.mk-hero--banner {
    position: relative;
    padding: 0 !important;
    text-align: left !important;
    background: #101013 !important;
    overflow: hidden;
    width: 100%;
    max-width: 100% !important;
    min-height: clamp(320px, 38vw, 750px);
    display: flex;
    align-items: center;
}

/* 背景图：铺满整个 banner，按 2.64:1 比例裁切 */
.mk-hero--banner .mk-hero__bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    line-height: 0;
}
.mk-hero--banner .mk-hero__bg img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center center;
    display: block;
}
/* 左侧再压一层柔和的暗部渐变，保证任意屏宽下文字都清晰 */
.mk-hero--banner .mk-hero__bg::after {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(
        90deg,
        rgba(9, 9, 11, .88) 0%,
        rgba(9, 9, 11, .74) 28%,
        rgba(9, 9, 11, .42) 48%,
        rgba(9, 9, 11, .08) 66%,
        rgba(9, 9, 11, 0) 82%
    );
}

/* 内容层：限宽 1200px，与页面其它区块对齐 */
.mk-hero--banner .mk-hero__inner {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 1200px;
    margin: 0 auto;
    padding: 64px 24px;
    box-sizing: border-box;
}
.mk-hero--banner .mk-hero__copy {
    max-width: 620px;
}

/* 文案排版 */
.mk-hero--banner h1 {
    font-size: 42px !important;
    line-height: 1.22 !important;
    font-weight: 700 !important;
    color: #fff !important;
    margin: 0 0 18px !important;
    text-shadow: 0 2px 20px rgba(0, 0, 0, .45);
}
.mk-hero--banner p {
    font-size: 17px !important;
    line-height: 1.62 !important;
    color: #C9C9D1 !important;
    margin: 0 0 32px !important;
    max-width: 560px;
    text-shadow: 0 1px 12px rgba(0, 0, 0, .4);
}
.mk-hero--banner .mk-hero__cta {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    align-items: center;
}
.mk-hero--banner .mk-hero__cta .mk-btn {
    margin: 0 !important;
}
.mk-hero--banner .mk-btn.ghost {
    border-color: rgba(255, 255, 255, .45) !important;
    color: #fff !important;
}
.mk-hero--banner .mk-btn.ghost:hover {
    border-color: var(--mk-orange) !important;
    background: rgba(255, 103, 0, .14);
}

/* --- 响应式 --- */
@media (max-width: 1100px) {
    .mk-hero--banner h1 { font-size: 36px !important; }
    .mk-hero--banner p { font-size: 16px !important; }
    .mk-hero--banner .mk-hero__copy { max-width: 56%; }
}

@media (max-width: 900px) {
    /* 窄屏：图片改为上下构图所需的固定高度，文案压在上半部 */
    .mk-hero.mk-hero--banner {
        min-height: 420px;
        align-items: flex-end;
    }
    .mk-hero--banner .mk-hero__bg img {
        object-position: 68% center;
    }
    .mk-hero--banner .mk-hero__bg::after {
        background: linear-gradient(
            180deg,
            rgba(9, 9, 11, .55) 0%,
            rgba(9, 9, 11, .72) 45%,
            rgba(9, 9, 11, .92) 100%
        );
    }
    .mk-hero--banner .mk-hero__inner { padding: 40px 20px; }
    .mk-hero--banner .mk-hero__copy { max-width: 100%; }
    .mk-hero--banner h1 { font-size: 30px !important; }
    .mk-hero--banner p { font-size: 15px !important; }
}

@media (max-width: 560px) {
    .mk-hero.mk-hero--banner { min-height: 380px; }
    .mk-hero--banner h1 { font-size: 25px !important; }
    .mk-hero--banner p { font-size: 14px !important; margin-bottom: 24px !important; }
    .mk-hero--banner .mk-hero__cta { gap: 10px; }
    .mk-hero--banner .mk-hero__cta .mk-btn {
        padding: 12px 26px !important;
        font-size: 14.5px !important;
    }
}

/* ------------------------------------------------------------
   3. 首页 [products] 卡片补一个「查看详情」的视觉线索
   ------------------------------------------------------------ */
.mk-section .woocommerce ul.products li.product .woocommerce-loop-product__link {
    display: block;
}
.mk-section .woocommerce ul.products li.product {
    transition: transform .18s, box-shadow .2s;
}
.mk-section .woocommerce ul.products li.product:hover {
    transform: translateY(-3px);
}

/* ------------------------------------------------------------
   4. 产品页顶部 USP 信任横条（填充 header 下 60px 空白）
   ------------------------------------------------------------ */
.mkux-usp-bar { margin: -50px 0 26px; }
.mkux-usp-bar .mkux-usp-list {
    list-style: none !important;
    margin: 0;
    padding: 14px 22px;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px 26px;
    background: #fff;
    border: 1px solid #EAEAEE;
    border-radius: 12px;
    box-shadow: 0 6px 18px rgba(16,16,20,.04);
}
.mkux-usp-bar li { display: flex; flex-direction: column; gap: 2px; padding-left: 16px; position: relative; }
.mkux-usp-bar li::before {
    content: "";
    position: absolute;
    left: 0;
    top: 7px;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #FF6700;
}
.mkux-usp-bar li strong { font-size: 14px; color: #1B1B1F; font-weight: 700; }
.mkux-usp-bar li span { font-size: 12.5px; color: #9A9AA0; }
@media (max-width: 900px) {
    .mkux-usp-bar { margin-top: -20px; }
    .mkux-usp-bar .mkux-usp-list { grid-template-columns: repeat(2, 1fr); padding: 12px 16px; }
}
@media (max-width: 480px) {
    .mkux-usp-bar { margin-top: 12px; }
    .mkux-usp-bar .mkux-usp-list { grid-template-columns: 1fr 1fr; }
}

/* ------------------------------------------------------------
   5. 产品循环卡片对齐：标题区固定高度、按钮贴底
   （首页 products 模块 + 分类页循环卡片通用）
   ------------------------------------------------------------ */
.mk-section .woocommerce ul.products li.product,
.woocommerce ul.products li.product,
.woocommerce-page ul.products li.product {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}
.mk-section .woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce ul.products li.product .woocommerce-loop-product__title,
.woocommerce-page ul.products li.product .woocommerce-loop-product__title {
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
    min-height: 62px;
    width: 100%;
}
.mk-section .woocommerce ul.products li.product .button,
.woocommerce ul.products li.product .button,
.woocommerce-page ul.products li.product .button {
    margin-top: auto !important;
}
