/* ==========================================================
   PERUNOV - PRODOTTI WOOCOMMERCE
   ========================================================== */

.perunov-products-component {
    width: 100%;
    color: var(--global-palette4);
    font-family: var(--global-body-font-family);
}

.perunov-products {
    display: grid;
    grid-template-columns: repeat(
        var(--perunov-product-columns, 6),
        minmax(0, 1fr)
    );
    gap: 18px;
    width: 100%;
    margin: 0;
    padding: 0;
}

.perunov-products-toolbar {
    display: grid;
    grid-template-columns: auto 1fr;
    align-items: center;
    gap: 20px;
    margin: 0 0 22px;
}

.perunov-products-toolbar__meta {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 18px;
    margin-left: auto;
    min-height: 38px;
}

.perunov-products-toolbar__views {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    min-height: 38px;
}

.perunov-products-toolbar__view {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    border: 1px solid var(--global-palette7);
    background: var(--global-palette9);
    color: var(--global-palette4);
    font-size: 19px;
    line-height: 1;
    cursor: pointer;
}

.perunov-products-toolbar__view:hover,
.perunov-products-toolbar__view:focus,
.perunov-products-toolbar__view.is-active {
    border-color: var(--global-palette-highlight);
    background: var(--global-palette-highlight);
    color: var(--global-palette9);
}

.perunov-products-toolbar__count {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    
    font-family: var(--global-body-font-family);
    font-size: 0.9em;
    line-height: 1.2;
    white-space: nowrap;
}

.perunov-products-toolbar__ordering {
    display: inline-flex;
    align-items: center;
    gap: 9px;
    margin: 0 !important;
    min-height: 38px;
}

.perunov-products-toolbar__ordering-label {
    margin: 0;
    
    font-family: var(--global-body-font-family);
    font-size: 0.9em;
    line-height: 1.2;
    white-space: nowrap;
}

.perunov-products-toolbar__ordering-select {
    min-width: 190px;
    height: 38px;
    margin: 0;
    padding: 0 34px 0 12px;
    border: 1px solid var(--global-palette7);
    border-radius: 0;
    background-color: var(--global-palette9);
    color: var(--global-palette4);
    font-family: var(--global-body-font-family);
    font-size: 0.9em;
    line-height: 1.2;
}

.perunov-product-card {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    margin: 0;
	text-align: left;
    background: var(--global-palette9);
    border: 1px solid var(--global-palette7);
    border-radius: 0;
    box-shadow: 0 5px 18px rgba(0, 20, 30, 0.06);
    transition: transform 300ms ease, box-shadow 300ms ease;
}

.perunov-products-component--grid .perunov-product-card:hover,
.perunov-products-wrapper--grid .perunov-product-card:hover {
    transform: translateY(-3px);
    box-shadow: 0 10px 28px rgba(0, 20, 30, 0.10);
}

.perunov-product-card__media {
    position: relative;
    overflow: hidden;
    background: var(--global-palette8);
}

.perunov-product-card__image-link {
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    overflow: hidden;
}

.perunov-product-card__image {
    display: block;
    width: 100%;
    height: 100%;
    margin: 0;
    object-fit: cover;
    object-position: center;
    transition: transform 600ms ease;
}

.perunov-products-component--grid .perunov-product-card:hover .perunov-product-card__image,
.perunov-products-wrapper--grid .perunov-product-card:hover .perunov-product-card__image {
}

@media (max-width: 767px) {
  .perunov-products .product,
  .perunov-product-card {
    flex: 0 0 100% !important;
    width: 100% !important;
    max-width: 100% !important;
  }
}

