/* ==================================================
   BASE
================================================== */

.ajaxweb-cat-wrapper {
    display: flex;
    height: 100%;
    width: 100%;
    overflow: hidden;
    direction: rtl;
    box-sizing: border-box;
}

.ajaxweb-cat-wrapper *,
.ajaxweb-cat-wrapper *::before,
.ajaxweb-cat-wrapper *::after {
    box-sizing: border-box;
}

/* ==================================================
   TABS COLUMN
================================================== */

.ajaxweb-tabs {
    display: flex;
    flex-direction: column;
    flex-shrink: 0;
}

.ajaxweb-tab {
    display: flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    border: none;
    background: transparent;
    text-align: right;
    transition: all .2s ease;
}

.ajaxweb-tab.active {
    font-weight: 700;
}

/* ICON */
.ajaxweb-icon {
    display: inline-flex;
    line-height: 1;
}

.ajaxweb-icon svg {
    width: 1em;
    height: 1em;
    fill: currentColor;
}

.ajaxweb-tab .ajaxweb-icon svg {
    width: 1em;
    height: 1em;
    display: block;
    fill: currentColor;
    transition: all .2s ease;
}

/* ==================================================
   CONTENT COLUMN
================================================== */

.ajaxweb-content {
    flex: 1;
    height: 100%;
    overflow: hidden;
}

.ajaxweb-tab-content {
    display: none;
    height: 100%;
    width: 100%;
}

.ajaxweb-tab-content.active {
    display: flex;
    flex-direction: column;
}

/* ==================================================
   CONTENT HEADER (همه محصولات X)
================================================== */

.ajaxweb-parent-header {
    font-weight: 700;
    margin-bottom: 12px;
}

.ajaxweb-parent-header a {
    text-decoration: none;
}

/* separator line */

.ajaxweb-parent-separator {
    width: 100%;
    height: 1px;
    background: currentColor;
    opacity: .15;
    margin-bottom: 16px;
}

/* ==================================================
   SUB CATEGORIES (RECURSIVE SAFE)
================================================== */
.ajaxweb-children {
    display: block;
}

.ajaxweb-cat-item {
    display: block;
}

.ajaxweb-cat-item > a {
    display: inline-block;
    text-decoration: none;
    transition: color .2s ease;
}

/* nested levels */

.ajaxweb-child .ajaxweb-children {
    margin-top: 8px;
    margin-right: 16px;
}

/* ==================================================
   MOBILE MODE
================================================== */

@media (max-width: 768px) {

    .ajaxweb-cat-wrapper {
        flex-direction: column;
        height: auto;
    }

    /* hide tabs */
    .ajaxweb-tabs {
        display: none;
    }

    .ajaxweb-content {
        height: auto;
        overflow: visible;
    }

    .ajaxweb-tab-content {
        display: block !important;
        height: auto;
        margin-bottom: 32px;
    }

    .ajaxweb-parent-separator {
        margin: 16px 0;
    }

    /* double separator between parents */

    .ajaxweb-tab-content:not(:last-child)::after {
        content: "";
        display: block;
        height: 2px;
        background: currentColor;
        opacity: .2;
        margin-top: 32px;
    }

    /* hide background image on mobile */
    .ajaxweb-tab-content {
        background-image: none !important;
    }
}
