/* ============================================================
   AjaxWeb Product Categories – Frontend CSS v2.0
   نکته: CSS Elementor controls با {{WRAPPER}} override میکنه
   این فایل فقط ساختار پایه است
============================================================ */

/* ── Reset ── */
.ajaxweb-cat-wrapper *,
.ajaxweb-cat-wrapper *::before,
.ajaxweb-cat-wrapper *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ══════════════════════════════════════════════
   WRAPPER
══════════════════════════════════════════════ */
.ajaxweb-cat-wrapper {
    display: flex;
    align-items: stretch;
    direction: rtl;
    overflow: hidden;
    position: relative;
    width: 100%;
    height: 400px; /* fallback – Elementor override میکنه */
}

/* ══════════════════════════════════════════════
   TAB POSITIONS
══════════════════════════════════════════════ */

/* راست (پیش‌فرض) */
.ajaxweb-cat-wrapper.ajaxweb-pos-right {
    flex-direction: row;
}

/* چپ */
.ajaxweb-cat-wrapper.ajaxweb-pos-left {
    flex-direction: row-reverse;
}

/* بالا (افقی) */
.ajaxweb-cat-wrapper.ajaxweb-pos-top {
    flex-direction: column;
}

.ajaxweb-cat-wrapper.ajaxweb-pos-top .ajaxweb-tabs {
    flex-direction: row;
    width: 100% !important;
    height: auto;
    overflow-x: auto;
    overflow-y: hidden;
}

.ajaxweb-cat-wrapper.ajaxweb-pos-top .ajaxweb-tab {
    flex-direction: row;
    white-space: nowrap;
    flex-shrink: 0;
}

/* ══════════════════════════════════════════════
   TABS COLUMN
══════════════════════════════════════════════ */
.ajaxweb-tabs {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
    overflow-y: auto;
    overflow-x: hidden;
    height: 100%;
    width: 120px; /* Elementor override */
    /* scrollbar مخفی */
    scrollbar-width: none;
    -ms-overflow-style: none;
}
.ajaxweb-tabs::-webkit-scrollbar { display: none; }

/* ── Tab Button ── */
.ajaxweb-tab {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    cursor: pointer;
    border: none;
    background: transparent;
    text-align: center;
    width: 100%;
    min-height: 80px;
    padding: 12px 8px;
    transition: background-color .25s ease, color .25s ease;
    position: relative;
    -webkit-tap-highlight-color: transparent;
    outline: none;
}

.ajaxweb-tab-label {
    display: block;
    font-size: 12px;
    line-height: 1.4;
    word-break: keep-all;
}

/* ── Icon ── */
.ajaxweb-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    line-height: 1;
}

.ajaxweb-icon svg,
.ajaxweb-icon img {
    display: block;
    width: 28px;
    height: 28px;
    fill: currentColor;
    transition: fill .25s ease, transform .25s ease;
    object-fit: contain;
}

/* PNG: هاور کمی بزرگ‌تر میشه */
.ajaxweb-tab:hover .ajaxweb-icon img {
    transform: scale(1.08);
}

/* ── Count Badge ── */
.ajaxweb-count {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 10px;
    min-width: 18px;
    height: 18px;
    padding: 0 4px;
    border-radius: 20px;
    line-height: 1;
    font-weight: 700;
}

/* ══════════════════════════════════════════════
   CONTENT COLUMN
══════════════════════════════════════════════ */
.ajaxweb-content {
    flex: 1;
    min-width: 0;
    height: 100%;
    overflow-y: auto;
    overflow-x: hidden;
    scrollbar-width: thin;
}

/* ── Panel ── */
.ajaxweb-tab-content {
    display: none;
    width: 100%;
    height: auto;
    padding: 20px;
}

.ajaxweb-tab-content.active {
    display: block;
}

/* ══════════════════════════════════════════════
   ANIMATIONS
══════════════════════════════════════════════ */

/* Fade */
.ajaxweb-anim-fade .ajaxweb-tab-content.active {
    animation: ajaxweb-fade .25s ease forwards;
}

@keyframes ajaxweb-fade {
    from { opacity: 0; }
    to   { opacity: 1; }
}

/* Slide Up */
.ajaxweb-anim-slide-up .ajaxweb-tab-content.active {
    animation: ajaxweb-slideup .3s cubic-bezier(.2,.8,.2,1) forwards;
}

