/* elegate — 商品列表页：面包屑、标题栏、控制条、网格、分页、侧栏。 */

/* 面包屑的外观在 base.css（全站通用，与生产 .woocommerce-breadcrumb 规则相同） */

/* ---------- 布局 ---------- */
.eg-shop__layout {
    display: block;
}

.eg-shop__main {
    min-width: 0;
}

.eg-shop__head {
    margin-bottom: 14px;
}

/* 生产 .woocommerce-page .page-title：1.786em / 行高 1.6em */
.eg-shop__title {
    margin: 0;
    font-size: 1.786em;
    font-weight: 500;
    line-height: 1.6em;
}

.eg-shop__head .woocommerce-result-count,
.eg-shopfoot .woocommerce-result-count {
    margin: 0;
}

/* ---------- 控制条 ---------- */
.eg-shopbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 9px;
    min-height: 51px;
    padding: 5.6px 20px;
    background: #efefef;
}

.eg-shopbar__views,
.eg-shopbar .eg-pager {
    display: none;
}

/* 视图切换：生产 .shop-control-bar .shop-view-switcher .nav-link（1.286em / 行高 2.24em，未选中 rgb(207.6,214.8,221.4)，选中 #495057，
   Font Awesome fa-th / fa-list / fa-th-list，颜色过渡 .15s） */
.eg-shopbar__view {
    display: block;
    letter-spacing: inherit;
    padding: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    color: #333e48;
    font-size: 1.286em;
    line-height: 2.24em;
    cursor: pointer;
    transition: color .15s ease-in-out, background-color .15s ease-in-out, border-color .15s ease-in-out;
}

.eg-shopbar__view:not(:hover):not(:focus):not(.is-active) {
    color: rgb(207.5853658537, 214.8292682927, 221.4146341463);
}

.eg-shopbar__view.is-active {
    color: #495057;
}

.eg-shopbar__filter {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 40px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--eg-text);
    font-size: 14px;
    cursor: pointer;
}

.eg-shopbar__order form {
    margin: 0;
    padding: 3px 0;
}

/* 排序：生产 select 元素规则（reboot.css：PNG 箭头、边框、appearance）+ .woocommerce-ordering .orderby 两条专属规则 */
.eg-shopbar__order select.orderby {
    border-radius: 1.429em;
    padding: .26rem 1.75rem .26rem .75rem;
}

.eg-pager {
    align-items: center;
    color: #5d7184;
}

.eg-pager__form {
    display: flex;
    align-items: center;
    gap: 10px;
    margin: 0;
}

.eg-pager__input {
    width: 47px;
    height: 32px;
    padding: 2px 10px;
    border: 1px solid #ddd;
    border-radius: 22px;
    background: #fff;
    color: var(--eg-text);
    font: inherit;
    text-align: center;
    -moz-appearance: textfield;
}

.eg-pager__input::-webkit-outer-spin-button,
.eg-pager__input::-webkit-inner-spin-button {
    margin: 0;
    -webkit-appearance: none;
}

.eg-pager__next {
    padding-left: 12px;
    color: #5d7184;
    font-size: 20px;
    line-height: 34px;
}

.eg-pager__next:hover { color: var(--eg-link-hover); }

/* ---------- 商品网格与视图 ---------- */
/* 商城列表：生产 loop_shop_columns 4、columns_wide 6 */
.eg-products {
    --eg-cols: 4;
    --eg-cols-wide: 6;
    transition: opacity var(--eg-ease);
}

.eg-products.is-busy {
    opacity: 0.45;
    pointer-events: none;
}

.eg-products > .eg-card {
    margin-bottom: 0;
}

/* 列表视图：图片在左，文字在右 */
.eg-products--list > .eg-card,
.eg-products--rows > .eg-card {
    flex-basis: 100%;
    border-bottom: 1px solid #eaeaea;
}

.eg-products--list > .eg-card::after,
.eg-products--rows > .eg-card::after {
    content: none;
}

.eg-products--list .eg-card__inner,
.eg-products--rows .eg-card__inner {
    display: grid;
    grid-template-columns: 200px minmax(0, 1fr) auto;
    grid-template-rows: auto;
    column-gap: 24px;
    align-items: center;
}

