/* ==========================================================================
   Catalog / Product List Styles
   Mobile First Approach
   ========================================================================== */

/* ==========================================================================
   Base Styles (Mobile Default < 576px)
   ========================================================================== */

.prod-items {
    position: relative;
    z-index: 0;
    gap: initial;
    margin: 0;

    .sectgl-item {
        margin: 0 0 20px;
        width: 100%;

        .prod-i {
            background: var(--secondary-color);
            padding: 5px;
            position: relative;
            transition: box-shadow 0.15s;
            display: grid;
            grid-template-columns: auto 1fr;
            gap: .5rem;
            min-height: initial;
            align-items: center;
            border-radius: 15px;
            background-color: #f4f4fd;

            .darkmode & {
                background-color: #121920;
            }

            .prod-i-top {
                position: relative;

                .prod-i-img:before {
                    content: none;
                }
            }

            .prod-i-img {
                margin: 0;
                height: auto;
                position: relative;
                display: block;
                padding: 0;
                text-align: center;
                font-size: 0;

                img {
                    display: inline-block;
                    max-width: 11rem;
                    max-height: 100%;
                    width: auto;
                    z-index: 1;
                    border-radius: 10px;
                    object-fit: contain;
                }
            }

            &:hover {
                .prod-i-img:before {
                    content: none;
                }

                .prod-i-actions {
                    display: none;
                }

                .prod-i-bot {
                    border-color: transparent;
                }

                box-shadow: 0 6px 40px 0 rgba(0, 0, 0, 0.15);
            }

            .prod-i-actions {
                display: none;
            }

            .prod-i-actions-in {
                transition: all 0.4s;
                padding: 5px 20px;
                border-radius: 40px;
                background: var(--secondary-color);
                display: inline-block;
                height: 40px;
                box-shadow: 0 0 10px 0 rgba(0, 0, 0, 0.04);
            }

            .prod-i-cart {
                padding: 0;
                text-align: center;
                position: relative;
                margin: 0 4px;
                display: inline-block;
                vertical-align: middle;

                button {
                    width: 30px;
                    height: 30px;
                    line-height: 30px;
                    display: block;
                    background-color: transparent;
                    padding: 0;
                    margin: 0;
                    border-radius: 0;
                    position: relative;
                    border: none;
                    transition: background-color 0.2s;
                    opacity: 1;

                    .icon {
                        margin: 0;
                        font-size: 20px;
                        color: var(--heading-color);

                        &:hover {
                            color: var(--third-color);
                        }
                    }
                }
            }

            .prod-i-bot {
                position: relative;
                border-top: 1px solid transparent;
                padding: 1rem 2rem;
                transition: border-color 0.2s;
                background-color: var(--secondary-color);
                z-index: 2;
                border-radius: 10px;
                text-align: left;
                height: 100%;

                .add-to-cart-mobile.blue-button {
                    display: none;
                }

            }

            .prod-i-ttl {
                font-size: 16px;
                font-weight: 600;
                color: var(--heading-color);
                text-align: left;
                padding: 0;
                position: relative;
                line-height: 140%;
                max-height: 77px;
                overflow: hidden;
                margin: 0 0 5px;
                display: flex;
                justify-content: space-between;

                a {
                    transition: all 0.2s;
                    color: var(--base-text-color);
                    border: none;
                    text-overflow: ellipsis;
                    overflow: hidden;
                    white-space: nowrap;
                    max-width: 40dvw;

                    &:active,
                    &:hover {
                        color: var(--third-color);
                    }
                }
            }

            .prod-i-info {
                position: relative;
                overflow: hidden;
                margin: 0;
                display: grid;
                grid-template-columns: 1fr auto;
            }

            .prod-i-categ {
                text-transform: uppercase;
                color: #9292b4;
                font-size: 12px;
                font-weight: 600;
                display: block;
                border-bottom: 1px solid transparent;
                margin: 3px 0 5px;
                line-height: 1.1;

                a {
                    border-bottom: 1px solid transparent;
                    color: #9292b4;

                    &:hover {
                        border-color: #9292b4;
                    }
                }
            }

            .prod-i-price {
                font-size: 15px;
                float: right;
                color: var(--third-color);
                text-align: right;
                margin: 0 0 10px;
                font-weight: 600;
                line-height: 1.4;
            }
        }
    }

    /* Media Queries (Min-Width) */
    @media (min-width: 576px) {
        display: grid;
        grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
        gap: 2rem;
        justify-items: center;

        .sectgl-item {
            width: 90%;

            .prod-i {
                display: grid;
                grid-template-rows: 1fr;
                grid-template-columns: 1fr;
                min-height: 280px;
                padding: 0;
                gap: 0;
                align-items: initial;

                .prod-i-img {
                    height: 160px;
                    padding: 5px 15px;

                    img {
                        max-width: 100%;
                    }
                }

                .prod-i-bot {
                    border-top: 1px solid var(--base-color);
                    padding: 20px;

                    .prod-i-info {
                        align-items: center;
                        gap: 5px;

                        .prod-i-categ {
                            margin: 0;
                        }

                        .prod-i-price {
                            margin: 0;
                        }
                    }
                }

                &:hover .prod-i-bot {
                    border-color: #e9e9ef;
                }

                /* Restore hover effects */
                .prod-i-top .prod-i-img:before {
                    content: '';
                    position: absolute;
                    left: 0;
                    right: 0;
                    top: 0;
                    bottom: -10px;
                    background-color: #f5f5fc;
                    opacity: 0;
                    transition: opacity 0.2s;
                    z-index: 2;
                    border-radius: 10px 10px 0 0;
                }

                &:hover .prod-i-img:before {
                    opacity: 0.5;
                }

                .prod-i-ttl a {
                    max-width: 16rem;
                }
            }
        }
    }

    @media (min-width: 768px) {
        .sectgl-item {
            .prod-i {

                .prod-i-img {
                    height: auto;
                }

                .prod-i-price {
                    margin: 0 0 10px;
                }

                .prod-i-ttl {
                    font-size: 18px;
                }

                .prod-i-bot {
                    .add-to-cart-mobile {
                        display: none;
                    }
                }

                .prod-i-info {
                    grid-template-columns: auto 1fr;

                    .prod-i-categ {
                        white-space: nowrap;
                        max-width: 8rem;
                        overflow: hidden;
                        text-overflow: ellipsis;
                        font-size: 1.1rem;
                    }

                    .prod-i-price {
                        grid-column: 1 / 3;
                        text-align: start;
                        font-size: 2rem;
                    }

                    .add-to-cart-mobile.blue-button {
                        display: block;
                        grid-column: 1 / 3;
                        justify-self: center;
                        background-color: var(--third-color);
                        width: 100%;
                        text-align: center;
                        border-radius: 5px;
                        padding: 4px 0;
                        color: white;
                        transition: background-color 0.2s, transform 0.2s, box-shadow 0.2s;
                        will-change: background-color, transform, box-shadow;

                        &:hover, &:active {
                            background-color: var(--primary-hover);
                            transform: translateY(-2px);
                            box-shadow: 0 10px 25px rgba(102, 234, 144, 0.4);
                        }
                    }
                }

                .prod-i-actions {
                    display: block;
                    position: absolute;
                    top: 50%;
                    margin: -20px 0 0;
                    z-index: 3;
                    text-align: center;
                    left: 0;
                    right: 0;
                    transition: opacity 0.2s;
                    opacity: 0;

                    .hover-label.prod-addbtn {
                        display: inline-flex;
                        width: auto;

                        i {
                            &::before {
                                color: var(--secondary-text-color);
                            }

                            &:hover, &:active {
                                &::before {
                                    color: var(--third-color);
                                }
                            }
                        }

                        span {
                            position: absolute;
                            bottom: 110%;
                            width: max-content;
                            left: 50%;
                            transform: translate3d(-50%, -50%, 0);
                            background-color: var(--third-color);
                            border-radius: 5px;
                            padding: 5px 10px;
                            color: white;
                            opacity: 0;
                            transition: transform 0.2s, opacity 0.3s;

                            &::before {
                                content: '';
                                position: absolute;
                                top: 100%;
                                left: 50%;
                                transform: translateX(-50%);
                                border-width: 5px;
                                border-style: solid;
                                border-color: var(--third-color) transparent transparent transparent;
                            }
                        }

                        &:hover span {
                            opacity: 1;
                            transform: translate3d(-50%, 0, 0);
                        }
                    }
                }

                .prod-i-info .prod-i-categ {
                    max-width: unset;
                }

                &:hover .prod-i-actions {
                    display: block;
                    opacity: 1;
                }
            }
        }
    }

    @media (min-width: 992px) {
        grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
        .sectgl-item {
            .prod-i {
                min-height: 368px;

                .prod-i-img {
                    height: 271px;
                    padding: 30px;
                }

                .prod-i-price {
                    margin: 0 0 7px;
                }

                .prod-i-ttl a {
                    max-width: unset;
                }

                .prod-i-info {
                    grid-template-columns: auto auto 1fr;
                    .prod-i-price {
                        grid-column: unset;
                        text-align: right;
                    }

                    .add-to-cart-mobile.blue-button {
                        grid-column: 1 / 4;
                    }
                }
            }
        }
    }

    @media (min-width: 1200px) {
        .sectgl-item {
            .prod-i {
                min-height: 465px;

                .prod-i-img {
                    height: 340px;
                    padding: 20px;
                }

                .prod-i-bot {
                    padding: 20px 30px;
                }
            }
        }
    }
}

