/* 1. Correct the Page Offsets */
/* Mobile: TopBar is hidden (d-none), only NavBar shows */
main {
    padding-top: 85px; 
}

/* Tablet/Desktop: TopBar becomes visible (d-md-block) */
@media (min-width: 768px) {
    main {
        padding-top: 145px; 
    }

    .filter-menu-container::after {
        content: '';
        position: absolute;
        top: 0;
        right: 0;
        height: 100%;
        width: 40px;
        background: linear-gradient(to right, rgba(255,255,255,0), rgba(255,255,255,0.9));
        pointer-events: none;
        border-radius: 0 50px 50px 0;
    }

}

/* 2. Fix the Jumping: Make the Mobile Menu Absolute */
/* This prevents the .fixed-top container from changing height when the menu opens */
@media (max-width: 991.98px) {
    .navbar-collapse {
        position: absolute;
        top: 100%; /* Positions it exactly at the bottom of the white nav bar */
        left: 0;
        right: 0;
        background-color: white;
        padding: 1rem;
        border-top: 1px solid #eee;
        box-shadow: 0 10px 15px rgba(0, 0, 0, 0.1);
        z-index: 1000;
    }
}

/* 3. Smooth out the animation flicker */
.collapsing {
    -webkit-transition: height 0.3s ease;
    transition: height 0.3s ease;
    backface-visibility: hidden;
    transform: translateZ(0); /* Force GPU rendering */
}

/* 4. Prevent the toggler from causing a blue highlight/jump on click */
.navbar-toggler:focus {
    box-shadow: none;
    outline: none;
}

/* Container for the filter menu */
.filter-menu-container {
    position: relative;
    width: 100%;
}

/* The wrapper that handles the layout */
.filter-scroll-wrapper {
    display: flex;
    align-items: center;
    gap: 8px;
    background: #fff;
    padding: 8px;
    border-radius: 50px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    border: 1px solid #f0f0f0;
}

/* The scrolling area */
.filter-scroll-content {
    display: flex;
    gap: 8px;
    overflow-x: auto;
    scroll-behavior: smooth;
    -webkit-overflow-scrolling: touch;
    white-space: nowrap;
    padding-right: 15px;
}

/* Hide scrollbar for Chrome, Safari and Opera */
.filter-scroll-content::-webkit-scrollbar {
    display: none;
}

/* Hide scrollbar for IE, Edge and Firefox */
.filter-scroll-content {
    -ms-overflow-style: none;  /* IE and Edge */
    scrollbar-width: none;  /* Firefox */
}

/* Base style for all buttons in the menu */
.filter-btn {
    display: inline-flex;
    align-items: center;
    padding: 8px 20px;
    font-size: 0.9rem;
    font-weight: 500;
    color: #444;
    background: #f8f9fa;
    border: 1px solid #eee;
    border-radius: 50px;
    text-decoration: none;
    transition: all 0.2s ease;
}

/* Back button special styling */
.filter-btn-back {
    background: #fff;
    color: #ff4d6d; /* Or your primary color */
    padding: 8px 15px;
    border-color: #eee;
    flex-shrink: 0; /* Prevents button from squishing */
}

/* Active state (The "Danger" color but more modern) */
.filter-btn.active {
    background: #ff4d6d;
    color: white;
    border-color: #ff4d6d;
}

.filter-btn:hover {
    background: #f0f0f0;
    color: #000;
}

.filter-btn.active:hover {
    background: #ff3355;
    color: #fff;
}
