/* متغیرهای رنگی - هماهنگ با استایل مدرن */
:root {
    --checo-primary: #2271b1; 
    --checo-hover: #135e96;
    --checo-border: #eaeaea;
    --checo-text: #333;
    --checo-meta: #777;
}

/* کانتینر اصلی */
.checo-tabs-wrapper {
    direction: rtl;
    margin-bottom: 50px;
    font-family: inherit !important;
    font-size: 14px;
}

/* --- تب‌ها (نویگیشن) --- */
.checo-tabs-nav {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    list-style: none !important;
    padding: 0 !important;
    margin: 0 0 25px 0 !important;
    border-bottom: 1px solid var(--checo-border);
}

.checo-tabs-nav li {
    padding: 8px 16px;
    cursor: pointer;
    font-weight: 500;
    color: var(--checo-meta);
    background: transparent;
    border-radius: 4px;
    transition: all 0.2s ease;
    font-size: 14px;
}

.checo-tabs-nav li:hover {
    color: var(--checo-primary);
    background: rgba(34, 113, 177, 0.05);
}

.checo-tabs-nav li.active {
    color: #fff;
    background: var(--checo-primary);
    box-shadow: 0 4px 10px rgba(34, 113, 177, 0.2);
}

/* --- پنل محتوا --- */
.checo-tabs-content .checo-tab-panel {
    display: none;
    animation: checoFadeIn 0.4s ease;
}
.checo-tabs-content .checo-tab-panel.active { display: block; }

@keyframes checoFadeIn { 
    from { opacity: 0; transform: translateY(5px); } 
    to { opacity: 1; transform: translateY(0); } 
}

/* --- گرید محصولات --- */
.checo-products-grid {
    display: grid;
    gap: 20px;
    /* پیش‌فرض */
    grid-template-columns: repeat(2, 1fr);
}

/* ستون‌بندی ریسپانسیو */
@media (min-width: 768px) {
    .checo-products-grid.desktop-cols-2 { grid-template-columns: repeat(2, 1fr); }
    .checo-products-grid.desktop-cols-3 { grid-template-columns: repeat(3, 1fr); }
    .checo-products-grid.desktop-cols-4 { grid-template-columns: repeat(4, 1fr); }
    .checo-products-grid.desktop-cols-5 { grid-template-columns: repeat(5, 1fr); }
    .checo-products-grid.desktop-cols-6 { grid-template-columns: repeat(6, 1fr); }
}

@media (max-width: 767px) {
    .checo-products-grid.mobile-cols-1 { grid-template-columns: 1fr; }
    .checo-products-grid.mobile-cols-2 { grid-template-columns: repeat(2, 1fr); }
}

/* --- کارت محصول --- */
.checo-product-item {
    background: #fff;
    border: 1px solid var(--checo-border);
    border-radius: 8px;
    overflow: hidden;
    transition: all 0.3s cubic-bezier(0.25, 0.8, 0.25, 1);
    position: relative;
    padding-bottom: 10px;
}

.checo-product-item:hover {
    box-shadow: 0 8px 20px rgba(0,0,0,0.06);
    border-color: #dcdcdc;
    transform: translateY(-3px);
}

.checo-product-link {
    text-decoration: none !important;
    color: inherit;
    display: block;
}

/* تصویر */
.checo-product-thumb {
    position: relative;
    overflow: hidden;
    margin-bottom: 10px;
    border-radius: 0 0 4px 4px;
    aspect-ratio: 1 / 1; /* مربعی */
}

.checo-product-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform 0.5s ease;
}

/* استایل تصویر دوم (هاور) - بسیار مهم */
.checo-hover-img {
    position: absolute !important;
    top: 0; left: 0; 
    width: 100% !important; 
    height: 100% !important;
    object-fit: cover;
    opacity: 0;
    transition: opacity 0.3s ease-in-out;
    z-index: 2;
    background: #fff; /* جلوگیری از پرش تصویر */
}

/* وقتی هاور میشه، تصویر دوم (اگر باشه) ظاهر بشه */
.checo-product-item:hover .checo-hover-img {
    opacity: 1;
}

/* زوم روی عکس اصلی وقتی هاور میشه (اگر عکس دوم نبود یا کلا برای افکت) */
.checo-product-item:hover .checo-product-thumb > img:first-child {
    transform: scale(1.05);
}

/* جزئیات محصول */
.checo-product-details {
    padding: 0 12px;
}

.checo-product-title {
    font-size: 13px;
    font-weight: 700;
    margin: 0 0 6px 0;
    line-height: 1.4;
    color: var(--checo-text);
    min-height: 38px;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
}

.checo-product-price {
    font-size: 14px;
    font-weight: 600;
    color: #444;
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 5px;
}

.checo-product-price del {
    font-size: 11px;
    color: #aaa;
}

.checo-product-price ins {
    text-decoration: none;
    color: #d0021b;
}

/* دکمه خرید */
.checo-add-to-cart-wrap {
    padding: 0 12px 12px 12px;
}

.checo-add-to-cart-wrap .button, 
.checo-add-to-cart-wrap .added_to_cart {
    width: 100%;
    display: block;
    text-align: center;
    background: #f5f5f5 !important;
    color: #444 !important;
    font-size: 12px !important;
    padding: 8px 0 !important;
    border-radius: 6px !important;
    font-weight: 500 !important;
    border: 1px solid transparent !important;
    transition: all 0.2s !important;
    line-height: 1.5 !important;
}

.checo-product-item:hover .checo-add-to-cart-wrap .button {
    background: var(--checo-primary) !important;
    color: #fff !important;
    border-color: var(--checo-primary) !important;
}

/* --- ارتفاع ثابت (Fixed Height) --- */
/* این کلاس باعث میشه دکمه‌ها در یک راستا قرار بگیرن */
.checo-fixed-height .checo-product-item {
    display: flex;
    flex-direction: column;
    height: 100%; /* ارتفاع پر شود */
}

.checo-fixed-height .checo-product-link {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

.checo-fixed-height .checo-product-details {
    display: flex;
    flex-direction: column;
    flex-grow: 1;
}

/* فاصله انداختن بین عنوان/قیمت و پایین باکس */
.checo-fixed-height .checo-product-price {
    margin-top: auto; /* قیمت رو هل میده پایین */
    padding-top: 10px;
}

.checo-fixed-height .checo-add-to-cart-wrap {
    margin-top: 0; /* چون فلکس پرنت هندل میکنه */
}

/* --- استایل نام دسته‌بندی (جدید) --- */
.checo-product-cat {
    display: block;
    font-size: 11px;
    color: #999;
    margin-bottom: 2px;
    font-weight: normal;
}

/* اصلاح تراز تب‌ها (برای اینکه style اینلاین شورت‌کد کار کنه) */
.checo-tabs-nav {
    /* مقادیر قبلی رو حفظ کن، فقط این رو مطمئن شو */
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    /* justify-content توسط PHP مقداردهی میشه */
}