/* ═══ shop-dark.css — جداشده از main.css (خطوط 7042-8141 نسخهٔ v1.1.267) بدون هیچ تغییری در محتوا/ترتیب.
   بازطراحی فروشگاه/دسته + دارک‌مود شاپ + badge v61
   ترتیب لود (زنجیرهٔ dependency در functions.php) = ترتیب قبلی داخل main.css. ═══ */
/* ═══════════════════════════════════════
   FIX v57 — Complete shop/category dark mode
   Based on actual WooCommerce shop markup:
   plist-item, plist-link, pcard, sidebar, filters, badges, price boxes.
   دارک مود اصولی: خاکستری/گرافیتی، نه مشکی خام.
═══════════════════════════════════════ */

:root{
    --hg-shop-page-bg:#f6f6f2;
    --hg-shop-bg-soft:#fbfbf8;
    --hg-shop-card:#ffffff;
    --hg-shop-card-2:#f9f9f6;
    --hg-shop-card-3:#f1f2ef;
    --hg-shop-ink:#17181b;
    --hg-shop-muted:#6f757b;
    --hg-shop-muted-2:#9aa0a6;
    --hg-shop-line:rgba(23,24,27,.085);
    --hg-shop-line-soft:rgba(23,24,27,.052);
    --hg-shop-primary:#17181b;
    --hg-shop-primary-text:#ffffff;
    --hg-shop-green:#34c759;
    --hg-shop-green-bg:rgba(52,199,89,.12);
    --hg-shop-orange:#f59e0b;
    --hg-shop-orange-bg:rgba(245,158,11,.13);
    --hg-shop-shadow:0 18px 46px rgba(20,23,28,.065);
    --hg-shop-shadow-soft:0 10px 26px rgba(20,23,28,.045);
}

html[data-hg-theme="dark"]{
    --hg-shop-page-bg:#0f131a;
    --hg-shop-bg-soft:#131923;
    --hg-shop-card:#171e28;
    --hg-shop-card-2:#1b2430;
    --hg-shop-card-3:#202b38;
    --hg-shop-ink:#eef2f7;
    --hg-shop-muted:#a2adba;
    --hg-shop-muted-2:#748294;
    --hg-shop-line:rgba(255,255,255,.105);
    --hg-shop-line-soft:rgba(255,255,255,.065);
    --hg-shop-primary:#eef2f7;
    --hg-shop-primary-text:#11161d;
    --hg-shop-green:#54e28a;
    --hg-shop-green-bg:rgba(84,226,138,.14);
    --hg-shop-orange:#fbbf24;
    --hg-shop-orange-bg:rgba(251,191,36,.14);
    --hg-shop-shadow:0 20px 58px rgba(0,0,0,.28);
    --hg-shop-shadow-soft:0 10px 32px rgba(0,0,0,.22);
}

/* Page base */
body.hg-product-archive{
    background:
        radial-gradient(circle at 82% 0%, rgba(100,116,139,.08), transparent 30%),
        linear-gradient(180deg,var(--hg-shop-bg-soft),var(--hg-shop-page-bg))!important;
    color:var(--hg-shop-ink)!important;
}
html[data-hg-theme="dark"] body.hg-product-archive{
    background:
        radial-gradient(circle at 82% 0%, rgba(148,163,184,.08), transparent 30%),
        linear-gradient(180deg,var(--hg-shop-bg-soft),var(--hg-shop-page-bg))!important;
}

.hg-product-archive .site-main,
.shop-container,
.shop-main{
    background:transparent!important;
    color:var(--hg-shop-ink)!important;
}

/* Breadcrumb */
.breadcrumb-wrap{
    color:var(--hg-shop-muted)!important;
}
.breadcrumb{
    background:var(--hg-shop-card)!important;
    border:1px solid var(--hg-shop-line)!important;
    box-shadow:var(--hg-shop-shadow-soft)!important;
}
.breadcrumb,
.breadcrumb li,
.breadcrumb a,
.breadcrumb svg{
    color:var(--hg-shop-muted)!important;
}
.breadcrumb a:hover{
    color:var(--hg-shop-ink)!important;
}

/* Mobile filter bar */
.mobile-filter-bar{
    background:transparent!important;
}
.mf-btn,
.mf-sort-btn{
    background:var(--hg-shop-card)!important;
    border:1px solid var(--hg-shop-line)!important;
    color:var(--hg-shop-muted)!important;
    box-shadow:var(--hg-shop-shadow-soft)!important;
}
.mf-btn svg{
    color:var(--hg-shop-muted)!important;
}
.mf-btn.active,
.mf-btn[aria-selected="true"]{
    background:var(--hg-shop-primary)!important;
    color:var(--hg-shop-primary-text)!important;
    border-color:transparent!important;
}
.mf-btn.active svg,
.mf-btn[aria-selected="true"] svg{
    color:var(--hg-shop-primary-text)!important;
}

