:root {
    --sans-serif: 'Montserrat', sans-serif;
}

.allergens {
    margin-bottom: 5vw;

    @media (min-width: 1680px) {
        margin-left: -8vw;
        margin-right: -8vw;
    }
}

.allergens__legend {
    background-color: #EBE0CE;
    border-radius: 15px 0 0 15px;
    bottom: 40px;
    cursor: pointer;
    display: flex;
    gap: 50px;
    padding: 20px 40px 15px 20px;
    position: fixed;
    right: 0;
    translate: calc(100% - 50px);
    transition: translate 0.2s ease;
    z-index: 25;

    @media (max-width: 767px) {
        gap: 15px;
        padding-right: 20px;
        translate: calc(100% - 45px);
    }

    &.allergens__legend--active {
        translate: 0;

        .allergens__legend-arrow {
            transform: scaleX(-1);
        }
    }
}

.allergens__legend-arrow {
    color: black;
    display: grid;
    padding-bottom: 5px;
    place-content: center;
}

.allergens__legend-item {
    align-items: center;
    color: black;
    display: flex;
    flex-direction: column;

    @media (max-width: 767px) {
        font-size: 12px;
    }
}

.allergens__legend-icon {
    aspect-ratio: 1;
    filter: invert(1);
    height: 25px;
    object-fit: contain;

    @media (max-width: 767px) {
        height: 20px;
    }
}

.allergens__filter-wrap {
    display: flex;
    justify-content: center;
}

.allergens__filter {
    -ms-overflow-style: -ms-autohiding-scrollbar;
    -webkit-overflow-scrolling: touch; 
    align-items: center;
    display: flex;
    flex-wrap: nowrap; 
    gap: 40px;
    /* justify-content: center; */
    margin-bottom: 5vw;
    overflow-x: auto; 
    padding-bottom: 5px;
    position: relative;

    &::-webkit-scrollbar {
        display: none;
    }
}

.allergens__filter-button {
    color: white;
    cursor: pointer;
    flex: 0 0 auto;
    font: 700 18px var(--sans-serif);

    &.allergens__filter-button--active {
        color: #DFBD82;
    }
}

.allergens__filter-highlight {
    background-color: #DFBD82;
    bottom: 0;
    display: block;
    height: 1px;
    left: 0;
    position: absolute;
    translate: -50% 0;
    transition: left 0.2s ease;
    width: 75px;
}

.allergens__grid {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
}

.allergens__card {
    background-color: white;
    border-radius: 15px;
    display: none;
    flex-basis: 300px;
    overflow: hidden;
    visibility: hidden;

    &.allergens__card--active {
        display: block;
        visibility: visible;
    }
}

.allergens__card-top {
    overflow: hidden;
    position: relative;
}

.allergens__card-image {
    aspect-ratio: 3/2;
    display: block;
    object-fit: cover;
}

.allergens__card-overlays {
    height: 100%;
    left: 0;
    position: absolute;
    top: 0;
    width: 100%;
}

.allergens__card-overlay {
    backdrop-filter: blur(4px);
    background-color: #000a;
    color: white;
    display: grid;
    height: 100%;
    left: 0;
    opacity: 0;
    padding: 10px;
    place-content: center;
    pointer-events: none;
    position: absolute;
    text-align: center;
    top: 0;
    transition: opacity 0.2s ease;
    width: 100%;

    &.allergens__card-overlay--active {
        opacity: 1;
        pointer-events: all;
    }

    h4 {
        color: white;
        font-weight: 700;
        margin: 0 auto 5px;
    }
}

.allergens__card-bottom {
    display: grid;
    gap: 10px;
    padding: 10px;
    text-align: center;
}

.allergens__card-title {
    font: 900 18px var(--sans-serif);
    margin: 0 auto 10px;
}

.allergens__card-types {
    align-items: center;
    display: flex;
    gap: 10px;
    justify-content: center;
}

.allergens__card-button {
    aspect-ratio: 1;
    background-color: #231F20;
    background-position: center;
    background-repeat: no-repeat;
    background-size: 20px;
    border-radius: 50%;
    cursor: pointer;
    height: 34px;
    transition: background-color 0.2s ease;

    &[data-allergen="milk"] { background-image: url('../images/milk.svg'); background-size: 16px; }
    &[data-allergen="egg"] { background-image: url('../images/egg.svg'); }
    &[data-allergen="gluten"] { background-image: url('../images/gluten.svg'); background-size: 22px; }
    &[data-allergen="fish"] { background-image: url('../images/fish.svg'); }
    &[data-allergen="peanut"] { background-image: url('../images/peanuts.svg'); }
    &[data-allergen="soy"] { background-image: url('../images/soy.svg'); }

    &:hover,
    &.allergens__card-button--active {
        background-color: #922D1F;
    }
}

.allergens__card-note {
    font-size: 12px;
    margin: 0 !important;
}