/*
Theme Name: Blokio Child
Template: blokio
Version: 1.0.1
Text Domain: blokio-child
*/

/* =====================================================================
   Blokio 子主题 — 自定义顶部导航栏样式
   块主题（Block Theme）适配版
   ===================================================================== */

:root {
    --blokio-child-bg: #0f1a2e;
    --blokio-child-bg-elevated: #16213d;
    --blokio-child-text: #ffffff;
    --blokio-child-muted: #a8b3cf;
    --blokio-child-accent: #ff6b35;
    --blokio-child-accent-hover: #ff8559;
    --blokio-child-link-hover: #ffd166;
    --blokio-child-transition: all .25s ease;
}

/* 深色导航栏背景 + 吸顶固定
   sticky 必须应用在模板部件包装层上：
   其直接父级（header.wp-block-template-part）只有导航栏自身高度，
   而 .wp-block-template-part 的父级 .wp-site-blocks 是整页高度，
   因此对外层包装使用 sticky 才能让导航栏在整个页面范围内吸顶。
   (Position fixed removed: only apply on the wrapping template part) */
.wp-block-template-part:has(> .blokio-child-topnav) {
    position: sticky;
    top: 0;
    z-index: 1000;
}

/* 商店（Shop）页面隐藏 WooCommerce 面包屑 */
.woocommerce-breadcrumb {
    display: none !important;
}

.blokio-header.blokio-child-topnav {
    background: var(--blokio-child-bg);
    border-bottom: 1px solid rgba(255, 255, 255, .06);
}

/* 导航链接样式 */
/* 站点标题向左移动，为导航菜单释放横向空间 */
.blokio-child-topnav .wp-block-site-title {
    margin-left: -18px;
    margin-right: 4px;
    white-space: nowrap;
}

.blokio-child-topnav .wp-block-navigation-item a {
    color: var(--blokio-child-text) !important;
    font-size: 13px;
    font-weight: 500;
    padding: 8px 6px;
    border-radius: 6px;
    transition: var(--blokio-child-transition);
    position: relative;
    white-space: nowrap;
}

.blokio-child-topnav .wp-block-navigation-item a:hover,
.blokio-child-topnav .wp-block-navigation-item a:focus {
    color: var(--blokio-child-link-hover) !important;
    background: rgba(255, 209, 102, .08);
}

/* 当前页高亮：暖黄文字 + 橙色下划线 */
.blokio-child-topnav .wp-block-navigation-item.current-menu-item > a,
.blokio-child-topnav .wp-block-navigation-item.current_page_item > a,
.blokio-child-topnav .wp-block-navigation-item.current-menu-ancestor > a {
    color: var(--blokio-child-link-hover) !important;
}

.blokio-child-topnav .wp-block-navigation-item.current-menu-item > a::after,
.blokio-child-topnav .wp-block-navigation-item.current_page_item > a::after {
    content: "";
    position: absolute;
    left: 10px;
    right: 10px;
    bottom: 2px;
    height: 2px;
    background: var(--blokio-child-accent);
    border-radius: 2px;
}

/* CTA 按钮：橙色背景上强制白字，确保清晰可读 */
.blokio-child-topnav .wp-block-button__link {
    color: #ffffff !important;
    border-radius: 24px !important;
    font-weight: 600 !important;
    transition: var(--blokio-child-transition) !important;
    white-space: nowrap;
}

.blokio-child-topnav .wp-block-button__link:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 16px rgba(255, 107, 53, .35);
}

/* =====================================================================
   导航栏社交图标（WhatsApp / Facebook / YouTube / TikTok）
   当前尺寸为 52px 按钮 / 30px 图标，现缩小至 70%：36px 按钮 / 21px 图标
   橙色圆形按钮背景，彩色品牌图标，悬浮效果
   链接为占位地址，用户可在后台自行替换为自己的账号链接
   ===================================================================== */
.blokio-child-social {
    display: inline-flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-left: 4px;
}

.blokio-child-social a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: #0f1a2e; /* match header --blokio-child-bg */
    transition: var(--blokio-child-transition);
    box-shadow: 0 3px 8px rgba(0, 0, 0, .22);
    flex: 0 0 auto;
}

.blokio-child-social a:hover,
.blokio-child-social a:focus {
    transform: translateY(-3px);
    box-shadow: 0 6px 14px rgba(234, 88, 12, .4);
}

