/*
Theme Name: Porto Child Primea
Theme URI: https://www.portotheme.com/wordpress/porto
Author: P-THEMES
Author URI: https://www.portotheme.com/
Description: Porto Responsive WordPress + eCommerce Theme.
Version: 1.1
Template: porto
License: Commercial
License URI: http://themeforest.net/licenses/regular_extended
Tags: woocommerce, corporate, ecommerce, responsive, blue, black, green, white, light, dark, red, two-columns, three-columns, four-columns, left-sidebar, right-sidebar, fixed-layout, responsive-layout, custom-menu, editor-style, featured-images, flexible-header, full-width-template, microformats, post-formats, rtl-language-support, sticky-post, theme-options, translation-ready, accessibility-ready
*/

/*************** ADD YOUR CUSTOM CSS HERE  ***************/
/* =========================================================
   PRIMEA - Centratura automatica ultima riga archivio prodotti
   Desktop: 4 colonne
   Tablet: 3 colonne
   Tablet piccolo: 2 colonne
   Mobile: 1 colonna, nessun intervento
   ========================================================= */


/* DESKTOP: 4 colonne */
@media screen and (min-width: 1200px) {

    /* Ultima riga composta da 3 elementi */
    .primea-archive-center
    .posts-wrap.portfolios-container
    > .porto-tb-item:nth-last-child(3):nth-child(4n + 1) {
        margin-left: 12.5% !important;
    }

    /* Ultima riga composta da 2 elementi */
    .primea-archive-center
    .posts-wrap.portfolios-container
    > .porto-tb-item:nth-last-child(2):nth-child(4n + 1) {
        margin-left: 25% !important;
    }

    /* Ultima riga composta da 1 elemento */
    .primea-archive-center
    .posts-wrap.portfolios-container
    > .porto-tb-item:last-child:nth-child(4n + 1) {
        margin-left: 37.5% !important;
    }

}


/* TABLET: 3 colonne */
@media screen and (min-width: 768px) and (max-width: 1199.98px) {

    /* Ultima riga composta da 2 elementi */
    .primea-archive-center
    .posts-wrap.portfolios-container
    > .porto-tb-item:nth-last-child(2):nth-child(3n + 1) {
        margin-left: 16.666667% !important;
    }

    /* Ultima riga composta da 1 elemento */
    .primea-archive-center
    .posts-wrap.portfolios-container
    > .porto-tb-item:last-child:nth-child(3n + 1) {
        margin-left: 33.333333% !important;
    }

}


/* TABLET PICCOLO: 2 colonne */
@media screen and (min-width: 576px) and (max-width: 767.98px) {

    /* Ultima riga composta da 1 elemento */
    .primea-archive-center
    .posts-wrap.portfolios-container
    > .porto-tb-item:last-child:nth-child(2n + 1) {
        margin-left: 25% !important;
    }

}

/* ==============================================
   PRIMEA - HERO MOBILE
   ============================================== */

@media (max-width: 575.98px) {

    .primea-mobile-hero {
        position: relative;
        min-height: 640px;
        display: flex;
        align-items: flex-end;
        overflow: hidden;
    }

    .primea-mobile-hero-content {
        position: relative;
        z-index: 2;
        width: 100%;
        padding: 78px 28px 42px;
        background: #fff;

        /*
         * Crea il taglio diagonale superiore,
         * richiamando la geometria della Hero desktop.
         */
        clip-path: polygon(
            0 42px,
            100% 0,
            100% 100%,
            0 100%
        );
    }

    /*
     * Linea rossa inclinata sopra il pannello bianco
     */
    .primea-mobile-hero-content::before {
        content: "";
        position: absolute;
        top: 21px;
        left: -3%;
        width: 106%;
        height: 1.5px;
        background: var(--porto-primary-color);
        transform: rotate(-3.7deg);
        transform-origin: left center;
        z-index: 3;
    }

    .primea-mobile-hero-content h1 {
        margin-top: 0;
    }

}