/* Sidebar and filter boxes */
.sidebar-card,
.sidebar-section,
.cat-search-wrap,
.cat-list-wrap,
.price-range-wrap,
.shop-topbar,
.no-products{
    background:var(--hg-shop-card)!important;
    border-color:var(--hg-shop-line)!important;
    color:var(--hg-shop-ink)!important;
    box-shadow:var(--hg-shop-shadow)!important;
}
.sidebar-card{
    border:1px solid var(--hg-shop-line)!important;
}
.sidebar-section{
    box-shadow:none!important;
    border-color:var(--hg-shop-line-soft)!important;
}
.sidebar-title,
.price-label,
.result-count,
.result-count strong,
.woocommerce-ordering label{
    color:var(--hg-shop-ink)!important;
}
.cat-search,
.price-input,
.sort-select,
select.sort-select{
    background:var(--hg-shop-card-2)!important;
    border:1px solid var(--hg-shop-line)!important;
    color:var(--hg-shop-ink)!important;
    box-shadow:none!important;
}
.cat-search::placeholder,
.price-input::placeholder{
    color:var(--hg-shop-muted-2)!important;
}
.cat-search-ico,
.price-sep-line{
    color:var(--hg-shop-muted)!important;
    border-color:var(--hg-shop-line-soft)!important;
}
.cat-search-ico svg{
    color:var(--hg-shop-muted)!important;
    stroke:currentColor!important;
}

/* Category filter buttons */
.cat-btn{
    background:transparent!important;
    color:var(--hg-shop-muted)!important;
    border:1px solid transparent!important;
    box-shadow:none!important;
}
.cat-btn:hover{
    background:var(--hg-shop-card-2)!important;
    color:var(--hg-shop-ink)!important;
    border-color:var(--hg-shop-line-soft)!important;
}
.cat-btn.active{
    background:var(--hg-shop-primary)!important;
    color:var(--hg-shop-primary-text)!important;
    border-color:transparent!important;
}
.cat-count{
    background:var(--hg-shop-card-3)!important;
    color:var(--hg-shop-muted)!important;
    border:1px solid var(--hg-shop-line-soft)!important;
}
.cat-btn.active .cat-count{
    background:rgba(255,255,255,.16)!important;
    color:var(--hg-shop-primary-text)!important;
    border-color:transparent!important;
}
.btn-price-apply{
    background:var(--hg-shop-primary)!important;
    color:var(--hg-shop-primary-text)!important;
    border-color:transparent!important;
}

/* Topbar + view buttons */
.shop-topbar{
    background:var(--hg-shop-card)!important;
    border:1px solid var(--hg-shop-line)!important;
}
.result-count{
    color:var(--hg-shop-muted)!important;
}
.result-count strong{
    color:var(--hg-shop-ink)!important;
}
.view-toggle{
    background:var(--hg-shop-card-2)!important;
    border:1px solid var(--hg-shop-line-soft)!important;
}
.vbtn{
    background:transparent!important;
    border:1px solid transparent!important;
    color:var(--hg-shop-muted)!important;
}
.vbtn svg{
    stroke:currentColor!important;
}
.vbtn:hover{
    background:var(--hg-shop-card)!important;
    color:var(--hg-shop-ink)!important;
}
.vbtn.active,
.vbtn[aria-pressed="true"]{
    background:var(--hg-shop-primary)!important;
    color:var(--hg-shop-primary-text)!important;
    border-color:transparent!important;
}

/* Grid product cards */
.products-grid,
.products-list{
    color:var(--hg-shop-ink)!important;
}
.product-card,
.pcard-link,
.plist-item,
.plist-link{
    background:var(--hg-shop-card)!important;
    border-color:var(--hg-shop-line)!important;
    color:var(--hg-shop-ink)!important;
}
.product-card,
.plist-item{
    box-shadow:var(--hg-shop-shadow)!important;
}
.product-card:hover,
.plist-item:hover{
    border-color:var(--hg-shop-line)!important;
    box-shadow:0 24px 62px rgba(20,23,28,.11)!important;
}
html[data-hg-theme="dark"] .product-card:hover,
html[data-hg-theme="dark"] .plist-item:hover{
    box-shadow:0 28px 76px rgba(0,0,0,.42)!important;
}
.pcard-img,
.plist-thumb{
    background:linear-gradient(145deg,var(--hg-shop-card-2),var(--hg-shop-card-3))!important;
    border-color:var(--hg-shop-line-soft)!important;
}
.pcard-img img,
.plist-thumb img{
    filter:none!important;
}
html[data-hg-theme="dark"] .pcard-img img,
html[data-hg-theme="dark"] .plist-thumb img{
    filter:brightness(.92) contrast(1.04)!important;
}
.pcard-img svg,
.plist-thumb svg{
    color:var(--hg-shop-muted)!important;
    stroke:currentColor!important;
}
.pcard-body,
.plist-info,
.plist-actions{
    background:transparent!important;
    color:var(--hg-shop-ink)!important;
}
.pcard-cat,
.plist-cat{
    color:var(--hg-shop-muted)!important;
}
.pcard-name,
.plist-name,
.product-card h2,
.plist-item h2{
    color:var(--hg-shop-ink)!important;
}
.pcard-footer,
.plist-link{
    border-color:var(--hg-shop-line-soft)!important;
}