.blokio-child-social svg {
    width: 21px;
    height: 21px;
    fill: #ffffff;
}

/* 各平台品牌彩色图标 */
.blokio-child-social a.social-whatsapp svg { fill: #25D366; }
.blokio-child-social a.social-facebook svg { fill: #1877F2; }
.blokio-child-social a.social-youtube svg { fill: #FF0000; }
.blokio-child-social a.social-tiktok svg { fill: #ffffff; }

/* =====================================================================
   页脚五大政策链接：纵向排列 + 橙色圆点
   ===================================================================== */
.blokio-child-policy-list {
    list-style: none;
    margin: 0;
    padding: 0;
}

.blokio-child-policy-list li {
    margin: 0;
    padding: 0;
    line-height: 1.4;
}

.blokio-child-policy-list li + li {
    margin-top: 14px;
}

.blokio-child-policy-list a {
    position: relative;
    display: inline-block;
    padding-left: 24px;
    color: var(--blokio-child-muted);
    font-size: 15px;
    text-decoration: none;
    transition: var(--blokio-child-transition);
}

/* 每个政策前面的橙色圆点 */
.blokio-child-policy-list a::before {
    content: "";
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    width: 9px;
    height: 9px;
    background: #ea580c;
    border-radius: 50%;
}

.blokio-child-policy-list a:hover,
.blokio-child-policy-list a:focus {
    color: var(--blokio-child-link-hover);
}

/* 页眉底部版权文字 */
.blokio-child-header-copyright {
    margin: 0;
    padding: 6px 0 10px;
    text-align: center;
    font-size: 12px;
    color: var(--blokio-child-muted);
    background: var(--blokio-child-bg);
    border-top: 1px solid rgba(255, 255, 255, .06);
}

/* 页脚版权信息：始终处于页脚最底部 */
.blokio-child-footer {
    display: flex;
    flex-direction: column;
}

.blokio-child-copyright {
    margin-top: auto;
    padding-top: 24px;
    border-top: 1px solid rgba(255, 255, 255, .12);
    width: 100%;
    color: var(--blokio-child-muted);
}

/* 响应式：小屏下保持可读 */
@media (max-width: 900px) {
    .blokio-child-topnav .wp-block-navigation-item a {
        padding: 8px 12px;
        font-size: 14px;
    }

    /* 小屏下隐藏导航栏社交图标，避免过度拥挤（可在移动菜单中使用） */
    .blokio-child-social {
        display: none;
    }
}

/* =====================================================================
   GTranslate 浮动语言切换器样式
   - 缩小到当前尺寸的 60%
   - 移动到页面最底部
   - 绿色背景 + 透明度 0.3 + 悬浮（hover）效果
   ===================================================================== */
#gt_float_wrapper {
    bottom: 0 !important;
    right: 10px !important;
    z-index: 999999 !important;
}

.gt_float_switcher {
    background: rgba(34, 197, 94, .3) !important;
    color: #ffffff !important;
    border-radius: 6px !important;
    transition: all .25s ease !important;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .22) !important;
}

.gt_float_switcher:hover,
.gt_float_switcher:focus-within {
    background: rgba(34, 197, 94, 1) !important;
    transform: translateY(-6px) !important;
    box-shadow: 0 8px 18px rgba(34, 197, 94, .45) !important;
}

.gt_float_switcher .gt-selected {
    background: transparent !important;
    padding: 0 !important;
}

.gt_float_switcher .gt-current-lang {
    display: flex !important;
    align-items: center !important;
    padding: 5px 9px !important;
    font-size: 11px !important;
    line-height: 1.2 !important;
    color: #ffffff !important;
}

.gt_float_switcher .gt-lang-code {
    font-size: 11px !important;
    color: #ffffff !important;
}

.gt_float_switcher img {
    width: 19px !important;
    height: auto !important;
    border-radius: 2px !important;
    margin-right: 4px !important;
}

.gt_float_switcher .gt_float_switcher-arrow {
    border-width: 3px 3px 0 !important;
    margin-left: 4px !important;
    border-top-color: #ffffff !important;
}

/* 下拉菜单保持可读，不被父级背景透明度影响 */
.gt_float_switcher .gt_options {
    background: #ffffff !important;
    border-radius: 6px !important;
    box-shadow: 0 -4px 14px rgba(0, 0, 0, .18) !important;
    bottom: 100% !important;
    margin-bottom: 6px !important;
}

.gt_float_switcher .gt_options a {
    color: #111827 !important;
    font-size: 12px !important;
    padding: 8px 12px !important;
}

.gt_float_switcher .gt_options a:hover {
    background: #f0fdf4 !important;
}



/* === SWTORO CUSTOM OVERRIDES === */

/* Instagram gallery: support 7 color tiles on desktop */
.blokio-instagram-grid {
    grid-template-columns: repeat(7, minmax(0, 1fr)) !important;
}

@media (max-width: 1200px) {
    .blokio-instagram-grid {
        grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 900px) {
    .blokio-instagram-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 600px) {
    .blokio-instagram-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
    }
}

@media (max-width: 360px) {
    .blokio-instagram-grid {
        grid-template-columns: 1fr !important;
    }
}

/* TranslatePress floating language switcher:
   70% size, green background at 25% opacity, pill floating button */
.trp-floating-switcher.trp-language-switcher {
    --bg: rgba(34, 197, 94, 0.25) !important;
    --bg-hover: rgba(34, 197, 94, 0.40) !important;
    --text: #ffffff !important;
    --text-hover: #ffffff !important;
    --border: 1px solid rgba(34, 197, 94, 0.45) !important;
    --border-radius: 999px !important;
    transform: scale(0.7) !important;
    transform-origin: bottom right !important;
}

/* === About Us submenu styling (2026-08-22 task) === */
.wp-block-navigation-submenu .wp-block-navigation__submenu-container {
    background-color: #0f1a2e !important;
    min-width: 100px !important;
}
.wp-block-navigation-submenu .wp-block-navigation-item__content {
    padding-left: 8px !important;
    padding-right: 8px !important;
}
/* === end About Us submenu styling === */

/* SHOP-BUTTONS-ORANGE */
/* Shop page: make all content buttons orange (#ea580c) */
body.woocommerce-shop .wp-block-button__link {
  background-color: #ea580c !important;
  color: #ffffff !important;
  border-color: #ea580c !important;
}
body.woocommerce-shop .wp-block-button__link:hover {
  background-color: #c2410c !important;
}

/* =========================================================
   swtoro 商品页侧边栏 v2 2026-09-02（对齐演示页 swtoro商品页演示.html）
   覆盖：产品分类页 / Shop 页 / 商品搜索结果页
   ========================================================= */
.swtoro-cat-layout {
    display: flex;
    gap: 24px;
    align-items: flex-start;
    max-width: 1240px;
    margin: 0 auto;
    padding: 0 14px 40px;
}
.swtoro-cat-layout > .wp-block-woocommerce-product-collection,
.swtoro-cat-layout > .wc-block-product-collection,
.swtoro-cat-layout > *:not(.swtoro-series-sidebar) {
    flex: 1;
    min-width: 0;
}
.swtoro-series-sidebar {
    flex: 0 0 240px;
    background: #16213d;
    border: 1px solid #26354f;
    border-radius: 12px;
    padding: 22px 14px;
    align-self: flex-start;
}
.swtoro-series-sidebar h3 {
    color: #a8b3cf;
    font-size: 12px;
    letter-spacing: 1px;
    text-transform: uppercase;
    margin: 0 0 12px 6px;
    font-weight: 600;
}
.swtoro-series-sidebar ul { list-style: none; margin: 0; padding: 0; }
.swtoro-series-sidebar li { margin-bottom: 4px; }
.swtoro-series-sidebar a {
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 8px;
    color: #ffffff;
    text-decoration: none;
    padding: 9px 12px;
    border-radius: 10px;
    font-size: 13.5px;
    transition: background .15s;
}
.swtoro-series-sidebar a:hover { background: #1f2c4a; }
.swtoro-series-sidebar a.active { background: #ea580c; color: #ffffff; font-weight: 600; }
.swtoro-series-sidebar a .count { font-size: 11px; opacity: .75; }
.swtoro-series-sidebar a.active .count { opacity: .9; }
@media (max-width: 900px) {
    .swtoro-cat-layout { flex-direction: column; padding: 0 14px 30px; }
    .swtoro-series-sidebar { flex: auto; width: 100%; position: static; }
    .swtoro-series-sidebar ul { display: flex; flex-wrap: wrap; gap: 6px; }
    .swtoro-series-sidebar li { margin: 0; }
}

/* =========================================================
   v3 2026-09-02 按用户截图要求
   产品归档页（分类 / Shop / 商品搜索）隐藏 hero 区
   （含标题 "Shop Quality-Checked Products From China"、
   描述段、"Shop Skin Care"/"Contact Us" 按钮及配图），
   仅留侧边栏 + 商品网格布局
   ========================================================= */
.post-type-archive-product .wp-block-columns:has(.has-display-font-size),
.tax-product_cat .wp-block-columns:has(.has-display-font-size),
.search .wp-block-columns:has(.has-display-font-size) {
    display: none !important;
}

/* =========================================================
   v4 2026-09-02 商品列表模块 1:1 对齐演示页 swtoro商品页演示.html
   仅作用于：产品分类页 / Shop 页 / 商品搜索结果页的商品卡片
   ========================================================= */

/* --- Grid container (WooCommerce product-template) --- */
.post-type-archive-product .wc-block-product-template,
.tax-product_cat .wc-block-product-template,
.search .wc-block-product-template {
    display: grid !important;
    grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)) !important;
    gap: 18px !important;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 1rem !important;
}

/* --- Individual product card --- */
.post-type-archive-product .wc-block-product,
.tax-product_cat .wc-block-product,
.search .wc-block-product {
    background: #ffffff !important;
    border: 1px solid #f1e7e1 !important;
    border-radius: 14px !important;
    overflow: hidden !important;
    cursor: pointer !important;
    transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease !important;
    display: flex !important;
    flex-direction: column !important;
    list-style: none !important;
    margin: 0 !important;
    padding: 0 !important;
    text-align: left !important;
}
.post-type-archive-product .wc-block-product:hover,
.tax-product_cat .wc-block-product:hover,
.search .wc-block-product:hover {
    transform: translateY(-3px) !important;
    box-shadow: 0 6px 22px rgba(234, 88, 12, .12) !important;
    border-color: #ea580c !important;
}

/* --- Image area (1:1 + peach gradient placeholder) --- */
.post-type-archive-product .wc-block-components-product-image,
.tax-product_cat .wc-block-components-product-image,
.search .wc-block-components-product-image {
    aspect-ratio: 1 / 1 !important;
    background: linear-gradient(135deg, #ffe9dd, #ffd9c2) !important;
    position: relative !important;
    overflow: hidden !important;
    display: block !important;
    margin: 0 !important;
    padding: 0 !important;
}
.post-type-archive-product .wc-block-components-product-image img,
.tax-product_cat .wc-block-components-product-image img,
.search .wc-block-components-product-image img {
    width: 100% !important;
    height: 100% !important;
    object-fit: cover !important;
    display: block !important;
    margin: 0 !important;
}

/* --- Body padding for title / price / button --- */
.post-type-archive-product .wp-block-post-title,
.tax-product_cat .wp-block-post-title,
.search .wp-block-post-title {
    font-size: 13.5px !important;
    font-weight: 600 !important;
    line-height: 1.4 !important;
    height: 2.8em !important;
    overflow: hidden !important;
    margin: 11px 12px 0 12px !important;
    padding: 0 !important;
    display: -webkit-box !important;
    -webkit-line-clamp: 2 !important;
    -webkit-box-orient: vertical !important;
}
.post-type-archive-product .wp-block-post-title a,
.tax-product_cat .wp-block-post-title a,
.search .wp-block-post-title a {
    color: #1f2430 !important;
    text-decoration: none !important;
    font-weight: 600 !important;
}

/* --- Series tag (injected by JS, styled to match demo .pc .ser) --- */
.post-type-archive-product .swtoro-card-ser,
.tax-product_cat .swtoro-card-ser,
.search .swtoro-card-ser {
    font-size: 11px !important;
    color: #c2410c !important;
    margin: 11px 12px 4px 12px !important;
    padding: 0 !important;
    font-weight: 400 !important;
    line-height: 1.3 !important;
    height: auto !important;
    text-transform: none !important;
    letter-spacing: 0 !important;
    text-align: left !important;
    background: transparent !important;
    border: 0 !important;
}

/* --- Price (orange, bold, strikethrough old price) --- */
.post-type-archive-product .wc-block-components-product-price,
.tax-product_cat .wc-block-components-product-price,
.search .wc-block-components-product-price {
    margin: 8px 12px 0 12px !important;
    color: #ea580c !important;
    font-weight: 700 !important;
    font-size: 14px !important;
    display: block !important;
    line-height: 1.3 !important;
    text-align: left !important;
}
.post-type-archive-product .wc-block-components-product-price .woocommerce-Price-amount,
.tax-product_cat .wc-block-components-product-price .woocommerce-Price-amount,
.search .wc-block-components-product-price .woocommerce-Price-amount {
    color: #ea580c !important;
    font-weight: 700 !important;
}
.post-type-archive-product .wc-block-components-product-price del,
.tax-product_cat .wc-block-components-product-price del,
.search .wc-block-components-product-price del {
    color: #8a8079 !important;
    text-decoration: line-through !important;
    font-weight: 500 !important;
    font-size: 12px !important;
    margin-left: 6px !important;
}
.post-type-archive-product .wc-block-components-product-price ins,
.tax-product_cat .wc-block-components-product-price ins,
.search .wc-block-components-product-price ins {
    text-decoration: none !important;
    color: #ea580c !important;
    background: transparent !important;
    font-weight: 700 !important;
}

/* --- Add to cart button (padded, keep orange from v1 rule) --- */
.post-type-archive-product .wc-block-components-product-button,
.tax-product_cat .wc-block-components-product-button,
.search .wc-block-components-product-button {
    margin: 8px 12px 13px 12px !important;
}

/* --- Recommended badge (injected by JS) --- */
.post-type-archive-product .swtoro-feat-badge,
.tax-product_cat .swtoro-feat-badge,
.search .swtoro-feat-badge {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    background: #c2410c !important;
    color: #ffffff !important;
    font-size: 10.5px !important;
    font-weight: 600 !important;
    padding: 2px 8px !important;
    border-radius: 999px !important;
    z-index: 2 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
}

/* --- Sale badge (WooCommerce built-in) - style like 推荐 --- */
.post-type-archive-product .wc-block-components-product-sale-badge,
.tax-product_cat .wc-block-components-product-sale-badge,
.search .wc-block-components-product-sale-badge {
    position: absolute !important;
    top: 8px !important;
    left: 8px !important;
    background: #c2410c !important;
    color: #fff !important;
    font-size: 10.5px !important;
    padding: 2px 8px !important;
    border-radius: 999px !important;
    z-index: 2 !important;
    line-height: 1.4 !important;
    margin: 0 !important;
    right: auto !important;
    bottom: auto !important;
    transform: none !important;
}

/* Direct children inside swtoro-cat-layout: kill max-width/margin constraints
   so the flex layout works (sidebar 240px, products fill remaining) */
.post-type-archive-product .swtoro-cat-layout > *,
.tax-product_cat .swtoro-cat-layout > *,
.search .swtoro-cat-layout > * {
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
/* v14 2026-09-02 布局由 functions.php 内联 CSS 控制（grid 两栏），本文件不再含侧栏布局规则 */

/* v14g layout - ext. from functions.php inline CSS, sole source */

.post-type-archive-product main,
.tax-product_cat main,
.search main {
    position: relative !important;
    max-width: 1240px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0px 14px 40px 284px !important;
    min-height: 600px !important;
}
/* Aside fixed-width but NOT height-constrained — scrolls with page (no inner scrollbar) */
.post-type-archive-product main > #swtoro-series-sidebar,
.tax-product_cat main > #swtoro-series-sidebar,
.search main > #swtoro-series-sidebar {
    position: absolute !important;
    top: 0 !important;
    left: 14px !important;
    width: 240px !important;
    max-width: 240px !important;
    margin: 0 !important;
    padding: 18px 16px !important;
    background: #16213d !important;
    border-radius: 12px !important;
    border: 1px solid #2a3a5c !important;
    z-index: 50 !important;
}
.post-type-archive-product .swtoro-cat-layout,
.tax-product_cat .swtoro-cat-layout,
.search .swtoro-cat-layout {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 0 0 8px !important;
    padding: 0 !important;
}
/* Sort row + breadcrumbs: 8px left margin so left-edge text isn't visually crowded by sidebar */
.post-type-archive-product main > .wc-block-breadcrumbs,
.tax-product_cat main > .wc-block-breadcrumbs,
.search main > .wc-block-breadcrumbs {
    margin-left: 8px !important;
}
.post-type-archive-product #swtoro-series-sidebar h3,
.tax-product_cat #swtoro-series-sidebar h3,
.search #swtoro-series-sidebar h3 {
    font-size: 13px !important;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: #a8b3cf !important;
    margin: 0 0 12px !important;
    padding: 0 !important;
    font-weight: 700;
}
.post-type-archive-product #swtoro-series-sidebar ul,
.tax-product_cat #swtoro-series-sidebar ul,
.search #swtoro-series-sidebar ul { list-style: none !important; margin: 0 !important; padding: 0 !important; }
.post-type-archive-product #swtoro-series-sidebar li,
.tax-product_cat #swtoro-series-sidebar li,
.search #swtoro-series-sidebar li { margin: 0 !important; padding: 0 !important; list-style: none !important; }
.post-type-archive-product #swtoro-series-sidebar li a,
.tax-product_cat #swtoro-series-sidebar li a,
.search #swtoro-series-sidebar li a {
    display: flex !important;
    justify-content: space-between;
    align-items: center;
    padding: 9px 12px !important;
    border-radius: 10px !important;
    margin-bottom: 4px !important;
    font-size: 12.5px !important;
    color: #e5eaf2 !important;
    text-decoration: none !important;
}
.post-type-archive-product #swtoro-series-sidebar li a:hover,
.tax-product_cat #swtoro-series-sidebar li a:hover,
.search #swtoro-series-sidebar li a:hover {
    background: rgba(234, 88, 12, 0.12) !important;
    color: #fff !important;
}
.post-type-archive-product #swtoro-series-sidebar li a.active,
.tax-product_cat #swtoro-series-sidebar li a.active,
.search #swtoro-series-sidebar li a.active {
    background: #ea580c !important;
    color: #fff !important;
}
.post-type-archive-product #swtoro-series-sidebar .count,
.tax-product_cat #swtoro-series-sidebar .count,
.search #swtoro-series-sidebar .count {
    font-size: 11px !important;
    opacity: 0.75;
    color: inherit !important;
}

