/* ═══════════════════════════════════
   ScrollMenu v8
   ═══════════════════════════════════ */

.scrollmenu-wrapper {
    --sm-bar-bg:    #ffffff;
    --sm-color:     #333333;
    --sm-active:    #e91e8c;
    --sm-fs:        13px;
    --sm-h:         50px;
    --sm-mega-bg:   #ffffff;
    --sm-mega-text: #333333;
    --sm-cols:      3;
    width: 100%;
}

/* ── Barre ── */
.scrollmenu-bar {
    display: flex;
    align-items: stretch;
    overflow-x: auto;
    overflow-y: visible;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    background: var(--sm-bar-bg);
    height: var(--sm-h);
    box-shadow: 0 1px 4px rgba(0,0,0,.08);
}
.scrollmenu-bar::-webkit-scrollbar { display: none; }

.sm-item {
    display: inline-flex;
    align-items: stretch;
    flex-shrink: 0;
}

/* ── Lien barre ── */
.sm-link {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    padding: 0 16px;
    height: 100%;
    color: var(--sm-color);
    text-decoration: none;
    font-size: var(--sm-fs);
    font-weight: 500;
    border-right: 1px solid rgba(0,0,0,.07);
    transition: color .2s, background .2s;
    white-space: nowrap;
    position: relative;
    cursor: pointer;
    user-select: none;
}
.sm-link:hover,
.sm-link.active,
.sm-item.sm-open .sm-link { color: var(--sm-active); background: rgba(0,0,0,.025); }
.sm-link.active::after {
    content: '';
    position: absolute;
    bottom: 0; left: 0; right: 0;
    height: 2px;
    background: var(--sm-active);
}

/* ── Icône dans la barre ── */
.sm-item-icon {
    display: none;
}

.sm-chevron {
    font-size: 10px;
    opacity: .5;
    transition: transform .2s;
}
.sm-item.sm-open .sm-chevron { transform: rotate(180deg); opacity: 1; }

/* ══════════════════════════════
   MEGA MENU (position:fixed via JS)
══════════════════════════════ */

.sm-megamenu {
    position: fixed;
    z-index: 999999;
    width: 1000px;
    max-width: calc(100vw - 16px);
    background: var(--sm-mega-bg);
    color: var(--sm-mega-text);
    border-top: 3px solid var(--sm-active);
    border-radius: 0 0 10px 10px;
    box-shadow: 0 8px 40px rgba(0,0,0,.16);
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity .2s ease, transform .2s ease, visibility 0s linear .2s;
    pointer-events: none;
}
.sm-megamenu.sm-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    transition: opacity .2s ease, transform .2s ease;
    pointer-events: auto;
}

.sm-mega-inner { padding: 20px 24px 24px; }

.sm-mega-header {
    margin-bottom: 16px;
    padding-bottom: 12px;
    border-bottom: 1px solid rgba(0,0,0,.07);
}
.sm-mega-title {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: var(--sm-mega-text);
    text-decoration: none;
    font-size: 15px;
    font-weight: 700;
}
.sm-mega-title:hover { color: var(--sm-active); }
.sm-see-all { font-size: 12px; font-weight: 500; color: var(--sm-active); }

.sm-mega-grid {
    display: grid;
    grid-template-columns: repeat(var(--sm-cols, 3), 1fr);
    gap: 20px 28px;
}

.sm-mega-group-title {
    display: block;
    font-size: 12px;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: .8px;
    color: var(--sm-mega-text);
    text-decoration: none;
    margin-bottom: 8px;
    padding-bottom: 6px;
    border-bottom: 1px solid rgba(0,0,0,.07);
    transition: color .2s;
}
.sm-mega-group-title:hover { color: var(--sm-active); }

.sm-mega-links { list-style: none; margin: 0; padding: 0; }
.sm-mega-links li { margin: 0; padding: 0; }
.sm-mega-links a {
    display: block;
    padding: 4px 0;
    font-size: 13px;
    color: rgba(0,0,0,.6);
    text-decoration: none;
    transition: color .15s, padding-left .15s;
    line-height: 1.5;
}
.sm-mega-links a:hover { color: var(--sm-active); padding-left: 6px; }

/* ══════════════════════════════
   MOBILE — mega masqué, icônes adaptées
   Le breakpoint est géré en JS (data-mega-bp)
   On masque par défaut sous 1000px via CSS
   et le JS ajuste dynamiquement
══════════════════════════════ */

@media (max-width: 999px) {
    .sm-megamenu   { display: none !important; }
    .sm-chevron    { display: none !important; }
    .sm-link       { padding: 0 10px; gap: 5px; }
    .sm-item-icon  { width: 24px; height: 24px; }
}

/* ══════════════════════════════
   FLÈCHES SCROLL GAUCHE / DROITE
══════════════════════════════ */

.scrollmenu-outer {
    position: relative;
    width: 100%;
}

.sm-arrow {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    z-index: 10;
    width: 28px;
    height: 28px;
    background: #fff;
    border: 1.5px solid var(--theme-color-default, var(--sm-active, #e91e8c));
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    font-size: 12px;
    color: var(--theme-color-default, var(--sm-active, #e91e8c));
    box-shadow: 0 2px 8px rgba(0,0,0,.12);
    transition: opacity .2s, transform .2s, box-shadow .2s;
    user-select: none;
    padding: 0;
    line-height: 1;
}
.sm-arrow:hover {
    box-shadow: 0 4px 14px rgba(0,0,0,.18);
    transform: translateY(-50%) scale(1.08);
}
.sm-arrow.sm-arrow-left  { left: 4px; }
.sm-arrow.sm-arrow-right { right: 4px; }

/* Masquer quand plus de scroll possible */
.sm-arrow.sm-hidden {
    opacity: 0;
    pointer-events: none;
}

/* Fondu sur les bords pour indiquer le scroll */
.scrollmenu-outer::before,
.scrollmenu-outer::after {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    width: 40px;
    z-index: 5;
    pointer-events: none;
    transition: opacity .3s;
}
.scrollmenu-outer::before {
    left: 0;
    background: linear-gradient(to right, var(--sm-bar-bg, #fff), transparent);
}
.scrollmenu-outer::after {
    right: 0;
    background: linear-gradient(to left, var(--sm-bar-bg, #fff), transparent);
}
.scrollmenu-outer.sm-at-start::before { opacity: 0; }
.scrollmenu-outer.sm-at-end::after   { opacity: 0; }
