/* =============================================================
   SABA MARKAZI - SIX CATEGORY CATALOG (2026)
   Scoped to menu/category cards/catalog page.
   ============================================================= */

/* six cards -> 3 per row; old custom 3+2 placement is neutralized */
.category-grid > .category-item:nth-child(4),
.category-grid > .category-item:nth-child(5),
.category-grid > .category-item:nth-child(6) { grid-column: span 2; }
.category-grid .smc-tools-card {background:linear-gradient(130deg,rgba(16,18,22,.48),rgba(13,14,18,.86)),var(--category-bg,none) center/cover no-repeat,#202329;}
.category-grid .smc-tools-card::after {content:"⚒";position:absolute;left:25px;top:30px;color:rgba(255,121,0,.38);font-size:58px;font-weight:700;pointer-events:none;}
.smc-tools-card .category-info {position:relative;z-index:2;}

/* dropdown sections are keyboard-friendly native details elements */
.cat-menu .smc-menu-panel { min-width:min(410px,90vw);max-height:min(73vh,680px);overflow-y:auto;padding:10px;background:#fff;overscroll-behavior:contain;}
.cat-menu .smc-menu-group {border-bottom:1px solid #eee;}
.cat-menu .smc-menu-group:last-child {border:0;}
.cat-menu .smc-menu-group summary {padding:12px 10px;display:flex;justify-content:space-between;align-items:center;gap:10px;cursor:pointer;list-style:none;font-weight:800;font-size:13px;color:#222;border-radius:8px;}
.cat-menu .smc-menu-group summary::-webkit-details-marker{display:none;}
.cat-menu .smc-menu-group[open] summary, .cat-menu .smc-menu-group summary:hover {color:#e96c00;background:#fff2e8;}
.cat-menu .smc-menu-chevron{color:#e96c00;transition:transform .18s;}
.cat-menu .smc-menu-group[open] .smc-menu-chevron{transform:rotate(180deg);}
.cat-menu .smc-menu-subtypes{padding:2px 12px 10px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:4px;}
.cat-menu .smc-menu-subtypes > a{padding:8px 9px;font-size:12px;font-weight:600;line-height:1.75;display:block;min-width:0;}
.cat-menu .smc-menu-subtypes > .smc-menu-all{grid-column:1/-1;color:#e86a00;font-weight:800;}
.cat-menu .smc-menu-empty{grid-column:1/-1;color:#888;font-size:12px;padding:7px;}
.cat-menu .smc-menu-subtypes a:hover{background:#fff2e8;color:#d85c00;}

/* category pages */
.smc-catalog-page{background:#f8f9fb;padding:22px 0 75px;min-height:75vh;}
.smc-catalog-page .smc-breadcrumb{display:flex;align-items:center;gap:9px;color:#979ba4;font-size:12px;margin-bottom:20px;}
.smc-catalog-page .smc-breadcrumb strong{color:#555d65;}
.smc-catalog-page .smc-breadcrumb a:hover{color:var(--brand-orange);}
.smc-catalog-heading{margin-bottom:21px;max-width:840px;}
.smc-catalog-heading .smc-eyebrow{font-size:12px;font-weight:850;color:#eb7100;}
.smc-catalog-heading h1{color:#20232a;font-size:clamp(24px,3vw,36px);font-weight:900;line-height:1.5;margin:3px 0 5px;}
.smc-catalog-heading p{color:#737985;font-size:13px;line-height:2;}
.smc-filter-list{display:flex;flex-wrap:wrap;gap:9px;margin:0 0 24px;}
.smc-filter-list .smc-filter{border:1px solid #e5e7e9;background:#fff;color:#565c65;padding:8px 15px;border-radius:30px;font-size:12px;font-weight:750;transition:color .2s,border-color .2s,background .2s;}
.smc-filter-list .smc-filter:hover{color:#e36a00;border-color:#ffbb7e;}
.smc-filter-list .smc-filter.is-active{background:var(--brand-orange);color:#fff;border-color:var(--brand-orange);}
.smc-results-label{color:#777;font-size:12px;margin:-7px 0 17px;}
.smc-catalog-grid{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:19px;}
.smc-product-card{display:flex;flex-direction:column;background:white;border-radius:18px;border:1px solid #e8ebef;overflow:hidden;box-shadow:0 7px 21px rgba(12,22,36,.045);transition:transform .2s,box-shadow .2s;}
.smc-product-card:hover{transform:translateY(-4px);box-shadow:0 18px 40px rgba(12,22,36,.085);}
.smc-product-image{position:relative;display:flex;align-items:center;justify-content:center;background:#f6f7f9;height:260px;padding:20px;border-bottom:1px solid #eee;}
.smc-product-image img{width:100%;height:100%;object-fit:contain;}
.smc-no-image{font-size:66px;color:var(--brand-orange);opacity:.5;}
.smc-sale-badge{position:absolute;right:14px;top:14px;background:var(--brand-orange);color:#fff;font-size:11px;border-radius:9px;padding:5px 11px;font-weight:800;}
.smc-product-details{padding:20px;display:flex;flex-direction:column;flex:1;gap:7px;text-align:right;}
.smc-product-type{color:#e77818;font-size:11px;}
.smc-product-details h2{font-size:17px;line-height:1.8;color:#21242a;min-height:59px;font-weight:850;}
.smc-product-details h2 a:hover{color:#f57900;}
.smc-product-model{font-size:11px;color:#8b9096;}
.smc-product-details p{color:#757c85;font-size:12px;line-height:1.9;min-height:45px;}
.smc-product-bottom{display:flex;align-items:center;justify-content:space-between;gap:12px;border-top:1px solid #eee;padding-top:16px;margin-top:auto;flex-wrap:wrap;}
.smc-product-price{display:flex;flex-direction:column;}
.smc-product-price del{font-size:10px;color:#9c9c9c;}
.smc-product-price strong{font-size:15px;color:#242424;white-space:nowrap;}
.smc-product-price strong small{color:#777;font-size:10px;}
.smc-product-price .smc-call-price{color:#ea730c;font-size:13px;}
.smc-view-product{background:var(--brand-orange);color:#fff!important;padding:9px 12px;font-weight:800;border-radius:9px;font-size:11px;white-space:nowrap;}
.smc-view-product:hover{background:#e66b00;}
.smc-empty-products{grid-column:1/-1;background:#fff;border:1px solid #eee;border-radius:18px;padding:56px 18px;text-align:center;}
.smc-empty-products > span{color:var(--brand-orange);font-size:45px;}
.smc-empty-products h2{font-size:19px;margin:10px 0;color:#242424;}
.smc-empty-products p{font-size:13px;color:#7c828a;margin-bottom:17px;}
.smc-empty-products a{color:#e36d00;font-weight:800;font-size:12px;}
.smc-pagination{display:flex;justify-content:center;align-items:center;flex-wrap:wrap;gap:15px;margin-top:32px;font-size:12px;}
.smc-pagination a{background:#fff;border:1px solid #e5e5e5;border-radius:9px;padding:8px 16px;color:#ea7000;}
@media(max-width:950px){.smc-catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr));}}
@media(max-width:700px){
    .category-grid > .category-item:nth-child(4),.category-grid > .category-item:nth-child(5),.category-grid > .category-item:nth-child(6){grid-column:auto;}
    .cat-menu .smc-menu-panel{min-width:min(350px,88vw);}
    .smc-catalog-grid{grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;}
    .smc-product-image{height:180px;padding:10px;}
    .smc-product-details{padding:12px;}
    .smc-product-details h2{font-size:13px;min-height:69px;}
    .smc-product-details p{display:none;}
    .smc-product-price strong{font-size:13px;}
    .smc-product-bottom{gap:9px;}
    .smc-view-product{width:100%;text-align:center;}
}
@media(max-width:520px){
    .smc-catalog-grid{grid-template-columns:1fr;}
    .smc-product-image{height:240px;}
    .smc-product-details h2{min-height:auto;font-size:17px;}
}

/* Dropdown visibility is controlled by the category button click only.
   Hover/focus-within previously forced it to stay open after a second click. */
@media (min-width: 901px) {
  .cat-menu > .smc-menu-panel:not(.is-open) {
    opacity: 0;
    visibility: hidden;
    transform: translateY(8px);
    pointer-events: none;
  }
  .cat-menu > .smc-menu-panel.is-open {
    opacity: 1;
    visibility: visible;
    transform: none;
    pointer-events: auto;
  }
}
@media(max-width:950px){
    .category-grid > .category-item:nth-child(4),
    .category-grid > .category-item:nth-child(5),
    .category-grid > .category-item:nth-child(6){grid-column:auto;}
}

/* Preserve original header links and ensure six category cards fit. */
.category-grid>.category-item:nth-child(4),
.category-grid>.category-item:nth-child(5),
.category-grid>.category-item:nth-child(6){grid-column:span 2;}


/* ==========================================
   POWER TOOLS CATEGORY CARD - FINAL FIX
========================================== */

.category-grid .category-item.smc-tools-card {
    background-color: #111;

    /* لایه تیره ملایم برای هماهنگی با بقیه کارت‌ها */
    background-image:
        linear-gradient(
            to bottom,
            rgba(5, 5, 5, 0.20) 0%,
            rgba(5, 5, 5, 0.32) 40%,
            rgba(5, 5, 5, 0.65) 72%,
            rgba(5, 5, 5, 0.88) 100%
        ),
        var(--category-bg);

    background-position: center, center;
    background-size: 100% 100%, auto 112%;
    background-repeat: no-repeat;

    transition:
        background-size 0.4s ease,
        transform 0.3s ease,
        box-shadow 0.3s ease;
}

/* هنگام هاور عکس کوچک‌تر شود */
.category-grid .category-item.smc-tools-card:hover {
    background-size: 100% 100%, auto 95%;
    transform: translateY(-3px);

    box-shadow:
        0 14px 30px rgba(0, 0, 0, 0.15);
}

/* حذف علامت اضافی ابزارآلات */
.category-grid .category-item.smc-tools-card::after {
    display: none;
}

/* Direct laser navigation: looks like a category, opens the page immediately. */
.cat-menu .smc-menu-direct {
    display:flex;align-items:center;min-height:47px;margin:0;
    padding:12px 10px;border-bottom:1px solid #eee;
    border-radius:8px;font-weight:800;font-size:13px;
    color:#222;text-decoration:none;line-height:1.7;
}
.cat-menu .smc-menu-direct:hover,
.cat-menu .smc-menu-direct:focus-visible {background:#fff2e8;color:#e96c00;}
@media (max-width:900px) {
  .navigation.smc-mobile-open .cat-menu .smc-menu-direct {
    width:100%; min-height:44px; padding:11px 9px;
    font-size:12px; text-align:right; border-bottom:1px solid #eaecef;
  }
}
