#top_menu {
    position: sticky;
    top: 0;
    background-color: #444;
    z-index: 1000;
    padding: 0.25rem 1rem;
}

.menu-container {
    display: flex;
    align-items: center;
    width: 100%;
    gap: 1rem;
}

.menu-left {
    display: flex;
    list-style: none;
    padding: 0 0 0 1rem;
    gap: 2rem;
}

.menu-right {
    display: flex;
    list-style: none;
    padding: 0.5rem 1rem 0 0;
    gap: 0.25rem;
}

.menu-search {
    flex: 1 1 auto;
    display: flex;
    justify-content: center;
    order: 2;
}

.menu-right {
    order: 3;
}

.menu-left li a,
.menu-right li a {
    text-decoration: none;
    color: #fff;
    font-size: 20px;
    text-shadow: 0 2px 2px rgba(0, 0, 0, 0.7);
    white-space: nowrap;
}

.menu-left li a:hover {
    text-decoration: underline;
    text-decoration-thickness: 1px;
}

.menu-left {
    flex: 0 0 auto;
}

.menu-search input[type="text"] {
    padding: 0.3rem;
    border: 1px solid #ccc;
    border-radius: 4px;
}

button {
    padding: 4px 14px;
    background: radial-gradient(circle at 50% 500%, #666d72 83%, transparent 85%), #3c454c;
    border: 1px solid #b4b7ba;
    border-radius: 4px;
    color: #fff;
    font-weight: bold;
    font-size: 11px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2), 0 2px 5px rgba(0, 0, 0, 0.5);
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    width: 115px;
    height: 24px;
}

button:hover {
    background: radial-gradient(circle at 50% 500%, #7a8186 80%, transparent 95%), #4b545b;
}

.search-label-full, .search-label-short {
    color: #fff;
}

.menu-right img {
    height: 26px;
}

/* Autocomplete suggestions dropdown styles */
.search-container {
    position: relative;
    display: inline-block;
}

.suggestions-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    width: 280px; /* slightly wider than the input for readability */
    background-color: #333; /* match header dark styling */
    border: 1px solid #555;
    border-radius: 4px;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.5);
    max-height: 400px;
    overflow-y: auto;
    z-index: 1100;
    margin-top: 5px;
}

.suggestion-item {
    display: flex;
    align-items: center;
    padding: 0.5rem 0.75rem;
    cursor: pointer;
    border-bottom: 1px solid #444;
    text-decoration: none;
    color: #eee;
    transition: background-color 0.15s ease-in-out;
}

.suggestion-item:last-child {
    border-bottom: none;
}

.suggestion-item:hover,
.suggestion-item.active {
    background-color: #555;
    color: #fff;
}

.suggestion-img {
    width: 45px;
    height: auto;
    margin-right: 0.75rem;
    border-radius: 3px;
    object-fit: contain;
    background-color: rgba(255, 255, 255, 0.05);
}

