/* -------------------------------------------
    Categories
        Base
        - Default Type
        - Classic Type
        - Icon Type
        - Ellipse Type
        - Group Type
            - Image
            - Icon
        - Banner Type
        - Badge Type
        - Overlay Category
        - Block Type
        - Icon Overlay Type
---------------------------------------------- */

// Base
.product-category {
    position: relative;
    font-size: font-size(1rem);
    figure {
        text-align: center;
    }
    img {
        display: block;
        width: 100%;
        height: auto;
        margin-left: auto;
        margin-right: auto;
    }
    mark {
        color: inherit;
        background: transparent;
        font-size: font-size(1.2rem);
        line-height: 1.2;
    }
    .btn {
        color: inherit;
    }
    i {
        display: inline-block;
        font-size: 4.2rem;
        color: #666;
        margin-bottom: 1.5rem;
        transition: transform .3s;
    }
    &.content-left .category-content {
        align-items: if-ltr(flex-start, flex-end);
        text-align: left;
    }
    &.content-center .category-content {
        align-items: center;
        text-align: center;
    }
    &.content-right .category-content {
        align-items: if-ltr(flex-end, flex-start);
        text-align: right;
    }
}
.woocommerce-loop-category__title {
    margin-bottom: .3rem;
    font: {
        size: 1.4rem;
        weight: 600;
    }
    line-height: 1.2;
    color: inherit;
    a {
        color: inherit;
    }
}
.category-wrap {
    margin-bottom: 2rem;
}
.category-content {
    display: flex;
    align-items: center;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    transition: background .3s;
}
.cat-type-absolute {
    .category-content {
        cursor: pointer;
        position: absolute;
        bottom: 0;
        #{$left}: 0;
        width: auto;
        min-height: 50px;
    }
}
// Default Type
.cat-type-default {
    overflow: hidden;
    .category-content {
        padding: 1.8rem 0;
        left: 10px;
        right: 10px;
        bottom: 10px;
        background: #fff;
        color: #222;
    }
    .woocommerce-loop-category__title {
        margin-bottom: 0;
    }
    &:hover {
        .category-content {
            background: var(--rio-primary-color, #26b);
            color: #fff;
        }
    }

    &.default-content-auto {
        .category-content {
            padding: 0;
            background: none;
            left: 50%;
            right: auto;
            transform: translateX(-50%);
        }
        .woocommerce-loop-category__title {
            position: relative;
            display: flex;
            align-items: center;
            justify-content: center;
            padding: 1.8rem 3.9rem;
            border-radius: inherit;
            transition: padding .3s, background .3s;
            background: #fff;
            white-space: nowrap;
            a {
                position: relative;
                transition: padding .3s;
                &::after {
                    content: '\e97f';
                    display: inline-block;
                    position: absolute;
                    #{$right}: 0;
                    top: 50%;
                    transform: translateY(-50%); 
                    font-family: riode;
                    font-size: 1.6rem;
                    font-weight: 400;
                    opacity: 0;
                    transition: opacity .3s;
                }
            }
        }
        &:hover {
            .woocommerce-loop-category__title {
                padding-left: 2.8rem;
                padding-right: 2.8rem;
                background: var(--rio-primary-color, #26b);
            }
            .woocommerce-loop-category__title a {
                padding-#{$right}: 23px;
                &::after {
                    opacity: 1;
                }
            }
        }
    }
}

// Classic Type
@if use_component(category-type-classic) {
.cat-type-classic {
    &.product {
        color: #fff;
        .category-content {
            border-radius: 0;
        }
    }
    mark {
        display: block;
        opacity: 0;
        line-height: 0;
        visibility: hidden;
        transition: opacity .3s, line-height .3s, visibility .3s, padding .3s;
    }
    .woocommerce-loop-category__title {
        margin-bottom: 0;
        text-transform: uppercase;
    }
    .category-content {
        width: 100%;
        height: 25%;
        background-color: rgba( 38, 38, 38, .9 );
    }
    &:hover {
        mark {
            visibility: visible;
            line-height: 1.2;
            opacity: 1;
            padding-top: 4px;
        }
    }
}
}
// Icon Type
// Inline
@if use_component(category-type-icon) {
.cat-type-icon {
    padding: 2.4rem .5rem;
    border: 1px solid #e1e1e1;
    color: #222;
    text-align: center;
    transition: border .3s;

    .woocommerce-loop-category__title {
        margin: 0;
        color: #222;
    }
    &:hover {
        border-color: var(--rio-primary-color, #26b);
        svg, i {
            fill: var(--rio-primary-color, #26b);
            transform: translateY(-4px);
        }
        .category-content {
            background: transparent;
        }
    }
}
.cat-type-icon-inline {
    display: inline-flex;
    align-items: center;
    figure {
        font-size: font-size(3.2rem);
        line-height: 1;
        color: #444;
        transition: color .3s;
        i {
            margin-#{$right}: .8rem;
        }
    }
    .woocommerce-loop-category__title {
        margin: 0;
        text-transform: none;
        text-align: $left;
        font-size: font-size(1.3rem);
        font-weight: inherit;
        font-family: inherit;
        line-height: 1.08;
        color: inherit;
        transition: color .3s;
    }
    &:hover {
        figure,
        .woocommerce-loop-category__title {
            color: var(--rio-primary-color, #26b);
        }
        svg {
            stroke: var(--rio-primary-color, #26b);
        }
        i, svg {
            animation: slideUpShorter .6s;
        }
    }
}
@keyframes slideUpShorter {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-4px);
    }
    100% {
        transform: translateY(0);
    }
}
}

// Ellipse Type
@if use_component(category-type-ellipse) {
    .cat-type-ellipse {
        &.product-category figure img {
            border-radius: 50%;
        }

        figure {
            border-radius: 50%;
            box-shadow: 0 0 50px 0 rgba(0,0,0,.1);
            background: #fff;
            overflow: hidden;

            img {
                padding: 12px;
                transform: rotateZ(-10deg) translateX(-14px);
                transition: transform .3s;
            }
        }
        .woocommerce-loop-category__title {
            color: #222;
            &:hover {
                color: var(--rio-primary-color, #26b);
            }
        }
        mark {
            color: #666;
            text-transform: uppercase;
        }
        .category-content {
            padding-top: 20px;
        }
        &:hover {
            figure img { transform: rotateZ(0); }
        }
    }
    .riode-rounded-skin .cat-type-ellipse.product-category {
        overflow: visible;
    }
}

// Ellipse Type 2
@if use_component(category-type-ellipse2) {
    .cat-type-ellipse2 {
        figure {
            border-radius: 50%;
            overflow: hidden;
        }
        .category-content {
            width: 100%;
            min-height: 25%;
            background-color: #fff;
        }
        .woocommerce-loop-category__title {
            color: #222;
            &:hover {
                color: var(--rio-primary-color, #26b);
            }
        }
    }
}

// Group Type
@if (use(category-type-group) or use(category-type-group-2)) {
.cat-type-group,
.cat-type-group-2 {
    display: flex;
    align-items: center;
    > * {
        flex: 1;
    }
}
}
// Image Type
@if use_component(category-type-group) {
.cat-type-group {
    color: #666;
    border: 1px solid $border-color;
    .category-content {
        position: static;
        padding: side-values(2rem 0 2rem 1rem);
        background: transparent;
        text-align: #{$left};
        align-items: if-ltr(flex-start, flex-end);
    }
    
    .woocommerce-loop-category__title {
        margin-bottom: 1.5rem;
        text-transform: none;
        font: {
            size: 1.6rem;
            weight: 400;
        }
        color: #222;
    }
    .category-list {
        font-size: font-size(1.3rem);
        line-height: 1.2;

        li:not(:last-child) {
            margin-bottom: .9rem;
        }
         a {
            position: relative;
            display: inline-block;
            transition: text-decoration .3s;
            &:hover {
                color: #222;
                text-decoration: underline;
            }
            &:active {
                color: var(--rio-primary-color, #26b);
            }
        }
    }
    &:hover {
        .woocommerce-loop-category__title {
            margin-bottom: 1.5rem;
        }
        .category-content {
            background: transparent;
        }
    } 
}
}

// Icon
@if use_component(category-type-group-2) {
.cat-type-group-2 {
    color: #fff;
    background-color: var(--rio-primary-color, #26b);
    overflow: hidden;
    figure {
        i {
            display: inline-block;
            font-size: 4.8rem;
            transition: transform .3s;
            color: #fff;
        }
    }
    img { margin-bottom: 1.5rem; }
     
    > a {
        padding-#{$right}: 1rem;
        &:hover i {
            transform: translateY(-.5rem);
            // animation-iteration-count: infinite;
        }
    }

    .category-content {
        padding-top: 4rem;
        padding-bottom: 4rem;
        background: transparent;
        text-align: $left;
        align-items: if-ltr(flex-start, flex-end);
    }
    
    .woocommerce-loop-category__title {
        margin-bottom: 0;
        text-align: center;
        color: #fff;
    }
    .category-list {
        font-size: font-size(1.3rem);
        line-height: 1.2;
        text-align: $left;

        li {
            white-space: nowrap;
            &:#{$before} {
                content: if-ltr('\f105', '\f104');
                padding-#{$right}: .8rem;
                font-family: var(--fa-style-family-classic,"Font Awesome 6 Free");
                font-size: 1.3rem;
                font-weight: 600;
                color: #fff;
            }
            &:not(:last-child) {
                margin-bottom: .9rem;
            }
        }
        a {
            position: relative;
            display: inline-block;
            transition: text-decoration .3s;
            &:hover {
                color: inherit;
                text-decoration: underline;
            }
        }
    }
    &:hover {
        .woocommerce-loop-category__title {
            margin-bottom: 0;
        }
        .category-content {
            background: transparent;
        }
    } 
}
}


// Banner Type
@if use_component(category-type-banner) {
.cat-type-banner {
    overflow: hidden;
    color: #222;
    &.text-white {
        color: #fff;
        .btn {
            color: #fff;
        }
    }
    .category-content {
        top: 3.7rem;
        #{$left}: 3.8rem;
        bottom: auto;
        align-items: flex-start;
        z-index: 1;
        background-color: transparent;
        transition: top .3s, padding .3s;
        min-height: 0;
    }
    .woocommerce-loop-category__title {
        text-transform: none;
        text-align: $left;
        font: {
            size: 2rem;
            family: inherit;
        }
    }
    mark {
        visibility: visible;
        opacity: 1;
        font-size: font-size(1.4rem);
        line-height: 1.2;
        transition: color .3s;
        z-index: 1;
    }
    .btn {
        position: absolute;
        opacity: 0;
        bottom: 0;
        transition: transform .3s, opacity .3s;
    }
    &:hover {
        .category-content {
            top: 3rem;
            padding-bottom: 3rem;
            background-color: transparent;
        }
        .btn {
            opacity: 1;
        }
    }
}
}
// Simple Type
@if use_component(category-type-simple) {
    .cat-type-simple {
        .category-content {
            padding: 1.7rem 0;
            mark {
                text-transform: uppercase;
            }
        }
        .woocommerce-loop-category__title {
            margin-bottom: .5rem;
            color: #222;
            text-transform: uppercase;
            &:hover {
                color: var(--rio-primary-color, #26b);
            }
        }
    }
}

// Badge Type
@if use_component(category-type-badge) {
.cat-type-badge {
    .woocommerce-loop-category__title {
        margin: 0;
        padding: 1.8rem 4rem;
        color: #222;
    }
    .btn {
        position: absolute;
        display: inline-flex;
        align-items: center;
        justify-content: center;
        padding: 1.28em 2rem;
        top: 100%;
        #{$left}: 0;
        opacity: 0;
        height: 100%;
        transition: top .3s, opacity .3s;
        color: #fff;
    }
    .category-content {
        #{$left}: 2rem;
        top: auto;
        bottom: 2rem;
        min-height: 0;
        z-index: 1;
        overflow: hidden;
        background-color: #fff;

        &:hover {
            .btn {
                top: 0;
                opacity: 1;
            }
        }
    }
}
}

// Overlay Category
.cat-type-overlay {
    .category-content {
        align-items: center;
        width: auto;
        min-height: 0;
    }
    mark {
        padding: 0;
        line-height: 0;
        opacity: 0;
        transform: translateY(-1rem);
        transition: transform .3s, opacity .3s, line-height .3s, padding .3s;
    }
    .woocommerce-loop-category__title {
        margin: 0;
        font-size: font-size(24px);
        text-transform: uppercase;
        color: #fff;
    }
    &:hover {
        .category-content {
            padding: 0;
            top: 50%;
        }
        mark {
            padding-top: 1rem;
            transform: translateY(0);
            opacity: 1;
        }
    }
    .category-content {
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
    }
}

// Block Category
.cat-type-block {
    color: #222;
    > a {
        color: inherit;
    }
    .woocommerce-loop-category__title {
        margin: 0;
        text-align: center;
        font-weight: 400;
        line-height: 1.7rem;
        text-transform: none;
    }
    &:hover {
        .woocommerce-loop-category__title {
            color: var(--rio-primary-color, #26b);
        }
    }
}

.filter-categories .active {
    color: var(--rio-primary-color, #26b);
}
// In Creative Grid
.grid-item {
    > .product-category {
        height: 100%;
    }
}

// Icon Overlay Type
.cat-type-icon-overlay {
    overflow: hidden;
    .category-content { 
        width: 100%;
        min-height: 25%;
        background-color: #eaf0f9;
        color: #222;
        border-radius: 0;
    }
    figure {
        &::after {
            content: '';
            position: absolute;
            left: 0;
            top: 0;
            width :100%;
            height: 100%;
            background-color: #27c;
            opacity: .9;
        }
        i {
            position: absolute;
            display: flex;
            align-items: center;
            justify-content: center;
            left: 50%;
            top: 37.5%;
            transform: translate(-50%, -50%);
            width: 100px;
            height: 100px;
            margin-bottom: 0;
            border-radius: 50%;
            background-color: rgba(255,255,255,.15);
            box-shadow: 0 5px 15px 0 #27c;
            z-index: 1;
            color: #fff;
        }
    }
    mark {
        display: block;
        opacity: 0;
        line-height: 0;
        visibility: hidden;
        transition: opacity .3s, line-height .3s, visibility .3s, padding .3s;
    }

    &:hover {
        mark {
            visibility: visible;
            line-height: 1.2;
            opacity: 1;
            padding-top: 4px;
        }
    }
}