.eg-products--rows .eg-card__inner {
    grid-template-columns: 90px minmax(0, 1fr) auto;
}

.eg-products--list .eg-card__link,
.eg-products--rows .eg-card__link {
    display: contents;
}

.eg-products--list .eg-card__thumb,
.eg-products--rows .eg-card__thumb {
    grid-area: 1 / 1;
    margin: 0;
}

.eg-products--list .eg-card__title,
.eg-products--rows .eg-card__title {
    grid-area: 1 / 2;
    height: auto;
    margin: 0;
    font-size: 15px;
    line-height: 20px;
}

.eg-products--list .eg-card__foot,
.eg-products--rows .eg-card__foot {
    grid-area: 1 / 3;
    gap: 24px;
    margin: 0;
}

/* 列表 / 紧凑视图的价格栏在网格的 auto 列里，宽度要按内容算；shop.css 给 .eg-card__foot 设的 container-type: inline-size
   会让它的宽度不按内容计算（auto 列量成 0，价格和加购按钮挤出去压到标题）。这里取消容器，划线价改回按价格自身限宽
   （没有容器时 cqw 按视口算，所以盖掉 shop.css @supports 里的 calc(100cqw - 40px)）。 */
.eg-products--list .eg-card__foot,
.eg-products--rows .eg-card__foot {
    container-type: normal;
}

.eg-products--list .eg-card__foot > .eg-card__price del,
.eg-products--rows .eg-card__foot > .eg-card__price del {
    max-width: 100%;
}

/* 手机窄屏（<768，和 shop.css 的移动断点一致）：三列放不下（200px 图 + 价格栏，375 下标题列宽量成 0、价格栏伸出卡片），
   改成两列两行——图片占左列两行，右列上面标题、下面价格 + 加购按钮。
   价格栏上方留 16px 行距给「脱离文档流、固定在现价正上方」的划线价，不压到标题。紧凑视图同样处理（图片更小）。 */
@media (max-width: 767px) {
    .eg-products--list .eg-card__inner,
    .eg-products--rows .eg-card__inner {
        grid-template-columns: 104px minmax(0, 1fr);
        grid-template-rows: auto auto;
        column-gap: 12px;
        row-gap: 16px;
    }

    .eg-products--rows .eg-card__inner {
        grid-template-columns: 72px minmax(0, 1fr);
    }

    .eg-products--list .eg-card__thumb,
    .eg-products--rows .eg-card__thumb {
        grid-area: 1 / 1 / 3 / 2;
    }

    .eg-products--list .eg-card__title,
    .eg-products--rows .eg-card__title {
        grid-area: 1 / 2;
        align-self: start;
    }

    .eg-products--list .eg-card__foot,
    .eg-products--rows .eg-card__foot {
        grid-area: 2 / 2;
        align-self: end;
        gap: 12px;
    }
}

/* ---------- 底部：结果数 + 页码 ---------- */
.eg-shopfoot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 0;
}

.eg-shopfoot .woocommerce-pagination ul {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    margin: 0;
    padding: 0;
    list-style: none;
}

.eg-shopfoot .page-numbers:not(ul) {
    display: grid;
    place-items: center;
    min-width: 32px;
    height: 32px;
    padding: 0 6px;
    border: 1px solid #e7e7e7;
    border-radius: 20px;
    color: #5d7184;
    transition: border-color var(--eg-ease), color var(--eg-ease);
}

.eg-shopfoot a.page-numbers:hover {
    background: rgb(231, 231, 231);
    color: var(--eg-link-hover);
}

.eg-shopfoot .page-numbers.current {
    border-color: var(--eg-primary);
    background: var(--eg-primary);
    color: var(--eg-on-primary);
    font-weight: 700;
}

.eg-shopfoot .page-numbers.dots {
    border-color: transparent;
}

