/* === CSS for CPS Brands Showcase Shortcode (v2.1 - With Highlights) === */
/* اعمال فونت ایران‌سنس ایکس روی شورت‌کد برندهای برتر */
.cps-top-brands-showcase,
.cps-top-brands-showcase * {
    font-family: 'IRANSansX', 'IRANSansXFaNum', 'IRANSans', tahoma, sans-serif !important;
}

.cps-top-brands-showcase {
    margin: 5px 0;
    padding: 3px;
    background-color: #f9fafb; 
    border-radius: 16px;
    border: 1px solid #f3f4f6;
    box-sizing: border-box;
}

.cps-top-brands-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 3px; 
    margin-bottom: 25px; 
}

/* --- استایل کارت برند (ساده و تمیز) --- */
.cps-brand-card {
    display: block; 
    background-color: #ffffff;
    border-radius: 12px;
    text-decoration: none;
    transition: all 0.25s ease-out;
    overflow: hidden; 
    box-shadow: 0 4px 10px -4px rgba(0, 0, 0, 0.05);
    position: relative; /* (جدید) برای نشان */
    
    /* (جدید) اعمال هایلایت با متغیر */
    border-width: 1px;
    border-style: solid;
    border-color: var(--cps-highlight-color, #e5e7eb); /* پیش‌فرض طوسی روشن */
}
.cps-brand-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 8px 20px -6px rgba(0, 0, 0, 0.1);
    border-color: var(--cps-highlight-color, #d1d5db); /* هاور */
}
.cps-brand-card__image-wrapper {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 90px; 
    padding: 5px;
    box-sizing: border-box;
}
.cps-brand-card__image {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 10px;
}
.cps-brand-card__placeholder-image {
     width: 60px; 
     height: 60px;
     border-radius: 10px; 
     background-color: transparent; 
     color: #9ca3af; 
     display: flex;
     align-items: center;
     justify-content: center;
     font-size: 2rem; 
     font-weight: 700;
     border: 2px solid #f3f4f6; 
}
.cps-brand-card__body {
    padding: 12px;
    text-align: center;
}
.cps-brand-card__title {
    margin: 0;
    font-size: 14px;
    font-weight: 600;
    color: #1f2937; 
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- (جدید) استایل نشان (Badge) --- */
.cps-brand-card__badge {
    position: absolute;
    top: -1px;
    left: -1px;
    font-size: 9px;
    font-weight: 700;
    padding: 3px 7px;
    border-radius: 10px 0 10px 0;
    line-height: 1.4;
    z-index: 2;
    background-color: var(--cps-badge-bg, #D32F2F);
    color: var(--cps-badge-color, #FFFFFF);
    box-shadow: 0 4px 10px rgba(0,0,0,0.1);
}


/* --- (جدید) استایل دکمه مدرن گرادینتی --- */
.cps-other-brands-link-wrapper {
    text-align: center;
    margin-top: 20px;
}
.cps-other-brands-link {
    display: inline-block;
    padding: 10px 25px;
    background: linear-gradient(90deg, #ff004c, #ff6a00); /* <<-- گرادینت */
    color: white !important;
    border: none;
    border-radius: 50px; /* گرد */
    text-decoration: none;
    font-size: 15px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(255, 106, 0, 0.3);
}
.cps-other-brands-link:hover {
    background: linear-gradient(90deg, #ff6a00, #ff004c);
    transform: scale(1.05) translateY(-2px);
    box-shadow: 0 6px 20px rgba(255, 106, 0, 0.4);
}

/* --- (جدید) ریسپانسیو حرفه‌ای (طبق پرامپت) --- */

/* ۱. موبایل (اجبار به ۴ ستون) */
@media (max-width: 600px) {
    .cps-top-brands-grid {
        grid-template-columns: repeat(4, 1fr) !important; /* <<-- ۴ ستون اجباری */
        gap: 0px; /* (اصلاح شد) گپ موبایل */
    }
    .cps-brand-card {
        border-width: 2px;
    }
    .cps-brand-card__image-wrapper {
        height: 70px; /* فشرده‌تر */
        padding: 5px;
    }
    .cps-brand-card__body {
        padding: 8px;
    }
    .cps-brand-card__title {
        font-size: 11px; /* فونت ریزتر */
        white-space: normal; /* اجازه شکستن کلمه */
        line-height: 1.3;
    }
    .cps-brand-card__badge {
        font-size: 8px;
        padding: 2px 5px;
    }
    .cps-other-brands-link {
        padding: 8px 20px;
        font-size: 13px;
    }
}

/* ۲. دسکتاپ (بر اساس تنظیمات ادمین) */
@media (min-width: 768px) {
    .cps-top-brands-grid {
        /* (جدید) استفاده از متغیر برای چیدمان منظم */
        grid-template-columns: repeat(var(--cps-shortcode-max-cols, 6), 1fr);
    }
}


/* === (جدید) استایل نئون === */
.cps-brand-card.has-neon-effect {
    box-shadow: 0 0 15px var(--cps-highlight-color, #007cba), 0 0 5px var(--cps-highlight-color, #007cba);
}
.cps-brand-card.has-neon-effect:hover {
    box-shadow: 0 0 20px var(--cps-highlight-color, #007cba), 0 0 10px var(--cps-highlight-color, #007cba);
}