/* ============================================================
   PRODUCT CATALOG
============================================================ */

.hab-product-catalog {
    width: 100%;
}


/* ============================================================
   HEADER
============================================================ */

.hab-catalog-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 20px;
    margin-bottom: 20px;
    border-bottom: 1px solid rgb(196, 196, 196);
}

.hab-catalog-title {
    margin: 0;
    padding-bottom: 10px;
    color: #a9285a !important;
    font-size: 34px;
    font-weight: 600;
    line-height: 1.2em;
}


/* ============================================================
   SORT
============================================================ */

.hab-catalog-sort {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 10px;
    flex-shrink: 0;
    white-space: nowrap;
}


/* Remove a estilização nativa do navegador */

select.hab-sort {
    -webkit-appearance: none;
    -moz-appearance: none;
    appearance: none;

    border: none !important;
    outline: none !important;
    box-shadow: none !important;

    background: transparent;
}


.hab-catalog-sort label {
    white-space: nowrap;
    flex-shrink: 0;
}


.hab-catalog-sort select {
    width: auto;
    min-width: 100px;

    border: 0;

    background: transparent;

    font-weight: 600;

    cursor: pointer;
}


.hab-catalog-sort select option,
select.hab-sort option {
    font-weight: 400;
}


.hab-catalog-sort select.hab-sort {
    color: #a9285a !important;
    -webkit-appearance: none !important;
    -moz-appearance: none !important;
    appearance: none !important;
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background-color: transparent !important;
    font-weight: 600;
    cursor: pointer;
    padding-right: 20px !important;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 1.5L6 6.5L11 1.5' stroke='%23222222' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
    background-repeat: no-repeat !important;
    background-position: right center !important;
}


/* Seta para cima */

.hab-catalog-sort select.hab-sort.is-active {

    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8' fill='none'%3E%3Cpath d='M1 6.5L6 1.5L11 6.5' stroke='%23222222' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E") !important;
}


/* ============================================================
   BODY
============================================================ */

.hab-catalog-body {

    display: grid;

    grid-template-columns:
        190px minmax(0, 1fr);

    gap: 24px;
}


/* ============================================================
   SIDEBAR
============================================================ */

.hab-catalog-sidebar {
    min-width: 0;
}


.hab-catalog-filter-title {

    font-weight: 700;

    margin-bottom: 15px;
}


.hab-catalog-categories {

    display: flex;

    flex-direction: column;
}


/* ============================================================
   CATEGORIAS
============================================================ */

.hab-category {

    width: 100%;

    display: flex;

    align-items: center;

    justify-content: space-between;

    border: 0;

    background: transparent;

    text-align: left;

    padding: 8px 0;

    margin: 0;

    cursor: pointer;

    color: #333;

    font-size: 14px;

    font-weight: 400;

    transition:
        color .2s ease,
        background-color .2s ease;
}


/* Categoria principal */

.hab-category:not(.hab-category-child) {
    font-weight: 500;
}


/* Hover */

.hab-category:hover {
    color: #A9285A;
}


/* Categoria ativa */

.hab-category.active {

    color: #A9285A;

    font-weight: 700;
}


/* ============================================================
   CONTADOR DA CATEGORIA
============================================================ */

.hab-category-count {

    flex-shrink: 0;

    color: #888;

    font-size: 12px;

    font-weight: 400;

    margin-left: 8px;
}


.hab-category.active .hab-category-count {
    color: #A9285A;
}


/* ============================================================
   SUBCATEGORIAS
============================================================ */

.hab-category.hab-category-child {

    width: calc(100% - 16px);

    margin-left: 16px;

    padding: 5px 0 5px 14px;

    position: relative;

    color: #777;

    font-size: 13px;

    font-weight: 400;
}


/* ============================================================
   HIERARQUIA
============================================================ */


/* Nível 1 */

.hab-category.hab-category-level-1 {

    margin-left: 16px;

    width: calc(100% - 16px);
}


/* Nível 2 */

.hab-category.hab-category-level-2 {

    margin-left: 32px;

    width: calc(100% - 32px);
}


/* Nível 3 */

.hab-category.hab-category-level-3 {

    margin-left: 48px;

    width: calc(100% - 48px);
}


/* Nível 4 */

.hab-category.hab-category-level-4 {

    margin-left: 64px;

    width: calc(100% - 64px);
}


/* ============================================================
   LINHA VERTICAL
============================================================ */

.hab-category.hab-category-child::before {

    content: "";

    position: absolute;

    left: 0;

    top: 0;

    bottom: 0;

    width: 1px;

    background: #e3e3e3;

    transition:
        background-color .2s ease;
}


/* ============================================================
   SÍMBOLO DA ÁRVORE
============================================================ */