/* Prices */
.pcard-price,
.plist-price,
.pcard-price ins,
.plist-price ins,
.pcard-price .woocommerce-Price-amount,
.plist-price .woocommerce-Price-amount,
.pcard-price bdi,
.plist-price bdi{
    color:var(--hg-shop-ink)!important;
}
.pcard-price del,
.plist-price del{
    color:var(--hg-shop-muted-2)!important;
}
.woocommerce-Price-currencySymbol{
    color:inherit!important;
}

/* Badges and tags */
.badge,
.pcard-save-badge,
.plist-tag,
.save-badge{
    background:var(--hg-shop-card-2)!important;
    color:var(--hg-shop-muted)!important;
    border:1px solid var(--hg-shop-line-soft)!important;
}
.badge-instant,
.plist-tag:not(.plist-tag-sale){
    background:var(--hg-shop-green-bg)!important;
    color:var(--hg-shop-green)!important;
    border-color:rgba(52,199,89,.18)!important;
}
.badge-sale,
.plist-tag-sale,
.save-badge,
.pcard-save-badge{
    background:var(--hg-shop-orange-bg)!important;
    color:var(--hg-shop-orange)!important;
    border-color:rgba(245,158,11,.20)!important;
}

/* Buttons */
.pcard-buy,
.plist-buy,
.add_to_cart_button,
.button.product_type_simple,
.woocommerce a.button,
.woocommerce button.button{
    background:var(--hg-shop-primary)!important;
    color:var(--hg-shop-primary-text)!important;
    border-color:transparent!important;
    box-shadow:none!important;
}
.pcard-buy:hover,
.plist-buy:hover,
.add_to_cart_button:hover,
.woocommerce a.button:hover,
.woocommerce button.button:hover{
    opacity:.92!important;
}

/* Hidden state should remain hidden */
.products-grid.hidden,
.products-list.hidden,
.hidden{
    display:none!important;
}

/* Woo messages and notices inside shop */
.woocommerce-info,
.woocommerce-message,
.woocommerce-error{
    background:var(--hg-shop-card)!important;
    color:var(--hg-shop-ink)!important;
    border:1px solid var(--hg-shop-line)!important;
    box-shadow:var(--hg-shop-shadow-soft)!important;
}
.woocommerce-error li,
.woocommerce-message a,
.woocommerce-info a{
    color:var(--hg-shop-ink)!important;
}

/* Pagination */
.pagination,
.woocommerce-pagination{
    color:var(--hg-shop-ink)!important;
}
.pagination ul li a,
.pagination ul li span,
.woocommerce-pagination ul.page-numbers li a,
.woocommerce-pagination ul.page-numbers li span{
    background:var(--hg-shop-card)!important;
    border:1px solid var(--hg-shop-line)!important;
    color:var(--hg-shop-muted)!important;
    box-shadow:var(--hg-shop-shadow-soft)!important;
}
.pagination .current,
.woocommerce-pagination .current{
    background:var(--hg-shop-primary)!important;
    color:var(--hg-shop-primary-text)!important;
}

/* Category header if exists */
.woocommerce-products-header,
.woocommerce-products-header__title,
.term-description{
    color:var(--hg-shop-ink)!important;
}
.term-description{
    background:var(--hg-shop-card)!important;
    border:1px solid var(--hg-shop-line)!important;
    box-shadow:var(--hg-shop-shadow-soft)!important;
}