.suggestion-info {
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.suggestion-name {
    font-weight: bold;
    font-size: 13px;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    color: #CCCCCC;
}

.suggestion-story {
    font-size: 11px;
    color: #aaa;
    text-overflow: ellipsis;
    white-space: nowrap;
    overflow: hidden;
    margin-top: 2px;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.mobile-menu-toggle,
.mobile-navigation label {
    display: none;
}

.mobile-navigation {
    display: contents;
}

.mobile-catalog-menu {
    display: none;
}

.search-clear {
    display: none;
}

.search-label-short {
    display: none;
}

@media (min-width: 980px) and (max-width: 1150px) {
    .menu-left {
        gap: 1rem;
        padding-left: 0.5rem;
    }

    .menu-left li a {
        font-size: 16px;
    }

    .menu-container {
        gap: 0.5rem;
    }
}

@media (max-width: 979px) {
    /* ── Burger : afficher le label, cacher les liens par défaut ── */
    .mobile-navigation label {
        display: flex;
        flex-direction: column;
        align-items: center;
        justify-content: center;
        gap: 5px;
        width: 36px;
        height: 36px;
        cursor: pointer;
        flex-shrink: 0;
        border-radius: 4px;
        padding: 7px 7px;
        box-sizing: border-box;
    }

    /* Les trois barres du burger */
    .burger-bar {
        display: block;
        width: 22px;
        height: 2px;
        background: #fff;
        border-radius: 2px;
        transition: transform 0.25s ease, opacity 0.2s ease;
        flex-shrink: 0;
    }

    /* Animation croix quand ouvert */
    .mobile-menu-toggle:checked + label .burger-bar:nth-child(1) {
        transform: translateY(7px) rotate(45deg);
    }
    .mobile-menu-toggle:checked + label .burger-bar:nth-child(2) {
        opacity: 0;
    }
    .mobile-menu-toggle:checked + label .burger-bar:nth-child(3) {
        transform: translateY(-7px) rotate(-45deg);
    }

    /* Menu links : cachés, dropdown en colonne */
    .menu-left {
        display: none;
        background-color: #444;
        flex-direction: column;
        gap: 0;
        padding: 0;
        z-index: 999;
        border-top: 1px solid #555;
    }

    .mobile-menu-toggle:checked ~ .menu-left {
        display: list-item;
        columns: 2;
    }

    .menu-right {
        display: none;
    }

    .mobile-menu-toggle:checked ~ .menu-right {
        display: flex;
        width: 100%;
        margin: 0;
        padding: 7px 0 2px;
        justify-content: center;
        background-color: #444;
        border-top: 1px solid #555;
        gap: 15px;
    }

    .menu-left li a {
        display: block;
        padding: 10px 20px;
        border-bottom: 1px solid #555;
        font-size: 13px;
    }

    /* La barre de navigation se positionne en relatif pour le dropdown */
    #top_menu {
        position: sticky;
        top: 0;
        z-index: 1000;
    }

    .menu-container {
        position: relative;
        min-height: 36px;
    }

    .mobile-navigation {
        display: flex;
        position: absolute;
        top: 0;
        left: 0;
        align-items: center;
        align-content: flex-start;
        flex-wrap: wrap;
        flex-shrink: 0;
        width: 36px;
        z-index: 1001;
    }

    .mobile-navigation:has(.mobile-menu-toggle:checked) {
        width: 75%;
    }

    .mobile-navigation .menu-left,
    .mobile-navigation .menu-right,
    .mobile-catalog-menu {
        flex-basis: 100%;
    }

    .mobile-catalog-menu {
        display: none;
    }

    .mobile-menu-toggle:checked ~ .mobile-catalog-menu {
        display: block;
        width: 200%;
        background-color: #444;
    }

    .mobile-catalog-section + .mobile-catalog-section {
        border-top: 1px solid #555;
    }

    .mobile-catalog-toggle {
        position: absolute;
        opacity: 0;
    }

    .mobile-catalog-section > label {
        display: flex;
        justify-content: space-between;
        color: #fff;
        cursor: pointer;
        font-size: 13px;
        text-shadow: 0 2px 2px rgba(0, 0, 0, 0.7);
        width: 100%;
    }

    .mobile-catalog-section > label::after {
        content: '▸';
        font-family: Arial, sans-serif;
        font-size: 14px;
        color: #ccc;
        transition: transform 0.2s ease;
    }

    .mobile-catalog-toggle:checked + label::after {
        transform: rotate(90deg);
    }

    .mobile-catalog-list {
        display: none;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.35rem 1rem;
        margin: 0;
        padding: 0 20px 12px 38px;
        list-style: disc;
    }

    .mobile-catalog-toggle:checked ~ .mobile-catalog-list {
        display: grid;
    }

    .mobile-catalog-list li {
        padding-left: 0;
        color: #ccc;
        font-size: 12px;
    }

    .mobile-catalog-list a {
        color: #fff;
        text-decoration: none;
        text-shadow: 0 2px 2px rgba(0, 0, 0, 0.7);
    }

    .mobile-catalog-list a:hover {
        text-decoration: underline;
    }
    /* Champ de recherche toujours visible, adapté */
    .search-label-full {
        display: none;
    }

    .search-label-short {
        display: inline;
    }

    .menu-search input[type="text"] {
        width: clamp(135px, 45vw, 180px);
        height: 24px;
        padding-right: 28px;
        box-sizing: border-box;
    }

    .menu-search button {
        width: initial;
    }

    /* Bouton clear visible sur mobile */
    .search-clear {
        display: flex;
        position: absolute;
        top: 50%;
        right: 4px;
        transform: translateY(-50%);
        align-items: center;
        justify-content: center;
        width: 22px;
        height: 22px;
        padding: 0;
        font-size: 16px;
        background: transparent;
        border: none;
        color: #aaa;
        cursor: pointer;
        box-shadow: none;
    }

    /* Icônes réseaux sociaux */
    .menu-right img {
        height: 22px;
    }

}
