/*
 * NIBBANAH Retail — Category Navigation v1.1.2
 * Porto/WooCommerce compatibility.
 * Keep category photography dominant; use a compact editorial title label.
 */

body.woocommerce-shop ul.products,
body.tax-product_cat ul.products {
    --nib-cat-gap: clamp(18px, 2.2vw, 32px);
}

.woocommerce ul.products li.product-category.product,
.woocommerce-page ul.products li.product-category.product {
    margin-bottom: clamp(28px, 4vw, 48px);
    text-align: left;
}

.woocommerce ul.products li.product-category.product > a,
.woocommerce-page ul.products li.product-category.product > a {
    display: block;
    position: relative;
    text-decoration: none;
}

/* Category image */
.woocommerce ul.products li.product-category.product img,
.woocommerce-page ul.products li.product-category.product img {
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    display: block;
    background: #f8f3f2;
    border-radius: 2px;
    transition: transform .35s ease, opacity .35s ease;
}

.woocommerce ul.products li.product-category.product a:hover img,
.woocommerce-page ul.products li.product-category.product a:hover img {
    transform: scale(1.012);
    opacity: .97;
}

/* Porto category-card wrappers */
.woocommerce li.product-category .thumb-info,
.woocommerce li.product-category .thumb-info-wrapper,
.woocommerce li.product-category .product-image,
.woocommerce-page li.product-category .thumb-info,
.woocommerce-page li.product-category .thumb-info-wrapper,
.woocommerce-page li.product-category .product-image {
    box-shadow: none !important;
    border: 0 !important;
    background: transparent !important;
}

.woocommerce li.product-category .thumb-info,
.woocommerce li.product-category .thumb-info-wrapper,
.woocommerce-page li.product-category .thumb-info,
.woocommerce-page li.product-category .thumb-info-wrapper {
    position: relative !important;
}

/*
 * Porto normally creates a large white title panel over the category image.
 * Turn it into a compact label so the product/category photograph stays visible.
 */
.woocommerce li.product-category .thumb-info-title,
.woocommerce-page li.product-category .thumb-info-title {
    position: absolute !important;
    top: auto !important;
    right: auto !important;
    bottom: 16px !important;
    left: 16px !important;
    width: auto !important;
    height: auto !important;
    min-width: 0 !important;
    min-height: 0 !important;
    max-width: calc(100% - 32px) !important;
    margin: 0 !important;
    padding: 10px 14px !important;
    transform: none !important;
    background: rgba(255,255,255,.94) !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: flex-start !important;
    box-shadow: none !important;
    border: 0 !important;
    z-index: 3 !important;
}

.woocommerce li.product-category .thumb-info-title::before,
.woocommerce li.product-category .thumb-info-title::after,
.woocommerce-page li.product-category .thumb-info-title::before,
.woocommerce-page li.product-category .thumb-info-title::after {
    display: none !important;
}

.woocommerce li.product-category .thumb-info-inner,
.woocommerce-page li.product-category .thumb-info-inner,
.woocommerce li.product-category .woocommerce-loop-category__title,
.woocommerce-page li.product-category .woocommerce-loop-category__title {
    width: auto !important;
    height: auto !important;
    min-height: 0 !important;
    margin: 0 !important;
    padding: 0 !important;
    color: #202020 !important;
    background: transparent !important;
    font-size: 14px !important;
    font-weight: 600 !important;
    line-height: 1.25 !important;
    letter-spacing: .16em !important;
    text-transform: uppercase !important;
    white-space: normal !important;
    overflow-wrap: normal !important;
    word-break: normal !important;
    text-align: left !important;
}

/*
 * Porto adds a secondary category type label (normally “Products”) inside
 * .thumb-info-type. Hide only that label while keeping the category name.
 */
.woocommerce ul.products li.product-category.product .thumb-info-type,
.woocommerce-page ul.products li.product-category.product .thumb-info-type,
.products .product-category .thumb-info-type {
    display: none !important;
}

/* Hide WooCommerce product count in category titles. */
.woocommerce ul.products li.product-category.product .count,
.woocommerce-page ul.products li.product-category.product .count,
.woocommerce li.product-category .thumb-info-title .count,
.woocommerce-page li.product-category .thumb-info-title .count {
    display: none !important;
}

/* Neutralize Porto effects that can enlarge/move the title panel on hover. */
.woocommerce li.product-category:hover .thumb-info-title,
.woocommerce-page li.product-category:hover .thumb-info-title,
.woocommerce li.product-category .thumb-info:hover .thumb-info-title,
.woocommerce-page li.product-category .thumb-info:hover .thumb-info-title {
    top: auto !important;
    right: auto !important;
    bottom: 16px !important;
    left: 16px !important;
    width: auto !important;
    height: auto !important;
    transform: none !important;
}

@media (max-width: 991px) {
    .woocommerce li.product-category .thumb-info-title,
    .woocommerce-page li.product-category .thumb-info-title {
        bottom: 12px !important;
        left: 12px !important;
        max-width: calc(100% - 24px) !important;
        padding: 8px 11px !important;
    }

    .woocommerce li.product-category .thumb-info-inner,
    .woocommerce-page li.product-category .thumb-info-inner,
    .woocommerce li.product-category .woocommerce-loop-category__title,
    .woocommerce-page li.product-category .woocommerce-loop-category__title {
        font-size: 14px !important;
        letter-spacing: .12em !important;
    }
}

@media (max-width: 767px) {
    .woocommerce ul.products li.product-category.product,
    .woocommerce-page ul.products li.product-category.product {
        margin-bottom: 24px;
    }

    .woocommerce li.product-category .thumb-info-title,
    .woocommerce-page li.product-category .thumb-info-title {
        bottom: 10px !important;
        left: 10px !important;
        max-width: calc(100% - 20px) !important;
        padding: 7px 9px !important;
    }

    .woocommerce li.product-category .thumb-info-inner,
    .woocommerce-page li.product-category .thumb-info-inner,
    .woocommerce li.product-category .woocommerce-loop-category__title,
    .woocommerce-page li.product-category .woocommerce-loop-category__title {
        font-size: 14px !important;
        line-height: 1.2 !important;
        letter-spacing: .10em !important;
    }
}