@keyframes ajaxweb-slideup {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* ══════════════════════════════════════════════
   VIEW ALL
══════════════════════════════════════════════ */
.ajaxweb-view-all {
    display: block;
    margin-bottom: 12px;
}

.ajaxweb-view-all a {
    text-decoration: none;
    font-size: 14px;
    transition: color .2s ease;
}

/* ══════════════════════════════════════════════
   DIVIDER
══════════════════════════════════════════════ */
.ajaxweb-divider {
    border: none;
    border-top: 1px solid currentColor;
    opacity: .15;
    margin-bottom: 20px;
}

/* ══════════════════════════════════════════════
   CONTENT GRID
══════════════════════════════════════════════ */
.ajaxweb-content-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr)); /* override با inline style */
    gap: 24px;
    align-items: start;
}

/* ══════════════════════════════════════════════
   GROUP HEADING (دسته سطح ۱)
══════════════════════════════════════════════ */
.ajaxweb-group-heading {
    border-right: 2px solid currentColor;
    padding-right: 8px;
    margin-bottom: 8px;
    line-height: 1.6;
}

.ajaxweb-group-heading a {
    font-weight: 700;
    font-size: 14px;
    text-decoration: none;
    display: block;
    transition: color .2s ease;
}

/* ══════════════════════════════════════════════
   SUB-CAT ITEMS (دسته سطح ۲)
══════════════════════════════════════════════ */
.ajaxweb-subcat-list {
    list-style: none;
}

.ajaxweb-subcat-item {
    display: block;
}

.ajaxweb-subcat-item:not(:last-child) {
    margin-bottom: 4px;
}

.ajaxweb-subcat-item a {
    display: flex;
    align-items: center;
    gap: 4px;
    text-decoration: none;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.6;
    transition: color .2s ease;
}

.ajaxweb-arrow {
    flex-shrink: 0;
    opacity: .5;
    transition: opacity .2s ease, transform .2s ease;
}

.ajaxweb-subcat-item a:hover .ajaxweb-arrow {
    opacity: 1;
    transform: translateX(-3px);
}

/* ══════════════════════════════════════════════
   TABLET  (max 1024px)
══════════════════════════════════════════════ */
@media (max-width: 1024px) {
    .ajaxweb-cat-wrapper {
        height: auto !important; /* روی تبلت ارتفاع آزاد */
    }
}

/* ══════════════════════════════════════════════
   MOBILE  (max 767px)  – مثل خانومی
   تب‌ها: ستون ثابت راست، اسکرول عمودی
   محتوا: کنارش، اسکرول عمودی
══════════════════════════════════════════════ */
@media (max-width: 767px) {

    .ajaxweb-cat-wrapper {
        flex-direction: row !important; /* همیشه row روی موبایل */
        align-items: stretch;
        height: 480px; /* Elementor override میکنه */
        overflow: hidden;
    }

    /* تب‌ها: ستون باریک سمت راست */
    .ajaxweb-tabs {
        width: 80px !important; /* Elementor mobile override */
        flex-shrink: 0;
        flex-direction: column !important;
        overflow-y: auto;
        overflow-x: hidden;
        height: 100%;
    }

    .ajaxweb-tab {
        flex-direction: column;
        padding: 10px 4px;
        min-height: 72px;
        gap: 4px;
    }

    .ajaxweb-tab-label {
        font-size: 10px;
    }

    .ajaxweb-icon svg,
    .ajaxweb-icon img {
        width: 22px;
        height: 22px;
    }

    /* محتوا: اسکرول‌پذیر عمودی */
    .ajaxweb-content {
        flex: 1;
        min-width: 0;
        height: 100%;
        overflow-y: auto;
        overflow-x: hidden;
    }

    .ajaxweb-tab-content {
        padding: 12px;
    }

    /* حالت top روی موبایل به row تبدیل میشه */
    .ajaxweb-cat-wrapper.ajaxweb-pos-top .ajaxweb-tabs {
        flex-direction: column !important;
        width: 80px !important;
        height: 100%;
        overflow-x: hidden;
        overflow-y: auto;
    }

    .ajaxweb-cat-wrapper.ajaxweb-pos-top .ajaxweb-tab {
        white-space: normal;
        flex-shrink: 0;
    }
}

/* ══════════════════════════════════════════════
   VERY SMALL  (max 480px)
══════════════════════════════════════════════ */
@media (max-width: 480px) {
    .ajaxweb-tabs {
        width: 68px !important;
    }

    .ajaxweb-tab {
        min-height: 64px;
        padding: 8px 2px;
    }

    .ajaxweb-tab-label {
        font-size: 9px;
    }

    .ajaxweb-icon svg,
    .ajaxweb-icon img {
        width: 18px;
        height: 18px;
    }
}
