

/* FOUC */
.spc-swiper:not(.swiper-initialized) .swiper-slide:not(:first-child){ display:none !important; }
.spc-swiper:not(.swiper-initialized){ overflow:hidden !important; }
.spc-swiper{ opacity:0; transition:opacity .2s ease; }
.spc-swiper.swiper-initialized{ opacity:1; }

/* افکت ورود */
.spc-header{
    opacity:0;
    transform:translateY(-14px);
    transition:opacity .5s ease, transform .5s ease;
}
.spc-slider-wrap{
    opacity:0;
    transform:translateY(22px);
    transition:opacity .55s .12s ease, transform .55s .12s ease;
}
.spc-header.spc-in,
.spc-slider-wrap.spc-in{
    opacity:1;
    transform:translateY(0);
}

/* Layout */
.spc-section{
    /* Fixed card geometry. Every strip of the card has a locked height — the
       media box, the one-line title, the two-line description — so a product
       with a short description and one with a long description resolve to
       exactly the same card height on every device, with the overflow cut by an
       ellipsis (-webkit-line-clamp). No hardcoded total: change a font size here
       and the cards stay equal to each other automatically. */
    --spc-media-h:195px;
    --spc-title-lh:1.7;
    --spc-title-fz:17px;
    --spc-desc-lh:1.9;
    --spc-desc-fz:13.5px;

    background:#fff;
    padding:36px 0 24px;
    direction:rtl;
    overflow:hidden;
    font-family:'IranBakh','IRANSansX','IRANSans','Vazirmatn',Tahoma,sans-serif;
}
.spc-container{
    width:min(1400px, calc(100% - 40px));
    margin:0 auto;
}
.spc-header{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:14px;
    margin-bottom:22px;
    flex-wrap:nowrap;
}
.spc-header-right{
    display:flex;
    flex-direction:column;
    align-items:flex-start;
    gap:9px;
    min-width:0;
}
.spc-badge{
    display:inline-flex;
    align-items:center;
    padding:7px 15px;
    background:#fff4cf;
    color:#c99617;
    border-radius:999px;
    font-size:13px;
    font-weight:700;
    line-height:1;
    white-space:nowrap;
}
.spc-title{
    margin:0;
    font-size:40px;
    line-height:1.25;
    color:#0f1b3d;
    font-weight:800;
}
.spc-all-link{
    display:inline-flex;
    align-items:center;
    gap:8px;
    padding:11px 18px;
    border:1.5px solid #E78B08;
    color:#E78B08;
    border-radius:11px;
    text-decoration:none;
    font-size:14px;
    font-weight:700;
    transition:all .22s ease;
    background:#fff;
    white-space:nowrap;
    flex-shrink:0;
}
.spc-all-link:hover{ background:#E78B08; color:#fff; }
.spc-arrow{ font-size:15px; line-height:1; }

.spc-slider-wrap{ overflow:visible; }
.spc-swiper{ overflow:visible !important; padding:8px 0 14px; }

/* Equal-height slides: the slide stretches, the card fills it. */
.spc-swiper .swiper-slide{
    height:auto;
    display:flex;
}

/* Card */
.spc-card{
    position:relative;
    background:#fff;
    border:1px solid #e8e8e8;
    border-radius:20px;
    overflow:hidden;
    transition:transform .32s ease, box-shadow .32s ease, border-color .32s ease;
    width:100%;
    display:flex;
    flex-direction:column;
    box-shadow:0 4px 16px rgba(0,0,0,.03);
    cursor:pointer;
}
.spc-card:hover{
    transform:translateY(-5px);
    box-shadow:0 14px 34px rgba(0,0,0,.09);
    border-color:#f0c24b;
}
.spc-card-overlay-link{
    position:absolute;
    inset:0;
    z-index:6;
    border-radius:20px;
    outline:none;
}
.spc-card-image-wrap{
    position:relative;
    height:var(--spc-media-h);
    flex:none;
    overflow:hidden;
    background:#f4f4f4;
}
.spc-card-image{
    width:100%;
    height:100%;
    object-fit:cover;
    display:block;
    transition:transform .42s ease;
}
.spc-card:hover .spc-card-image{ transform:scale(1.05); }
.spc-cat-badge{
    position:absolute;
    top:12px;
    right:12px;
    z-index:3;
    display:inline-flex;
    align-items:center;
    padding:5px 11px;
    background:#f7a91b;
    color:#fff;
    font-size:12.5px;
    font-weight:700;
    border-radius:8px;
    line-height:1;
    box-shadow:0 4px 13px rgba(247,169,27,.26);
    pointer-events:none;
}
.spc-hover-overlay{
    position:absolute;
    inset:0;
    display:flex;
    align-items:center;
    justify-content:center;
    background:linear-gradient(to top, rgba(0,0,0,.18), rgba(0,0,0,.02));
    opacity:0;
    visibility:hidden;
    transition:all .28s ease;
    z-index:5;
    pointer-events:none;
}
.spc-card:hover .spc-hover-overlay{ opacity:1; visibility:visible; }
.spc-hover-btn{
    display:inline-flex;
    align-items:center;
    gap:7px;
    padding:9px 16px;
    background:#f7a91b;
    color:#fff;
    border-radius:9px;
    font-size:13.5px;
    font-weight:700;
    box-shadow:0 7px 22px rgba(247,169,27,.38);
}
.spc-eye{ font-size:12px; line-height:1; }
.spc-card:hover .spc-card-title{ color:#c99216; }

/* Card body — every strip has a locked height so the card total never drifts. */
.spc-card-body{
    padding:16px 16px 13px;
    flex:1 1 auto;
    display:flex;
    flex-direction:column;
    min-height:0;
}
.spc-card-title{
    margin:0 0 9px;
    font-size:var(--spc-title-fz);
    line-height:var(--spc-title-lh);
    font-weight:800;
    color:#1d2b4f;
    transition:color .22s ease;
    /* Exactly one line, ellipsis on overflow. */
    height:calc(var(--spc-title-fz) * var(--spc-title-lh));
    display:-webkit-box;
    -webkit-line-clamp:1;
    line-clamp:1;
    -webkit-box-orient:vertical;
    overflow:hidden;
}
.spc-card-desc{
    font-size:var(--spc-desc-fz);
    line-height:var(--spc-desc-lh);
    color:#6f7686;
    margin-bottom:12px;
    /* Exactly two lines; the "…" comes from line-clamp, not from PHP. */
    height:calc(var(--spc-desc-fz) * var(--spc-desc-lh) * 2);
    display:-webkit-box;
    -webkit-line-clamp:2;
    line-clamp:2;
    -webkit-box-orient:vertical;
    overflow:hidden;
}

/* FIX meta: کنار هم در همه سایزها */
.spc-card-meta{
    display:flex;
    align-items:center;
    justify-content:space-between;
    gap:4px;
    padding-top:11px;
    margin-top:auto;           /* همیشه کف کارت */
    border-top:1px solid #ededed;
    flex-wrap:nowrap;          /* همیشه یک خط */
}
.spc-meta-item{
    display:flex;
    align-items:center;
    gap:4px;
    color:#767c8d;
    font-size:11.5px;          /* کوچیک‌تر تا دو آیتم جا بشن */
    line-height:1.7;
    white-space:nowrap;
}
.spc-meta-label{ font-weight:700; color:#8a8f9b; }
.spc-meta-value{ color:#666; font-weight:500; }

/* Responsive */
@media (max-width:1400px){ .spc-title{ font-size:34px; } }
@media (max-width:1200px){ .spc-title{ font-size:30px; } }
@media (max-width:992px){
    .spc-section{
        --spc-media-h:175px;
        --spc-title-fz:15px;
        --spc-desc-fz:12.5px;
    }
    .spc-title{ font-size:26px; }
    /* meta یک خط */
    .spc-card-meta{ flex-direction:row; flex-wrap:nowrap; gap:4px; }
    .spc-meta-item{ font-size:11px; }
}

/* FIX موبایل: badge نشون بده + عنوان و دکمه یک خط
   ترفند: display:contents روی header-right → badge و title
   مستقیم توی grid شرکت می‌کنن */
@media (max-width:767px){
    .spc-section{
        --spc-media-h:143px;   /* 15px کوچیک‌تر */
        --spc-title-fz:13.5px;
        --spc-desc-fz:11.5px;
        --spc-desc-lh:1.75;

        padding:14px 0 14px;
    }
    .spc-container{ width:calc(100% - 24px); }

    /* grid دو ردیفه: ردیف اول badge، ردیف دوم عنوان+دکمه */
    .spc-header{
        display:grid;
        grid-template-areas:
            "badge badge"
            "title btn";
        grid-template-columns: 1fr auto;
        gap:7px 8px;
        margin-bottom:13px;
        align-items:center;
    }

    /* display:contents → box خودش حذف میشه، فرزندانش (badge و title)
       مستقیم توی grid والد (spc-header) قرار می‌گیرن */
    .spc-header-right{
        display:contents;
    }

    .spc-badge{
        grid-area:badge;
        justify-self:start;   /* فقط اندازه محتوا، نه کل عرض */
        font-size:10.5px;
        padding:5px 11px;
    }
    .spc-title{
        grid-area:title;
        font-size:17px;
        line-height:1.35;
        align-self:center;
    }
    .spc-header-left{
        grid-area:btn;
        align-self:center;
    }
    .spc-all-link{
        font-size:11.5px;
        padding:8px 11px;
        border-radius:9px;
        gap:4px;
    }
    .spc-arrow{ font-size:13px; }

    .spc-cat-badge{ top:8px; right:8px; font-size:10.5px; padding:4px 8px; }
    .spc-card-body{ padding:12px 12px 10px; }
    .spc-card-title{ margin-bottom:6px; }
    .spc-card-desc{ margin-bottom:9px; }
    /* meta موبایل یک خط */
    .spc-card-meta{ flex-wrap:nowrap; gap:3px; }
    .spc-meta-item{ font-size:10px; }
    .spc-hover-btn{ font-size:12px; padding:7px 11px; }
}

/* ── Navy variant ─────────────────────────────────────────────
   Used by panel-built sections placed under the navy services block
   ([crush_product_section] with «پس‌زمینه: سرمه‌ای»). Only the surrounding
   chrome changes colour; the cards stay light so product photos keep their
   contrast. */
.spc-section--navy{
    background:linear-gradient(180deg,#0f172a 0%,#16233f 100%);
}
.spc-section--navy .spc-title{ color:#ffffff; }
.spc-section--navy .spc-badge{
    background:rgba(245,158,11,.16);
    color:#fbbf24;
}
.spc-section--navy .spc-all-link{
    background:transparent;
    color:#fbbf24;
    border-color:rgba(245,158,11,.55);
}
.spc-section--navy .spc-all-link:hover{
    background:#E78B08;
    border-color:#E78B08;
    color:#fff;
}
.spc-section--navy .spc-card{
    border-color:rgba(255,255,255,.10);
    box-shadow:0 10px 30px rgba(0,0,0,.28);
}
