.menu {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

.menu h2 {
    text-align: center;
    font-size: 2rem;
}

.menu-content {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    gap: 2rem;
}

#menu-categories {
    display: flex;
    gap: 1rem;
    justify-content: center;
    flex-wrap: wrap;
}

/* Custom dropdown for mobile */
.category-dropdown-wrapper {
    display: none;
    max-width: 720px;
    margin: 0;
    position: relative;
}

.category-dropdown-toggle {
    width: 100%;
    text-align: left;
    padding: 0.8rem 1rem;
    border-radius: 8px;
    border: 1px solid #6B7621;
    background: #383F0D;
    color: #F8FECD;
    font-size: 1rem;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.category-dropdown-toggle svg {
    transition: transform 400ms ease;
    color: #F8FECD;
    margin-left: 1rem;
}

.category-dropdown-wrapper.open .category-dropdown-toggle svg {
    transform: rotate(180deg);
}

.category-dropdown-list {
    list-style: none;
    margin: 0;
    padding: 0.5rem;
    background: #FBEDBC;
    border-radius: 8px;
    border: 1px solid #6B762199;
    box-shadow: 0 8px 18px 2px rgba(0, 0, 0, 0.25);
    max-height: 320px;
    overflow: auto;
    position: absolute;
    top: calc(100% + 0.5rem);
    left: 0;
    right: 0;
    z-index: 10;
    /* hidden by default */
    opacity: 0;
    visibility: hidden;
    transform: translateY(-6px);
    transition: opacity 400ms ease, transform 400ms ease, visibility 400ms;
    pointer-events: none;
}

.category-dropdown-wrapper.open .category-dropdown-list {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.category-dropdown-item {
    padding: 0.6rem 0.8rem;
    margin: 0.15rem 0;
    border-radius: 6px;
    cursor: pointer;
    color: #383F0D;
}

.category-dropdown-item:hover,
.category-dropdown-item:focus {
    background: rgba(107, 118, 33, 0.06);
    outline: none;
}

.category-dropdown-item[aria-selected='true'],
.category-dropdown-item.active {
    background: #6B7621;
    color: #F8FECD;
}

#menu-categories .category-btn {
    padding: 0.8rem 1.2rem;
    border: 1px solid #6B7621;
    box-shadow: 2px 2px 2px rgba(0, 0, 0, 0.5);
    background-color: #FBEDBC;
    color: #181B03;
    border-radius: 4px;
    cursor: pointer;
    font-size: 1rem;
    transition: background-color 0.2s ease-in-out, box-shadow 0.2s ease-in-out, border 0.2s ease-in-out, color 0.2s ease-in-out;
}

#menu-categories .category-btn:hover {
    background-color: #6B7621;
    box-shadow: 1px 1px 2px rgba(0, 0, 0, 0.4);
    border: 1px solid #383F0D;
    color: #FEF7E0;
}

#menu-categories .category-btn.active {
    background-color: #383F0D;
    color: #F8FECD;
    border: none;
}

#menu-items {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1.5rem;
    margin-bottom: 4rem;
}

#menu-items .menu-item {
    display: flex;
    flex-direction: column;
    gap: 1rem;
    border: 1px solid #6B762140;
    box-shadow: 0 0 4px 1px rgba(0, 0, 0, 0.1);
    border-radius: 8px;
    padding: 1.5rem 1rem;
    justify-content: center;
}

#menu-items .menu-item:hover {
    box-shadow: 0 0 6px 2px rgba(0, 0, 0, 0.12);
}

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

#menu-items .menu-item .item-name {
    font-weight: 600;
    font-size: 1.2rem;
    color: #383F0D;
}

#menu-items .menu-item .item-price {
    font-weight: 600;
    font-size: 1rem;
    color: #E5530F;
}

#menu-items .menu-item .dots {
    flex: 1;
    height: 1rem;
    min-width: 2rem;
    border-bottom: 0.24rem dotted #6B762180;
}

#menu-items .menu-item .item-desc {
    color: #6B7621;
    font-size: 1rem;
    line-height: 1.3;
}

@media (max-width: 1024px) {
    #menu-items {
        gap: 1.2rem;
    }

    #menu-items .menu-item .item-name {
        font-size: 1.1rem;
    }

    #menu-items .menu-item .dots {
        min-width: 1.5rem;
        border-bottom: 0.2rem dotted #6B762180;
    }
}

@media (max-width: 880px) {
    #menu-categories {
        gap: 0.8rem;
    }

    #menu-items {
        gap: 1rem;
    }

    #menu-items .menu-item {
        box-shadow: 0 0 4px rgba(0, 0, 0, 0.1);
    }

    #menu-items .menu-item:hover {
        box-shadow: 0 0 4px 2px rgba(0, 0, 0, 0.1);
    }

    #menu-items .menu-item .item-name {
        font-size: 1rem;
    }

    #menu-items .menu-item .item-desc {
        font-size: 0.9rem;
    }
}

@media (max-width: 760px) {
    .menu {
        gap: 1.6rem;
    }

    .menu h2 {
        font-size: 1.8rem;
    }

    #menu-categories {
        gap: 0.6rem;
        /* hide desktop buttons on narrow screens */
        display: none;
    }

    /* show mobile dropdown in place of buttons */
    .menu-content .category-dropdown-wrapper {
        display: block;
    }

    #menu-categories .category-btn {
        padding: 0.6rem 1rem;
        font-size: 0.9rem;
    }

    #menu-items {
        grid-template-columns: 1fr;
        gap: 1.2rem;
        margin-bottom: 2rem;
    }
}

@media (max-width: 480px) {
    .menu {
        padding: 1.5rem 1rem;
        gap: 1.2rem;
    }

    .menu-content {
        gap: 1.2rem;
    }

    .menu h2 {
        font-size: 1.6rem;
    }

    #menu-items {
        gap: 0.6rem;
    }

    #menu-items .menu-item {
        padding: 1.2rem 1rem;
        gap: 0.6rem;
    }

    #menu-items .menu-item .item-row {
        gap: 0.6rem;
    }

    #menu-items .menu-item .item-name,
    #menu-items .menu-item .item-price {
        font-size: 0.9rem;
    }

    #menu-items .menu-item .dots {
        border-bottom: 0.18rem dotted #6B762180;
        height: 0.8rem;
    }

    #menu-items .item-desc {
        font-size: 0.8rem;
    }
}