/**
* 2007-2024 PrestaShop
*
* NOTICE OF LICENSE
*
* This source file is subject to the Academic Free License (AFL 3.0)
* that is bundled with this package in the file LICENSE.txt.
* It is also available through the world-wide-web at this URL:
* http://opensource.org/licenses/afl-3.0.php
* If you did not receive a copy of the license and are unable to
* obtain it through the world-wide-web, please send an email
* to license@prestashop.com so we can send you a copy immediately.
*
* DISCLAIMER
*
* Do not edit or add to this file if you wish to upgrade PrestaShop to newer
* versions in the future. If you wish to customize PrestaShop for your
* needs please refer to http://www.prestashop.com for more information.
*
*  @author    PrestaShop SA <contact@prestashop.com>
*  @copyright 2007-2024 PrestaShop SA
*  @license   http://opensource.org/licenses/afl-3.0.php  Academic Free License (AFL 3.0)
*  International Registered Trademark & Property of PrestaShop SA
*
* Don't forget to prefix your containers with your own identifier
* to avoid any conflicts with others containers.
*/
#categorieshome .categorieshome-title{ 
    padding: 2rem 0;
    margin: 0; 
}
 
/* Grille fluide : s'adapte à 4, 5 ou 6 catégories sans tuile vide.
   Les cartes remplissent l'espace disponible de façon homogène. */
#categorieshome .grid_items {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 20px;
    margin-bottom: 3rem;
}

/* Style "mise en avant" de la 1re catégorie, uniquement quand la grille
   s'y prête (>= 4 cartes et >= 3 colonnes) : la 1re carte occupe 2x2. */
@media (min-width: 981px) {
    #categorieshome .grid_items {
        grid-template-columns: repeat(4, 1fr);
        grid-auto-rows: 1fr;
    }
    /* 5 catégories : bento d'origine (1 grande + 4 petites) */
    #categorieshome .grid_items[data-count="5"] .cat_item:nth-child(1) { grid-area: 1 / 1 / 3 / 3; }
    /* 4 catégories : 1 grande + 3 petites, sans trou */
    #categorieshome .grid_items[data-count="4"] { grid-template-columns: repeat(3, 1fr); }
    #categorieshome .grid_items[data-count="4"] .cat_item:nth-child(1) { grid-area: 1 / 1 / 3 / 3; }
    /* 6+ : grille régulière 4 colonnes, pas de mise en avant (évite les trous) */
}

#categorieshome img{
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 6px;
    display: block;
}
#categorieshome .cat_item{
    position: relative;
    display: block;
    overflow: hidden;
    border-radius: 9px;
    box-shadow: 0 5px 10px rgba(0, 0, 0, 0.10);
    text-decoration: none;
    transition: transform 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}
#categorieshome .cat_item:hover{
    transform: scale(1.02);
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.18);
}
/* RGAA 10.7 : focus clavier visible et net */
#categorieshome .cat_item:focus-visible{
    outline: 3px solid #ffbf47;
    outline-offset: 3px;
}

/* Bloc titre/description : style d'origine conservé (badge centré en haut). */
#categorieshome .cat_item .cat_info{
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    padding: 25px 10px;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}
/* Badge nom de catégorie : fond --primary ajusté au texte (style d'origine). */
#categorieshome .cat_item .cat_name{
    color: #fff;
    background-color: var(--primary);
    font-family: var(--font_title);
    font-weight: 700;
    padding: 9px;
    border-radius: 3px;
    max-width: fit-content;
}
/* Description : zone réservée, apparaît au survol (comportement d'origine). */
#categorieshome .cat_item .description{
    position: relative;
    margin-top: 0;
    opacity: 0;
    transform: translateY(-10px);
    transition: opacity .3s, transform .3s;
    color: #fff;
    background-color: var(--primary);
    padding: 0 15px;
    border-radius: 3px;
    max-width: 100%;
}
#categorieshome .cat_item:hover .description,
#categorieshome .cat_item:focus-visible .description{
    opacity: 1;
    transform: translateY(8px);
    padding: 9px 15px;
}

@media (max-width: 980px){
    #categorieshome .grid_items,
    #categorieshome .grid_items[data-count="4"]{
        grid-template-columns: repeat(2, 1fr);
    }
    #categorieshome .grid_items .cat_item:nth-child(1){ grid-area: auto; }
    #categorieshome .cat_item .cat_name{ font-size: 16px; }
    /* description masquée en mobile, comme à l'origine */
    #categorieshome .cat_item .description{ display: none; }
}
@media (max-width: 560px){
    #categorieshome .grid_items,
    #categorieshome .grid_items[data-count="4"]{
        grid-template-columns: 1fr;
    }
}