/* =====================================================
   CUSTOMMENU - Menu Personnalisé
   PrestaShop 9 - Auteur : Thomas
===================================================== */

/* ---- Variables ---- */
:root {
    --cm-bg: #FEF5EF;
    --cm-color: #333;
    --cm-color-hover: #d37e67;
    --cm-submenu-bg: #FEF5EF;
    --cm-submenu-shadow: 0 4px 16px rgba(0,0,0,0.10);
    --cm-font-size: 13px;
    --cm-font-weight: 200;
    --cm-transition: 0.25s ease;
    --cm-gap: 15px;
}

/* ---- Reset ---- */
.custommenu-nav *,
.custommenu-nav *::before,
.custommenu-nav *::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

/* ---- Nav wrapper ---- */
.custommenu-nav {
    position: relative;
    width: 100%;
}

/* ---- Liste principale ---- */
.custommenu-list {
    display: flex;
    align-items: center;
    list-style: none;
    gap: 0;
    flex-wrap: wrap;
}

/* ---- Item ---- */
.custommenu-item {
    position: relative;
}

/* ---- Lien principal ---- */
.custommenu-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 11px var(--cm-gap);
    font-size: var(--cm-font-size);
    font-weight: var(--cm-font-weight);
    text-transform: uppercase;
    color: var(--cm-color);
    text-decoration: none;
    transition: transform var(--cm-transition), color var(--cm-transition);
    white-space: nowrap;
}

.custommenu-link:hover {
    color: var(--cm-color-hover);
    text-decoration: none;
    transform: translateY(-3px);
}


/* =====================================================
   STYLE PAR ITEM (premier niveau)
   Les index commencent à 0
===================================================== */

li.custommenu-item.has-submenu {
    text-align: center;
}

/* Accueil */
.custommenu-item-0 > .custommenu-link > span{ }

/* Histoire */
.custommenu-item-1 > .custommenu-link > span{ }

/* Traitement */
.custommenu-item-2 > .custommenu-link > span{
	color : #ff888b !important;
	font-weight : bold;
}

/* Rémission */
.custommenu-item-3 > .custommenu-link > span{
	color : #a6b3a3 !important;
	font-weight : bold;
}

/* Aidantes */
.custommenu-item-4 > .custommenu-link > span{
	color : #d37e67 !important;
	font-weight : bold;
}

/* Week-end */
.custommenu-item-5 > .custommenu-link > span{ }

/* Partenaires */
.custommenu-item-6 > .custommenu-link > span{ }

/* boutique */
.custommenu-item-7 > .custommenu-link > span{ }

/* Contact */
.custommenu-item-8 > .custommenu-link > span{ }

/*
.custommenu-link:hover {
	color: var(--cm-color-hover) !important;
}*/
.custommenu-link > span:hover {
    text-decoration: none;
    transform: translateY(-3px);
	color: #FFA0A3 !important;
}

.custommenu-link:hover {
    color: #FFA0A3  !important;
    text-decoration: none !important;
}

.custommenu-sublink:hover {
    color: var(--cm-color-hover) !important;
    text-decoration: none !important;
}
.custommenu-link {
    display: inline-flex;
    align-items: center;
    gap: 5px;
    padding: 11px var(--cm-gap);
    font-size: var(--cm-font-size);
    font-weight: var(--cm-font-weight);
    text-transform: uppercase;
    color: var(--cm-color);
    text-decoration: none;
}

.custommenu-link__label {
    display: inline-block;
    transition: transform var(--cm-transition), color var(--cm-transition);
}

.custommenu-link:hover .custommenu-link__label {
    transform: translateY(-3px);
}

/* ---- Flèche triangle ---- */
.custommenu-arrow {
    font-size: 8px;
    line-height: 1;
    color: var(--cm-color);
    transition: transform var(--cm-transition), color var(--cm-transition);
    display: inline-block;
}
/* 
.custommenu-link:hover .custommenu-arrow {
	color: var(--cm-color-hover) !important;
} */

/* Flèche vers le haut quand sous-menu ouvert */
.custommenu-item.is-open > .custommenu-link .custommenu-arrow {
    transform: rotate(180deg);
}

/* ---- Sous-menu ---- */
.custommenu-submenu {
    display: none;
    position: absolute;
    top: 100%;
    left: 50%;
    transform: translateX(-50%);
    min-width: 125px;
    list-style: none;
    background: var(--cm-submenu-bg);
    box-shadow: var(--cm-submenu-shadow);
    z-index: 1000;
    padding: 8px 0;

    /* Zone tampon invisible en haut pour éviter le gap */
    padding-top: 12px;
    margin-top: -1px;
}

/* Pseudo-element pour combler le gap visuellement */
.custommenu-item.has-submenu::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 0;
    right: 0;
    height: 10px;
    background: transparent;
    z-index: 999;
}

.custommenu-submenu.is-visible {
    display: block;
    animation: cm-fadeIn 0.18s ease;
}