/* ---------- 侧栏 ---------- */
.eg-shop__sidebar {
    position: fixed;
    top: 0;
    bottom: 0;
    left: 0;
    z-index: 1100;
    width: 280px;
    max-width: 86vw;
    overflow-y: auto;
    overscroll-behavior: contain;
    background: #fff;
    box-shadow: 2px 0 8px rgba(0, 0, 0, 0.08);
    opacity: 0;
    transform: translateX(-100%);
    visibility: hidden;
    transition: transform 0.3s, opacity 0.3s, visibility 0s linear 0.3s;
}

.eg-shop__sidebar.is-open {
    opacity: 1;
    transform: none;
    visibility: visible;
    transition: transform 0.3s, opacity 0.3s;
}

/* 生产的筛选侧栏没有标题栏：关闭按钮只在获得键盘焦点时出现，平时点页面空白处或按 Esc 关闭 */
.eg-shop__sidebar-head {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
}

.eg-shop__sidebar-head strong {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
}

.eg-shop__sidebar-close:not(:focus-visible) {
    opacity: 0;
    pointer-events: none;
}

.eg-shop__sidebar-close {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font-size: 22px;
    cursor: pointer;
}

.eg-shop__sidebar-body {
    /* 底部多留一段：手机底部导航浮在抽屉之上，最后一个小工具不能被它挡住 */
    padding: 20px 15px 90px;
}

.eg-shop__backdrop {
    position: fixed;
    inset: 0;
    z-index: 1090;
    /* 不蒙暗页面，只用来接住「点页面空白处关闭」 */
    background: transparent;
    opacity: 0;
    transition: opacity 0.3s;
}

.eg-shop__backdrop.is-open { opacity: 1; }

.eg-shop__sidebar .eg-widget {
    margin-bottom: 46px;
}

/* 生产 .sidebar .widget-title + .sidebar > .widget > .widget-title：1.286em / 行高 1em / 下 1.75em，下内边距 1.053em（按 1.357em 时的值） */
.eg-shop__sidebar .eg-widget__title {
    position: relative;
    margin: 0 0 1.75em;
    padding-bottom: 1.053em;
    border-bottom: 1px solid #ddd;
    font-size: 1.286em;
    font-weight: 500;
    line-height: 1em;
}

.eg-shop__sidebar .eg-widget__title::after {
    content: "";
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 66px;
    height: 2px;
    background: var(--eg-primary);
}

/* 价格筛选（商城小工具的滑块标记） */
.eg-shop__sidebar .price_slider {
    position: relative;
    height: 2px;
    margin: 30px 8px 0;
    background: #919191;
}

.eg-shop__sidebar .ui-slider-range {
    position: absolute;
    top: -2px;
    height: 6px;
    background: #aaa;
}

.eg-shop__sidebar .ui-slider-handle {
    position: absolute;
    top: 50%;
    width: 16px;
    height: 16px;
    margin: -8px 0 0 -8px;
    border-radius: 50%;
    background: var(--eg-primary);
    cursor: ew-resize;
    touch-action: none;
}

.eg-shop__sidebar .ui-slider-handle:last-child {
    border: 3px solid var(--eg-primary);
    background: #fff;
}

.eg-shop__sidebar .price_slider_amount {
    display: flex;
    flex-direction: column;
    gap: 29px;
    margin-top: 21px;
    color: #aaa;
}

.eg-shop__sidebar .price_slider_amount .price_label {
    order: -1;
    line-height: 14px;
}

.eg-shop__sidebar .price_slider_amount input[style*="display: none"],
.eg-shop__sidebar .price_slider_amount .clear { display: none; }

.eg-shop__sidebar .price_slider_amount input {
    width: 48%;
    height: 36px;
    padding: 4px 10px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font: inherit;
}

.eg-shop__sidebar .price_slider_amount .button {
    align-self: flex-start;
    padding: 10.5px 23px;
    border: 1px solid #efecec;
    border-radius: 8px;
    background: #efecec;
    color: var(--eg-text);
    font: inherit;
    font-weight: 700;
    line-height: 14px;
    cursor: pointer;
    transition: color 0.15s, background-color 0.15s, border-color 0.15s;
}

.eg-shop__sidebar .price_slider_amount .button:hover,
.eg-shop__sidebar .price_slider_amount .button:focus-visible {
    border-color: #000;
    background: #000;
    color: #fff;
}