.perunov-product-card__badge {
    position: absolute;
    top: 10px;
    left: 10px;
    z-index: 2;
    padding: 5px 9px;
    border-radius: 999px;
    background: var(--global-palette4);
    color: var(--global-palette9);
    font-family: var(--global-body-font-family);
    font-size: 0.75em;
    line-height: 1;
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.perunov-product-card__content {
    display: flex;
    flex: 1 1 auto;
    flex-direction: column;
    padding: 14px 14px 16px;
}

.perunov-product-card__rating {
    display: flex;
    align-items: center;
    gap: 5px;
    margin: 0 0 7px;
    min-height: 18px;
}

.perunov-product-card__rating .star-rating {
    float: none;
    margin: 0;
    font-size: 0.9em;
}

.perunov-product-card__rating-count {
    color: var(--global-palette6);
    font-family: var(--global-body-font-family);
    font-size: 0.8em;
}

.perunov-product-card__title {
    margin: 0 0 7px;
    font-size: 1em;
	text-transform: unset;
    line-height: 1.3em;
    font-family: var(--global-body-font-family);
    font-weight: inherit;
}

.perunov-product-card__title a {
    color: var(--global-palette4);
    text-decoration: none;
}

.perunov-product-card__title a:hover,
.perunov-product-card__title a:focus {
    color: var(--global-palette-highlight);
    text-decoration: none;
}

.perunov-product-card__weight {
    margin-bottom: 7px;
    color: var(--global-palette6);
    font-family: var(--global-body-font-family);
    font-size: 0.9em;
}

.perunov-product-card__excerpt {
    display: none;
    margin: 0 0 14px;
    color: var(--global-palette4);
    font-family: var(--global-body-font-family);
    font-size: 1em;
    line-height: 1.5em;
}

.perunov-product-card__price {
    margin: 10px 0 12px;
    color: var(--global-palette4);
    font-family: var(--global-body-font-family);
    font-size: 1em;
    line-height: 1.3em;
    font-weight: 700;
}

.perunov-product-card__price del {
    margin-right: 5px;
    color: var(--global-palette6);
    font-size: 0.9em;
    font-weight: 400;
}

.perunov-product-card__price ins {
    text-decoration: none;
}

.perunov-product-card__cart {
    display: flex;
    align-items: stretch;
    gap: 10px;
    width: 100%;
    margin-top: auto;
}

.perunov-product-card__quantity {
    flex: 0 0 58px;
    width: 58px;
    min-width: 0;
    height: 42px;
    margin: 0;
    padding: 6px 8px;
    border: 1px solid var(--global-palette7);
    border-radius: 0;
    background: var(--global-palette8);
    color: var(--global-palette4);
    text-align: center;
    font: inherit;
}

/*
 * Il pulsante usa la classe WooCommerce/Kadence `.button` nel markup.
 * Qui definiamo solo il comportamento nel layout della card: colori, font,
 * bordi, padding, hover e border-radius restano quelli globali del tema.
 */
.perunov-product-card__cart-button {
    display: inline-flex;
    flex: 1 1 auto;
    align-items: center;
    justify-content: center;
    font-size: 0.85em !important;
    text-align: center;
    text-decoration: none;
	padding: .4em .4em !important;
	line-height:1.3em;
}

.perunov-product-card__cart-button:hover,
.perunov-product-card__cart-button:focus {
    text-decoration: none;
}

.perunov-product-card__cart-button--select {
    flex: 0 1 auto;
}

.perunov-product-card .added_to_cart {
    display: none !important;
}

.perunov-products-component--list .perunov-products,
.perunov-products-wrapper--list .perunov-products {
    display: block;
}

.perunov-products-component--list .perunov-product-card,
.perunov-products-wrapper--list .perunov-product-card {
    display: grid;
    grid-template-columns: minmax(190px, 280px) minmax(0, 1fr);
    gap: 0;
    margin-bottom: 28px;
    overflow: visible;
    border: 0;
    border-radius: 0;
    box-shadow: none;
}

.perunov-products-component--list .perunov-product-card__image-link,
.perunov-products-wrapper--list .perunov-product-card__image-link {
    aspect-ratio: 1 / 1;
}

.perunov-products-component--list .perunov-product-card__content,
.perunov-products-wrapper--list .perunov-product-card__content {
    padding: 0 0 0 24px;
}

.perunov-products-component--list .perunov-product-card__title,
.perunov-products-wrapper--list .perunov-product-card__title {
    margin-bottom: 5px;
}

.perunov-products-component--list .perunov-product-card__excerpt,
.perunov-products-wrapper--list .perunov-product-card__excerpt {
    display: block;
    max-width: 780px;
}

.perunov-products-component--list .perunov-product-card__price,
.perunov-products-wrapper--list .perunov-product-card__price {
    margin-top: 7px;
}

.perunov-products-component--list .perunov-product-card__cart,
.perunov-products-wrapper--list .perunov-product-card__cart {
    max-width: 420px;
}

.perunov-products-pagination {
    margin-top: 34px;
}

.perunov-products-pagination ul.page-numbers {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: center;
    gap: 6px;
    margin: 0;
    padding: 16px 0;
    list-style: none;
    background: transparent;
}

.perunov-products-pagination li {
    margin: 0;
    padding: 0;
}

.perunov-products-pagination .page-numbers a,
.perunov-products-pagination .page-numbers span {
    display: inline-flex;
    min-width: 34px;
    height: 34px;
    align-items: center;
    justify-content: center;
    padding: 0 8px;
    border-radius: 999px;
    color: var(--global-palette4);
    font-family: var(--global-body-font-family);
    font-size: 0.9em;
    line-height: 1;
    text-decoration: none;
}

.perunov-products-pagination .page-numbers a:hover,
.perunov-products-pagination .page-numbers a:focus,
.perunov-products-pagination .page-numbers .current {
    background: var(--global-palette4);
    color: var(--global-palette9);
}

@media (max-width: 1024px) {
    .perunov-products-component--grid .perunov-products,
    .perunov-products-wrapper--grid .perunov-products {
        grid-template-columns: repeat(
            min(var(--perunov-product-columns, 3), 3),
            minmax(0, 1fr)
        );
        gap: 16px;
    }

    .perunov-products-component--list .perunov-product-card,
    .perunov-products-wrapper--list .perunov-product-card {
        grid-template-columns: 220px minmax(0, 1fr);
    }
}

@media (max-width: 640px) {
    .perunov-products-toolbar {
        grid-template-columns: 1fr;
        align-items: start;
        gap: 12px;
        margin-bottom: 16px;
    }

    .perunov-products-toolbar__meta {
        width: 100%;
        align-items: center;
        justify-content: space-between;
        gap: 12px;
    }

    .perunov-products-toolbar__ordering {
        flex: 1 1 auto;
    }

    .perunov-products-toolbar__ordering-label {
        font-size: 12px;
    }

    .perunov-products-toolbar__ordering-select {
        min-width: 0;
        width: 100%;
        max-width: 210px;
        font-size: 13px;
    }

    .perunov-products-toolbar__count {
        font-size: 12px;
        text-align: right;
    }

    .perunov-products-component--grid .perunov-products,
    .perunov-products-wrapper--grid .perunov-products {
        grid-template-columns: repeat(
            min(var(--perunov-product-columns, 1), 1),
            minmax(0, 1fr)
        );
        gap: 12px;
    }

    .perunov-product-card__content {
        padding: 11px 10px 12px;
    }

    .perunov-product-card__cart {
        gap: 6px;
    }

    .perunov-product-card__quantity {
        flex-basis: 46px;
        width: 46px;
        height: 38px;
        padding-inline: 4px;
    }

    .perunov-products-component--list .perunov-product-card,
    .perunov-products-wrapper--list .perunov-product-card {
        display: block;
        margin-bottom: 26px;
    }

    .perunov-products-component--list .perunov-product-card__image-link,
    .perunov-products-wrapper--list .perunov-product-card__image-link {
        aspect-ratio: 1 / 1;
    }

    .perunov-products-component--list .perunov-product-card__content,
    .perunov-products-wrapper--list .perunov-product-card__content {
        padding: 14px 0 0;
    }

}

@media (max-width: 380px) {
    .perunov-products-component--grid .perunov-products,
    .perunov-products-wrapper--grid .perunov-products {
        grid-template-columns: 1fr;
    }
}

body.single-product .perunov-related-products {
    margin-bottom: 2em;
}