.hab-category.hab-category-child
.hab-category-name::before {

    content: "└";

    display: inline-block;

    margin-right: 7px;

    color: #aaa;

    font-size: 12px;

    transition:
        color .2s ease;
}


/* ============================================================
   HOVER SUBCATEGORIA
============================================================ */

.hab-category.hab-category-child:hover {
    color: #A9285A;
}


.hab-category.hab-category-child:hover::before {

    background: #A9285A;
}


.hab-category.hab-category-child:hover
.hab-category-name::before {

    color: #A9285A;
}


/* ============================================================
   SUBCATEGORIA ATIVA
============================================================ */

.hab-category.hab-category-child.active {

    color: #A9285A;

    font-weight: 600;
}


.hab-category.hab-category-child.active::before {

    background: #A9285A;
}


.hab-category.hab-category-child.active
.hab-category-name::before {

    color: #A9285A;
}


/* ============================================================
   PRODUTOS
============================================================ */

.hab-catalog-products {

    display: grid;

    grid-template-columns:
        repeat(4, minmax(0, 1fr));

    gap: 16px;

    /*
     * Faz todos os cards da mesma linha
     * ocuparem a mesma altura.
     */
    align-items: stretch;

    transition:
        opacity .2s ease;
}


.hab-catalog-products.is-loading {

    opacity: .45;

    pointer-events: none;
}


/* ============================================================
   CARD DO PRODUTO
============================================================ */

.hab-catalog-product {

    /*
     * Flex permite controlar a posição
     * do botão dentro do card.
     */
    display: flex;

    flex-direction: column;

    /*
     * Faz o card ocupar toda a altura
     * disponível da linha do grid.
     */
    height: 100%;

    box-sizing: border-box;

    background: white;

    border-radius: 8px;

    overflow: hidden;

    transition:
        box-shadow .2s ease,
        transform .2s ease;
}


/* Hover */

.hab-catalog-product:hover {

    transform: translateY(-2px);

    box-shadow:
        0 5px 20px rgba(0, 0, 0, .08);
}


/* ============================================================
   IMAGEM
============================================================ */

.hab-catalog-product-image {

    display: block;

    /*
     * Todas as imagens ficam exatamente
     * com a mesma proporção.
     */
    aspect-ratio: 1 / 1;

    width: 100%;

    background: #fff;

    flex-shrink: 0;
}


.hab-catalog-product-image {

    display: block;

    width: 100%;

    aspect-ratio: 1 / 1;

    height: auto;

    overflow: hidden;

    background: #fff;

    flex-shrink: 0;
}


.hab-catalog-product-image img {

    display: block;

    width: 100% !important;

    height: 100% !important;

    max-width: none;

    max-height: none;

    aspect-ratio: 1 / 1;

    object-fit: contain;

    object-position: center;

    margin: 0;

    padding: 0;
}


/* ============================================================
   INFORMAÇÕES DO PRODUTO
============================================================ */

.hab-catalog-product-info {
    display: flex;
    flex-direction: column;
    flex: 1;
    min-width: 0;
    padding: 12px;
    box-sizing: border-box;
}


/* ============================================================
   TÍTULO
============================================================ */

.hab-catalog-product-title {
    font-family: "Montserrat", Sans-serif !important;
    text-align: center;
    height: 20px;
    min-height: 20px;
    margin: 0 0 13px;
    font-size: 16px;
    line-height: 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    text-transform: uppercase;
    font-weight: 500;
}


.hab-catalog-product-title a {
    color: #a9285a !important;
    text-decoration: none !important;
}

.hab-catalog-product-title a:hover{
    opacity: 0.9;
}


/* ============================================================
   PREÇO
============================================================ */

.hab-catalog-product-price {
    text-align: center;
    min-height: 43px;
    font-size: 17px;
    font-weight: 700;
    line-height: 1.4;
    color: #94A3B8;
    font-weight: 700;
}


/* Preço antigo */

.hab-catalog-product-price del {

    display: block;

    /*
     * Reserva uma linha mesmo quando
     * o produto não possui preço antigo.
     */
    min-height: 16px;

    color: #999;

    font-size: 12px;

    line-height: 16px;

    font-weight: 400;
}


/* Preço promocional */

.hab-catalog-product-price ins {

    text-decoration: none;

    color: #059669;
    background: white;
}


/* ============================================================
   BOTÃO — VER PRODUTO
============================================================ */