/* Mobile refine */
@media(max-width:760px){
    .breadcrumb{
        background:var(--hg-shop-card)!important;
    }
    .mobile-filter-bar{
        padding-bottom:2px!important;
    }
    .products-grid{
        grid-template-columns:repeat(2,minmax(0,1fr))!important;
        gap:9px!important;
    }
    .product-card{
        border-radius:18px!important;
    }
    .pcard-img{
        min-height:112px!important;
        height:112px!important;
    }
    .pcard-body{
        padding:9px!important;
    }
    .pcard-name{
        font-size:11.5px!important;
        line-height:1.55!important;
    }
    .pcard-cat{
        font-size:9.4px!important;
    }
    .pcard-buy{
        height:28px!important;
        min-height:28px!important;
        border-radius:10px!important;
        font-size:9.8px!important;
        padding:0 9px!important;
    }
    .pcard-price ins,
    .pcard-price .woocommerce-Price-amount{
        font-size:10.5px!important;
    }
    .badge{
        font-size:8px!important;
        padding:4px 7px!important;
    }

    /* list view mobile */
    .plist-item{
        border-radius:18px!important;
    }
    .plist-link{
        gap:10px!important;
        padding:10px!important;
    }
    .plist-thumb{
        width:56px!important;
        height:56px!important;
        flex-basis:56px!important;
        border-radius:14px!important;
    }
    .plist-name{
        font-size:12px!important;
    }
    .plist-cat,
    .plist-tag,
    .save-badge{
        font-size:8.8px!important;
    }
    .plist-buy{
        height:28px!important;
        border-radius:10px!important;
        font-size:9.5px!important;
    }
}

/* Ultra-specific fallback for any remaining white blocks on shop/category */
body.woocommerce-shop html[data-hg-theme="dark"],
html[data-hg-theme="dark"] body.hg-product-archive .shop-container *{
    scrollbar-color:var(--hg-shop-card-3) var(--hg-shop-bg-soft);
}
html[data-hg-theme="dark"] body.hg-product-archive .sidebar-card,
html[data-hg-theme="dark"] body.hg-product-archive .shop-topbar,
html[data-hg-theme="dark"] body.hg-product-archive .product-card,
html[data-hg-theme="dark"] body.hg-product-archive .plist-item{
    background-color:var(--hg-shop-card)!important;
}


/* ═══════════════════════════════════════
   FIX v58 — Hide visual breadcrumb on shop/category safely
   Breadcrumb markup remains in DOM for accessibility; JSON-LD is added in wp_head.
═══════════════════════════════════════ */

body.hg-product-archive .breadcrumb-wrap{
    position:absolute!important;
    width:1px!important;
    height:1px!important;
    padding:0!important;
    margin:0!important;
    overflow:hidden!important;
    clip:rect(0 0 0 0)!important;
    clip-path:inset(50%)!important;
    white-space:nowrap!important;
    border:0!important;
}

/* Remove the visual top gap that breadcrumb used to create */
body.hg-product-archive .site-main{
    padding-top:18px!important;
}

@media(max-width:760px){
    body.hg-product-archive .site-main{
        /* v1.1.219 — فاصله‌ی بیشتر از هدر شناور تا محتوای شاپ به بالا نچسبد */
        padding-top:22px!important;
    }
}


/* ═══════════════════════════════════════
   FIX v59 — Product category dark-mode polish
   هدف: دکمه‌ها در دارک‌مود زیاد سفید نباشند + بخش‌های روشن واقعی دسته‌بندی پوشش داده شوند
   Markup covered: cat-hero, cat-sort-bar, sidebar, product grid/list, badges, buttons.
═══════════════════════════════════════ */

html[data-hg-theme="dark"]{
    /* graphite premium palette, not pure black/white */
    --hg-shop-page-bg:#0f131a!important;
    --hg-shop-bg-soft:#131923!important;
    --hg-shop-card:#171f2a!important;
    --hg-shop-card-2:#1d2733!important;
    --hg-shop-card-3:#253140!important;
    --hg-shop-ink:#edf2f7!important;
    --hg-shop-muted:#a3adba!important;
    --hg-shop-muted-2:#728094!important;
    --hg-shop-line:rgba(255,255,255,.105)!important;
    --hg-shop-line-soft:rgba(255,255,255,.065)!important;

    /* dark buttons should be graphite, not white */
    --hg-shop-primary:#263241!important;
    --hg-shop-primary-hover:#303d4e!important;
    --hg-shop-primary-text:#f4f7fb!important;

    --hg-shop-green:#54e28a!important;
    --hg-shop-green-bg:rgba(84,226,138,.13)!important;
    --hg-shop-orange:#f8c24e!important;
    --hg-shop-orange-bg:rgba(248,194,78,.13)!important;
    --hg-shop-blue:#9fb7ff!important;
    --hg-shop-blue-bg:rgba(159,183,255,.12)!important;
    --hg-shop-shadow:0 20px 58px rgba(0,0,0,.32)!important;
    --hg-shop-shadow-soft:0 10px 30px rgba(0,0,0,.23)!important;
}

/* whole category/shop page background */
html[data-hg-theme="dark"] body.hg-product-archive{
    background:
        radial-gradient(circle at 82% 0%, rgba(148,163,184,.07), transparent 32%),
        radial-gradient(circle at 10% 80%, rgba(100,116,139,.05), transparent 28%),
        linear-gradient(180deg,var(--hg-shop-bg-soft),var(--hg-shop-page-bg))!important;
    color:var(--hg-shop-ink)!important;
}

