/* =============================
   استایل کلی Dynamic Tabs Menu
============================= */
.dynamic-tabs-menu-wrapper {
    width: 100%;
    margin: 20px auto;
    background: #fff;
    border-radius: 15px;
    direction: rtl;
    font-family: tahoma;
    padding:20px;
    position: relative;
    box-sizing: border-box;
}
/* -----------------------------
   فلش‌های اسکرول تب‌ها
------------------------------ */

/* دکمه فلش */
.tabs-scroll-btn {
     display: none; /* مخفی پیش‌فرض */
    position: absolute;
    color: #2c3e50; /* رنگ فلش */
    border-radius:5px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
    transition: all 0.3s ease;
    font-size: 25px;
    font-weight: bold;
    background: #00000017;
  padding-top: 26px;
  padding-bottom: 26px;
  padding-left: 5px;
  padding-right: 5px;
}


/* فلش چپ */
.tabs-scroll-left {
    left: -10px;
}
.tabs-scroll-left::after {
    content: "\2039"; /* ← علامت فلش */
}

/* فلش راست */
.tabs-scroll-right {
    right: -10px;
}
.tabs-scroll-right::after {
    content: "\203A"; /* → علامت فلش */
}

/* -----------------------------
   اسکرول افقی تب‌ها
------------------------------ */
.dynamic-tabs-menu-wrapper .tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 10px;
    overflow-x: auto;
    white-space: nowrap;
    scrollbar-width: thin;
    position: relative;
    padding-bottom: 5px;
}

/* -----------------------------
   تب‌ها (Tab)
------------------------------ */
.dynamic-tabs-menu-wrapper .tab {
    border: none;
    cursor: pointer;
    transition: all 0.3s ease; /* انیمیشن تغییر رنگ */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
    color: #2c3e50;
    border-radius: 12px;
    border: 1px solid #e4e5e6;
    background: #f3f3f3;
    padding: 10px;
    font-size:12px;
}

/* تب فعال */
.dynamic-tabs-menu-wrapper .tab.active {
    background: #2c3e50;
border: 1px solid #e4e5e6;
        color: #ffffff;

    
}


/* هاور تب */
.dynamic-tabs-menu-wrapper .tab:hover {
    background: #2c3e50;
border: 1px solid #e4e5e6;
        color: #ffffff;
    
}

/* عکس تب */
.tab-icon {
    width: 45px;
    height: auto;
    object-fit: cover;
    border-radius: 8px;
    margin-bottom: 6px;
      min-width: 45px;
}

/* متن تب */
.tab-title {
    white-space: nowrap;
    font-weight: bold;
}

/* -----------------------------
   اسلایدر زیر دسته‌ها (Subcat Row)
------------------------------ */
.subcats-wrapper {
    margin-top: 10px;
}

.subcats-row {
    display: none; /* پیشفرض مخفی */
    overflow-x: auto;
    white-space: nowrap;
    padding-bottom: 10px;
    position: relative;
    transition: all 0.3s ease; /* انیمیشن ظاهر شدن */
}

.subcats-row.active {
    display: flex; 
    align-items: center; 
    gap: 8px;
}



.subcats-row::-webkit-scrollbar {
    display: none;
}

/* -----------------------------
   زیرتب‌ها (Subcat Button)
------------------------------ */
.subcat-btn {
    display: inline-flex;
    align-items: center;
    background: #f3f3f3; /* حالت پیشفرض */
    border-radius: 12px;
    padding: 6px 12px;
    margin-left: 8px;
    cursor: pointer;
    border: 1px solid #e5e7eb !important;
    transition: all 0.3s ease;
    color: #000; 
    min-height: 47px;
    font-size:14px;

}

/* زیرتب فعال */
.subcat-btn.active {
    background: #2c3e50;
        color: #ffffff;
    border: 1px solid #e4e5e6;
}

/* زیرتب هاور */
.subcat-btn:hover {
    background: #2c3e50;
        color: #ffffff;
    border-color: #2c3e50;
}

/* تصویر زیرتب */
.subcat-img {
    width: 32px;
    height: 32px;
    border-radius: 6px;
    margin-left: 8px;
}

/* -----------------------------
   جستجو
------------------------------ */
.dynamic-tabs-menu-wrapper .search-wrapper {
    position: relative;
}

.dynamic-tabs-menu-wrapper .search-input {
    width: 100%;
    border-radius: 10px;
    border: 1px solid #ccc;
    margin-bottom: 15px;
    font-size: 14px;
    padding: 6px 10px;
}

.dynamic-tabs-menu-wrapper .clear-search {
    position: absolute;
    left: 10px;
    top: 50%;
    transform: translateY(-50%);
    cursor: pointer;
    font-size: 18px;
    display: none;
}