.hab-catalog-product-button {

    display: block;

    width: 100%;

    box-sizing: border-box;

    /*
     * Empurra o botão para o final
     * do card.
     */
    margin-top: auto;

    text-align: center;

    padding: 14px 12px;

    border: 1px solid #e1e6ea;

    border-radius: 5px;

    background: white;

    color: #A9285A !important;

    text-decoration: none !important;

    font-size: 13px;

    line-height: normal;

    font-weight: 600;

    cursor: pointer;

    transition:
        background-color .2s ease,
        transform .15s ease;
}


/* Hover */

.hab-catalog-product-button:hover {

    background: #a9285a;

    color: #fff !important;

    text-decoration: none;
}


/* Clique */

.hab-catalog-product-button:active {

    transform: scale(.98);
}


/* ============================================================
   PAGINAÇÃO
============================================================ */

.hab-catalog-pagination {

    display: flex;

    justify-content: center;

    align-items: center;

    gap: 6px;

    margin-top: 30px;
}


.hab-page {

    min-width: 36px;

    height: 36px;

    padding: 0 10px;

    border: 1px solid #ddd;

    background: #fff;

    color: #333;

    cursor: pointer;

    border-radius: 4px;

    transition:
        background-color .2s ease,
        color .2s ease,
        border-color .2s ease;
}


.hab-page:hover {

    border-color: #A9285A;

    color: #A9285A;
}


.hab-page.active {

    background: #A9285A;

    color: #fff;

    border-color: #A9285A;
}


/* ============================================================
   VAZIO
============================================================ */

.hab-catalog-empty {

    grid-column: 1 / -1;

    padding: 50px 20px;

    text-align: center;

    color: #777;
}


/* ============================================================
   LOADING
============================================================ */

.hab-catalog-products.is-loading {

    opacity: .45;

    pointer-events: none;
}


/* ============================================================
   TABLET
============================================================ */

@media (max-width: 1024px) {

    .hab-catalog-body {

        grid-template-columns:
            160px minmax(0, 1fr);
    }


    .hab-catalog-products {

        grid-template-columns:
            repeat(3, minmax(0, 1fr));

        gap: 16px;

        align-items: stretch;
    }
}


/* ============================================================
   MOBILE
============================================================ */

@media (max-width: 767px) {

    .hab-catalog-header {

        align-items: flex-start;

        flex-direction: column;

        gap: 12px;
        
    }


    .hab-catalog-body {

        display: block;
    }


    .hab-catalog-sidebar {

        margin-bottom: 20px;
    }


    /* ========================================================
       CATEGORIAS MOBILE
    ======================================================== */

    .hab-catalog-categories {

        flex-direction: row;

        overflow-x: auto;

        gap: 8px;

        padding-bottom: 8px;
    }


    .hab-category {

        width: auto;

        flex-shrink: 0;

        white-space: nowrap;

        padding: 8px 12px;

        border: 1px solid #ddd;

        border-radius: 20px;
    }


    /* Subcategorias */

    .hab-category.hab-category-child {

        width: auto;

        margin-left: 0;

        padding: 8px 12px;
    }


    .hab-category.hab-category-child::before {

        display: none;
    }


    .hab-category.hab-category-child
    .hab-category-name::before {

        content: "↳";

        margin-right: 5px;
    }


    /* Categoria ativa */

    .hab-category.active {

        background: #A9285A;

        color: #fff;

        border-color: #A9285A;
    }


    .hab-category.active .hab-category-count {

        color: #fff;
    }


    .hab-category.hab-category-child.active {

        background: #A9285A;

        color: #fff;
    }


    .hab-category.hab-category-child.active
    .hab-category-name::before {

        color: #fff;
    }


    /* ========================================================
       PRODUTOS MOBILE
    ======================================================== */

    .hab-catalog-products {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 10px;

        align-items: stretch;
    }


    .hab-catalog-product-info {

        padding: 10px;
    }


    .hab-catalog-product-title {

        height: 19px;

        min-height: 19px;

        line-height: 19px;
    }


    .hab-catalog-product-price {

        min-height: 40px;

        font-size: 16px;

        margin-bottom: 10px;
    }


    .hab-catalog-product-price del {

        min-height: 15px;

        font-size: 11px;

        line-height: 15px;
    }
}


/* ============================================================
   MOBILE PEQUENO
============================================================ */

@media (max-width: 480px) {

    .hab-catalog-products {

        grid-template-columns:
            repeat(2, minmax(0, 1fr));

        gap: 8px;

        align-items: stretch;
    }


    .hab-catalog-product-info {

        padding: 8px;
    }


    .hab-catalog-product-title {

        height: 18px;

        min-height: 18px;

        line-height: 18px;

    }


    .hab-catalog-product-price {

        min-height: 37px;

        font-size: 15px;

        margin-bottom: 9px;
    }


    .hab-catalog-product-price del {

        min-height: 14px;

        font-size: 10px;

        line-height: 14px;
    }

}
