/* ==========================================================
   PERUNOV – CATEGORIE PRODOTTO WOOCOMMERCE
   ========================================================== */

.perunov-product-categories {
    display: grid;
    grid-template-columns: repeat(
        var(--perunov-category-columns, 4),
        minmax(0, 1fr)
    );
    gap: 20px;
    width: 100%;
    max-width: 100%;
    margin: 0;
    padding: 0;
}

.perunov-category-card {
    min-width: 0;
    width: 100%;
    margin: 0;
    padding: 0;
}

.perunov-category-card__link {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;

    background: var(--wp--preset--color--theme-palette-8, #e4e4e4);
    color: var(--wp--preset--color--theme-palette-9) !important;

    text-decoration: none;
    isolation: isolate;
}

.perunov-category-card__link:hover,
.perunov-category-card__link:focus {
    color: var(--wp--preset--color--theme-palette-9) !important;
    text-decoration: none;
}

.perunov-category-card__media {
    position: absolute;
    inset: 0;
    overflow: hidden;
}

.perunov-category-card__image {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;

    object-fit: cover;
    object-position: center;

    transition:
        transform 700ms ease,
        filter 500ms ease;
}

.perunov-category-card__placeholder {
    width: 100%;
    height: 100%;
    background:
        linear-gradient(
            180deg,
            var(--wp--preset--color--theme-palette-8, #f2f2f2) 0%,
            var(--wp--preset--color--theme-palette-8, #e4e4e4) 48%,
            var(--wp--preset--color--theme-palette-7, #8f8f8f) 100%
        );
}

.perunov-category-card__overlay {
    position: absolute;
    inset: 0;
    z-index: 1;

    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0) 40%,
            rgba(0, 0, 0, 0.15) 60%,
            rgba(0, 0, 0, 0.65) 100%
        );

    transition: background 450ms ease;
}

.perunov-category-card__content {
    position: absolute;
    right: 0;
    bottom: 0;
    left: 0;
    z-index: 2;

    padding: 20px;
}

.perunov-category-card__title {
    position: relative;
    display: inline-block;
    margin: 0;
    padding-right: 20px;

    font-family: var(--global-heading-font-family, inherit);
    color: var(--wp--preset--color--theme-palette-9) !important;
    font-size: 1.5em;

    line-height: 1.04;
    text-transform: uppercase;

    overflow-wrap: normal;
    word-break: normal;
    hyphens: none;
	
	display: block;
    width: 100%;
	
	transition: all 300ms ease;
}

.perunov-category-card__title::before {
    position: absolute;
    top: 0;
    bottom: 0;
    left: calc(100% - 20px);
    z-index: 9;

    display: flex;
    align-items: center;

    opacity: 1;
    background: rgba(0, 0, 0, 0);
    content: '→';
	font-family: var(--global-body-font-family, inherit);

    transition: all 300ms ease;
}

.perunov-category-card__link:hover .perunov-category-card__title {
	left: 1em;
	transition: all 300ms ease;
}

.perunov-category-card__link:hover .perunov-category-card__title::before,
.perunov-category-card__link:focus .perunov-category-card__title::before {
    left: -1em;
    background: rgba(0, 0, 0, 0);
}

.perunov-category-card__link:hover .perunov-category-card__image,
.perunov-category-card__link:focus .perunov-category-card__image {
    transform: scale(1.05);
    filter: brightness(0.9);
}

.perunov-category-card__link:hover .perunov-category-card__overlay,
.perunov-category-card__link:focus .perunov-category-card__overlay {
    background:
        linear-gradient(
            180deg,
            rgba(0, 0, 0, 0.05) 30%,
            rgba(0, 0, 0, 0.25) 55%,
            rgba(0, 0, 0, 0.80) 100%
        );
}


/* ==========================================================
   VARIANTI NUMERO COLONNE
   ========================================================== */

/* Una sola categoria */
.perunov-product-categories[style*="--perunov-category-columns: 1"] {
    grid-template-columns: 100%;
    padding-left: 10px;
}

/* Due categorie */
.perunov-product-categories[style*="--perunov-category-columns: 2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}


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

@media (max-width: 1024px) {

    .perunov-product-categories {
        grid-template-columns: repeat(
            min(var(--perunov-category-columns, 2), 2),
            minmax(0, 1fr)
        );
    }

    .perunov-product-categories[style*="--perunov-category-columns: 1"] {
        grid-template-columns: minmax(280px, 440px);
    }
}


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

@media (max-width: 640px) {

    .perunov-product-categories,
    .perunov-product-categories[style*="--perunov-category-columns: 1"],
    .perunov-product-categories[style*="--perunov-category-columns: 2"] {
        grid-template-columns: 1fr;
    }
}