/* v15 2026-09-02 Grid 两列终极方案（style.css 与 functions.php inline 完全一致） */
body.post-type-archive-product main,
body.tax-product_cat main,
body.search main {
    display: grid !important;
    grid-template-columns: 240px minmax(0, 1fr) !important;
    column-gap: 24px !important;
    align-items: start !important;
    max-width: 1240px !important;
    margin-left: auto !important;
    margin-right: auto !important;
    padding: 0 14px 40px !important;
    min-height: 600px !important;
    overflow: visible !important;
}
body.post-type-archive-product main > #swtoro-series-sidebar,
body.tax-product_cat main > #swtoro-series-sidebar,
body.search main > #swtoro-series-sidebar {
    grid-column: 1 !important;
    grid-row: 1 / span 999 !important;
    position: sticky !important;
    top: 84px !important;
    align-self: start !important;
    width: 240px !important;
    max-width: 240px !important;
    margin: 0 !important;
    padding: 18px 16px !important;
    background: #16213d !important;
    border-radius: 12px !important;
    border: 1px solid #2a3a5c !important;
    max-height: calc(100vh - 100px) !important;
    overflow-y: auto !important;
    overflow-x: hidden !important;
    box-sizing: border-box !important;
    z-index: 50 !important;
}
body.post-type-archive-product main > *:not(#swtoro-series-sidebar),
body.tax-product_cat main > *:not(#swtoro-series-sidebar),
body.search main > *:not(#swtoro-series-sidebar) {
    grid-column: 2 !important;
    min-width: 0 !important;
    max-width: none !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
}
@media (max-width: 900px) {
    body.post-type-archive-product main,
    body.tax-product_cat main,
    body.search main {
        display: block !important;
        padding: 0 14px 40px !important;
    }
    body.post-type-archive-product main > #swtoro-series-sidebar,
    body.tax-product_cat main > #swtoro-series-sidebar,
    body.search main > #swtoro-series-sidebar {
        position: static !important;
        width: 100% !important;
        max-width: 100% !important;
        max-height: none !important;
        overflow-y: visible !important;
        margin: 0 0 24px !important;
    }
}
/* Critical: no ancestor breaks position:sticky */
body.post-type-archive-product,
body.tax-product_cat,
body.search { overflow: visible !important; }
body.post-type-archive-product > .wp-site-blocks,
body.tax-product_cat > .wp-site-blocks,
body.search > .wp-site-blocks { overflow: visible !important; }
/* Critical: no ancestor breaks position:sticky */
body.post-type-archive-product,
body.tax-product_cat,
body.search {
    overflow: visible !important;
}
body.post-type-archive-product > .wp-site-blocks,
body.tax-product_cat > .wp-site-blocks,
body.search > .wp-site-blocks {
    overflow: visible !important;
}

/* Wider viewport: sticky off, just normal flow */
@media (max-width: 900px) {
    body.post-type-archive-product main > #swtoro-series-sidebar,
    body.tax-product_cat main > #swtoro-series-sidebar,
    body.search main > #swtoro-series-sidebar {
        position: static !important;
        max-height: none !important;
        overflow-y: visible !important;
    }
}