/* -----------------------------
   سورت
------------------------------ */
.dynamic-tabs-menu-wrapper .sort-box {
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.dynamic-tabs-menu-wrapper .sort-option {
    cursor: pointer;
    font-size: 12px;
    padding: 0 3px;
    color:#5f5f5f;
    transition: all 0.2s ease;
}

.dynamic-tabs-menu-wrapper .sort-option.active {
    color: #2c3e50;
}

/* -----------------------------
   لیست محصولات و آیتم‌ها
------------------------------ */
.dynamic-tabs-menu-wrapper .items {
    display: flex;
    flex-direction: column;
    padding-bottom: 100px;
}

.dynamic-tabs-menu-wrapper .item {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-bottom: 5px;
    padding: 16px;
    border: 1px solid #eee;
    border-radius: 24px;
    align-items: stretch;
    transition: all 0.3s ease; 
}

/* عکس محصول */
.dynamic-tabs-menu-wrapper .item img {
    width: 120px;
    height: 120px;
    border-radius: 10px;
    object-fit: cover;
    object-position: center;
}

/* ستون راست و چپ */
.item-right-image {
    text-align: center;
}

.add-to-cart-under-image {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.item-left-info {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* عنوان و توضیح و قیمت */
.item-title {
    font-size: 15px;
    font-weight: bold;
    margin-bottom: 6px;
    margin-top: 8px;
}

.item-title a {
    text-decoration: none;
}

.item-desc {
    font-size: 14px;
    line-height: 1.6;
    margin-bottom: 10px;
}

.item-price {
    margin-top: auto;
}

.item-price del {
    color: #818181;
    text-decoration: line-through;
    margin-left: 8px;
    font-size: 14px;


}

.item-price ins {
        font-size: 14px;
    color: #000;
    font-weight: bold;
}

.item-stock-quantity {
    font-size: 11px;
    color: #999999;
    margin-top: auto;
    padding-bottom: 3px;
}

/* -----------------------------
   دکمه‌های + و - تعداد محصول
------------------------------ */
.btn-out-of-stock {
    width: 100%;
    background: #eee;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 14px;
    padding: 8px 0;
    color: #555;
    cursor: default;
    pointer-events: none;

}

.btn-free {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    font-size: 14px;
}

.qty-box {
    display: flex;
    gap: 8px;
}

/* دکمه‌های + و - پیشفرض */
@keyframes pop {
  0%   { transform: scale(1); }
  50%  { transform: scale(1.2); } /* بزرگ شدن */
  100% { transform: scale(1); }    /* برگشت به حالت اولیه */
}

.qty-plus,
.qty-minus {
    width: 32px;
    height: 32px;
    border-radius: 8px;
      padding: 0;
    font-size: 18px;
    background: #2c3e50;
    color: #fff;
    border: 1px solid #e4e5e6;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

/* هاور و کلیک */
.qty-plus:hover ,
.qty-minus:hover
{
     background: #2c3e50;
    color: #fff;
    border: 1px solid #e4e5e6;
}

.qty-plus:active,
.qty-minus:active {
    animation: pop 0.3s ease forwards; /* 0.3 ثانیه انیمیشن */
  background: #285786;
    
}

/* نمایش تعداد */
.qty-display {
    min-width: 25px;
    text-align: center;
    font-size: 16px;
    font-weight: bold;
    padding-top: 4px;
}

/* لودینگ هنگام اضافه/کم کردن */
.qty-loading {
    width: 20px;
    height: 20px;
    border: 2px solid #ccc;
    border-top-color: #2c3e50;
    border-radius: 50%;
    animation: spin 0.6s linear infinite;
    margin: 0 auto;
}

@keyframes spin {
    to { transform: rotate(360deg); }
}

/* -----------------------------
   دکمه ثبت سفارش
------------------------------ */
.checkout-fixed-btn {
    position: fixed;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    width: 90px;
    height: 90px;
    color: #fff;
    border-radius: 100%;
    font-size: 13px;
    font-weight: bold;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 4px;
    z-index: 9999;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: all 0.3s ease;
    background: #2c3e50;
    text-decoration: none;
}

.checkout-fixed-btn.show {
    bottom: 20px;
}

.checkout-fixed-btn .cart-count {
    font-size: 14px;
    font-weight: normal;
    opacity: 0.9;
    font-size: 13px;
    text-decoration: none;
}

/* -----------------------------
   ریسپانسیو
------------------------------ */




@media (min-width: 800px) {

    .dynamic-tabs-menu-wrapper .items {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 15px;

    }
}

@media (min-width: 992px) {

    .dynamic-tabs-menu-wrapper .items {
        display: grid;
        grid-template-columns: repeat(2, 1fr);
        gap: 20px;
    }
}

/* ============================================
   === NEW LAYOUT FIXES (بالا/پایین جدید) ===
============================================ */

/* ساختار جدید بالا و پایین */
.item-top{
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
}

.item-bottom {
    display: flex;
    justify-content: space-between;
    width: 100%;
    gap: 20px;
    align-items: flex-end;
    
}

/* بخش بالایی */
.item-top-right {
    text-align: center;
}

.item-top-left {
    flex: 1;
    display: flex;
    flex-direction: column;
}

/* بخش پایینی */
.item-bottom-right {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 120px;
}

.item-bottom-left {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: flex-end;
}

/* خنثی‌سازی ساختار قبلی بدون تغییر ظاهر */
.item-right-image,
.item-left-info {
    display: contents;
}