/* category hero was still light */
html[data-hg-theme="dark"] .cat-hero,
html[data-hg-theme="dark"] .cat-hero-inner{
    background:transparent!important;
    color:var(--hg-shop-ink)!important;
}
html[data-hg-theme="dark"] .cat-hero-inner{
    border:1px solid var(--hg-shop-line)!important;
    background:
        radial-gradient(circle at 84% 0%, rgba(255,255,255,.055), transparent 32%),
        linear-gradient(145deg, rgba(23,31,42,.92), rgba(18,24,33,.88))!important;
    box-shadow:var(--hg-shop-shadow)!important;
}
html[data-hg-theme="dark"] .cat-hero-title{
    color:var(--hg-shop-ink)!important;
}
html[data-hg-theme="dark"] .cat-hero-desc,
html[data-hg-theme="dark"] .cat-hero-text p{
    color:var(--hg-shop-muted)!important;
}
html[data-hg-theme="dark"] .cat-hero-count,
html[data-hg-theme="dark"] .cat-hero-meta span{
    background:var(--hg-shop-card-2)!important;
    border:1px solid var(--hg-shop-line-soft)!important;
    color:var(--hg-shop-muted)!important;
}

/* category mobile sort bar was still light */
html[data-hg-theme="dark"] .cat-sort-bar{
    background:var(--hg-shop-card)!important;
    border:1px solid var(--hg-shop-line)!important;
    color:var(--hg-shop-ink)!important;
    box-shadow:var(--hg-shop-shadow-soft)!important;
}
html[data-hg-theme="dark"] .cat-sort-label{
    color:var(--hg-shop-muted)!important;
}
html[data-hg-theme="dark"] .cat-sort-select,
html[data-hg-theme="dark"] .cat-sort-bar select{
    background:var(--hg-shop-card-2)!important;
    border:1px solid var(--hg-shop-line-soft)!important;
    color:var(--hg-shop-ink)!important;
    box-shadow:none!important;
}

/* sidebar and filter internals */
html[data-hg-theme="dark"] .sidebar,
html[data-hg-theme="dark"] .shop-main,
html[data-hg-theme="dark"] .shop-container{
    background:transparent!important;
    color:var(--hg-shop-ink)!important;
}
html[data-hg-theme="dark"] .sidebar-card,
html[data-hg-theme="dark"] .sidebar-section,
html[data-hg-theme="dark"] .price-range-wrap,
html[data-hg-theme="dark"] .shop-topbar{
    background:var(--hg-shop-card)!important;
    border-color:var(--hg-shop-line)!important;
    color:var(--hg-shop-ink)!important;
}
html[data-hg-theme="dark"] .sidebar-section{
    background:var(--hg-shop-card-2)!important;
}
html[data-hg-theme="dark"] .sidebar-title,
html[data-hg-theme="dark"] .price-label,
html[data-hg-theme="dark"] .cat-sort-label,
html[data-hg-theme="dark"] .result-count{
    color:var(--hg-shop-muted)!important;
}
html[data-hg-theme="dark"] .result-count strong{
    color:var(--hg-shop-ink)!important;
}
html[data-hg-theme="dark"] .price-input,
html[data-hg-theme="dark"] .sort-select,
html[data-hg-theme="dark"] #sortSelect,
html[data-hg-theme="dark"] #priceMin,
html[data-hg-theme="dark"] #priceMax{
    background:#121923!important;
    border:1px solid var(--hg-shop-line-soft)!important;
    color:var(--hg-shop-ink)!important;
}
html[data-hg-theme="dark"] .price-input::placeholder{
    color:var(--hg-shop-muted-2)!important;
}
html[data-hg-theme="dark"] .price-sep-line{
    background:var(--hg-shop-line)!important;
}