@keyframes cm-fadeIn {
    from { opacity: 0; transform: translateX(-50%) translateY(-4px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
}



/* Traitement */

.custommenu-item-2 > .custommenu-link > span{
	color : #ff888b !important;
}
.custommenu-item-2 > .custommenu-link:hover .custommenu-arrow {
	color : #ff888b !important;
}
.custommenu-item-2 > ul{
	background-color : #F9E0E1 !important;
	font-weight : bold;
}
.custommenu-item-2 > ul > li > a{
	font-weight : bold;
}
.custommenu-item-2 > ul > li > a:hover{
	color : #000000 !important;
}
.custommenu-item-2 > ul > li:hover{
	background-color : rgba(0,0,0,0.02) !important;
}

/* Rémission */
.custommenu-item-3 > .custommenu-link > span{
	color : #a6b3a3 !important;
}
.custommenu-item-3 > .custommenu-link:hover .custommenu-arrow {
	color : #a6b3a3 !important;
}
.custommenu-item-3 > ul{
	background-color : #a6b3a3 !important;
	font-weight : bold;
}
.custommenu-item-3 > ul > li > a{
	color : #ffffff !important;
	font-weight : bold;
}
.custommenu-item-3 > ul > li > a:hover{
	color : #ffffff !important;
}
.custommenu-item-3 > ul > li:hover{
	background-color : rgba(0,0,0,0.1) !important;
}

/* Aidantes */
.custommenu-item-4 > .custommenu-link > span{
	color : #d37e67 !important;
}
.custommenu-item-4 > .custommenu-link:hover .custommenu-arrow {
	color : #d37e67 !important;
}
.custommenu-item-4 > ul{
	background-color : #d37e67 !important;
	font-weight : bold;
}
.custommenu-item-4 > ul > li > a{
	color : #ffffff !important;
	font-weight : bold;
}
.custommenu-item-4 > ul > li > a:hover{
	color : #ffffff !important;
}
.custommenu-item-4 > ul > li:hover{
	background-color : rgba(0,0,0,0.1) !important;
}


/* ---- Liens sous-menu ---- */
.custommenu-sublink {
    display: block;
    padding: 9px 20px;
    font-size: 12px;
    font-weight: 200;
    text-transform: uppercase;
    color: var(--cm-color);
    text-decoration: none;
    transition: transform var(--cm-transition), color var(--cm-transition), background var(--cm-transition);
    white-space: nowrap;
}

.custommenu-sublink:hover {
    color: var(--cm-color-hover);
    text-decoration: none;
    transform: translateY(-2px);
    background: rgba(211, 126, 103, 0.05);
}

/* ---- Hamburger (caché desktop) ---- */
.custommenu-hamburger {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 5px;
    background: none;
    border: none;
    cursor: pointer;
    padding: 8px;
    width: 40px;
    height: 40px;
}

.custommenu-hamburger__bar {
    display: block;
    width: 24px;
    height: 2px;
    background: var(--cm-color);
    transition: transform 0.3s ease, opacity 0.3s ease;
    transform-origin: center;
}

/* Animation hamburger → croix */
.custommenu-hamburger.is-open .custommenu-hamburger__bar:nth-child(1) {
    transform: translateY(7px) rotate(45deg);
}
.custommenu-hamburger.is-open .custommenu-hamburger__bar:nth-child(2) {
    opacity: 0;
    transform: scaleX(0);
}
.custommenu-hamburger.is-open .custommenu-hamburger__bar:nth-child(3) {
    transform: translateY(-7px) rotate(-45deg);
}

/* ---- Focus outline supprimé ---- */
.custommenu-nav *:focus,
.custommenu-nav *:focus-visible {
    outline: none !important;
}

/* =====================================================
   RESPONSIVE - Mobile
===================================================== */
@media (max-width: 991px) {

    .custommenu-hamburger {
        display: flex;
    }

    .custommenu-list {
        display: none;
        flex-direction: column;
        align-items: stretch;
        position: absolute;
        top: 100%;
        left: 0;
        right: 0;
        background: var(--cm-bg);
        box-shadow: 0 6px 20px rgba(0,0,0,0.10);
        z-index: 1000;
        padding: 10px 0;
    }

    .custommenu-list.is-open {
        display: flex;
    }

    .custommenu-item {
        width: 100%;
    }

    .custommenu-link {
        width: 100%;
        justify-content: space-between;
        padding: 12px 20px;
        border-bottom: 1px solid rgba(0,0,0,0.05);
    }

    .custommenu-link:hover {
        transform: none;
    }

    /* Sous-menu mobile : accordéon */
    .custommenu-submenu {
        position: static;
        transform: none;
        box-shadow: none;
        background: rgba(0,0,0,0.03);
        padding: 0;
        min-width: 100%;
        margin-top: 0;
    }

    .custommenu-submenu.is-visible {
        animation: none;
    }

    .custommenu-sublink {
        padding: 10px 30px;
        border-bottom: 1px solid rgba(0,0,0,0.04);
    }

    .custommenu-sublink:hover {
        transform: none;
    }

    .custommenu-item.has-submenu::after {
        display: none;
    }
}