/* =========================================================
   v14c product grid (restored per user 118.png 2026-09-02)
   Force 3-column responsive layout matching previous UI
   ========================================================= */
.post-type-archive-product ul.wc-block-product-template,
.tax-product_cat ul.wc-block-product-template,
.search ul.wc-block-product-template,
.post-type-archive-product .wc-block-product-template,
.tax-product_cat .wc-block-product-template,
.search .wc-block-product-template,
.post-type-archive-product .wc-block-product-template__responsive,
.tax-product_cat .wc-block-product-template__responsive,
.search .wc-block-product-template__responsive {
    display: grid !important;
    grid-template-columns: repeat(5, 1fr) !important;
    gap: 20px !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
    margin: 0 !important;
    list-style: none !important;
}
.post-type-archive-product .wc-block-product-template > li,
.tax-product_cat .wc-block-product-template > li,
.search .wc-block-product-template > li {
    width: 100% !important;
    max-width: 100% !important;
    margin: 0 !important;
    list-style: none !important;
}
@media (max-width: 900px) {
    .post-type-archive-product ul.wc-block-product-template,
    .tax_product_cat ul.wc-block-product-template,
    .search ul.wc-block-product-template,
    .post-type-archive-product .wc-block-product-template__responsive,
    .tax_product_cat .wc-block-product-template__responsive,
    .search .wc-block-product-template__responsive { grid-template-columns: repeat(3, 1fr) !important; }
}
@media (max-width: 560px) {
    .post-type-archive-product ul.wc-block-product-template,
    .tax-product_cat ul.wc-block-product-template,
    .search ul.wc-block-product-template,
    .post-type-archive-product .wc-block-product-template__responsive,
    .tax-product_cat .wc-block-product-template__responsive,
    .search .wc-block-product-template__responsive { grid-template-columns: repeat(2, 1fr) !important; }
}