/* 4 Columns Layout */
.prod-items-4 {
    .sectgl-item {
        @media (min-width: 992px) {
            .prod-i {
                min-height: 368px;
            }

            .prod-i-img {
                height: 271px;
            }
        }
    }
}

/* Sidebar Layout Variations */
.section-wrap-withsb {
    .prod-items-3 {
        .sectgl-item {
            @media (min-width: 992px) {
                .prod-i {
                    min-height: 370px;
                }

                .prod-i-img {
                    height: 273px;
                    padding: 30px;
                }

                .prod-i .prod-i-bot {
                    padding: 20px 30px 8px;
                }

                .prod-i .prod-i-price {
                    margin: 0 0 7px;
                }
            }

            @media (min-width: 1200px) {
                .prod-i {
                    min-height: 297px;
                }

                .prod-i-img {
                    height: 200px;
                    padding: 25px;
                }

                .prod-i .prod-i-bot {
                    padding: 20px 25px 8px;
                }

                .prod-i .prod-i-price {
                    margin: 0 0 7px;
                }
            }
        }
    }
}

.add-to-cart-mobile {
    border: 0;
    padding: 0;
    background-color: transparent;
    text-align: end;
    display: block;

    i:active {
        color: var(--third-color);
        transition: color 0.1s ease-in;
    }
}

.cart-actions {
    padding: 0;
    background-color: transparent;
}

/* ==========================================================================
   CART Icon Styles
   ========================================================================== */

i.icon.ion-android-cart {
    font-size: 20px;

    &:hover {
        color: var(--third-color)
    }
}

/* ==========================================================================
   CART Button
   ========================================================================== */

.bi-cart-plus::before {
    font-size: 2.5rem;
}

/* ==========================================================================
   Catalog Animation
   ========================================================================== */

#catalog-section article {
    opacity: 0;
    transform: translateY(30px);
    transition: opacity 0.8s ease, transform 0.8s ease;
    will-change: transform, opacity;

    &.show-on-scroll {
        opacity: 1;
        transform: translateY(0);
    }
}

@media screen and (min-width: 1200px) {
    .cont {
        max-width: unset;
    }
}