/* buttons: graphite instead of bright white */
html[data-hg-theme="dark"] .btn-price-apply,
html[data-hg-theme="dark"] .pcard-buy,
html[data-hg-theme="dark"] .plist-buy,
html[data-hg-theme="dark"] .add_to_cart_button,
html[data-hg-theme="dark"] .woocommerce a.button,
html[data-hg-theme="dark"] .woocommerce button.button{
    background:linear-gradient(145deg,#2c3949,#222d3b)!important;
    color:#f4f7fb!important;
    border:1px solid rgba(255,255,255,.08)!important;
    box-shadow:0 10px 22px rgba(0,0,0,.22)!important;
}
html[data-hg-theme="dark"] .btn-price-apply:hover,
html[data-hg-theme="dark"] .pcard-buy:hover,
html[data-hg-theme="dark"] .plist-buy:hover,
html[data-hg-theme="dark"] .add_to_cart_button:hover,
html[data-hg-theme="dark"] .woocommerce a.button:hover,
html[data-hg-theme="dark"] .woocommerce button.button:hover{
    background:linear-gradient(145deg,#344356,#293646)!important;
    color:#ffffff!important;
}

/* view toggle buttons */
html[data-hg-theme="dark"] .view-toggle{
    background:var(--hg-shop-card-2)!important;
    border:1px solid var(--hg-shop-line-soft)!important;
}
html[data-hg-theme="dark"] .vbtn{
    background:transparent!important;
    color:var(--hg-shop-muted)!important;
}
html[data-hg-theme="dark"] .vbtn.active,
html[data-hg-theme="dark"] .vbtn[aria-pressed="true"]{
    background:linear-gradient(145deg,#2c3949,#222d3b)!important;
    color:#f4f7fb!important;
    border:1px solid rgba(255,255,255,.08)!important;
}
html[data-hg-theme="dark"] .vbtn svg{
    stroke:currentColor!important;
}

/* product cards: all inner white areas */
html[data-hg-theme="dark"] .product-card,
html[data-hg-theme="dark"] .pcard-link,
html[data-hg-theme="dark"] .plist-item,
html[data-hg-theme="dark"] .plist-link{
    background:var(--hg-shop-card)!important;
    border-color:var(--hg-shop-line)!important;
    color:var(--hg-shop-ink)!important;
}
html[data-hg-theme="dark"] .pcard-body,
html[data-hg-theme="dark"] .pcard-footer,
html[data-hg-theme="dark"] .plist-info,
html[data-hg-theme="dark"] .plist-actions{
    background:transparent!important;
    color:var(--hg-shop-ink)!important;
}
html[data-hg-theme="dark"] .pcard-img,
html[data-hg-theme="dark"] .plist-thumb{
    background:linear-gradient(145deg,#202b38,#18212d)!important;
    border-color:var(--hg-shop-line-soft)!important;
}
html[data-hg-theme="dark"] .pcard-img img,
html[data-hg-theme="dark"] .plist-thumb img{
    filter:brightness(.90) contrast(1.05)!important;
}
html[data-hg-theme="dark"] .pcard-img svg,
html[data-hg-theme="dark"] .plist-thumb svg{
    stroke:var(--hg-shop-muted)!important;
    color:var(--hg-shop-muted)!important;
}

/* text and price */
html[data-hg-theme="dark"] .pcard-name,
html[data-hg-theme="dark"] .plist-name{
    color:var(--hg-shop-ink)!important;
}
html[data-hg-theme="dark"] .pcard-cat,
html[data-hg-theme="dark"] .plist-cat{
    color:var(--hg-shop-muted)!important;
}
html[data-hg-theme="dark"] .pcard-price,
html[data-hg-theme="dark"] .plist-price,
html[data-hg-theme="dark"] .pcard-price ins,
html[data-hg-theme="dark"] .plist-price ins,
html[data-hg-theme="dark"] .pcard-price bdi,
html[data-hg-theme="dark"] .plist-price bdi,
html[data-hg-theme="dark"] .woocommerce-Price-amount{
    color:#f1f5f9!important;
}
html[data-hg-theme="dark"] .pcard-price del,
html[data-hg-theme="dark"] .plist-price del{
    color:var(--hg-shop-muted-2)!important;
}

/* badges: softer in dark */
html[data-hg-theme="dark"] .badge,
html[data-hg-theme="dark"] .pcard-save-badge,
html[data-hg-theme="dark"] .plist-tag,
html[data-hg-theme="dark"] .save-badge{
    background:var(--hg-shop-card-2)!important;
    color:var(--hg-shop-muted)!important;
    border:1px solid var(--hg-shop-line-soft)!important;
}
html[data-hg-theme="dark"] .badge-instant,
html[data-hg-theme="dark"] .plist-tag:not(.plist-tag-sale){
    background:rgba(84,226,138,.12)!important;
    color:#73ee9f!important;
    border-color:rgba(84,226,138,.18)!important;
}
html[data-hg-theme="dark"] .badge-sale,
html[data-hg-theme="dark"] .plist-tag-sale,
html[data-hg-theme="dark"] .save-badge,
html[data-hg-theme="dark"] .pcard-save-badge{
    background:rgba(248,194,78,.12)!important;
    color:#f8c24e!important;
    border-color:rgba(248,194,78,.18)!important;
}

/* list view leftovers */
html[data-hg-theme="dark"] .products-list,
html[data-hg-theme="dark"] .products-grid{
    background:transparent!important;
}
html[data-hg-theme="dark"] .plist-tags{
    background:transparent!important;
}

/* pagination / empty */
html[data-hg-theme="dark"] .pagination,
html[data-hg-theme="dark"] .pagination *,
html[data-hg-theme="dark"] .woocommerce-pagination,
html[data-hg-theme="dark"] .woocommerce-pagination *{
    color:var(--hg-shop-muted)!important;
}
html[data-hg-theme="dark"] .pagination .current,
html[data-hg-theme="dark"] .woocommerce-pagination .current{
    background:#2c3949!important;
    color:#f4f7fb!important;
}

/* If any internal div still inherits pure white */
html[data-hg-theme="dark"] body.hg-product-archive .shop-container .sidebar-card *,
html[data-hg-theme="dark"] body.hg-product-archive .shop-container .shop-topbar *,
html[data-hg-theme="dark"] body.hg-product-archive .shop-container .product-card *,
html[data-hg-theme="dark"] body.hg-product-archive .shop-container .plist-item *{
    border-color:inherit;
}

/* Mobile: category hero and sort compact + dark */
@media(max-width:760px){
    html[data-hg-theme="dark"] .cat-hero-inner{
        border-radius:22px!important;
    }
    html[data-hg-theme="dark"] .cat-sort-bar{
        border-radius:18px!important;
    }
    html[data-hg-theme="dark"] .cat-sort-select{
        min-height:34px!important;
        border-radius:13px!important;
    }
}


/* ═══════════════════════════════════════
   FIX v60 — Category hero dark-mode layout stability
   مشکل: در دارک‌مود cat-hero جمع می‌شد و فرم خودش را از دست می‌داد.
   این بخش layout را در روز/شب ثابت نگه می‌دارد و فقط رنگ‌ها را عوض می‌کند.
═══════════════════════════════════════ */

.cat-hero{
    width:min(1180px, calc(100% - 28px))!important;
    margin:22px auto 18px!important;
    padding:0!important;
    display:block!important;
    position:relative!important;
    overflow:visible!important;
    color:var(--hg-shop-ink, #17181b)!important;
    background:transparent!important;
}

.cat-hero-inner{
    width:100%!important;
    min-height:112px!important;
    padding:24px 26px!important;
    display:grid!important;
    grid-template-columns:minmax(0, 1fr) auto!important;
    align-items:center!important;
    gap:18px!important;
    border-radius:30px!important;
    border:1px solid var(--hg-shop-line, rgba(23,24,27,.085))!important;
    background:
        radial-gradient(circle at 84% 0%, rgba(255,255,255,.44), transparent 34%),
        linear-gradient(145deg, rgba(255,255,255,.90), rgba(247,247,243,.82))!important;
    box-shadow:var(--hg-shop-shadow, 0 18px 46px rgba(20,23,28,.065))!important;
    overflow:hidden!important;
    position:relative!important;
    box-sizing:border-box!important;
}

.cat-hero-inner::before{
    content:""!important;
    position:absolute!important;
    inset:auto 18px 16px auto!important;
    width:94px!important;
    height:94px!important;
    border-radius:999px!important;
    background:radial-gradient(circle, rgba(23,24,27,.055), transparent 70%)!important;
    pointer-events:none!important;
}

.cat-hero-text{
    min-width:0!important;
    position:relative!important;
    z-index:1!important;
}

.cat-hero-title{
    margin:0!important;
    padding:0!important;
    color:var(--hg-shop-ink, #17181b)!important;
    font-size:clamp(22px, 3vw, 34px)!important;
    font-weight:1000!important;
    line-height:1.35!important;
    letter-spacing:-.7px!important;
    white-space:normal!important;
}

.cat-hero-desc,
.cat-hero-text p{
    margin:8px 0 0!important;
    max-width:720px!important;
    color:var(--hg-shop-muted, #6f757b)!important;
    font-size:12px!important;
    line-height:1.9!important;
    font-weight:750!important;
}

.cat-hero-meta{
    display:flex!important;
    align-items:center!important;
    justify-content:flex-end!important;
    min-width:max-content!important;
    position:relative!important;
    z-index:1!important;
}

.cat-hero-count{
    min-width:96px!important;
    min-height:42px!important;
    padding:0 15px!important;
    display:inline-flex!important;
    align-items:center!important;
    justify-content:center!important;
    gap:5px!important;
    border-radius:999px!important;
    border:1px solid var(--hg-shop-line, rgba(23,24,27,.085))!important;
    background:rgba(255,255,255,.72)!important;
    color:var(--hg-shop-muted, #6f757b)!important;
    font-size:12px!important;
    font-weight:950!important;
    white-space:nowrap!important;
    box-shadow:none!important;
}

/* Dark mode: same structure, only premium graphite colors */
html[data-hg-theme="dark"] .cat-hero{
    color:var(--hg-shop-ink)!important;
    background:transparent!important;
}

html[data-hg-theme="dark"] .cat-hero-inner{
    min-height:112px!important;
    padding:24px 26px!important;
    display:grid!important;
    grid-template-columns:minmax(0, 1fr) auto!important;
    align-items:center!important;
    gap:18px!important;
    border-radius:30px!important;
    border:1px solid rgba(255,255,255,.105)!important;
    background:
        radial-gradient(circle at 84% 0%, rgba(148,163,184,.13), transparent 34%),
        linear-gradient(145deg, rgba(29,39,51,.94), rgba(18,25,35,.92))!important;
    box-shadow:0 22px 58px rgba(0,0,0,.30)!important;
    overflow:hidden!important;
}

html[data-hg-theme="dark"] .cat-hero-inner::before{
    background:radial-gradient(circle, rgba(148,163,184,.12), transparent 70%)!important;
}

html[data-hg-theme="dark"] .cat-hero-title{
    color:#eef2f7!important;
}

html[data-hg-theme="dark"] .cat-hero-desc,
html[data-hg-theme="dark"] .cat-hero-text p{
    color:#a2adba!important;
}

html[data-hg-theme="dark"] .cat-hero-count{
    min-width:96px!important;
    min-height:42px!important;
    padding:0 15px!important;
    border:1px solid rgba(255,255,255,.10)!important;
    background:rgba(255,255,255,.065)!important;
    color:#a2adba!important;
}

/* Mobile: keep hero from collapsing */
@media(max-width:760px){
    .cat-hero{
        width:min(100% - 18px, 100%)!important;
        margin:14px auto 12px!important;
    }

    .cat-hero-inner,
    html[data-hg-theme="dark"] .cat-hero-inner{
        min-height:94px!important;
        padding:17px 16px!important;
        grid-template-columns:minmax(0, 1fr)!important;
        gap:12px!important;
        border-radius:22px!important;
        align-items:start!important;
    }

    .cat-hero-title{
        font-size:22px!important;
        line-height:1.35!important;
    }

    .cat-hero-desc,
    .cat-hero-text p{
        font-size:10.5px!important;
        line-height:1.75!important;
        margin-top:5px!important;
    }

    .cat-hero-meta{
        justify-content:flex-start!important;
        min-width:0!important;
    }

    .cat-hero-count,
    html[data-hg-theme="dark"] .cat-hero-count{
        min-width:0!important;
        min-height:32px!important;
        padding:0 11px!important;
        font-size:10px!important;
    }

    .cat-hero-inner::before{
        width:72px!important;
        height:72px!important;
        inset:auto 14px 12px auto!important;
    }
}


/* ═══════════════════════════════════════
   FIX v61 — Discount save badge dark-mode
   Target:
   <div class="pcard-save-wrap"><span class="pcard-save-badge">... صرفه‌جویی</span></div>
   مشکل: در دارک‌مود روشن می‌ماند؛ این rule با specificity بالا و بدون سفید خام فیکس می‌کند.
═══════════════════════════════════════ */

html[data-hg-theme="dark"] .pcard-save-wrap,
html[data-hg-theme="dark"] .product-card .pcard-save-wrap,
html[data-hg-theme="dark"] body.hg-product-archive .pcard-save-wrap{
    background:transparent!important;
    box-shadow:none!important;
}

html[data-hg-theme="dark"] .pcard-save-badge,
html[data-hg-theme="dark"] .product-card .pcard-save-badge,
html[data-hg-theme="dark"] .pcard-save-wrap .pcard-save-badge,
html[data-hg-theme="dark"] body.hg-product-archive .pcard-save-wrap .pcard-save-badge{
    background:linear-gradient(145deg, rgba(248,194,78,.15), rgba(248,194,78,.08))!important;
    background-color:rgba(248,194,78,.12)!important;
    color:#f8c24e!important;
    border:1px solid rgba(248,194,78,.24)!important;
    box-shadow:0 8px 18px rgba(0,0,0,.22)!important;
    backdrop-filter:none!important;
    -webkit-backdrop-filter:none!important;
}

/* If Woo/product-card stylesheet loads after main.css, this keeps the light-mode clean too */
.pcard-save-badge{
    border:1px solid rgba(245,158,11,.22)!important;
}

/* List-view saving badge too */
html[data-hg-theme="dark"] .save-badge,
html[data-hg-theme="dark"] .plist-price .save-badge,
html[data-hg-theme="dark"] body.hg-product-archive .plist-price .save-badge{
    background:linear-gradient(145deg, rgba(248,194,78,.15), rgba(248,194,78,.08))!important;
    background-color:rgba(248,194,78,.12)!important;
    color:#f8c24e!important;
    border:1px solid rgba(248,194,78,.24)!important;
    box-shadow:none!important;
}

/* Mobile: keep badge compact and readable */
@media(max-width:760px){
    html[data-hg-theme="dark"] .pcard-save-badge,
    html[data-hg-theme="dark"] .product-card .pcard-save-badge{
        font-size:8px!important;
        padding:4px 7px!important;
        border-radius:999px!important;
    }
}
