/* === Brand bar + barre de recherche flottante === */
        /* --- 4a. BRAND BAR (non-sticky, scrolls with page) --- */
        .brand-bar {
            background: var(--bg-card);
            border-bottom: 1px solid var(--border-color);
            transition: background-color 0.3s ease, border-color 0.3s ease;
        }

        .brand-bar-inner {
            display: flex;
            align-items: center;
            justify-content: space-between;
            padding: 1rem 1.5rem;
            gap: 1rem;
            max-width: 1200px;
            margin: 0 auto;
            width: 100%;
        }

        .brand {
            display: flex;
            align-items: center;
            gap: 0.875rem;
            text-decoration: none;
        }

        .brand-logo-full {
            width: 168px;
            flex-shrink: 0;
            display: block;
            line-height: 0;
        }

        .brand-logo-full img {
            width: 100%;
            height: auto;
            display: block;
        }

        .brand-logo-full .brand-logo-dark {
            display: none;
        }

        [data-theme="dark"] .brand-logo-full .brand-logo-light {
            display: none;
        }

        [data-theme="dark"] .brand-logo-full .brand-logo-dark {
            display: block;
        }

        .theme-switch {
            width: 56px;
            height: 30px;
            border-radius: 20px;
            background: rgba(0, 0, 0, 0.2);
            border: 1px solid rgba(0, 0, 0, 0.1);
            position: relative;
            cursor: pointer;
            transition: background 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
            display: flex;
            align-items: center;
            padding: 2px;
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.15);
            flex-shrink: 0;
        }

        [data-theme="dark"] .theme-switch {
            background: var(--accent);
            border-color: var(--accent-hover);
            box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.3);
        }

        .switch-handle {
            width: 24px;
            height: 24px;
            border-radius: 50%;
            background: #fff;
            box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 0.75rem;
            transform: translateX(0);
            transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), background-color 0.3s ease;
        }

        [data-theme="dark"] .switch-handle {
            transform: translateX(26px);
            background: #1e293b;
        }

        /* --- 4b. SEARCH BAR (floating on scroll) --- */
        .search-bar-wrapper {
            /* Sits flush below brand bar initially */
            position: sticky;
            top: 0;
            z-index: 60;
            padding: 0.6rem 1.5rem;
            background: transparent;
            border-bottom: none;
            transition:
                padding 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                transform 0.3s ease;
        }

        .search-bar-wrapper.scroll-down {
            transform: translateY(-100%);
        }

        .search-bar-wrapper.is-floating {
            padding: 0.75rem 2.5rem;
        }

        .search-bar-inner {
            max-width: 700px;
            margin: 0 auto;
            position: relative;
            transition: all 0.35s cubic-bezier(0.4, 0, 0.2, 1);
        }

        .search-icon {
            position: absolute;
            left: 1rem;
            top: 50%;
            transform: translateY(-50%);
            color: var(--text-tertiary);
            pointer-events: none;
            display: flex;
            align-items: center;
            justify-content: center;
            transition: color 0.2s ease;
            z-index: 10;
        }

        .search-icon svg {
            width: 16px;
            height: 16px;
        }

        .search-input {
            width: 100%;
            padding: 0.75rem 6rem 0.75rem 2.75rem;
            border: 1px solid var(--border-color);
            border-radius: 0.5rem;
            background: var(--bg-input);
            color: var(--text-primary);
            font-size: 0.875rem;
            outline: none;
            transition:
                border-color 0.2s ease,
                border-radius 0.35s cubic-bezier(0.4, 0, 0.2, 1),
                box-shadow 0.35s ease,
                background 0.3s ease;
        }

        .search-input::placeholder {
            color: var(--text-tertiary);
        }

        .search-input:focus {
            border-color: var(--accent);
        }

        .search-actions {
            position: absolute;
            right: 1rem;
            top: 50%;
            transform: translateY(-50%);
            display: none;
            align-items: center;
            gap: 0.5rem;
        }

        .search-actions.is-visible {
            display: flex;
        }

        .search-count {
            font-size: 0.75rem;
            color: var(--text-tertiary);
            font-weight: 700;
        }

        .clear-search {
            background: var(--bg-filter);
            border: none;
            color: var(--text-secondary);
            cursor: pointer;
            padding: 0;
            display: flex;
            align-items: center;
            justify-content: center;
            width: 24px;
            height: 24px;
            border-radius: 50%;
            transition: all 0.2s ease;
        }

        .clear-search:hover {
            background: var(--accent-light);
            color: var(--accent);
        }

        .clear-search svg {
            width: 14px;
            height: 14px;
        }

        .search-shortcut {
            position: absolute;
            right: 1rem;
            top: 50%;
            transform: translateY(-50%);
            font-size: 0.65rem;
            font-weight: 800;
            color: var(--text-tertiary);
            background: var(--bg-filter);
            padding: 0.25rem 0.45rem;
            border-radius: 0.4rem;
            border: 1px solid var(--border-color);
            pointer-events: none;
            transition: opacity 0.2s ease;
        }

        .search-shortcut.is-hidden {
            opacity: 0;
        }

        @media (max-width: 768px) {
            .search-shortcut {
                display: none;
            }

            .search-input {
                padding-right: 4rem;
            }
        }

        /* Floating state: rounded pill + elevated shadow */
        .search-bar-wrapper.is-floating .search-input {
            border-radius: 2rem;
            box-shadow:
                0 8px 32px rgba(0, 0, 0, 0.12),
                0 2px 8px rgba(0, 0, 0, 0.08),
                0 0 0 1px var(--border-color);
            background: #f8f9fd;
        }

        .search-bar-wrapper.is-floating .search-input:focus {
            box-shadow:
                0 8px 32px rgba(225, 29, 72, 0.15),
                0 2px 8px rgba(0, 0, 0, 0.08),
                0 0 0 2px rgba(225, 29, 72, 0.25);
            border-color: var(--accent);
        }

        [data-theme="dark"] .search-bar-wrapper.is-floating .search-input {
            background: #192236;
            box-shadow:
                0 8px 32px rgba(0, 0, 0, 0.4),
                0 2px 8px rgba(0, 0, 0, 0.25),
                0 0 0 1px var(--border-color);
        }

        [data-theme="dark"] .search-bar-wrapper.is-floating .search-input:focus {
            box-shadow:
                0 8px 32px rgba(225, 29, 72, 0.2),
                0 0 0 2px rgba(225, 29, 72, 0.3);
        }