.eg-shop__sidebar .ui-slider-handle:hover {
    box-shadow: 0 0 0 0.236em rgba(0, 0, 0, 0.1);
}

/* 商品列表小工具 */
.eg-shop__sidebar .product_list_widget {
    margin: 0;
    padding: 0;
    list-style: none;
}

/* 生产 .product_list_widget / .sidebar .product_list_widget 的规则原样（.electro-price → .eg-price） */
.eg-shop__sidebar .product_list_widget > li {
    margin-bottom: 1.35em;
}

/* 生产 .product_list_widget > li::after 与 .electro-price::after：清除图片 / 价格的浮动，否则条目互相挤进对方的空位 */
.eg-shop__sidebar .product_list_widget > li::after,
.eg-shop__sidebar .product_list_widget .eg-price::after {
    content: "";
    display: block;
    clear: both;
}

.eg-shop__sidebar .product_list_widget > li:last-child {
    margin-bottom: 0;
}

.eg-shop__sidebar .product_list_widget img {
    width: 75px;
    height: 75px;
    margin-right: 20px;
    float: left;
}

.eg-shop__sidebar .product_list_widget li > a,
.eg-shop__sidebar .product_list_widget li > a .product-title {
    display: block;
    font-weight: 400;
    color: #333e48;
}

.eg-shop__sidebar .product_list_widget .product-title {
    font-size: 1em;
    line-height: 1.2em;
}

.eg-shop__sidebar .product_list_widget a:hover { color: #000; }

.eg-shop__sidebar .product_list_widget .eg-price {
    margin-top: 1.667em;
    display: block;
    margin-left: 95px;
    position: relative;
}

.eg-shop__sidebar .product_list_widget ins {
    text-decoration: none;
    float: left;
}

.eg-shop__sidebar .product_list_widget del,
.eg-shop__sidebar .product_list_widget del .amount {
    color: #8f8f8f;
}

.eg-shop__sidebar .product_list_widget del {
    float: left;
    display: block;
    width: 100%;
    position: absolute;
    top: -18px;
    line-height: 18px;
}

.eg-shop__sidebar .product_list_widget .amount {
    display: inline-block;
    font-size: 1.071em;
}

.eg-shop__sidebar .product_list_widget ins .amount {
    font-size: 1.071em;
}

.eg-shop__sidebar .product_list_widget del .amount {
    text-decoration: line-through;
    font-size: .928em;
}

.eg-shop__sidebar .product_list_widget .eg-price .amount {
    font-weight: 700;
    font-size: 1.071em;
}

.eg-shop__sidebar .product_list_widget .eg-price ins .amount {
    color: #dc3545;
}

.eg-shop__sidebar .product_list_widget .eg-price del .amount {
    font-size: .733em;
}

/* 面包屑：与生产子主题同一阈值，981 起显示（≤980 的隐藏规则在 base.css） */
@media (min-width: 981px) {
    .eg-crumbs { display: block; }
}

/* ---------- 桌面 ---------- */
@media (min-width: 1200px) {

    .eg-shop--sidebar .eg-shop__layout {
        display: grid;
        grid-template-columns: 270px minmax(0, 1fr);
        column-gap: 30px;
        align-items: start;
    }

    .eg-shop--sidebar .eg-shop__main { grid-area: 1 / 2; }

    .eg-shop__head {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 20px;
    }

    .eg-shopbar {
        min-height: 46px;
        padding: 2.8px 20px;
        border-radius: 9px;
    }

    .eg-shopbar__views {
        display: flex;
        gap: 15px;
    }

    .eg-shopbar .eg-pager { display: flex; }
    .eg-shopbar__filter { display: none; }

    .eg-shop__sidebar {
        position: static;
        grid-area: 1 / 1;
        width: auto;
        max-width: none;
        overflow: visible;
        box-shadow: none;
        opacity: 1;
        transform: none;
        visibility: visible;
        transition: none;
        z-index: auto;
    }

    .eg-shop__sidebar-head { display: none; }
    .eg-shop__sidebar-body { padding: 0; }
    .eg-shop__backdrop { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    .eg-shop__sidebar,
    .eg-shop__backdrop,
    .eg-products { transition: none; }
}