/* v17 2026-09-02 空商品状态：JS 检测到 main 内无 .wc-block-product <li> 时，给 main 加 .swtoro-empty-products 类
   隐藏整列（面包屑/排序/商品集合区），侧边栏保留，layout 退化为单列 */
body.post-type-archive-product main.swtoro-empty-products,
body.tax-product_cat main.swtoro-empty-products,
body.search main.swtoro-empty-products {
    display: block !important;
    grid-template-columns: none !important;
}
body.post-type-archive-product main.swtoro-empty-products > *:not(#swtoro-series-sidebar),
body.tax-product_cat main.swtoro-empty-products > *:not(#swtoro-series-sidebar),
body.search main.swtoro-empty-products > *:not(#swtoro-series-sidebar) {
    display: none !important;
}
body.post-type-archive-product main.swtoro-empty-products > #swtoro-series-sidebar,
body.tax-product_cat main.swtoro-empty-products > #swtoro-series-sidebar,
body.search main.swtoro-empty-products > #swtoro-series-sidebar {
    position: sticky !important;
    top: 84px !important;
    max-height: calc(100vh - 100px) !important;
    overflow-y: auto !important;
}
/* v18 2026-09-02 Showing+Sort 行 fixed 永久定位（JS 计算 right column 边界，固定在 header 下方 84px） */
body.post-type-archive-product main > .wp-block-group.alignwide,
body.tax-product_cat main > .wp-block-group.alignwide,
body.search main > .wp-block-group.alignwide {
    position: fixed !important;
    top: 84px !important;
    left: var(--swtoro-right-left, 14px) !important;
    width: var(--swtoro-right-width, auto) !important;
    right: 14px !important;
    z-index: 40 !important;
    margin-left: 0 !important;
    margin-right: 0 !important;
    max-width: calc(1240px - 240px - 24px - 14px - 14px) !important;
    background: var(--wp--preset--color--background, #0f1a2e) !important;
    padding: 10px 14px !important;
    border-radius: 8px !important;
    box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35) !important;
    display: flex !important;
    justify-content: space-between !important;
    align-items: center !important;
    flex-wrap: wrap !important;
    gap: 12px !important;
}
