/*--start afisare la brand-------------*/
/* Containerul de produse pentru Brand, Search si Etichete */
.tax-pwb_brand ul.products, 
.tax-product_brand ul.products,
.search-results ul.products,
.tax-product_tag ul.products {
    display: flex !important;
    flex-wrap: wrap !important;
    gap: 15px !important;
    padding: 0 !important;
    margin: 0 auto !important;
    justify-content: flex-start !important;
}

/* Stil general (Desktop - 4 pe rand) */
.tax-pwb_brand ul.products li.product, 
.tax-product_brand ul.products li.product,
.search-results ul.products li.product,
.tax-product_tag ul.products li.product {
    flex: 1 1 calc(25% - 15px) !important;
    max-width: calc(25% - 15px) !important;
    list-style: none !important;
    margin: 0 0 20px 0 !important;
    display: block !important;
}

/* --- RESPONSIVENESS --- */

/* Tableta: 3 produse pe rand (sub 1024px) */
@media (max-width: 1024px) {
    .tax-pwb_brand ul.products li.product, 
    .tax-product_brand ul.products li.product,
    .search-results ul.products li.product,
    .tax-product_tag ul.products li.product {
        flex: 1 1 calc(33.333% - 15px) !important;
        max-width: calc(33.333% - 15px) !important;
    }
}

/* Mobil: 2 produse pe rand (sub 767px) */
@media (max-width: 767px) {
    .tax-pwb_brand ul.products li.product, 
    .tax-product_brand ul.products li.product,
    .search-results ul.products li.product,
    .tax-product_tag ul.products li.product {
        flex: 1 1 calc(50% - 15px) !important;
        max-width: calc(50% - 15px) !important;
    }

    /* Ajustare font titlu pe mobil */
    .tax-pwb_brand ul.products li.product h2, 
    .tax-product_brand ul.products li.product h2,
    .search-results ul.products li.product h2,
    .tax-product_tag ul.products li.product h2 {
        font-size: 14px !important;
        line-height: 1.2 !important;
        min-height: 40px;
    }
}

/* Mobil mic: 2 produse pe rand (sub 480px) */
@media (max-width: 480px) {
    .tax-pwb_brand ul.products,
    .search-results ul.products,
    .tax-product_tag ul.products {
        gap: 10px !important;
    }
    .tax-pwb_brand ul.products li.product, 
    .tax-product_brand ul.products li.product,
    .search-results ul.products li.product,
    .tax-product_tag ul.products li.product {
        flex: 1 1 calc(50% - 10px) !important;
        max-width: calc(50% - 10px) !important;
    }
}
/*---end afisare la brand----*/

/* 1. Schimbarea culorii link-urilor generale */
a {
    color: #3254ba !important;
}

/* 2. Schimbarea culorii la hover (trecerea mouse-ului) */
a:hover {
    color: #1e1e1e !important; /* Revine la negru mat la hover pentru contrast */
    text-decoration: none;
}

/* 3. Tintirea elementelor care au culoarea albastra veche setata direct in cod (inline) */
[style*="color: #0c10e8"], 
[style*="color:#0c10e8"] {
    color: #3254ba !important;
}

/* 4. Schimbarea fundalului daca albastrul vechi este folosit la butoane sau iconite */
[style*="background-color: #0c10e8"],
[style*="background-color:#0c10e8"] {
    background-color: #3254ba !important;
}

/* 5. Asigurarea consistentei in widget-uri si continutul paginilor */
.widget a, .entry-content a, .site-info a {
    color: #3254ba;
}
/*--------------*/


/* Afisare produse pe doua coloane pe mobil */
@media (max-width: 767px) {
    .woocommerce ul.products[class*="columns-"] li.product, 
    .woocommerce-page ul.products[class*="columns-"] li.product {
        width: 48% !important; /* Aproape de 50% pentru a lasa spatiu intre ele */
        float: left !important;
        margin-left: 1% !important;
        margin-right: 1% !important;
        clear: none !important;
        display: list-item !important;
    }
    
    /* Ne asiguram ca randurile se rup corect dupa fiecare 2 produse */
    .woocommerce ul.products[class*="columns-"] li.product:nth-child(2n+1) {
        clear: both !important;
    }
}

/*afisare poze cu categorii in partea de sus*/
    /* Containerul principal flexibil */
    .grid-categorii {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
        gap: 15px; /* Spațiul între poze */
        width: 100%;
        max-width: 1200px;
        margin: 0 auto;
        padding: 10px;
    }

    /* Elementul de categorie */
    .categorie-item {
        position: relative;
        flex: 1 1 calc(33.333% - 20px); /* 3 pe rând implicit */
        min-width: 250px;
        max-width: 400px;
        border-radius: 8px;
        overflow: hidden;
        box-shadow: 0 4px 6px rgba(0,0,0,0.1);
    }

    /* Imaginea */
    .categorie-item img {
        width: 100%;
        height: auto;
        display: block;
        filter: brightness(65%); /* Întunecăm poza ca să se vadă textul galben */
        transition: transform 0.3s ease;
    }

    /* Efect la trecerea cu mouse-ul */
    .categorie-item:hover img {
        transform: scale(1.05%);
        filter: brightness(50%);
    }

    /* Textul de pe poză */
    .categorie-text {
        position: absolute;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        width: 85%; /* Textul nu va atinge marginile pozei */
        color: yellow;
        font-weight: bold;
        font-size: 18px;
        text-align: center;
        text-shadow: 2px 2px 5px #000;
        text-transform: uppercase;
        pointer-events: none;
    }

    /* RESPONSIVE: Tabletă (2 pe rând) */
    @media (max-width: 992px) {
        .categorie-item {
            flex: 1 1 calc(50% - 20px);
        }
    }

    /* RESPONSIVE: Mobil (Una sub alta) */
    @media (max-width: 600px) {
        .categorie-item {
            flex: 1 1 100%;
            max-width: 100%;
        }
        .categorie-text {
            font-size: 16px;
        }
    }